PageSourceSearch

https://www.terranovastyle.com/cdn/shop/t/51/assets/cmp-mc-stoq.js?v=36940583030542545461789380518

js terranovastyle.com collected 2026-09-26 00:09:29 UTC 3,028 bytes, 2 lines download raw bytes

1(()=>{const productCache=new Map;let appLoading=null;const sizeLabel=document.currentScript&&document.currentScript.dataset.sizeLabel||"";window.addEventListener("stoq:restock-modal:opened",event=>{const variant=event.detail&&event.detail.variant,variantTitle=variant&&(variant.title||variant.public_title);variantTitle&&requestAnimationFrame(()=>{const modal=document.querySelector("#restock-rocket"),productName=modal&&modal.querySelector("#form-Product-Name");if(!productName)return;let line=modal.querySelector("[data-stoq-variant]");line||(line=document.createElement("p"),line.setAttribute("data-stoq-variant",""),productName.insertAdjacentElement("afterend",line)),line.textContent=sizeLabel?`${sizeLabel}: ${variantTitle}`:variantTitle})});const config=()=>window._RestockRocketConfig||{},hasOpenModal=()=>!!(window._RestockRocket&&typeof window._RestockRocket.openModal=="function"),loadRestockRocket=()=>{if(hasOpenModal())return Promise.resolve(window._RestockRocket);if(appLoading)return appLoading;const cfg=config(),src=!!(cfg.settings&&cfg.settings.preorder_enabled)?cfg.scriptUrlCollection:cfg.scriptUrlCollectionBis||cfg.scriptUrlCollection;return src?(appLoading=new Promise(resolve=>{const script=document.createElement("script");script.defer=!0,script.src=src,script.onload=()=>{let attempts=0;const check=()=>{if(hasOpenModal())return resolve(window._RestockRocket);if(++attempts>50)return resolve(null);setTimeout(check,100)};check()},script.onerror=()=>resolve(null),document.body.appendChild(script)}),appLoading):Promise.resolve(null)},fetchProduct=handle=>{if(productCache.has(handle))return productCache.get(handle);const root=window.Shopify&&Shopify.routes&&Shopify.routes.root||"/",request=fetch(`${root}products/${handle}.js`).then(response=>response.ok?response.json():null).catch(()=>null);return productCache.set(handle,request),request},getProduct=async(productId,handle,variantId)=>{const configProduct=config().product;if(configProduct&&String(configProduct.id)===String(productId))return configProduct;if(handle){const product=await fetchProduct(handle);if(product)return product;productCache.delete(handle)}return{id:productId,variants:[{id:variantId,available:!1}]}};class McStoq extends HTMLElement{connectedCallback(){this.dataset.stoqBound!=="true"&&(this.dataset.stoqBound="true",this.addEventListener("click",this.onClick))}onClick=async event=>{event.preventDefault();const productId=this.dataset.productId;if(!productId||!this.dataset.variant){console.error("McStoq: data-product-id o data-variant mancanti");return}const variantId=Number(this.dataset.variant)||this.dataset.variant,app=await loadRestockRocket();if(!app){console.error("McStoq: Restock Rocket non disponibile");return}const product=await getProduct(productId,this.dataset.handle,variantId);app.openModal(product,variantId)}}customElements.get("mc-stoq")||customElements.define("mc-stoq",McStoq),window.McStoq=McStoq})();
2//# sourceMappingURL=/cdn/shop/t/51/assets/cmp-mc-stoq.js.map?v=36940583030542545461789380518

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.