PageSourceSearch

https://biokhaan.com/cdn/shop/t/18/assets/cart-icon.js?v=22367625488298260711781090903

js biokhaan.com collected 2026-10-06 13:17:35 UTC 1,646 bytes, 2 lines download raw bytes

1import{ThemeEvents}from"@theme/events";class CartIcon extends HTMLElement{constructor(){super(),this.cartCount=null,this.addToCartBehavior=null,this.clickHandler=this.handleClick.bind(this),this.cartUpdatedHandler=this.onCartUpdated.bind(this)}connectedCallback(){this.addToCartBehavior=this.dataset.addToCartBehavior||"open_cart",this.cartCount=this.querySelector('[data-ref="cart-count"]'),this.addEventListener("click",this.clickHandler),document.addEventListener(ThemeEvents.cartUpdated,this.cartUpdatedHandler)}disconnectedCallback(){document.removeEventListener(ThemeEvents.cartUpdated,this.cartUpdatedHandler),this.removeEventListener("click",this.clickHandler)}getCurrentItemCount(){return parseInt(this.cartCount.textContent)}onCartUpdated(event){this.cartCount.textContent=event.detail.data.itemCount,this.addToCartBehavior=="open_cart"&&this.openCart(),setTimeout(()=>{this.ensureCartCountIsCorrect()},100)}ensureCartCountIsCorrect(){const cartDrawer=document.querySelector('[data-ref="cart-drawer"]');if(!cartDrawer)return;let cartCount=0;cartDrawer.querySelectorAll('[data-ref="cart-item"]').forEach(cartItem=>{cartCount+=parseInt(cartItem.querySelector('[data-ref="quantity-selector-input"]').value)}),cartCount!=this.getCurrentItemCount()&&(this.cartCount.textContent=cartCount)}handleClick(){this.openCart()}openCart(){const cartDrawer=document.querySelector('[data-ref="cart-drawer"]');cartDrawer?cartDrawer.open():window.location.href=Theme.routes.cart_url}}customElements.get("cart-icon")||customElements.define("cart-icon",CartIcon);
2//# sourceMappingURL=/cdn/shop/t/18/assets/cart-icon.js.map?v=22367625488298260711781090903

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.