class CartDrawer extends MainDrawer{constructor(){super(),this.recommendations=document.querySelector("cart-recommendations"),this.openDrawerDebounced=debounce(event=>{document.getElementById("CARTDRAWERCSS")||this.classList.add("loading"),loadCss("cart-drawer").then(()=>{this.classList.remove("loading")}).catch(error=>{console.error(error)}),this.dataset.recommendations&&loadScript("cart-recommendations").catch(error=>{console.error(error)}),this.openDrawer()},250),document.querySelector("#cart-icon-bubble").addEventListener("click",e=>{e.preventDefault(),this.openDrawerDebounced()})}renderContents(parsedState){this.productId=parsedState.id,this.getSectionsToRender().forEach(section=>{const sectionElement=section.selector?document.querySelector(section.selector):document.getElementById(section.id);sectionElement.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)}),this.openDrawerDebounced()}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}getSectionsToRender(){return[{id:"cart-drawer",selector:"#CartDrawer"},{id:"cart-icon-bubble"}]}getSectionDOM(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector)}setActiveElement(element){this.activeElement=element}}customElements.define("cart-drawer",CartDrawer);class CartDrawerItems extends CartItems{getSectionsToRender(){return[{id:"CartDrawer",section:"cart-drawer",selector:".drawer__container"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}}customElements.define("cart-drawer-items",CartDrawerItems); //# sourceMappingURL=/cdn/shop/t/38/assets/cart-drawer.js.map?v=c12ec46885bd2b59000b1d21501f7287