https://deluxehomeartshop.com/cdn/shop/t/30/assets/dha-pdp-extras.js?v=25220285715497530381791207076
1(()=>{"use strict";if(window.dhaPdpExtras)return;window.dhaPdpExtras=!0;const root=()=>document.querySelector('product-info[data-section-type="product-page"]'),qtyInputs=()=>[...document.querySelectorAll('product-info[data-section-type="product-page"] input[name="quantity"]')],mainQty=()=>{const input=root()?.querySelector('.m-product-form--main input[name="quantity"]')||qtyInputs()[0];return Math.max(1,parseInt(input?.value,10)||1)},lang=(document.documentElement.lang||"da").split("-")[0],currency=window.Shopify?.currency?.active,money=cents=>{try{if(currency)return new Intl.NumberFormat(lang,{style:"currency",currency}).format(cents/100)}catch{}return(cents/100).toFixed(2)};function place(){const info=root();if(!info)return;const per=info.querySelector('[data-dha-move="price"][hidden]'),priceBlock=info.querySelector(".main-product__block-price");per&&priceBlock&&(priceBlock.append(per),per.hidden=!1);const remote=info.querySelector('[data-dha-move="obs"][hidden]');if(remote){const target=[...info.querySelectorAll(".main-product__block-custom_liquid .m-product-tag--sale")].find(tag=>!tag.closest("a")&&!tag.closest(".main-product__block-price"))?.closest(".main-product__block");target?target.replaceChildren(remote):(info.querySelector(".dha-product-heading")||info.querySelector(".main-product__block-title"))?.after(remote),remote.hidden=!1}}function syncAddons(){const n=mainQty();document.querySelectorAll("[data-dha-addon][data-dha-per]").forEach(box=>{const per=parseFloat(box.dataset.dhaPer)||0,pack=parseInt(box.dataset.dhaPack,10)||1,cents=parseInt(box.dataset.dhaCents,10)||0,q=Math.max(1,Math.ceil(per*n/pack));box.dataset.quantity=String(q);const row=box.closest(".dha-addon");if(!row)return;const qty=row.querySelector("[data-dha-addon-qty]");qty&&(qty.textContent=q);const total=row.querySelector("[data-dha-addon-total]");total&¢s&&(total.textContent="+ "+money(cents*q));const note=row.querySelector("[data-dha-addon-note]");note?.dataset.template&&(note.textContent=note.dataset.template.replace("[n]",q*pack))}),document.querySelectorAll("[data-dha-calc-qty]").forEach(button=>{button.setAttribute("aria-pressed",String(parseInt(button.dataset.dhaCalcQty,10)===n))})}function setQuantity(n){qtyInputs().forEach(input=>{input.value=n,input.dispatchEvent(new Event("input",{bubbles:!0})),input.dispatchEvent(new Event("change",{bubbles:!0}))}),syncAddons()}document.addEventListener("click",event=>{const calc=event.target.closest("[data-dha-calc-qty]");if(calc){event.preventDefault(),setQuantity(parseInt(calc.dataset.dhaCalcQty,10)||1);return}event.target.closest("m-quantity-input, .m-quantity")&&setTimeout(syncAddons,0)}),document.addEventListener("input",event=>{event.target.matches?.('input[name="quantity"]')&&syncAddons()}),document.addEventListener("change",event=>{event.target.matches?.('input[name="quantity"]')&&syncAddons()});const nativeAppend=FormData.prototype.append;FormData.prototype.append=function(name,value,...rest){try{const match=typeof name=="string"&&name.match(/^items\[(\d+)\]\[quantity\]$/);if(match&&match[1]!=="0"){const id=this.get(`items[${match[1]}][id]`),box=id&&document.querySelector(`[data-dha-addon][value="${CSS.escape(String(id))}"]:checked`);box?.dataset.quantity&&(value=box.dataset.quantity)}}catch{}return nativeAppend.call(this,name,value,...rest)};const start=()=>{place(),syncAddons()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",start,{once:!0}):start(),window.addEventListener("load",start,{once:!0})})(); 2//# sourceMappingURL=/cdn/shop/t/30/assets/dha-pdp-extras.js.map?v=25220285715497530381791207076
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.