1class MCartDrawer extends HTMLElement{constructor(){super(),this.cartDrawerInner=this.querySelector(".m-cart-drawer__inner"),this.cartDrawerCloseIcon=this.querySelector(".m-cart-drawer__close"),this.cartOverlay=this.querySelector(".m-cart__overlay"),this.rootUrl=window.Shopify.routes.root,this.setHeaderCartIconAccessibility(),this.cartDrawerCloseIcon.addEventListener("click",this.close.bind(this)),this.addEventListener("click",t=>{t.target.closest(".m-cart-drawer__inner")!==this.cartDrawerInner&&this.close()})}setHeaderCartIconAccessibility(){document.querySelectorAll(".m-cart-icon-bubble").forEach(t=>{t.setAttribute("role","button"),t.setAttribute("aria-haspopup","dialog"),t.addEventListener("click",e=>{MinimogSettings.enable_cart_drawer&&(e.preventDefault(),this.open(t))})})}open(t){t&&this.setActiveElement(t),this.classList.add("m-cart-drawer--active"),requestAnimationFrame(()=>{this.style.setProperty("--m-bg-opacity","0.5"),this.cartDrawerInner.style.setProperty("--translate-x","0")}),window.MinimogEvents.emit(MinimogTheme.pubSubEvents.openCartDrawer)}close(){this.style.setProperty("--m-bg-opacity","0"),this.cartDrawerInner.style.setProperty("--translate-x","100%"),setTimeout(()=>{this.classList.remove("m-cart-drawer--active")},300)}renderContents(t){this.classList.contains("m-cart--empty")&&this.classList.remove("m-cart--empty"),this.productId=t.id,this.getSectionsToRender().forEach(e=>{(e.selector?document.querySelector(e.selector):document.getElementById(e.id)).innerHTML=this.getSectionInnerHTML(t.sections[e.id],e.selector)}),setTimeout(()=>{this.open(),window.FoxKitV2&&window.FoxKitV2.Modules.InCart&&window.FoxKitV2.Modules.InCart.getCart()})}updateCartCount(t){document.querySelectorAll(".m-cart-count-bubble").forEach(e=>{t>0?(e.textContent=t,e.classList.remove("hidden")):e.classList.add("hidden")})}getCart(){return fetchJSON(this.rootUrl+"cart.json")}onCartDrawerUpdate(t=!0){fetch(`${MinimogSettings.routes.cart}?section_id=cart-drawer`).then(t2=>t2.text()).then(e=>{this.getSectionsToRender().forEach(r=>{r.block==="cart-items"?((r.selector?document.querySelector(r.selector):document.getElementById(r.id)).innerHTML=this.getSectionInnerHTML(e,r.selector),window.FoxKitV2&&window.FoxKitV2.Modules.InCart&&window.FoxKitV2.Modules.InCart.getCart()):t&&((r.selector?document.querySelector(r.selector):document.getElementById(r.id)).innerHTML=this.getSectionInnerHTML(e,r.selector))})}).catch(t2=>{}),this.getCart().then(t2=>{this.classList.toggle("m-cart--empty",t2.item_count===0),this.updateCartCount(t2.item_count)})}getSectionInnerHTML(t,e=".shopify-section"){return new DOMParser().parseFromString(t,"text/html").querySelector(e).innerHTML}getSectionsToRender(){return[{id:"cart-drawer",selector:"[data-minimog-cart-items]",block:"cart-items"},{id:"cart-drawer",selector:"[data-minimog-cart-discounts]",block:"cart-footer"},{id:"cart-drawer",selector:"[data-cart-subtotal]",block:"cart-footer"},{id:"cart-drawer",selector:"[data-minimog-gift-wrapping]",block:"cart-footer"}]}getSectionDOM(t,e=".shopify-section"){return new DOMParser().parseFromString(t,"text/html").querySelector(e)}setActiveElement(t){this.activeElement=t}}customElements.define("m-cart-drawer",MCartDrawer);class MCartDrawerItems extends MCartTemplate{getSectionsToRender(){return[{id:"MinimogCartDrawer",section:"cart-drawer",selector:"[data-minimog-cart-items]"},{id:"MinimogCartDrawer",section:"cart-drawer",selector:"[data-minimog-cart-discounts]"},{id:"MinimogCartDrawer",section:"cart-drawer",selector:"[data-cart-subtotal]"},{id:"MinimogCartDrawer",section:"cart-drawer",selector:"[data-minimog-gift-wrapping]"}]}}customElements.define("m-cart-drawer-items",MCartDrawerItems),(function(){if(window.__bnGiftV3)return;window.__bnGiftV3=!0;var VID=51654661505336;function qs(s){return document.querySelector(s)}function qsa(s){return Array.prototype.slice.call(document.querySelectorAll(s))}function inCart(cb){fetch("/cart.js").then(function(r){return r.json()}).then(function(c){cb(c.items.some(function(i){return i.variant_id===VID}),c)}).catch(function(){})}function paint(has,c){qsa(".bn-gift-toggle").forEach(function(t){t.checked=has}),qsa(".gift-product-d5").forEach(function(g){g.classList.toggle("active",has)}),c&&qsa(".m-cart-count,[data-cart-count]").forEach(function(el){el.textContent=c.item_count})}function refreshDrawer(){var d=document.querySelector("m-cart-drawer");d&&typeof d.onCartDrawerUpdate=="function"&&d.onCartDrawerUpdate(!0),fetch("/?section_id=cart-drawer").then(function(r){return r.text()}).then(function(html){var doc=new DOMParser().parseFromString(html,"text/html"),fresh=doc.querySelector(".gift-con-d5"),cur=document.querySelector(".gift-con-d5");fresh&&cur&&cur.replaceWith(fresh),inCart(paint)}
1).catch(function(){})}function setBox(want){var req=want?fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:VID,quantity:1}]})}):fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:String(VID),quantity:0})});req.then(function(r){if(!r.ok)throw new Error("cart");return r.json()}).then(function(){inCart(paint),refreshDrawer()}).catch(function(){inCart(paint),alert("Sorry, we could not update the gift box. Please try again.")})}document.addEventListener("change",function(e){var t=e.target;t&&t.classList&&t.classList.contains("bn-gift-toggle")&&setBox(t.checked)}),document.addEventListener("click",function(e){var g=e.target&&e.target.closest?e.target.closest(".gift-product-d5"):null;if(g){setBox(!g.classList.contains("active"));return}var op=e.target&&e.target.closest?e.target.closest(".gift-message-opener-d5, .gw-note-trigger-d5"):null;if(op){var pop=qs(".gw-popup-d5");pop&&pop.classList.add("active");return}if(e.target&&e.target.classList&&e.target.classList.contains("gw-cancel-d5")){var p1=qs(".gw-popup-d5");p1&&p1.classList.remove("active");return}if(e.target&&e.target.classList&&e.target.classList.contains("gw-save-d5")){var btn=e.target,ta=qs(".gw-textarea-d5"),msg=ta?ta.value:"";btn.disabled=!0,fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{"Gift Message":msg}})}).then(function(){btn.textContent="Saved!",setTimeout(function(){btn.textContent="Save Note",btn.disabled=!1},2e3)}).catch(function(){btn.disabled=!1,alert("Could not save your note. Please try again.")});return}}),document.addEventListener("DOMContentLoaded",function(){inCart(paint)}),inCart(paint)})(); 2//# sourceMappingURL=/cdn/shop/t/15/assets/cart-drawer.js.map?v=46738678372016032821783701506
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.