customElements.get("newsletter-modal")||customElements.define("newsletter-modal",class extends ModalElement{constructor(){super(),!(window.location.pathname==="/challenge"||!theme.cookiesEnabled)&&(!theme.config.isTouch||Shopify.designMode?this.init():new theme.initWhenVisible(theme.utils.throttle(this.init.bind(this))))}get shouldLock(){return!0}get testMode(){return this.getAttribute("data-test-mode")==="true"}get delay(){return this.hasAttribute("data-delay")?parseInt(this.getAttribute("data-delay")):5}get expiry(){return this.hasAttribute("data-expiry")?parseInt(this.getAttribute("data-expiry")):30}get cookieName(){return"concept:newsletter-popup"}get submited(){return this.querySelector(".alert")!==null}init(){if(!this.initialized){if(this.initialized=!0,this.submited){this.load(1);return}(this.testMode||!this.getCookie(this.cookieName))&&this.load(this.delay)}}load(delay){Shopify.designMode||setTimeout(()=>this.show(),delay*1e3)}afterShow(){super.afterShow(),this.classList.add("show-image")}afterHide(){if(super.afterHide(),this.classList.remove("show-image"),this.testMode){this.removeCookie(this.cookieName);return}this.setCookie(this.cookieName,this.expiry)}getCookie(name){const match=document.cookie.match(`(^|;)\\s*${name}\\s*=\\s*([^;]+)`);return match?match[2]:null}setCookie(name,expiry){document.cookie=`${name}=true; max-age=${expiry*24*60*60}; path=/`}removeCookie(name){document.cookie=`${name}=; max-age=0`}}); //# sourceMappingURL=/cdn/shop/t/3/assets/newsletter-popup.js.map?v=145134458895424454371750874410