PageSourceSearch

https://duplinwinery.com/cdn/shop/t/37/assets/allure-discount-pric…?v=91466488594180875911786498204

js duplinwinery.com collected 2026-10-03 21:19:59 UTC 4,256 bytes, 2 lines download raw bytes

1(()=>{const moneyFormat=document.currentScript?.dataset.moneyFormat||"${{amount}}",observedProductInfo=new WeakSet,scheduledProductInfo=new WeakSet;function formatWithDelimiters(number,precision=2,thousands=",",decimal="."){if(number==null||Number.isNaN(Number(number)))return"0";const parts=(Number(number)/100).toFixed(precision).split("."),dollars=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${thousands}`);return parts[1]?`${dollars}${decimal}${parts[1]}`:dollars}function formatMoney(cents){const placeholder=moneyFormat.match(/{{\s*(\w+)\s*}}/)?.[1]||"amount";let value;switch(placeholder){case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'",".");break;default:value=formatWithDelimiters(cents,2);break}return moneyFormat.replace(/{{\s*\w+\s*}}/,value)}function getVariantId(productInfo){return productInfo.querySelector('form[action*="/cart/add"] [name="id"]')?.value||""}function getPriceData(block){const dataElement=block.querySelector("[data-allure-variant-prices]");if(!dataElement?.textContent)return null;try{return JSON.parse(dataElement.textContent)}catch(error){return console.error("Unable to read Allure subscription price data:",error),null}}function setText(element,text){element&&element.textContent.trim()!==text&&(element.textContent=text)}function setDisplay(element,display){!element||element.style.display===display||(display?element.style.display=display:element.style.removeProperty("display"))}function syncOneTimePrice(productInfo){const block=productInfo.querySelector(".allure-subscription-block"),selectedOption=block?.querySelector('input[name="allure_selling_plan_id"]:checked');if(!block||!selectedOption||selectedOption.value)return;const variantId=getVariantId(productInfo),priceData=getPriceData(block),price=Number(priceData?.prices?.[variantId]?.[""]),compareAtPrice=Number(priceData?.compare_at?.[variantId]),priceElement=productInfo.querySelector(".price"),regularBlock=priceElement?.querySelector(".price__regular"),saleBlock=priceElement?.querySelector(".price__sale");if(!variantId||!Number.isFinite(price)||!priceElement||!regularBlock||!saleBlock)return;const regularPrice=regularBlock.querySelector(".price-item--regular"),salePrice=saleBlock.querySelector(".price-item--sale"),saleCompareAt=saleBlock.querySelector("s.price-item--regular");Number.isFinite(compareAtPrice)&&compareAtPrice>price?(priceElement.classList.add("price--on-sale"),setText(salePrice,formatMoney(price)),setText(saleCompareAt,formatMoney(compareAtPrice)),setDisplay(regularBlock,"none"),setDisplay(saleBlock,"")):(priceElement.classList.remove("price--on-sale"),setText(regularPrice,formatMoney(price)),setDisplay(regularBlock,""),setDisplay(saleBlock,"none"))}function scheduleSync(productInfo){!productInfo||scheduledProductInfo.has(productInfo)||(scheduledProductInfo.add(productInfo),requestAnimationFrame(()=>{scheduledProductInfo.delete(productInfo),syncOneTimePrice(productInfo)}))}function observeProductInfo(productInfo){if(!productInfo||observedProductInfo.has(productInfo))return;const block=productInfo.querySelector(".allure-subscription-block"),priceElement=productInfo.querySelector(".price");if(!block||!priceElement)return;observedProductInfo.add(productInfo),scheduleSync(productInfo),new MutationObserver(()=>scheduleSync(productInfo)).observe(priceElement,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}function observeAllProductInfo(){document.querySelectorAll("product-info").forEach(observeProductInfo)}document.addEventListener("change",event=>{event.target.matches('input[name="allure_selling_plan_id"], form[action*="/cart/add"] [name="id"]')&&scheduleSync(event.target.closest("product-info"))}),document.addEventListener("shopify:section:load",observeAllProductInfo),observeAllProductInfo(),new MutationObserver(observeAllProductInfo).observe(document.documentElement,{childList:!0,subtree:!0})})();
2//# sourceMappingURL=/cdn/shop/t/37/assets/allure-discount-price-display-fix.js.map?v=91466488594180875911786498204

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.