PageSourceSearch

https://artmie.hr/cdn/shop/t/41/assets/amh-cart-reco.js?v=30827548704792120491783501337

js artmie.hr collected 2026-10-02 23:23:47 UTC 2,852 bytes, 2 lines download raw bytes

1(function(){"use strict";var GAG=/myhsurprise|myhtip|mystery-proizvod|spakirati/i,applying=!1;function onCartPage(){try{if(/\/cart(\/|$|\?|#)/.test(window.location.pathname))return!0}catch(e){}return!!document.querySelector('[id^="shopify-section"][id*="cart-section"], [id^="shopify-section"][id*="main-cart"], cart-items, cart-items-component')}function cartProductList(){return document.querySelector('[id^="shopify-section"][id*="product_list"]')}function alreadyOurs(){return document.querySelector('[id^="shopify-section"][id*="recommended_products"][data-amh-cc="1"]')}function anchorHandle(cart){var items=(cart.items||[]).filter(function(i){return i&&i.handle});return items.length?(items.sort(function(a,b){return(b.price||0)-(a.price||0)}),items[0].handle):null}function cleanCards(section){return section.querySelectorAll('a[href*="/products/"]').forEach(function(a){var href=a.getAttribute("href")||"",soldOut=!1,card=a.closest("product-card, .resource-list__item, li");card&&(soldOut=/rasprodano|sold\s*out|nedostupno|nema na (stanju|zalihi)|ausverkauft|vyprodáno|elfogyott|epuizat|wyprzedan/i.test(card.textContent||"")),(GAG.test(href)||soldOut)&&card&&card.remove()}),section}function inject(section){var target=cartProductList();if(!target)return!1;var node=document.importNode(section,!0);node.setAttribute("data-amh-cc","1"),applying=!0,target.parentNode.replaceChild(node,target);var sid=node.id?node.id.replace("shopify-section-",""):"";try{document.dispatchEvent(new CustomEvent("shopify:section:load",{bubbles:!0,detail:{sectionId:sid}}))}catch(e){}return setTimeout(function(){applying=!1},100),!0}function run(){!onCartPage()||alreadyOurs()||!cartProductList()||fetch("/cart.js",{headers:{Accept:"application/json"}}).then(function(r){return r.json()}).then(function(cart){var h=anchorHandle(cart);return h?fetch("/products/"+h):null}).then(function(r){return r?r.text():null}).then(function(html){if(html){var doc=new DOMParser().parseFromString(html,"text/html"),rec=doc.querySelector('[id^="shopify-section"][id*="recommended_products"]');if(rec){cleanCards(rec);var n=new Set(Array.from(rec.querySelectorAll('a[href*="/products/"]')).map(function(a){return(a.getAttribute("href")||"").split("?")[0]})).size;n<3||inject(rec)}}}).catch(function(){})}var t=null;function schedule(){applying||(clearTimeout(t),t=setTimeout(run,300))}function boot(){run();try{var host=document.querySelector("#MainContent, main")||document.body;new MutationObserver(schedule).observe(host,{childList:!0,subtree:!0})}catch(e){}["cart:refresh","cart:updated","cart:change","on:cart:update"].forEach(function(ev){document.addEventListener(ev,schedule)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",boot):boot()})();
2//# sourceMappingURL=/cdn/shop/t/41/assets/amh-cart-reco.js.map?v=30827548704792120491783501337

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.