1class ViewportImageLoader extends HTMLElement{constructor(){super(),this.observer=null,this.isIntersecting=!1,this.rootMargin=this.getAttribute("root-margin")||"50px",this.threshold=parseFloat(this.getAttribute("threshold"))||.1}connectedCallback(){if(!window.IntersectionObserver){this.showImages();return}this.observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&!this.isIntersecting&&(this.isIntersecting=!0,this.showImages(),this.observer.unobserve(this))})},{rootMargin:this.rootMargin,threshold:this.threshold}),this.observer.observe(this)}disconnectedCallback(){this.observer&&(this.observer.disconnect(),this.observer=null)}showImages(){this.classList.add("ec:visible");const images=this.querySelectorAll("img");images.forEach(img=>{img.dataset.src&&!img.src&&(img.src=img.dataset.src,img.removeAttribute("data-src")),img.dataset.srcset&&!img.srcset&&(img.srcset=img.dataset.srcset,img.removeAttribute("data-srcset"))}),this.querySelectorAll("source[data-src], source[data-srcset]").forEach(source=>{source.dataset.srcset&&!source.srcset&&(source.srcset=source.dataset.srcset,source.removeAttribute("data-srcset")),source.dataset.src&&!source.srcset&&(source.srcset=source.dataset.src,source.removeAttribute("data-src"))}),this.dispatchEvent(new CustomEvent("images-visible",{bubbles:!0,detail:{images:Array.from(images)}}))}}customElements.get("viewport-image-loader")||customElements.define("viewport-image-loader",ViewportImageLoader); 2//# sourceMappingURL=/cdn/shop/t/125/assets/viewport-image-loader.js.map?v=49245837690034352781782965574
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.