PageSourceSearch

https://therootdeep.com/cdn/shop/t/21/assets/cart-drawer.js?v=72072807100957230531782277863

js therootdeep.com collected 2026-09-26 11:30:09 UTC 2,878 bytes, 2 lines download raw bytes

1class CartDrawer extends HTMLElement{constructor(){super(),window.FoxTheme=window.FoxTheme||{},window.FoxTheme.Cart=this,this.drawer=this.closest("drawer-component"),window.FoxTheme.CartDrawer=this.drawer,this.openWhenAdded=this.dataset.openWhenAdded==="true",this.onCartRefreshListener=this.onCartRefresh.bind(this)}connectedCallback(){window.FoxThemeEvents.subscribe(PUB_SUB_EVENTS.cartUpdate,async state=>{state.item_count!==0&&this.renderContents(state,!0,state.source!=="quick-order-list")}),document.addEventListener("cart:refresh",this.onCartRefreshListener)}disconnectedCallback(){document.removeEventListener("cart:refresh",this.onCartRefreshListener)}async onCartRefresh(event){const cartDrawer=document.getElementById("cart-drawer");if(cartDrawer)try{const responseText=await(await fetch(`${FoxThemeSettings.routes.root}?section_id=cart-drawer`)).text(),newCartContent=new DOMParser().parseFromString(responseText,"text/html").getElementById("cart-drawer").innerHTML;cartDrawer.innerHTML=newCartContent,setTimeout(()=>{const newDrawer=cartDrawer.querySelector("drawer-component");event.detail?.open===!0&&!newDrawer?.isOpen()&&newDrawer?.openDrawer()},100),FoxThemeCartHelpers.getState().then(state=>{FoxThemeCartHelpers.updateCartCount(state.item_count)})}catch(error){console.error("Error refreshing cart:",error)}}renderContents(parsedState,renderFooter=!0,isOpen=!0){parsedState.errors||(this.classList.contains("is-empty")&&this.classList.remove("is-empty"),this.getSectionsToRender(renderFooter).forEach(section=>{const sectionElement=section.selector?document.querySelector(section.selector):document.getElementById(section.id);sectionElement.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)}),setTimeout(()=>{this.openWhenAdded&&!this.drawer.isOpen()&&isOpen&&(this.drawer.openDrawer(),document.body.classList.add("prevent-scroll"),window.FoxThemeEvents.emit("ON_CART_DRAWER_OPEN",parsedState))}))}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}getSectionsToRender(renderFooter=!1){const sections=[{id:"cart-drawer",selector:".f-cart-drawer__items"}];return renderFooter&&sections.push({id:"cart-drawer",selector:".f-drawer__footer"}),sections}}customElements.define("cart-drawer",CartDrawer);class CartDrawerItems extends CartItems{initLoading(){this.loading=new window.FoxTheme.AnimateLoading(document.querySelector("cart-drawer"),{overlay:document.querySelector("cart-drawer")})}getSectionsToRender(){return[{id:"Drawer-Cart",section:"cart-drawer",selector:".f-cart-drawer__items"},{id:"Drawer-Cart",section:"cart-drawer",selector:".f-cart-drawer__block-subtotal"}]}}customElements.define("cart-drawer-items",CartDrawerItems);
2//# sourceMappingURL=/cdn/shop/t/21/assets/cart-drawer.js.map?v=72072807100957230531782277863

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.