PageSourceSearch

https://namuk.com/cdn/shop/t/119/assets/cart-notification.js?v=56786870352857197221789543938

js namuk.com collected 2026-09-25 18:46:31 UTC 2,335 bytes, 2 lines download raw bytes

1class CartNotification extends HTMLElement{constructor(){super();this.notification=document.getElementById("cart-notification");this.header=document.querySelector("[data-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(hasError=false){const errorClass="cart-notification--has-error";if(hasError){this.notification.classList.add(errorClass)}else{this.notification.classList.remove(errorClass)}this.notification.classList.add("animate","active");this.notification.addEventListener("transitionend",()=>{this.notification.focus();trapFocus(this.notification)},{once:true});document.body.addEventListener("click",this.onBodyClick)}close(){this.notification.classList.remove("active");document.body.removeEventListener("click",this.onBodyClick);removeTrapFocus(this.activeElement)}renderContents(parsedState){this.productId=parsedState.id;this.getSectionsToRender().forEach(section=>{document.getElementById(section.id).innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)});this.header?.reveal();this.open()}renderQuantityError(inventoryQuantity){const errorMessageElem=this.notification.querySelector("[data-cart-notification-error-message]");const inventoryQty=parseInt(inventoryQuantity)||0;errorMessageElem.innerText=window.cartStrings.quantityError.replace("[quantity]",inventoryQty);this.open(true)}getSectionsToRender(){return[{id:"cart-notification-product",selector:`#cart-notification-product-${this.productId}`},{id:"cart-notification-button"},{id:"cart-icon-bubble",selector:"[data-cart-icon-bubble]"},{id:"cart-icon-bubble-mobile-drawer",selector:"[data-cart-icon-bubble-mobile-drawer]"}]}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")){this.close()}}setActiveElement(element){this.activeElement=element}}if(!customElements.get("cart-notification")){customElements.define("cart-notification",CartNotification)}
2//# sourceMappingURL=cart-notification.js.map

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.