1/*! Copyright (c) Safe As Milk. All rights reserved. */import{debounce}from"utils";class ProductSingle extends HTMLElement{#resizeObserver;#variant;constructor(){super(),this.updateGallery=this.updateGallery.bind(this),this.setPdpHeight=this.setPdpHeight.bind(this)}connectedCallback(){this.mediaGallery=this.querySelector("media-gallery"),this.productUrl=this.dataset.productUrl,this.sectionId=this.dataset.sectionId,this.#moveModalsFromStickyScrollContainer(),this.#resizeObserver=new ResizeObserver(debounce(this.setPdpHeight,5)),this.#resizeObserver.observe(this.querySelector(".product-single__box"))}disconnectedCallback(){this.#resizeObserver.disconnect()}setPdpHeight(){this.style.setProperty("--pdp-height",`${this.querySelector(".product-single__box").offsetHeight}px`)}updateGallery(mediaGallery){const gallery=this.querySelector("media-gallery");if(!mediaGallery||!this.sectionId||!this.productUrl||!gallery)return;const newGallery=mediaGallery;gallery.replaceWith(newGallery),this.mediaGallery=newGallery,window.ShopifyXR&&window.ShopifyXR.setupXRElements()}updateMedia(){if(!this.mediaGallery||!this.#variant.featured_media)return;const mediaId=this.#variant.featured_media.id;this.mediaGallery.goToSlide(mediaId)}set variant(variant){this.#variant=variant,this.updateMedia()}get variant(){return this.#variant}#moveModalsFromStickyScrollContainer(){this.querySelectorAll("sticky-scroll modal-dialog, sticky-scroll popup-dialog").forEach((modal=>{this.append(modal)}))}}customElements.define("product-single",ProductSingle); 2//# sourceMappingURL=/cdn/shop/t/49/assets/product-single.js.map?v=72518883779433099071786712553
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.