PageSourceSearch

https://www.herbalgoodnessco.com/cdn/shop/t/94/assets/header.toggle-cart.js?v=98854154335626053671788882632

js herbalgoodnessco.com collected 2026-09-25 22:27:35 UTC 1,952 bytes, 2 lines download raw bytes

1import{EVENTS}from"util.events";class ToggleCart extends HTMLElement{connectedCallback(){this.abortController=new AbortController,this.cartOpen=!1,this.cartType=this.getAttribute("cart-type"),this.cartTrigger=this.querySelector(`[href="${window.Shopify.routes.root}cart"]`),this.cartTrigger&&(this.cartTrigger.addEventListener("click",this.handleClick.bind(this),{signal:this.abortController.signal}),document.addEventListener(EVENTS.ajaxProductAdded,evt=>{this.updateCartCount(evt.detail.product)},{signal:this.abortController.signal}),document.addEventListener(EVENTS.cartUpdated,evt=>{this.updateCartCount(evt.detail.cart)},{signal:this.abortController.signal}),document.addEventListener(EVENTS.headerDrawerClosed,this.handleDrawerClosed.bind(this),{signal:this.abortController.signal}),document.addEventListener(EVENTS.headerDrawerOpened,evt=>{evt.target.getAttribute("open")===EVENTS.cartOpen&&(this.cartOpen=!0,this.cartTrigger.setAttribute("aria-expanded","true"))},{signal:this.abortController.signal}))}handleDrawerClosed(){this.cartOpen=!1,this.cartTrigger.setAttribute("aria-expanded","false")}handleClick(evt){this.cartType!=="page"&&(evt.preventDefault(),this.cartOpen?(evt.target.dispatchEvent(new CustomEvent(EVENTS.cartClose,{bubbles:!0})),this.cartTrigger.setAttribute("aria-expanded","false"),this.cartOpen=!1):(evt.target.dispatchEvent(new CustomEvent(EVENTS.cartOpen,{bubbles:!0})),this.cartTrigger.setAttribute("aria-expanded","true"),this.cartOpen=!0))}disconnectedCallback(){this.abortController.abort()}updateCartCount(state){const newCartCount=new DOMParser().parseFromString(state.sections["cart-ajax"],"text/html").querySelector(".cart-link__bubble"),cartCount=this.querySelector(".cart-link__bubble");!newCartCount||!cartCount||(cartCount.outerHTML=newCartCount.outerHTML)}}customElements.define("toggle-cart",ToggleCart);
2//# sourceMappingURL=/cdn/shop/t/94/assets/header.toggle-cart.js.map?v=98854154335626053671788882632

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.