1import{DialogComponent,DialogOpenEvent}from"@theme/dialog";import{CartAddEvent}from"@theme/events";class CartDrawerComponent extends DialogComponent{#summaryThreshold=.5;connectedCallback(){super.connectedCallback(),document.addEventListener(CartAddEvent.eventName,this.#handleCartAdd),this.addEventListener(DialogOpenEvent.eventName,this.#updateStickyState)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(CartAddEvent.eventName,this.#handleCartAdd),this.removeEventListener(DialogOpenEvent.eventName,this.#updateStickyState)}#handleCartAdd=()=>{this.hasAttribute("auto-open")&&this.showDialog()};open(){this.showDialog(),customElements.whenDefined("shopify-payment-terms").then(()=>{document.querySelector("shopify-payment-terms")?.shadowRoot?.querySelector("#shopify-installments-cta")?.addEventListener("click",this.closeDialog,{once:!0})})}close(){this.closeDialog()}#updateStickyState(){const{dialog}=this.refs;if(!dialog)return;const content=dialog.querySelector(".cart-drawer__content"),summary=dialog.querySelector(".cart-drawer__summary");if(!content||!summary){dialog.setAttribute("cart-summary-sticky","false");return}const drawerHeight=dialog.getBoundingClientRect().height,ratio=summary.getBoundingClientRect().height/drawerHeight;dialog.setAttribute("cart-summary-sticky",ratio>this.#summaryThreshold?"false":"true")}}customElements.get("cart-drawer-component")||customElements.define("cart-drawer-component",CartDrawerComponent); 2//# sourceMappingURL=/cdn/shop/t/1/assets/cart-drawer.js.map?v=60516533948368149871770216290
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.