PageSourceSearch

https://horze.eu/cdn/shop/t/676/assets/cart-drawer-BaM7Jurv.js

js horze.eu collected 2026-09-24 11:35:38 UTC 2,792 bytes, 1 lines download raw bytes

1import{e as u,a as l,t as p}from"./vendor-lit-reactive-element-Cjcwuima.js";import"./vendor-lit-html-nFsY_NSA.js";import{r as d}from"./vendor-lit-element-CtcYdrtK.js";import{s as c}from"./main-DqQb9x5n.js";import"./vendor-vue-runtime-dom-Dqgu9pQP.js";import"./vendor-vue-runtime-core-DAnRjgOf.js";import"./vendor-vue-reactivity-Df4oAq-x.js";import"./vendor-vue-shared-D3_Apz_L.js";import"./ds-Bp-orcBC.js";import"./vendor-lit-context-BDzdL6mz.js";var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(t,e,i,r)=>{for(var s=r>1?void 0:r?m(e,i):e,a=t.length-1,h;a>=0;a--)(h=t[a])&&(s=(r?h(e,i,s):h(s))||s);return r&&s&&f(e,i,s),s};const b="[data-app], cart-promotions",w=120;let n=class extends d{constructor(){super(...arguments),this.isOpen=!1,this.unsubscribe=null,this.unsubscribeSheet=null,this.fetchTimeoutId=null,this.hasPendingFetch=!1,this.isSheetOpen=!1}connectedCallback(){super.connectedCallback(),this.unsubscribe=c("cartUpdate",()=>{this.scheduleFetch()}),this.unsubscribeSheet=c("promotionSheetOpen",t=>{this.isSheetOpen=t===!0,this.isSheetOpen||this.runPendingFetch()})}disconnectedCallback(){super.disconnectedCallback(),this._observer&&this._observer.disconnect(),this.unsubscribe&&this.unsubscribe(),this.unsubscribeSheet&&this.unsubscribeSheet(),this.fetchTimeoutId&&(clearTimeout(this.fetchTimeoutId),this.fetchTimeoutId=null)}scheduleFetch(){this.hasPendingFetch=!0,!this.isSheetOpen&&(this.fetchTimeoutId&&clearTimeout(this.fetchTimeoutId),this.fetchTimeoutId=window.setTimeout(()=>{this.fetchTimeoutId=null,this.runPendingFetch()},w))}runPendingFetch(){this.hasPendingFetch&&(this.hasPendingFetch=!1,this.fetchDrawer())}firstUpdated(){this._observer=new MutationObserver(t=>{for(const e of t)e.type==="attributes"&&e.attributeName==="data-open"&&(this.isOpen=this.modalDialog.hasAttribute("data-open"))}),this._observer.observe(this.modalDialog,{attributes:!0})}fetchDrawer(){const t=this.parentElement.id.replace("shopify-section-","");fetch(`${window.Shopify.routes.root}?sections=${t}`).then(e=>e.json()).then(e=>{const i=e["cart-drawer"]||null;if(!i)return;const r=new DOMParser().parseFromString(i,"text/html").querySelector(".drawer__inner");!this.drawerInner||!r||this.replaceDrawerContent(r.innerHTML)})}replaceDrawerContent(t){var i;const e=Array.from(this.drawerInner.querySelectorAll(b));this.drawerInner.innerHTML=t;for(const r of e)(i=this.placeholderFor(r))==null||i.replaceWith(r)}placeholderFor(t){const e=t.getAttribute("data-app");return this.drawerInner.querySelector(e?`[data-app="${e}"]:not([data-v-app])`:t.localName)}createRenderRoot(){return this}};o([u("modal-dialog")],n.prototype,"modalDialog",2);o([u(".drawer__inner")],n.prototype,"drawerInner",2);o([l()],n.prototype,"isOpen",2);n=o([p("cart-drawer")],n);export{n as CartDrawer};

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.