1class CartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault(),(this.closest("cart-items")||this.closest("cart-drawer-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){document.querySelector(".drawer__footer klarna-placement div")&&setTimeout(function(){var _div2=document.createElement("div");_div2.setAttribute("class","style"),document.querySelector(".drawer__footer klarna-placement div").shadowRoot.append(_div2),document.querySelector(".drawer__footer klarna-placement div").shadowRoot.querySelector(".style").innerHTML=`<style>.container[part="osm-container"] {border-width: 0; padding: 0; font-size: 13px; font-family: Scto Grotesk B; color: #000; } 2 .container[part="osm-container"] .link {font-size: 13px; font-family: Scto Grotesk B; color: #000; }</style>`,document.querySelector("#CartDrawer klarna-placement").classList.add("active")},1500),this.updateQuantity(event.target.dataset.index,event.target.value,document.activeElement.getAttribute("name"))}getSectionsToRender(){return[{id:"main-cart-items",section:document.getElementById("main-cart-items").dataset.id,selector:".js-contents"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"},{id:"cart-live-region-text",section:"cart-live-region-text",selector:".shopify-section"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer").dataset.id,selector:".js-contents"}]}updateQuantity(line,quantity,name){this.enableLoading(line);const body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map(section=>section.section),sections_url:window.location.pathname});fetch("/cart/change.js",{...fetchConfig(),body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);this.classList.toggle("is-empty",parsedState.item_count===0);const cartDrawerWrapper=document.querySelector("cart-drawer"),cartFooter=document.getElementById("main-cart-footer");cartFooter&&cartFooter.classList.toggle("is-empty",parsedState.item_count===0),cartDrawerWrapper&&cartDrawerWrapper.classList.toggle("is-empty",parsedState.item_count===0),this.get
2SectionsToRender().forEach((section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id),funThis=this;let lengthSelector=document.querySelectorAll(`#${section.id}`).length==1?document.querySelectorAll(`#${section.id} ${section.selector}`):document.querySelectorAll(`#${section.id}`);lengthSelector.length>1?lengthSelector.forEach(function(secEle){secEle.innerHTML=funThis.getSectionInnerHTML(parsedState.sections[section.id],section.selector)}):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}"]`)?cartDrawerWrapper?trapFocus(cartDrawerWrapper,lineItem.querySelector(`[name="${name}"]`)):lineItem.querySelector(`[name="${name}"]`).focus():parsedState.item_count===0&&cartDrawerWrapper?trapFocus(cartDrawerWrapper.querySelector(".drawer__inner-empty"),cartDrawerWrapper.querySelector("a")):document.querySelector(".cart-item")&&cartDrawerWrapper&&trapFocus(cartDrawerWrapper,document.querySelector(".cart-item__name")),this.disableLoading()}).catch(error=>{this.querySelectorAll(".loading-overlay").forEach(overlay=>overlay.classList.add("hidden")),document.getElementById("cart-errors")&&(document.getElementById("cart-errors").textContent=window.cartStrings.error),this.disableLoading()});function paybrightWidgetContainer(){setTimeout(function(){location.reload()},500)}}updateLiveRegions(line,itemCount){this.currentItemCount===itemCount&&(document.getElementById(`Line-item-error-${line}`).querySelector(".cart-item__error-text").innerHTML=window.cartStrings.quantityError.replace("[quantity]",document.getElementById(`Quantity-${line}`).value)),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.getElementById("main-cart-items")&&document.getElementById("main-cart-items").classList.add("cart__items--disabled"),this.querySelectorAll(`#CartItem-${line} .loading-overlay`).forEach(overlay=>overlay.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement&&this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(){document.getElementById("main-cart-items")&&document.getElementById("main-cart-items").classList.remove("cart__items--disabled")}}customElements.define("cart-items",CartItems); 3//# sourceMappingURL=/cdn/shop/t/265/assets/cart.js.map?v=85850110963762093391787151544
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.