PageSourceSearch

https://www.superfeet.com/cdn/shop/t/240/assets/private-sale-searc…?v=49113479817543539631790271470

js superfeet.com collected 2026-10-03 19:04:16 UTC 2,634 bytes, 2 lines download raw bytes

1(()=>{const inlineConfig=window.privateSaleSearchspringDiscount;function storedEligibility(){let stored;try{stored=JSON.parse(localStorage.getItem("privateSaleEligibility"))}catch{return null}return!stored||!stored.percent||!Array.isArray(stored.handles)||!stored.handles.length?null:stored}const PROCESSED_ATTR="data-private-sale-adjusted";function discountedPrice(base,percent){const baseCents=Math.round(base*100),discountCents=Math.floor(baseCents*percent/100);return((baseCents-discountCents)/100).toFixed(2)}function cardHandle(card){const link=card.querySelector('a[href*="/products/"]');if(!link)return null;const match=link.getAttribute("href").match(/\/products\/([^/?#]+)/);return match?match[1]:null}function processCard(card,percent,handles){if(handles&&!handles.includes(cardHandle(card)))return;const pricing=card.querySelector(".ss__result__details__pricing");if(!pricing)return;const priceSpans=pricing.querySelectorAll(".ss__price:not(.ss__price--strike)"),currentSpan=priceSpans[priceSpans.length-1];if(!currentSpan||currentSpan.hasAttribute(PROCESSED_ATTR))return;const valueSpan=currentSpan.querySelector(".ss__price__value");if(!valueSpan)return;const basePrice=parseFloat(valueSpan.textContent);if(isNaN(basePrice))return;const discounted=discountedPrice(basePrice,percent),alreadyOnSale=!!pricing.querySelector(".ss__price--strike");if(currentSpan.setAttribute(PROCESSED_ATTR,"true"),!alreadyOnSale){const strikeClone=currentSpan.cloneNode(!0);strikeClone.classList.add("ss__price--strike"),strikeClone.removeAttribute(PROCESSED_ATTR),currentSpan.insertAdjacentElement("beforebegin",strikeClone)}valueSpan.textContent=discounted}function debounce(fn,wait){let timeout;return(...args)=>{clearTimeout(timeout),timeout=setTimeout(()=>fn(...args),wait)}}function processAll(){const inlinePercent=inlineConfig&&inlineConfig.percent,eligibility=storedEligibility();inlinePercent&&document.querySelectorAll("#searchspring-content .ss__result").forEach(card=>processCard(card,inlinePercent,null)),eligibility&&document.querySelectorAll(".ss__result").forEach(card=>{inlinePercent&&card.closest("#searchspring-content")||processCard(card,eligibility.percent,eligibility.handles)})}function init(){if(!(inlineConfig&&inlineConfig.percent)&&!storedEligibility())return;processAll();const debouncedProcessAll=debounce(processAll,150);new MutationObserver(debouncedProcessAll).observe(document.body,{childList:!0,subtree:!0,characterData:!0})}document.addEventListener("DOMContentLoaded",init)})();
2//# sourceMappingURL=/cdn/shop/t/240/assets/private-sale-searchspring-price-override.js.map?v=49113479817543539631790271470

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.