class ProductRecommendations extends HTMLElement{constructor(){super(),this.parent=this.closest(".product-recommendations--parent")}fetchProducts(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML,this.parent&&(this.parent.classList.add("product-recommendations--full"),document.body.classList.contains("open-cart")&&this.parent.classList.add("active"))),this.classList.add("product-recommendations--loaded")}).catch(e=>{console.error(e)})}connectedCallback(){this.fetchProducts()}}customElements.define("product-recommendations",ProductRecommendations);
//# sourceMappingURL=/cdn/shop/t/41/assets/product-recommendations.js.map?v=5872399794701766591739221809