const n={VISIBLE:"banner:visible"};class i extends HTMLElement{connectedCallback(){this.announcementId=this.getAttribute("data-announcement-id")||"default",this.drawer=this.getSlotElement("drawer");const e=this.getSlotElement("close");e&&e.addEventListener("click",()=>this.close()),this.init()}init(){this.drawer&&(window.addEventListener("resize",()=>this.updateCssVars()),this.updateCssVars());const e=!this.isClosed();document.body.classList.toggle(n.VISIBLE,e),this.inert=!e}updateCssVars(){this.drawer&&this.style.setProperty("--banner-height",`${this.drawer.offsetHeight}px`)}close(){this.setStorage("closed",!0),document.body.classList.remove(n.VISIBLE),this.inert=!0}isClosed(){return this.getStorage("closed")===!0}getStorage(e){const s=`photos-banner:${this.announcementId}:${e}`,t=window.sessionStorage.getItem(s);return t?JSON.parse(t):null}setStorage(e,s){const t=`photos-banner:${this.announcementId}:${e}`,o=JSON.stringify(s);window.sessionStorage.setItem(t,o)}getSlotElement(e){return this.querySelector(`[data-slot="${e}"]`)}}customElements.get("photos-banner")||customElements.define("photos-banner",i);