1import{c as u}from"./__vite-focus-trap.esm.cfa47d0b.js";import{C as d,t as a,a as c}from"./__vite-custom-html-element.a1e75c8d.js";function l(t,e,i){let s=!1;t.type.includes("shopify:section")?e.hasAttribute("section")&&e.getAttribute("section")===t.detail.sectionId&&(s=!0):t.type.includes("shopify:block")&&t.target===e&&(s=!0),s&&i(t)}const h=class extends d{static get observedAttributes(){return["open"]}constructor(){if(super(),Shopify.designMode&&(this.rootDelegate.on("shopify:section:select",t=>l(t,this,()=>this.open=!0)),this.rootDelegate.on("shopify:section:deselect",t=>l(t,this,()=>this.open=!1))),this.hasAttribute("append-body")){const t=document.getElementById(this.id);this.removeAttribute("append-body"),t&&t!==this?(t.replaceWith(this.cloneNode(!0)),this.remove()):document.body.appendChild(this)}}connectedCallback(){this.delegate.on("click",".openable__overlay",()=>this.open=!1),this.delegate.on("click",'[data-action="close"]',t=>{t.stopPropagation(),this.open=!1})}get requiresLoading(){return this.hasAttribute("href")}get hrefTarget(){return this.getAttribute("data-href-target")||this.tagName.toLowerCase()}get contentTarget(){return this.getAttribute("data-content-target")||null}get open(){return this.hasAttribute("open")}set open(t){t?(async()=>(await this._load(),this.clientWidth,this.setAttribute("open","")))():this.removeAttribute("open")}get shouldTrapFocus(){return!0}get returnFocusOnDeactivate(){return!this.hasAttribute("return-focus")||this.getAttribute("return-focus")==="true"}onDeactivateFocusTrap(){this.open=!1}get focusTrap(){return this._focusTrap=this._focusTrap||u(this,{fallbackFocus:this,initialFocus:this.hasAttribute("initial-focus-selector")?this.getAttribute("initial-focus-selector"):void 0,clickOutsideDeactivates:t=>!(t.target.hasAttribute("aria-controls")&&t.target.getAttribute("aria-controls")===this.id),allowOutsideClick:t=>t.target.hasAttribute("aria-controls")&&t.target.getAttribute("aria-controls")===this.id,returnFocusOnDeactivate:this.returnFocusOnDeactivate,onDeactivate:this.onDeactivateFocusTrap.bind(this),preventScroll:!0})}attributeChangedCallback(t,e,i){switch(t){case"open":e===null&&i===""?(this.shouldTrapFocus&&setTimeout(()=>this.focusTrap.activate(),150),a(this,"openable-element:open")):i===null&&(this.shouldTrapFocus&&this.focusTrap.deactivate(),this.removeAttribute("href"),a(this,"openable-element:close"))}}async _load(){if(!this.requiresLoading)return;c(this,"openable-element:load:start");const t=await fetch(this.getAttribute("href")),e=document.createElement("div");e.innerHTML=await t.text();const i=e.querySelector(this.hrefTarget)||e,s=this.contentTarget?this.querySelector(this.contentTarget)||this:this;s.innerHTML=i.innerHTML,i.querySelectorAll("script").forEach(o=>{const r=document.createElement("script");[...o.attributes].forEach(n=>r.setAttribute(n.name,n.value)),r.textContent=o.textContent,document.body.appendChild(r)}),c(this,"openable-element:load:end")}};window.customElements.define("openable-element",h);const p=class extends h{connectedCallback(){if(super.connectedCallback(),this.hasAttribute("reverse-breakpoint")){this.originalDirection=this.classList.contains("drawer--from-left")?"left":"right";const t=window.matchMedia(this.getAttribute("reverse-breakpoint"));t.addListener(this._checkReverseOpeningDirection.bind(this)),this._checkReverseOpeningDirection(t)}this.delegate.on("click",".drawer__overlay",()=>this.open=!1)}attributeChangedCallback(t,e,i){switch(super.attributeChangedCallback(t,e,i),t){case"open":document.documentElement.classList.toggle("lock-all",this.open),this.location==="product-info"&&document.documentElement.classList.toggle("product-info-drawer-open",this.open)}}get location(){return this.getAttribute("location")}_checkReverseOpeningDirection(t){this.classList.remove("drawer--from-left"),(this.originalDirection==="left"&&!t.matches||this.originalDirection!=="left"&&t.matches)&&this.classList.add("drawer--from-left")}};window.customElements.define("drawer-content",p);export{p as D,h as O,l as f};
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.