1(()=>{"use strict";const MAP=window.CuraproxVisualSwatchMap||{};function tpl(name){const el=document.getElementById(name);return el?el.textContent:""}const TOOTHBRUSH_SVG=window.CuraproxToothbrushSvg||tpl("cpc-toothbrush-svg-template")||"",HEAD_SVG=window.CuraproxHeadSvg||tpl("cpc-head-svg-template")||"";function esc(s){if(s==null)return"";const d=document.createElement("div");return d.textContent=String(s),d.innerHTML}function handleize(s){return String(s??"").normalize("NFD").replace(/[Ì-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function partColor(part){const ph=handleize(String(part).trim());if(ph&&MAP[ph]&&MAP[ph].body)return MAP[ph].body;const prefix=ph+"-";for(const k in MAP)if(k.indexOf(prefix)===0&&MAP[k].body)return MAP[k].body;return"#d9d9d9"}function swatchVisual(color,idx,flags,idSuffix){const vis=MAP[color.handle]||{};let vars="";if(vis.img)return{vars:"--toothbrush-image:url("+vis.img+");",html:'<span class="cpc-swatch__img"></span>'};const parts=String(color.name||"").split("/");if(parts.length>=3||parts.length===2&&flags.isHead){const n=Math.min(parts.length,3);for(let i=0;i<n;i++)vars+="--trio-"+(i+1)+":"+partColor(parts[i])+";";const duo=parts.length===2?" cpc-swatch__trio--duo":"";return{vars,html:'<span class="cpc-swatch__trio'+duo+'"></span>'}}if(flags.isRefill)return vis.body&&(vars+="--body:"+vis.body+";"),{vars,html:HEAD_SVG||'<span class="cpc-swatch__disc"></span>'};if(flags.isTB){vis.body&&(vars+="--body:"+vis.body+";"),vis.bristles&&(vars+="--bristles:"+vis.bristles+";");const svg=TOOTHBRUSH_SVG?TOOTHBRUSH_SVG.split("__UID__").join(color.handle+"-"+idSuffix+"-"+idx):'<span class="cpc-swatch__disc"></span>';return{vars,html:svg}}return vars="--disc-color:"+(vis.body||"#d9d9d9")+";",{vars,html:'<span class="cpc-swatch__disc"></span>'}}function buildSwatchSpan(color,idx,flags,idSuffix,title,showText){const sv=swatchVisual(color,idx,flags,idSuffix),label=showText+": "+title+" \u2014 "+color.name;return'<span class="cpc-swatch" style="'+esc(sv.vars)+'" data-cpc-swatch-add data-variant-id="'+esc(color.variantId)+'" data-media-id="'+esc(color.mediaId)+'" data-image="'+esc(color.image)+'" data-hover-image="'+esc(color.hover)+'" data-variant-url="'+esc(color.url)+'" role="button" tabindex="0" aria-pressed="false" aria-label="'+esc(label)+'"'+(color.blocked?' aria-disabled="true"':"")+">"+sv.html+"</span>"}function enhanceRow(row){if(row.dataset.cpcEnhanced)return;let colors;try{colors=JSON.parse(row.dataset.cpcColors)}catch{return}if(!Array.isArray(colors)||!colors.length)return;const flags={isTB:row.dataset.cpcIsTb==="true",isHead:row.dataset.cpcIsHead==="true",isRefill:row.dataset.cpcIsRefill==="true"},title=row.dataset.cpcProductTitle||"",idSuffix=row.classList.contains("cpc-swatches--inline")?"d":"m",showText=window.CuraproxSwatchShowText||"Show",max=Math.max(1,parseInt(row.dataset.cpcMax,10)||3),shownColors=colors.slice(0,max);let html=shownColors.map((c,i)=>buildSwatchSpan(c,i,flags,idSuffix,title,showText)).join("");const extra=colors.length-shownColors.length;if(extra>0){const productUrl=colors[0]&&colors[0].url?String(colors[0].url).split("?")[0]:"#";html+='<a class="cpc-swatch-more functional" data-cpc-swatch-more href="'+esc(productUrl)+'" aria-label="'+esc("+"+extra+" "+title)+'">+'+extra+"</a>"}row.innerHTML=html,row.dataset.cpcEnhanced="1"}function run(root){(root&&root.querySelectorAll?root:document).querySelectorAll(".cpc-swatches[data-cpc-colors]").forEach(enhanceRow)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>run(document)):run(document),document.addEventListener("shopify:section:load",e=>run(e.target))})(); 2//# sourceMappingURL=/cdn/shop/t/2/assets/curaprox-card-swatch-enhance.js.map?v=112336933183989132971787053019
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.