https://ragamuffinroasters.com/cdn/shop/t/19/assets/popup-dialog.js?v=157033950712611029671736536729
1import A11yDialog from"a11y-dialog";import Cookies from"js-cookie";import{ResumableInterval}from"utils";class PopupDialog extends HTMLElement{#e;#t;#n;#i;#o;#s;#a;constructor(){super(),this.#t=this.#h.bind(this),this.#n=this.#d.bind(this),this.#i=this.#l.bind(this),this.#o=this.#r.bind(this),this.#s=this.#u.bind(this),this.#a=this.#m.bind(this)}connectedCallback(){if(this.#e=new A11yDialog(this),this.content=this.querySelector('[role="document"]'),this.disableBodyScroll=this.hasAttribute("data-disable-body-scroll"),this.openOnPageLoad=null,this.rememberState=null,this.hasAttribute("data-open-on-page-load")){const e=this.getAttribute("data-open-on-page-load"),t=Number(e);this.openOnPageLoad=!0,t&&(this.openOnPageLoad=t)}if(this.hasAttribute("data-remember-state")){const e=this.getAttribute("data-remember-state"),t=Number(e);this.rememberState=!0,t&&(this.rememberState=t)}this.dismissAfterInterval=Number(this.getAttribute("data-dismiss-after-interval")||0),document.querySelectorAll(`[data-a11y-dialog-show="${this.#e.id}"]`).forEach((e=>{e.addEventListener("click",PopupDialog.#c)})),this.#e.on("opening",this.#t).on("show",this.#i).on("closing",this.#n).on("hide",this.#o),(this.rememberState&&!Cookies.get(this.id)&&this.openOnPageLoad||!this.rememberState&&this.openOnPageLoad)&&("number"==typeof this.openOnPageLoad?setTimeout((()=>{this.open()}),this.openOnPageLoad):this.open()),this.dismissAfterInterval&&(this.interval=new ResumableInterval({interval:this.dismissAfterInterval,callback:()=>{this.close()}}),this.content.addEventListener("mouseenter",this.#s),this.content.addEventListener("mouseleave",this.#a))}disconnectedCallback(){document.querySelectorAll(`[data-a11y-dialog-show="${this.#e.id}"]`).forEach((e=>{e.removeEventListener("click",PopupDialog.#c)})),this.#e.off("opening",this.#t).off("show",this.#i).off("closing",this.#n).off("hide",this.#o),this.content.removeEventListener("mouseenter",this.#s),this.content.removeEventListener("mouseleave",this.#a),this.interval=null}get shown(){return this.#e.shown}async open(){return this.#e.show(),new Promise((e=>{this.#e.shown?e():this.#e.on("show",(()=>{e()}),{once:!0})}))}openInstantly(){this.content.style.animation="none",this.#e.show(),this.content.style.animation=null}async close(){return this.#e.hide(),this.interval&&this.interval.reset(),new Promise((e=>{this.#e.shown?this.#e.on("hide",(()=>{e()}),{once:!0}):e()}))}closeInstantly(){this.content.style.animation="none",this.#e.hide(),this.content.style.animation=null}on(e,t,n){return this.addEventListener(e,t,n),this}off(e,t,n){return this.removeEventListener(e,t,n),this}#h(){this.dispatchEvent(new CustomEvent("on:popup:opening")),this.disableBodyScroll&&document.body.classList.add("u-scroll-disabled")}#d(){this.dispatchEvent(new CustomEvent("on:popup:closing"))}#l(){this.dispatchEvent(new CustomEvent("on:popup:opened")),this.interval&&this.interval.start()}#r(){this.dispatchEvent(new CustomEvent("on:popup:closed")),this.disableBodyScroll&&document.body.classList.remove("u-scroll-disabled"),this.rememberState&&Cookies.set(this.id,"1",{..."number"==typeof this.rememberState?{expires:this.rememberState}:{},path:"/",secure:!0,SameSite:"None"})}#u(){this.interval&&this.interval.stop()}#m(){this.interval&&this.interval.resume()}static#c(e){e.preventDefault()}}customElements.define("popup-dialog",PopupDialog);export default PopupDialog; 2//# sourceMappingURL=popup-dialog.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.