import { Controller } from '@hotwired/stimulus';
export default class default_1 extends Controller {
    connect() {
        if (localStorage.getItem('mapbox-consent') === 'true') {
            this.showMap();
        }
        else {
            this.showPlaceholder();
        }
    }
    giveConsent() {
        localStorage.setItem('mapbox-consent', 'true');
        this.showMap();
        window.dispatchEvent(new CustomEvent('mapbox-consent-given'));
    }
    toggleInfo() {
        this.infoTarget.classList.toggle('hidden');
    }
    showMap() {
        this.mapTarget.classList.remove('hidden');
        this.placeholderTarget.classList.add('hidden');
    }
    showPlaceholder() {
        this.mapTarget.classList.add('hidden');
        this.placeholderTarget.classList.remove('hidden');
    }
}
default_1.targets = ['map', 'placeholder', 'info'];
