1function u(){return new ObserverConstructor(".js_product-card_observe",{},(a,e)=>{a.forEach(o);function o(r,s){const t=r.target;"_index_in_list"in t||(t._index_in_list=s),r.isIntersecting&&(e.unobserve(t),t.classList.remove("js_product-card_observe"),forEachDOMCollection(t.querySelectorAll(".js_product-card__lazy-img"),c),requestAnimationFrame(()=>{var d,i;t._product_data=t._product_data||{category:{name:t.dataset.categoryName},id:parseInt(t.dataset.id),img:t.querySelector(".js_product-card__img").src,index:t._index_in_list,partner:{id:parseInt(t.dataset.partnerId),name:((d=t.querySelector(".js_product-card__seller-name"))==null?void 0:d.textContent.trim())||""},price:parseFloat(t.dataset.price)||"",price_formatted:t.dataset.priceFormatted,product_name:t.querySelector(".js_product-card__title").textContent.trim()||"",url:t.dataset.url,is_calculator:t.dataset.isCalculator,min_quantity:parseInt(t.dataset.minQuantity)},t.addEventListener("mouseup",_=>{var n;_.target.closest(".js_product-card__link")&&[1,2].includes(_.which)&&((n=window.data_layer)==null||n.push_ecommerce("select_item",t._product_data),browser_storage.local.setItem("obj_for_gtm_from_list",JSON.stringify(t._product_data)))}),(i=window.data_layer)==null||i.view_item_list.push(data_layer.create_product_obj(t._product_data))}))}function c(r){const s=r.dataset.src;s&&(r._old_src=r.src,r.onerror=()=>{if(r.src=r._old_src,r._reload){r.onerror=null;return}setTimeout(()=>{r._reload=!0,r.src=s+"?reload"},1e3)},r.src=s)}})}const m={observer:u(),init(){this.observer.observe(),document.body.addEventListener("click",a=>{var s;const e=a.target.closest(".js-add-favorite")||a.target.closest(".js-remove-favorite");if(!e)return;const o=e.classList.contains("js-add-favorite"),c=a.target.closest(".js_product-card")||a.target.closest(".js_v-product-card"),r=((s=c.querySelector(".js_product-card__link"))==null?void 0:s.getAttribute("href"))||"";axios[o?"post":"delete"](e.dataset.url).then(({data:t})=>{t.status==="success"?(o?(e.classList.remove("js-add-favorite"),e.classList.add("product-card__btn-favorite_active"),e.classList.add("js-remove-favorite"),toastr.success(trans.common.item_added_to_favorites),data_layer.push_ecommerce("add_to_wishlist",c._product_data)):(e.classList.remove("product-card__btn-favorite_active"),e.classList.remove("js-remove-favorite"),e.classList.add("js-add-favorite"),toastr.success(trans.common.item_removed_from_favorites),document.dispatchEvent(new CustomEvent("del-from-favorites",{detail:{product_id:a.target.dataset.id}}))),document.dispatchEvent(new CustomEvent("wishlist-changed",{detail:{product_id:parseInt(e.dataset.id,10),product_url:r,in_wishlist:o}})),document.getElementById("js_favorites-number").textContent=t.count||""):toastr.error(t.message||trans.common.error)}).catch(t=>{handling_error(t),toastr.error(trans.common.error)})})}};export{m as product_card};
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.