1const r="bg_nurture_token",n="bg_nurture_session";function o(){if(typeof window>"u")return null;try{const t=new URLSearchParams(window.location.search).get("bgt");return t&&/^[a-f0-9]{16,64}$/.test(t)&&localStorage.setItem(r,t),localStorage.getItem(r)}catch{return null}}function a(){try{let t=sessionStorage.getItem(n);return t||(t=Math.random().toString(36).slice(2)+Date.now().toString(36),sessionStorage.setItem(n,t)),t}catch{return"na"}}function s(t,e={}){const i=o();if(i)try{fetch("/api/public/nurture/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i,type:t,sessionId:a(),path:e.path??window.location.pathname,count:e.count}),keepalive:!0}).catch(()=>{})}catch{}}function c(t){if(!o())return;s("site_visit",{path:t});let e="page_view";t.startsWith("/bathroom-vision-studio")?e="vision_studio_visit":t.startsWith("/tools/bathroom-remodel-cost")||t.startsWith("/cost-calculator")?e="estimator_visit":t.startsWith("/bath-remodel-match")||t.startsWith("/go-local")?e="contractor_match_visit":/^\/(pillars|trends|permits|guide|local|bathroom-remodel)/.test(t)&&(e="guide_viewed"),s(e,{path:t})}function u(){return o()}export{u as getNurtureToken,s as trackNurture,c as trackNurturePageView};
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.