PageSourceSearch

https://babynetic.com/cdn/shop/t/15/assets/cart.js?v=28303065890827419921783701506

js babynetic.com collected 2026-10-04 13:34:07 UTC 5,504 bytes, 2 lines download raw bytes

1class MCartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",(t=>{t.preventDefault(),(this.closest("m-cart")||this.closest("m-cart-drawer-items")).updateQuantity(this.dataset.index,0)}))}}customElements.define("m-cart-remove-button",MCartRemoveButton);class MCartTemplate extends HTMLElement{constructor(){super(),this.cartUpdateUnsubscriber=void 0,this.isCartPage=MinimogSettings.templateName==="cart",this.cartDrawerWrapper=document.querySelector("m-cart-drawer"),this.cartDrawerInner=document.querySelector(".m-cart-drawer__inner"),this.mainCartItems=this.querySelector("[data-minimog-cart-items]"),this.cartSubTotal=this.querySelector("[data-cart-subtotal]"),this.cartDiscount=this.querySelector("[data-minimog-cart-discounts]"),this.giftWrapping=this.querySelector("[data-minimog-gift-wrapping]");let t=this.cartDrawerInner;this.isCartPage&&(t=document.body),this.loading=new MinimogLibs.AnimateLoading(t,{overlay:t}),this.rootUrl=window.Shopify.routes.root;const e=debounce((t2=>{t2.target.name!=="id"&&this.onChange(t2)}),300);this.isCartPage?this.mainCartItems.addEventListener("change",e.bind(this)):this.addEventListener("change",e.bind(this)),MinimogEvents.subscribe(MinimogTheme.pubSubEvents.cartUpdate,(t2=>{this.getCart().then((t3=>{this.updateCartCount(t3.item_count)}))}))}updateCartCount(t){document.querySelectorAll(".m-cart-count-bubble").forEach((e=>{t>0?(e.textContent=t,e.classList.remove("m:hidden")):e.classList.add("m:hidden")}))}getCart(){return fetchJSON(this.rootUrl+"cart.json")}connectedCallback(){this.cartUpdateUnsubscriber=MinimogEvents.subscribe(MinimogTheme.pubSubEvents.cartUpdate,(t=>{t.source!=="main-cart-items"&&this.onCartUpdate()}))}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}onCartUpdate(t=!0){const{routes:e}=window.MinimogSettings;fetch(`${e.cart}?section_id=cart-template`).then((t2=>t2.text())).then((e2=>{const i=new DOMParser().parseFromString(e2,"text/html"),n=i.querySelector("[data-minimog-cart-items]"),r=i.querySelector("[data-cart-subtotal]"),a=i.querySelector("[data-minimog-cart-discounts]"),s=i.querySelector("[data-minimog-gift-wrapping]");this.isCartPage&&(this.mainCartItems.innerHTML=n.innerHTML,t&&(this.cartSubTotal.innerHTML=r.innerHTML,this.cartDiscount.innerHTML=a.innerHTML,this.giftWrapping.innerHTML=s.innerHTML),window.FoxKitV2&&window.FoxKitV2.Modules.InCart&&window.FoxKitV2.Modules.InCart.getCart()),window.fetchAndDisplayRecommendations();const checkGift=setInterval(()=>{document.querySelector(".remove-gift-auto-d5")&&(document.querySelector(".gift-product-d5.active")?.click(),clearInterval(checkGift))},100)})).catch((t2=>{}))}onChange(t){this.updateQuantity(t.target.dataset.index,t.target.value,document.activeElement.getAttribute("name"))}updateQuantity(t,e,i){this.loading.start();const cartItem=document.querySelector(`.m-cart-item[data-index="${t}"]`),key=cartItem?cartItem.dataset.key:null;if(!key){console.error("Cart item key not found for index:",t),this.loading.finish();return}const feeItem=document.querySelector(`[data-fee-parent="${cartItem.dataset.id}"]`)||null,{routes:n}=window.MinimogSettings,r=JSON.stringify({updates:{[key]:e,...feeItem?{[feeItem.dataset.key]:e}:{}},sections:this.getSectionsToRender().map((t2=>t2.section)),sections_url:window.location.pathname});fetch(`${n.cart_update_url}`,{...fetchConfig(),body:r}).then((t2=>t2.text())).then((e2=>{const i2=JSON.parse(e2);let n2=document.getElementById(`MinimogDrawer-quantity-${t}`);this.isCartPage&&(n2=MinimogTheme.config.mqlMobile?document.querySelector(`.MinimogQuantity-${t}.MinimogQuantity-mobile`):document.querySelector(`.MinimogQuantity-${t}.MinimogQuantity-desktop`));const r2=document.querySelectorAll(".m-cart-item");if(i2.errors)return this.loading.finish(),n2.value=n2.getAttribute("value"),void this.updateLiveRegions(t,i2.errors);this.classList.toggle("m-cart--empty",i2.item_count===0),this.cartDrawerWrapper&&this.cartDrawerWrapper.classList.toggle("m-cart--empty",i2.item_count===0),this.get
1SectionsToRender().forEach((t2=>{(document.getElementById(t2.id).querySelector(t2.selector)||document.getElementById(t2.id)).innerHTML=this.getSectionInnerHTML(i2.sections[t2.section],t2.selector)}));const a=i2.items[t-1]?i2.items[t-1].quantity:void 0;let s="";r2.length===i2.items.length&&a!==parseInt(n2.value)&&(s=a===void 0?window.MinimogStrings.cartError:window.MinimogStrings.quantityError.replace("[quantity]",a)),this.updateLiveRegions(t,s),MinimogEvents.emit(MinimogTheme.pubSubEvents.cartUpdate,{...i2,source:"main-cart-items"})})).catch((()=>{})).finally((()=>{this.loading.finish(),window.fetchAndDisplayRecommendations()}))}updateLiveRegions(t,e){let i=document.getElementById(`MinimogCartDrawer-Item-${t}`);this.isCartPage&&(i=document.getElementById(`MinimogCart-Item-${t}`)),e!==""&&i&&MinimogTheme.Notification.show({target:i,type:"warning",message:e})}getSectionInnerHTML(t,e){return new DOMParser().parseFromString(t,"text/html").querySelector(e).innerHTML}getSectionsToRender(){return[{id:"MinimogCart",section:"cart-template",selector:"[data-minimog-cart-items]"},{id:"MinimogCart",section:"cart-template",selector:"[data-cart-subtotal]"},{id:"MinimogCart",section:"cart-template",selector:"[data-minimog-cart-discounts]"},{id:"MinimogCart",section:"cart-template",selector:"[data-minimog-gift-wrapping]"}]}}customElements.define("m-cart",MCartTemplate);
2//# sourceMappingURL=/cdn/shop/t/15/assets/cart.js.map?v=28303065890827419921783701506

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.