PageSourceSearch

https://smoon-lingerie.com/cdn/shop/t/60/assets/cart.js?v=33290606024765344131768818039

js smoon-lingerie.com collected 2026-10-10 00:36:14 UTC 6,291 bytes, 2 lines download raw bytes

1class CartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault(),this.closest("cart-items").updateQuantity(this.dataset.index,0)})}}customElements.define("cart-remove-button",CartRemoveButton);class CartItems extends HTMLElement{constructor(){super(),this.lineItemStatusElement=document.getElementById("shopping-cart-line-item-status"),this.currentItemCount=Array.from(this.querySelectorAll('[name="updates[]"]')).reduce((total,quantityInput)=>total+parseInt(quantityInput.value),0),this.debouncedOnChange=debounce(event=>{this.onChange(event)},300),this.addEventListener("change",this.debouncedOnChange.bind(this))}onChange(event){this.updateQuantity(event.target.dataset.index,event.target.value,document.activeElement.getAttribute("name"))}getSectionsToRender(){const sectionsToRender=[{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"},{id:"cart-live-region-text",section:"cart-live-region-text",selector:".shopify-section"}];if(document.getElementById("main-cart-items")&&document.getElementById("main-cart-footer"))return[...sectionsToRender,{id:"main-cart-items",section:document.getElementById("main-cart-items").dataset.id,selector:".js-contents"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer").dataset.id,selector:".js-contents"}];const summaryBoxComposition=document.querySelector("summary#box-composition-summary");return summaryBoxComposition&&sectionsToRender.push({id:summaryBoxComposition.dataset.sectionId,section:summaryBoxComposition.dataset.sectionId,selector:"details"}),[...sectionsToRender,{id:"cart-drawer-products",section:"cart-drawer-products",selector:".js-contents"},{id:"cart-drawer-footer",section:"cart-drawer-footer",selector:".js-contents"}]}updateQuantity(line,quantity,name){this.enableLoading(line);const productScriptTag=document.getElementById(`CartItem-${line}`).querySelector('[id^="LineItem-Json-"]'),setionsUrl=window.location.pathname.includes("/apps/")?"/":window.location.pathname,body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map(section=>section.section),sections_url:setionsUrl});fetch(`${routes.cart_change_url}`,{...fetchConfig(),body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);this.classList.toggle("is-empty",parsedState.item_count===0);const cartFooter=document.getElementById("main-cart-footer"),cartDrawerItems=document.getElementById("cart-drawer-items");cartFooter&&cartFooter.classList.toggle("is-empty",parsedState.item_count===0),cartDrawerItems&&cartDrawerItems.classList.toggle("is-empty",parsedState.item_count===0),this.get
1SectionsToRender().forEach((section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)})),this.updateLiveRegions(line,parsedState.item_count);const lineItem=document.getElementById(`CartItem-${line}`);lineItem&&lineItem.querySelector(`[name="${name}"]`)&&lineItem.querySelector(`[name="${name}"]`).focus(),this.disableLoading(),window.dispatchEvent(new CustomEvent("quantity:update",{detail:{newQuantity:parseInt(quantity,10),productData:productScriptTag?JSON.parse(productScriptTag.textContent):{}}}))}).catch(error=>{console.error(error),this.querySelectorAll(".loading-overlay").forEach(overlay=>overlay.classList.add("hidden")),document.getElementById("cart-errors").textContent=window.cartStrings.error,this.disableLoading()})}updateLiveRegions(line,itemCount){this.currentItemCount=itemCount,this.lineItemStatusElement.setAttribute("aria-hidden",!0);const cartStatus=document.getElementById("cart-live-region-text");cartStatus.setAttribute("aria-hidden",!1),setTimeout(()=>{cartStatus.setAttribute("aria-hidden",!0)},1e3)}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}enableLoading(line){document.querySelector("#main-cart-items, .cart-drawer__items").classList.add("cart-drawer__items--disabled"),this.querySelectorAll(`#CartItem-${line} .loading-overlay`).forEach(overlay=>overlay.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(){document.querySelector("#main-cart-items, .cart-drawer__items").classList.remove("cart-drawer__items--disabled")}refreshCart(){const sectionsToFetch=this.getSectionsToRender().map(section=>section.section),sectionsUrl=`${window.location.protocol}//${window.location.host}?sections=${sectionsToFetch.join(",")}`;fetch(sectionsUrl).then(response=>response.json()).then(sections=>{fetch(`${window.Shopify.routes.root}cart.js`).then(response=>response.json()).then(cartData=>{this.classList.toggle("is-empty",cartData.item_count===0);const cartFooter=document.getElementById("main-cart-footer"),cartDrawerItems=document.getElementById("cart-drawer-items");cartFooter&&cartFooter.classList.toggle("is-empty",cartData.item_count===0),cartDrawerItems&&cartDrawerItems.classList.toggle("is-empty",cartData.item_count===0),this.get
1SectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace&&sections[section.section]&&(elementToReplace.innerHTML=this.getSectionInnerHTML(sections[section.section],section.selector))}),this.currentItemCount=cartData.item_count})}).catch(error=>{console.error("Erreur lors du rafra\xEEchissement du panier:",error)})}}customElements.define("cart-items",CartItems),window.Shopify||(window.Shopify={}),window.Shopify.updateCartDrawer=function(){const cartItems=document.querySelector("cart-items");cartItems?cartItems.refreshCart():console.warn("cart-items element not found")},window.Shopify.openCartDrawer=function(){const cartSummary=document.querySelector("summary#cart-icon-bubble");cartSummary&&!cartSummary.closest("details").hasAttribute("open")?(cartSummary.click(),cartSummary.closest("details").setAttribute("open","open")):cartSummary||console.warn("cart-icon-bubble element not found")};
2//# sourceMappingURL=/cdn/shop/t/60/assets/cart.js.map?v=33290606024765344131768818039

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.