1class CartNotification extends HTMLElement{constructor(){super(),this.notification=document.getElementById("cart-notification"),this.header=document.querySelector("sticky-header"),this.onBodyClick=this.handleBodyClick.bind(this),this.notification.addEventListener("keyup",evt=>evt.code==="Escape"&&this.close()),this.querySelectorAll('button[type="button"]').forEach(closeButton=>closeButton.addEventListener("click",this.close.bind(this)))}open(){this.notification.classList.add("animate","active"),this.notification.addEventListener("transitionend",()=>{this.notification.focus(),trapFocus(this.notification)},{once:!0}),document.body.addEventListener("click",this.onBodyClick)}close(){this.notification.classList.remove("active"),document.body.removeEventListener("click",this.onBodyClick),removeTrapFocus(this.activeElement)}renderContents(parsedState){if(this.productId=parsedState?.id,parsedState){const image=parsedState.featured_image?.url?`<img class="cart-notification-product__image" src="${parsedState.featured_image.url}" alt="" width="119" height="123" loading="lazy">`:'<img class="cart-notification-product__image" src="https://cdn.shopify.com/shopifycloud/shopify/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c.gif" alt="" width="119" height="123" loading="lazy">',option=parsedState.options_with_values?.[0],newItemHtml=` 2 <div class="row-cart" data-variant-id="${parsedState.id}"> 3 ${image} 4 <a href="javascript:void(0)" class="removeitem" data-variant-id="${parsedState.id}">X Remove</a> 5 <div class="cart_item_content"> 6 <a href="${parsedState.url}"> 7 <h3 class="cart-notification-product__name h4">${parsedState.product_title}</h3> 8 </a> 9 <dl> 10 ${option?`<div class="product-option"><dt>${option.name}: </dt><dd>${option.value}</dd></div>`:""} 11 <div class="product-option"><dt>Qty: </dt><dd>${parsedState.quantity}</dd></div> 12 </dl> 13 </div> 14 </div>`,existing=document.querySelector(`#cart-notification-product .row-cart[data-variant-id="${parsedState.id}"]`);existing?existing.outerHTML=newItemHtml:$("#cart-notification-product").prepend(newItemHtml)}this.header&&this.header.reveal(),this.open(),fetch("/cart.js",{cache:"no-store"}).then(res=>res.json()).then(cart=>{const total=Math.round(cart.items_subtotal_price/100);$(".mini-cart-total-price span").html(`$${total} AUD`),$(".cart-count-bubble span").html(`(${cart.item_count})`),$("body").addClass("drawer--open"),$(".overlay_body").show(),$(".point-to-icon").addClass("animate active");const msgEl=document.querySelector(".cart-msg-under");if(msgEl){const fship=parseInt(msgEl.dataset.fship,10),isOver=cart.total_price>=fship;msgEl.innerHTML=isOver?msgEl.dataset.msgOver:msgEl.dataset.msgUnder;const freeShippingRow=document.querySelector(".mini-cart-shipping-free");freeShippingRow&&(freeShippingRow.style.display=isOver?"flex":"none")}cart.items.length===0?($("div#cart-notification .cart-notification__links").hide(),$(".cartempty").show()):($(".cartempty").hide(),$("div#cart-notification .cart-notification__links").show()),$.get("/cart?view=cart_free_shipping",function(pro){$(".productshippingbar").html(pro)})}).catch(err=>console.error("Failed to fetch cart:",err))}getSectionsToRender(){return[{id:"cart-notification-product",selector:`#cart-notification-product-${this.productId}`},{id:"cart-notification-button"},{id:"cart-icon-bubble"}]}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}handleBodyClick(evt){const target=evt.target;if(target!==this.notification&&!target.closest("cart-notification")){const disclosure=target.closest("details-disclosure");this.activeElement=disclosure?disclosure.querySelector("summary"):null,this.close()}}setActiveElement(element){this.activeElement=element}}customElements.define("cart-notification",CartNotification); 15//# sourceMappingURL=/cdn/shop/t/106/assets/cart-notification.js.map?v=162939386203353047261790057973
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.