1const getMetaByWidgetType=widget=>{if(widget==="search")return findify.grid.state.meta;if(widget==="autocomplete")return findify.autocomplete.state.meta;if(widget.includes("findify-rec"))return findify.recommendation.state[widget]?.response?.meta;throw new Error(`there is no meta for widget type : ${widget}`)},initProductCardAnalytics=(id,properties)=>{const meta=getMetaByWidgetType(properties.widget);try{findify.core.analytics?.sendEvent("click-item",{rid:meta.rid,item_id:id,variant_item_id:properties.selected_variant_id})}catch(error){console.log("error",error)}},savePosition=(id,page)=>{const url=window.location.href;sessionStorage.setItem("product",JSON.stringify({id,url,page}))},initOnProductCardClick=(id,page,properties)=>{document.querySelector(`.${properties.widget}_${id}`).addEventListener("click",e=>{initProductCardAnalytics(id,properties),savePosition(id,page)})},cleanActiveSwatches=productCard=>{productCard.querySelectorAll(".findify-color-swatch").forEach(swatch=>swatch.classList.remove("findify-active"))},setProductUrl=(productCard,url)=>{productCard.querySelectorAll(".findify-product-link").forEach(aTag=>aTag.setAttribute("href",url))},onSwatchClick=(event,product_url,variant_url,variant_image)=>{const targetedSwatch=event.target,productCard=targetedSwatch.closest("div[id].findify-product-card"),swatchImage=productCard.querySelector(".findify-product-swatch-image");targetedSwatch.classList.contains("findify-active")?(cleanActiveSwatches(productCard),setProductUrl(productCard,product_url),swatchImage.setAttribute("hidden",!0)):(cleanActiveSwatches(productCard),targetedSwatch.classList.add("findify-active"),setProductUrl(productCard,variant_url),swatchImage.removeAttribute("hidden"),swatchImage.src=`//cdn.shopify.com/s/files/${variant_image}`)}; 2//# sourceMappingURL=/cdn/shop/t/94/assets/findify-product-card.js.map?v=22863626409412978461777450330
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.