https://www.ecigarettedirect.co.uk/cdn/shop/t/6/assets/recently-vi…?v=130713739479440482921749367650
1customElements.get("recently-viewed-products")||customElements.define("recently-viewed-products",class extends HTMLElement{constructor(){super(),this.productIds=[];const url=this.constructQueryUrl();if(!url)return this.remove();this.observer=new IntersectionObserver((entries,observer)=>{entries[0].isIntersecting&&(observer.disconnect(),this.fetchData(url))},{rootMargin:"0px 0px 400px 0px"}),this.observer.observe(this)}disconnectedCallback(){this.observer&&this.observer.disconnect()}fetchData(url){fetch(url).then(response=>{if(!response.ok)throw new Error(`Network response was not ok: ${response.statusText}`);return response.text()}).then(text=>{this.renderHtml(text)}).catch(error=>{this.remove()})}renderHtml(html){const sourceRecentlyViewedMain=new DOMParser().parseFromString(html,"text/html").querySelector(".recently-viewed-main");if(sourceRecentlyViewedMain){const itemListWrapper=sourceRecentlyViewedMain.querySelector(".slider-wrapper"),fragment=document.createDocumentFragment();this.productIds.forEach(id=>{const item=itemListWrapper.querySelector(`li[data-product-id="${id}"]`);item&&fragment.appendChild(item)}),itemListWrapper.innerHTML="",itemListWrapper.appendChild(fragment),this.querySelector(".products-container").innerHTML=sourceRecentlyViewedMain.outerHTML,initializeScrollLazyImageTrigger(),initializeToolTipTrigger()}else this.remove()}constructQueryUrl(){const limit=parseInt(this.dataset.limit)||5;if(this.productIds=retrieveData(RECENTLY_VIEWED_KEY).slice(-limit).reverse(),!this.productIds||this.productIds.length<=0)return null;const baseUrl=this.dataset.searchUrl,query=this.productIds.map(id=>`id:${id}`).join(" OR "),params=new URLSearchParams({q:query,type:"product",section_id:this.dataset.section,ose:"false"});return`${baseUrl}?${params.toString()}`}}); 2//# sourceMappingURL=/cdn/shop/t/6/assets/recently-viewed-products.js.map?v=130713739479440482921749367650
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.