@sentientui/core 0.38.0 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +43 -1
  2. package/dist/{chunk-NCLBL5V3.mjs → chunk-EVF5PQ4U.mjs} +1 -1
  3. package/dist/{chunk-NCLBL5V3.mjs.map → chunk-EVF5PQ4U.mjs.map} +1 -1
  4. package/dist/chunk-QEIHHO3T.mjs +2 -0
  5. package/dist/chunk-QEIHHO3T.mjs.map +1 -0
  6. package/dist/{index-BdpO3Qlm.d.cts → index-BAfi7_FG.d.cts} +60 -5
  7. package/dist/{index-DzGhQhSK.d.ts → index-DyKtujwf.d.ts} +60 -5
  8. package/dist/index-engagement.js +1 -1
  9. package/dist/index-engagement.js.map +1 -1
  10. package/dist/index-engagement.mjs +1 -1
  11. package/dist/index-graph.d.cts +5 -5
  12. package/dist/index-graph.d.ts +5 -5
  13. package/dist/index-graph.js +1 -1
  14. package/dist/index-graph.js.map +1 -1
  15. package/dist/index-graph.mjs +1 -1
  16. package/dist/index-local.d.cts +3 -3
  17. package/dist/index-local.d.ts +3 -3
  18. package/dist/index-region.d.cts +1 -1
  19. package/dist/index-region.d.ts +1 -1
  20. package/dist/index-region.mjs +1 -1
  21. package/dist/index-server.d.cts +73 -5
  22. package/dist/index-server.d.ts +73 -5
  23. package/dist/index-server.js +1 -1
  24. package/dist/index-server.js.map +1 -1
  25. package/dist/index-server.mjs +1 -1
  26. package/dist/index-server.mjs.map +1 -1
  27. package/dist/index.d.cts +3 -3
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +1 -1
  32. package/dist/{region-skeleton-D2ahkcbe.d.cts → region-skeleton-BRIVB-qf.d.cts} +1 -0
  33. package/dist/{region-skeleton-D2ahkcbe.d.ts → region-skeleton-BRIVB-qf.d.ts} +1 -0
  34. package/dist/{session-meta-CvEwPQCX.d.ts → session-meta-BtRtwsHI.d.ts} +1 -1
  35. package/dist/{session-meta-USVMwvsR.d.cts → session-meta-qx4kIL5y.d.cts} +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-VLFWHJNJ.mjs +0 -2
  38. package/dist/chunk-VLFWHJNJ.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import{a as Z}from"./chunk-WKXD7KI3.mjs";import{a as j,d as J,e as H,f as q,g as se}from"./chunk-Z6ILOYBD.mjs";import{M as Q,O as X}from"./chunk-VLFWHJNJ.mjs";import"./chunk-XZRKD2GS.mjs";import"./chunk-NCLBL5V3.mjs";import"./chunk-MKM7TD3L.mjs";import"./chunk-J5EL7HKC.mjs";import{a as $,b as z}from"./chunk-TMCGHANO.mjs";import{fnv1a as ue}from"@sentientui/policy";var ee=[100,300,1e3,3e3,1e4],ie=250,ae=1e3,ce=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function te(t,o){t.n++;let e=o-t.mean;t.mean+=e/t.n,t.m2+=e*(o-t.mean)}var ne=t=>t.n>1?Math.sqrt(t.m2/t.n):0;function le(t){var o;try{let e=t.createElement("canvas"),u=e.getContext("webgl")||e.getContext("experimental-webgl");if(!u)return"unknown";let d=u.getExtension("WEBGL_debug_renderer_info"),p=d?String((o=u.getParameter(d.UNMASKED_RENDERER_WEBGL))!=null?o:""):"";return p?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(p)?"sw":"hw":"unknown"}catch(e){return"unknown"}}function re(t,o=Date.now){var a,c;let e=(a=t.defaultView)!=null?a:typeof window!="undefined"?window:void 0,u={n:0,mean:0,m2:0},d={n:0,mean:0,m2:0},p=[0,0,0,0,0,0],_=0,G=0,k=0,U=0,g=0,V=0,T=0,h=0,I=0,b=0,L=-1/0,C=-1/0,m=null,w=null,A=null,x=(c=e==null?void 0:e.scrollY)!=null?c:0,N=0,f=t.hidden?null:o(),E=()=>{let n=o();if(A!=null){let l=n-A,v=0;for(;v<ee.length&&l>=ee[v];)v++;p[v]++}A=n},O=()=>{_++,L=o()},R=()=>{G++,C=o()},M=()=>{m=o()},D=()=>{m!=null&&(te(u,o()-m),m=null)},P=()=>{let n=o();k++,n-L>ie&&n-C>ae&&U++,E()},S=()=>{g++},W=()=>{var l;let n=(l=e==null?void 0:e.scrollY)!=null?l:0;V+=Math.abs(n-x),x=n,E()},K=n=>{let l=o();T++,(n.key==="Backspace"||n.key==="Delete")&&I++,ce.has(n.key)&&b++,w!=null&&te(d,l-w),w=l,E()},F=n=>{let l=n.data;typeof l=="string"&&(h+=l.length),E()},B=()=>{let n=o();t.hidden?f!=null&&(N+=n-f,f=null):f==null&&(f=n)},i={passive:!0,capture:!0};t.addEventListener("mousemove",O,i),t.addEventListener("touchstart",R,i),t.addEventListener("touchmove",S,i),t.addEventListener("mousedown",M,i),t.addEventListener("mouseup",D,i),t.addEventListener("click",P,i),t.addEventListener("wheel",S,i),t.addEventListener("keydown",K,i),t.addEventListener("input",F,i),t.addEventListener("visibilitychange",B),e==null||e.addEventListener("scroll",W,i);let r=le(t),s=(()=>{var n;try{return((n=e==null?void 0:e.matchMedia)==null?void 0:n.call(e,"(prefers-reduced-motion: reduce)").matches)===!0}catch(l){return!1}})();return{snapshot(){var v,y;let n=o(),l=N+(f!=null?n-f:0);return{v:1,active_ms:Math.round(l),mm:_,mm_rate:l>0?Number((_*1e3/l).toFixed(2)):0,touches:G,clicks:k,hold_n:u.n,hold_mean:Math.round(u.mean),hold_std:Math.round(ne(u)),teleport:U,wheel:g,scroll_px:Math.round(V),keydowns:T,input_chars:h,ik_cv:d.mean>0?Number((ne(d)/d.mean).toFixed(2)):0,backspaces:I,gaps:[...p],reduced_motion:s,kb_nav:b,renderer:r,vp:[(v=e==null?void 0:e.innerWidth)!=null?v:0,(y=e==null?void 0:e.innerHeight)!=null?y:0],dpr:(e==null?void 0:e.devicePixelRatio)||1}},stop(){t.removeEventListener("mousemove",O,i),t.removeEventListener("touchstart",R,i),t.removeEventListener("touchmove",S,i),t.removeEventListener("mousedown",M,i),t.removeEventListener("mouseup",D,i),t.removeEventListener("click",P,i),t.removeEventListener("wheel",S,i),t.removeEventListener("keydown",K,i),t.removeEventListener("input",F,i),t.removeEventListener("visibilitychange",B),e==null||e.removeEventListener("scroll",W,i)}}}var de="section, header, footer, nav, main > div, [data-sentient-section]",me=2e4,oe="__session__";function pe(t){let o=Array.from(t.querySelectorAll(de)),e=o.filter(u=>o.filter(d=>d!==u&&u.contains(d)).length<2);return e.filter(u=>!e.some(d=>d!==u&&d.contains(u)))}function fe(t,o,e,u){try{fetch(`${o}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${t}`},body:JSON.stringify({pageUrl:e,sections:u})}).catch(()=>{})}catch(d){}}var Y=()=>{};function ve(t,o){var x,N,f,E,O,R,M,D,P,S,W,K,F,B,i;let e=(x=o.doc)!=null?x:typeof document!="undefined"?document:void 0;if(!e||typeof IntersectionObserver=="undefined"||X()||!o.apiKey||!o.apiKey.startsWith("pk_"))return Y;let u=((N=o.apiBase)!=null?N:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),d=pe(e);if(d.length===0)return Y;let p=new Map,_=[];for(let r of d){let s=(O=[(E=o.sectionTypes)==null?void 0:E[(f=r.getAttribute("data-sentient-id"))!=null?f:""],r.getAttribute("data-sentient-type")].find(y=>j.includes(y)))!=null?O:null,a=q(r),c=(M=s!=null?s:(R=o.typeOf)==null?void 0:R.call(o,r))!=null?M:H(a).type,n=Z(r,e),l=n?`nc-${c}-${ue(JSON.stringify({id:(D=n.id)!=null?D:null,dataAttr:(P=n.dataAttr)!=null?P:null,selector:(S=n.selector)!=null?S:null})).toString(36)}`:`nc-${c}`;p.set(r,l);let v=J.filter(([,y])=>y.test(a.bodyText)).map(([y])=>y);_.push(z($({componentId:l,semanticType:c,source:s?"markup":"auto"},n?{locator:n}:{}),{observation:$($({tag:a.tag,idClass:a.idClass.slice(0,200),headingText:a.headingText,textLength:a.textLength,actionCount:a.actionCount},a.ariaRole?{ariaRole:a.ariaRole}:{}),v.length>0?{patternFlags:v}:{})}))}let G=(B=(F=(K=(W=e.defaultView)!=null?W:typeof window!="undefined"?window:void 0)==null?void 0:K.location)==null?void 0:F.pathname)!=null?B:"/";fe(o.apiKey,u,G,_);let k=re(e),U=()=>{let r;try{r=k.snapshot()}catch(s){return}try{t.track({projectId:o.apiKey,componentId:oe,eventType:"interaction_stats",payload:r})}catch(s){}},g=new Map,V=r=>{let s=g.get(r);return s||(s={ms:0,scroll:0,enterAt:null,intersecting:!1},g.set(r,s)),s},T=new IntersectionObserver(r=>{for(let s of r){let a=p.get(s.target);if(!a)continue;let c=V(a);s.isIntersecting?(c.intersecting=!0,c.enterAt=Date.now(),s.intersectionRatio>c.scroll&&(c.scroll=s.intersectionRatio)):(c.intersecting=!1,c.enterAt!=null&&(c.ms+=Date.now()-c.enterAt,c.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let r of p.keys())T.observe(r);let h=(r=!1)=>{var a;let s=Date.now();for(let[c,n]of g)if(n.enterAt!=null&&(n.ms+=s-n.enterAt,n.enterAt=null),!(n.ms<=0)){try{t.track({projectId:o.apiKey,componentId:c,eventType:"dwell",payload:{dwell_time:Math.round(n.ms),scroll_depth:Number(n.scroll.toFixed(2))}})}catch(l){}n.ms=0}if(U(),r)try{(a=t.flush)==null||a.call(t)}catch(c){}},I=()=>{if(e.hidden)h(!0);else{let r=Date.now();for(let s of g.values())s.intersecting&&(s.enterAt=r)}},b=!1,L=r=>{if(h(!0),r!=null&&r.persisted){b=!0;return}try{T.disconnect()}catch(s){}},C=r=>{if(!(r!=null&&r.persisted)||!b)return;b=!1;let s=Date.now();for(let a of g.values())a.enterAt=a.intersecting&&!e.hidden?s:null};e.addEventListener("visibilitychange",I);let m=(i=e.defaultView)!=null?i:typeof window!="undefined"?window:void 0;m==null||m.addEventListener("pagehide",L),m==null||m.addEventListener("pageshow",C);let w=setInterval(()=>{if(e.hidden||b)return;h();let r=Date.now();for(let s of g.values())s.intersecting&&(s.enterAt=r)},me),A=[];return o.microSignals&&[...p.entries()].forEach(([r,s],a)=>{A.push(Q((c,n={})=>{try{t.track({projectId:o.apiKey,componentId:s,eventType:"micro_signal",payload:$({signalType:c},n)})}catch(l){}},r,void 0,{tabLoss:a===0}))}),()=>{h(!0),clearInterval(w),k.stop(),e.removeEventListener("visibilitychange",I),m==null||m.removeEventListener("pagehide",L),m==null||m.removeEventListener("pageshow",C);for(let r of A)r();try{T.disconnect()}catch(r){}}}export{oe as INTERACTION_STATS_COMPONENT,j as SEMANTIC_TYPES,H as classifyFeatures,se as classifySection,q as featuresFromElement,ve as startEngagementCapture};
1
+ import{a as Z}from"./chunk-WKXD7KI3.mjs";import{a as j,d as J,e as H,f as q,g as se}from"./chunk-Z6ILOYBD.mjs";import{O as Q,Q as X}from"./chunk-QEIHHO3T.mjs";import"./chunk-XZRKD2GS.mjs";import"./chunk-EVF5PQ4U.mjs";import"./chunk-MKM7TD3L.mjs";import"./chunk-J5EL7HKC.mjs";import{a as $,b as z}from"./chunk-TMCGHANO.mjs";import{fnv1a as ue}from"@sentientui/policy";var ee=[100,300,1e3,3e3,1e4],ie=250,ae=1e3,ce=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function te(t,o){t.n++;let e=o-t.mean;t.mean+=e/t.n,t.m2+=e*(o-t.mean)}var ne=t=>t.n>1?Math.sqrt(t.m2/t.n):0;function le(t){var o;try{let e=t.createElement("canvas"),u=e.getContext("webgl")||e.getContext("experimental-webgl");if(!u)return"unknown";let d=u.getExtension("WEBGL_debug_renderer_info"),p=d?String((o=u.getParameter(d.UNMASKED_RENDERER_WEBGL))!=null?o:""):"";return p?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(p)?"sw":"hw":"unknown"}catch(e){return"unknown"}}function re(t,o=Date.now){var a,c;let e=(a=t.defaultView)!=null?a:typeof window!="undefined"?window:void 0,u={n:0,mean:0,m2:0},d={n:0,mean:0,m2:0},p=[0,0,0,0,0,0],_=0,G=0,k=0,U=0,g=0,V=0,T=0,h=0,I=0,b=0,L=-1/0,C=-1/0,m=null,w=null,A=null,x=(c=e==null?void 0:e.scrollY)!=null?c:0,N=0,f=t.hidden?null:o(),E=()=>{let n=o();if(A!=null){let l=n-A,v=0;for(;v<ee.length&&l>=ee[v];)v++;p[v]++}A=n},O=()=>{_++,L=o()},R=()=>{G++,C=o()},M=()=>{m=o()},D=()=>{m!=null&&(te(u,o()-m),m=null)},P=()=>{let n=o();k++,n-L>ie&&n-C>ae&&U++,E()},S=()=>{g++},W=()=>{var l;let n=(l=e==null?void 0:e.scrollY)!=null?l:0;V+=Math.abs(n-x),x=n,E()},K=n=>{let l=o();T++,(n.key==="Backspace"||n.key==="Delete")&&I++,ce.has(n.key)&&b++,w!=null&&te(d,l-w),w=l,E()},F=n=>{let l=n.data;typeof l=="string"&&(h+=l.length),E()},B=()=>{let n=o();t.hidden?f!=null&&(N+=n-f,f=null):f==null&&(f=n)},i={passive:!0,capture:!0};t.addEventListener("mousemove",O,i),t.addEventListener("touchstart",R,i),t.addEventListener("touchmove",S,i),t.addEventListener("mousedown",M,i),t.addEventListener("mouseup",D,i),t.addEventListener("click",P,i),t.addEventListener("wheel",S,i),t.addEventListener("keydown",K,i),t.addEventListener("input",F,i),t.addEventListener("visibilitychange",B),e==null||e.addEventListener("scroll",W,i);let r=le(t),s=(()=>{var n;try{return((n=e==null?void 0:e.matchMedia)==null?void 0:n.call(e,"(prefers-reduced-motion: reduce)").matches)===!0}catch(l){return!1}})();return{snapshot(){var v,y;let n=o(),l=N+(f!=null?n-f:0);return{v:1,active_ms:Math.round(l),mm:_,mm_rate:l>0?Number((_*1e3/l).toFixed(2)):0,touches:G,clicks:k,hold_n:u.n,hold_mean:Math.round(u.mean),hold_std:Math.round(ne(u)),teleport:U,wheel:g,scroll_px:Math.round(V),keydowns:T,input_chars:h,ik_cv:d.mean>0?Number((ne(d)/d.mean).toFixed(2)):0,backspaces:I,gaps:[...p],reduced_motion:s,kb_nav:b,renderer:r,vp:[(v=e==null?void 0:e.innerWidth)!=null?v:0,(y=e==null?void 0:e.innerHeight)!=null?y:0],dpr:(e==null?void 0:e.devicePixelRatio)||1}},stop(){t.removeEventListener("mousemove",O,i),t.removeEventListener("touchstart",R,i),t.removeEventListener("touchmove",S,i),t.removeEventListener("mousedown",M,i),t.removeEventListener("mouseup",D,i),t.removeEventListener("click",P,i),t.removeEventListener("wheel",S,i),t.removeEventListener("keydown",K,i),t.removeEventListener("input",F,i),t.removeEventListener("visibilitychange",B),e==null||e.removeEventListener("scroll",W,i)}}}var de="section, header, footer, nav, main > div, [data-sentient-section]",me=2e4,oe="__session__";function pe(t){let o=Array.from(t.querySelectorAll(de)),e=o.filter(u=>o.filter(d=>d!==u&&u.contains(d)).length<2);return e.filter(u=>!e.some(d=>d!==u&&d.contains(u)))}function fe(t,o,e,u){try{fetch(`${o}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${t}`},body:JSON.stringify({pageUrl:e,sections:u})}).catch(()=>{})}catch(d){}}var Y=()=>{};function ve(t,o){var x,N,f,E,O,R,M,D,P,S,W,K,F,B,i;let e=(x=o.doc)!=null?x:typeof document!="undefined"?document:void 0;if(!e||typeof IntersectionObserver=="undefined"||X()||!o.apiKey||!o.apiKey.startsWith("pk_"))return Y;let u=((N=o.apiBase)!=null?N:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),d=pe(e);if(d.length===0)return Y;let p=new Map,_=[];for(let r of d){let s=(O=[(E=o.sectionTypes)==null?void 0:E[(f=r.getAttribute("data-sentient-id"))!=null?f:""],r.getAttribute("data-sentient-type")].find(y=>j.includes(y)))!=null?O:null,a=q(r),c=(M=s!=null?s:(R=o.typeOf)==null?void 0:R.call(o,r))!=null?M:H(a).type,n=Z(r,e),l=n?`nc-${c}-${ue(JSON.stringify({id:(D=n.id)!=null?D:null,dataAttr:(P=n.dataAttr)!=null?P:null,selector:(S=n.selector)!=null?S:null})).toString(36)}`:`nc-${c}`;p.set(r,l);let v=J.filter(([,y])=>y.test(a.bodyText)).map(([y])=>y);_.push(z($({componentId:l,semanticType:c,source:s?"markup":"auto"},n?{locator:n}:{}),{observation:$($({tag:a.tag,idClass:a.idClass.slice(0,200),headingText:a.headingText,textLength:a.textLength,actionCount:a.actionCount},a.ariaRole?{ariaRole:a.ariaRole}:{}),v.length>0?{patternFlags:v}:{})}))}let G=(B=(F=(K=(W=e.defaultView)!=null?W:typeof window!="undefined"?window:void 0)==null?void 0:K.location)==null?void 0:F.pathname)!=null?B:"/";fe(o.apiKey,u,G,_);let k=re(e),U=()=>{let r;try{r=k.snapshot()}catch(s){return}try{t.track({projectId:o.apiKey,componentId:oe,eventType:"interaction_stats",payload:r})}catch(s){}},g=new Map,V=r=>{let s=g.get(r);return s||(s={ms:0,scroll:0,enterAt:null,intersecting:!1},g.set(r,s)),s},T=new IntersectionObserver(r=>{for(let s of r){let a=p.get(s.target);if(!a)continue;let c=V(a);s.isIntersecting?(c.intersecting=!0,c.enterAt=Date.now(),s.intersectionRatio>c.scroll&&(c.scroll=s.intersectionRatio)):(c.intersecting=!1,c.enterAt!=null&&(c.ms+=Date.now()-c.enterAt,c.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let r of p.keys())T.observe(r);let h=(r=!1)=>{var a;let s=Date.now();for(let[c,n]of g)if(n.enterAt!=null&&(n.ms+=s-n.enterAt,n.enterAt=null),!(n.ms<=0)){try{t.track({projectId:o.apiKey,componentId:c,eventType:"dwell",payload:{dwell_time:Math.round(n.ms),scroll_depth:Number(n.scroll.toFixed(2))}})}catch(l){}n.ms=0}if(U(),r)try{(a=t.flush)==null||a.call(t)}catch(c){}},I=()=>{if(e.hidden)h(!0);else{let r=Date.now();for(let s of g.values())s.intersecting&&(s.enterAt=r)}},b=!1,L=r=>{if(h(!0),r!=null&&r.persisted){b=!0;return}try{T.disconnect()}catch(s){}},C=r=>{if(!(r!=null&&r.persisted)||!b)return;b=!1;let s=Date.now();for(let a of g.values())a.enterAt=a.intersecting&&!e.hidden?s:null};e.addEventListener("visibilitychange",I);let m=(i=e.defaultView)!=null?i:typeof window!="undefined"?window:void 0;m==null||m.addEventListener("pagehide",L),m==null||m.addEventListener("pageshow",C);let w=setInterval(()=>{if(e.hidden||b)return;h();let r=Date.now();for(let s of g.values())s.intersecting&&(s.enterAt=r)},me),A=[];return o.microSignals&&[...p.entries()].forEach(([r,s],a)=>{A.push(Q((c,n={})=>{try{t.track({projectId:o.apiKey,componentId:s,eventType:"micro_signal",payload:$({signalType:c},n)})}catch(l){}},r,void 0,{tabLoss:a===0}))}),()=>{h(!0),clearInterval(w),k.stop(),e.removeEventListener("visibilitychange",I),m==null||m.removeEventListener("pagehide",L),m==null||m.removeEventListener("pageshow",C);for(let r of A)r();try{T.disconnect()}catch(r){}}}export{oe as INTERACTION_STATS_COMPONENT,j as SEMANTIC_TYPES,H as classifyFeatures,se as classifySection,q as featuresFromElement,ve as startEngagementCapture};
2
2
  //# sourceMappingURL=index-engagement.mjs.map
@@ -1,10 +1,10 @@
1
- import { r as SentientConfig, q as SentientClient } from './index-BdpO3Qlm.cjs';
2
- export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, f as EventType, h as GraphClient, i as GraphConfig, j as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, l as MicroSignalType, n as PageNode, Q as QueueConfig, S as STAGE_ATTRIBUTE, s as SentientEvent, t as SessionConfig, u as SessionManager, w as StageAttributes, y as attachMicroSignalDetectors, B as exposedStage, H as grantConsent, J as isDoNotTrackEnabled, U as sanitizePageUrl, V as sessionCookieName, Y as setStageAttribute } from './index-BdpO3Qlm.cjs';
3
- import { b as CompoundLocator } from './session-meta-USVMwvsR.cjs';
4
- export { D as DecisionSnapshot, S as SNAPSHOT_STORAGE_KEY_PREFIX, d as SlotConfigEntry, e as SlotDeclInput, f as SlotOps, i as armOfResult, j as baselineResultFor, k as baselineSlots, n as deriveSessionSegment, o as detectDeviceClass, p as detectTimeOfDay, q as detectTrafficSource, t as readSnapshot, u as referrerDomainFromReferer, v as renderPrePaintScript, w as toWireSlot, y as writeSnapshot } from './session-meta-USVMwvsR.cjs';
1
+ import { s as SentientConfig, r as SentientClient } from './index-BAfi7_FG.cjs';
2
+ export { a as AssignResult, b as Assignment, c as AssignmentCache, E as EventQueue, g as EventType, i as GraphClient, j as GraphConfig, k as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, m as MicroSignalType, o as PageNode, Q as QueueConfig, S as STAGE_ATTRIBUTE, t as SentientEvent, u as SessionConfig, v as SessionManager, x as StageAttributes, z as attachMicroSignalDetectors, F as exposedStage, I as grantConsent, K as isDoNotTrackEnabled, X as sanitizePageUrl, Y as sessionCookieName, $ as setStageAttribute } from './index-BAfi7_FG.cjs';
3
+ import { b as CompoundLocator } from './session-meta-qx4kIL5y.cjs';
4
+ export { D as DecisionSnapshot, S as SNAPSHOT_STORAGE_KEY_PREFIX, d as SlotConfigEntry, e as SlotDeclInput, f as SlotOps, i as armOfResult, j as baselineResultFor, k as baselineSlots, n as deriveSessionSegment, o as detectDeviceClass, p as detectTimeOfDay, q as detectTrafficSource, t as readSnapshot, u as referrerDomainFromReferer, v as renderPrePaintScript, w as toWireSlot, y as writeSnapshot } from './session-meta-qx4kIL5y.cjs';
5
5
  export { B as BLOCK_ALIGNS, a as BLOCK_EMPHASES, b as BLOCK_FITS, c as BLOCK_GAPS, d as BLOCK_GRID_COLUMNS, e as BLOCK_HEADING_LEVELS, f as BLOCK_JUSTIFIES, g as BLOCK_MAX_WIDTHS, h as BLOCK_PADS, i as BLOCK_RATIOS, j as BLOCK_SIZES, k as BLOCK_SURFACES, l as BLOCK_TEXT_ALIGNS, m as BLOCK_TONES, n as BLOCK_WEIGHTS, o as BadgeBlock, p as BlockAlign, q as BlockEmphasis, r as BlockFit, s as BlockGap, t as BlockJustify, u as BlockMaxWidth, v as BlockNode, w as BlockPad, x as BlockRatio, y as BlockSize, z as BlockSurface, A as BlockTextAlign, C as BlockTone, D as BlockWeight, E as ButtonBlock, G as DividerBlock, H as FORM_FIELD_KINDS, I as FORM_INPUT_TYPES, J as FormBlock, K as FormField, L as GridBlock, M as HeadingBlock, N as ImageBlock, P as LinkBlock, Q as MAX_BLOCK_ARMS, R as MAX_BLOCK_CHILDREN, S as MAX_BLOCK_DEPTH, T as MAX_BLOCK_NODES, U as MAX_BLOCK_TEXT_LEN, V as MAX_FORM_FIELDS, W as MAX_FORM_SELECT_OPTIONS, $ as SitePalette, a0 as SpacerBlock, a1 as StackBlock, a5 as TextBlock, a6 as containsFormBlock } from './style-vocabulary-Ba_g6_DD.cjs';
6
6
  export { SlotResult } from '@sentientui/policy';
7
- import './region-skeleton-D2ahkcbe.cjs';
7
+ import './region-skeleton-BRIVB-qf.cjs';
8
8
  import './index-consent.cjs';
9
9
 
10
10
  /** Reads the rendered DOM to build the page-side context graph. */
@@ -1,10 +1,10 @@
1
- import { r as SentientConfig, q as SentientClient } from './index-DzGhQhSK.js';
2
- export { A as AssignResult, a as Assignment, b as AssignmentCache, E as EventQueue, f as EventType, h as GraphClient, i as GraphConfig, j as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, l as MicroSignalType, n as PageNode, Q as QueueConfig, S as STAGE_ATTRIBUTE, s as SentientEvent, t as SessionConfig, u as SessionManager, w as StageAttributes, y as attachMicroSignalDetectors, B as exposedStage, H as grantConsent, J as isDoNotTrackEnabled, U as sanitizePageUrl, V as sessionCookieName, Y as setStageAttribute } from './index-DzGhQhSK.js';
3
- import { b as CompoundLocator } from './session-meta-CvEwPQCX.js';
4
- export { D as DecisionSnapshot, S as SNAPSHOT_STORAGE_KEY_PREFIX, d as SlotConfigEntry, e as SlotDeclInput, f as SlotOps, i as armOfResult, j as baselineResultFor, k as baselineSlots, n as deriveSessionSegment, o as detectDeviceClass, p as detectTimeOfDay, q as detectTrafficSource, t as readSnapshot, u as referrerDomainFromReferer, v as renderPrePaintScript, w as toWireSlot, y as writeSnapshot } from './session-meta-CvEwPQCX.js';
1
+ import { s as SentientConfig, r as SentientClient } from './index-DyKtujwf.js';
2
+ export { a as AssignResult, b as Assignment, c as AssignmentCache, E as EventQueue, g as EventType, i as GraphClient, j as GraphConfig, k as GraphSnapshot, L as LEGACY_SESSION_COOKIE_NAME, M as MicroSignalEmitter, m as MicroSignalType, o as PageNode, Q as QueueConfig, S as STAGE_ATTRIBUTE, t as SentientEvent, u as SessionConfig, v as SessionManager, x as StageAttributes, z as attachMicroSignalDetectors, F as exposedStage, I as grantConsent, K as isDoNotTrackEnabled, X as sanitizePageUrl, Y as sessionCookieName, $ as setStageAttribute } from './index-DyKtujwf.js';
3
+ import { b as CompoundLocator } from './session-meta-BtRtwsHI.js';
4
+ export { D as DecisionSnapshot, S as SNAPSHOT_STORAGE_KEY_PREFIX, d as SlotConfigEntry, e as SlotDeclInput, f as SlotOps, i as armOfResult, j as baselineResultFor, k as baselineSlots, n as deriveSessionSegment, o as detectDeviceClass, p as detectTimeOfDay, q as detectTrafficSource, t as readSnapshot, u as referrerDomainFromReferer, v as renderPrePaintScript, w as toWireSlot, y as writeSnapshot } from './session-meta-BtRtwsHI.js';
5
5
  export { B as BLOCK_ALIGNS, a as BLOCK_EMPHASES, b as BLOCK_FITS, c as BLOCK_GAPS, d as BLOCK_GRID_COLUMNS, e as BLOCK_HEADING_LEVELS, f as BLOCK_JUSTIFIES, g as BLOCK_MAX_WIDTHS, h as BLOCK_PADS, i as BLOCK_RATIOS, j as BLOCK_SIZES, k as BLOCK_SURFACES, l as BLOCK_TEXT_ALIGNS, m as BLOCK_TONES, n as BLOCK_WEIGHTS, o as BadgeBlock, p as BlockAlign, q as BlockEmphasis, r as BlockFit, s as BlockGap, t as BlockJustify, u as BlockMaxWidth, v as BlockNode, w as BlockPad, x as BlockRatio, y as BlockSize, z as BlockSurface, A as BlockTextAlign, C as BlockTone, D as BlockWeight, E as ButtonBlock, G as DividerBlock, H as FORM_FIELD_KINDS, I as FORM_INPUT_TYPES, J as FormBlock, K as FormField, L as GridBlock, M as HeadingBlock, N as ImageBlock, P as LinkBlock, Q as MAX_BLOCK_ARMS, R as MAX_BLOCK_CHILDREN, S as MAX_BLOCK_DEPTH, T as MAX_BLOCK_NODES, U as MAX_BLOCK_TEXT_LEN, V as MAX_FORM_FIELDS, W as MAX_FORM_SELECT_OPTIONS, $ as SitePalette, a0 as SpacerBlock, a1 as StackBlock, a5 as TextBlock, a6 as containsFormBlock } from './style-vocabulary-Ba_g6_DD.js';
6
6
  export { SlotResult } from '@sentientui/policy';
7
- import './region-skeleton-D2ahkcbe.js';
7
+ import './region-skeleton-BRIVB-qf.js';
8
8
  import './index-consent.js';
9
9
 
10
10
  /** Reads the rendered DOM to build the page-side context graph. */
@@ -1,2 +1,2 @@
1
- "use strict";var Kn=Object.create;var Be=Object.defineProperty,$n=Object.defineProperties,Un=Object.getOwnPropertyDescriptor,Fn=Object.getOwnPropertyDescriptors,jn=Object.getOwnPropertyNames,qt=Object.getOwnPropertySymbols,Wn=Object.getPrototypeOf,Vt=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable;var zt=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t)=>{for(var n in t||(t={}))Vt.call(t,n)&&zt(e,n,t[n]);if(qt)for(var n of qt(t))Hn.call(t,n)&&zt(e,n,t[n]);return e},oe=(e,t)=>$n(e,Fn(t));var qn=(e,t)=>{for(var n in t)Be(e,n,{get:t[n],enumerable:!0})},Xt=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of jn(t))!Vt.call(e,c)&&c!==n&&Be(e,c,{get:()=>t[c],enumerable:!(s=Un(t,c))||s.enumerable});return e};var zn=(e,t,n)=>(n=e!=null?Kn(Wn(e)):{},Xt(t||!e||!e.__esModule?Be(n,"default",{value:e,enumerable:!0}):n,e)),Vn=e=>Xt(Be({},"__esModule",{value:!0}),e);var Tr={};qn(Tr,{BLOCK_ALIGNS:()=>ho,BLOCK_EMPHASES:()=>xo,BLOCK_FITS:()=>Co,BLOCK_GAPS:()=>So,BLOCK_GRID_COLUMNS:()=>To,BLOCK_HEADING_LEVELS:()=>_o,BLOCK_JUSTIFIES:()=>bo,BLOCK_MAX_WIDTHS:()=>Oo,BLOCK_PADS:()=>Ro,BLOCK_RATIOS:()=>Io,BLOCK_SIZES:()=>vo,BLOCK_SURFACES:()=>Ao,BLOCK_TEXT_ALIGNS:()=>ko,BLOCK_TONES:()=>wo,BLOCK_WEIGHTS:()=>Eo,FORM_FIELD_KINDS:()=>Po,FORM_INPUT_TYPES:()=>Do,LEGACY_SESSION_COOKIE_NAME:()=>pe,MAX_BLOCK_ARMS:()=>Ko,MAX_BLOCK_CHILDREN:()=>Go,MAX_BLOCK_DEPTH:()=>Bo,MAX_BLOCK_NODES:()=>Lo,MAX_BLOCK_TEXT_LEN:()=>$o,MAX_FORM_FIELDS:()=>No,MAX_FORM_SELECT_OPTIONS:()=>Mo,SNAPSHOT_STORAGE_KEY_PREFIX:()=>ye,STAGE_ATTRIBUTE:()=>nt,armOfResult:()=>tt,attachMicroSignalDetectors:()=>fn,baselineResultFor:()=>Ne,baselineSlots:()=>cn,containsFormBlock:()=>gn,deriveSessionSegment:()=>vt,detectDeviceClass:()=>Ae,detectTimeOfDay:()=>Pe,detectTrafficSource:()=>Re,exposedStage:()=>ot,grantConsent:()=>xn,init:()=>Mn,isDoNotTrackEnabled:()=>je,locatorFromElement:()=>ct,readSnapshot:()=>Ie,referrerDomainFromReferer:()=>Oe,renderPrePaintScript:()=>Jt,sanitizePageUrl:()=>Ct,sessionCookieName:()=>Ee,setStageAttribute:()=>rt,toWireSlot:()=>Ue,writeSnapshot:()=>Ce});module.exports=Vn(Tr);function ue(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function ft(e,t){return new Promise(n=>{let s=setTimeout(()=>n(!1),t),c=()=>{clearTimeout(s),n(!0)};e.then(c,c)})}var Xn;function Qt(e){Xn=typeof e=="string"&&e!==""?e:void 0}function ie(e){return e?`_${e.slice(0,12)}`:""}var pe="_snt_uid";function Ee(e){return`${pe}${ie(e)}`}var qe="__sntForgetGen",Qn=()=>{try{return window[qe]}catch(e){return}};function ze(e){var t,n;try{let s=window,c=(t=s[qe])!=null?t:s[qe]={};c[e]=((n=c[e])!=null?n:0)+1}catch(s){}}function me(e){var t,n;return(n=(t=Qn())==null?void 0:t[e])!=null?n:0}var ye="_snt_snap:";var Jn=["low","medium","high"];function Ie(e){try{let t=localStorage.getItem(ye+e);if(!t)return null;let n=JSON.parse(t);if(!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!Jn.includes(n.band)||typeof n.slots!="object"||n.slots===null||Array.isArray(n.slots)||!(n.layoutOrder===null||Array.isArray(n.layoutOrder))||typeof n.savedAt!="number"||!(Date.now()-n.savedAt<2592e6)||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig)))return null;let s=n.vocabulary;return s!==void 0&&(typeof s!="object"||s===null||!Array.isArray(s.entries)||!Array.isArray(s.images))&&delete n.vocabulary,n.stage!==void 0&&typeof n.stage!="string"&&delete n.stage,n}catch(t){return null}}function Ce(e,t){try{localStorage.setItem(ye+e,JSON.stringify(t))}catch(n){}}function Jt(e,t){return'(function(){try{var N=navigator,W=window;if(N.doNotTrack=="1"||N.doNotTrack=="yes"||W.doNotTrack=="1"||N.msDoNotTrack=="1"||N.globalPrivacyControl)return;var r=localStorage.getItem('+JSON.stringify(ye+e).replace(/</g,"\\u003c")+');if(!r)return;var s=JSON.parse(r);if(!s||s.v!==1||typeof s.persona!=="string"||typeof s.band!=="string")return;if(!('+2592e6+">Date.now()-s.savedAt))return;var d=document.documentElement;"+(t!=null&&t.stage?'if(typeof s.stage=="string"&&!d.hasAttribute("data-sentient-stage"))d.setAttribute("data-sentient-stage",s.stage);':"")+'if(d.hasAttribute("data-sentient-persona"))return;d.setAttribute("data-sentient-persona",s.persona);d.setAttribute("data-sentient-confidence",s.band);}catch(e){}})();'}function Se(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function Te(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":t>=400&&t<500&&t!==429?"dropped":"retry"}function Ve(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let s=JSON.parse(n);return Array.isArray(s)?(localStorage.removeItem(e),s.slice(-t)):[]}catch(n){return[]}}function Ge(e,t,n){try{let s=(()=>{try{let r=localStorage.getItem(n);if(!r)return[];let u=JSON.parse(r);return Array.isArray(u)?u:[]}catch(r){return[]}})(),c=new Map;for(let r of s)c.set(r.id,r);for(let r of e)c.set(r.id,r);localStorage.setItem(n,JSON.stringify([...c.values()].slice(-t)))}catch(s){}}function Xe(e,t){try{let n=localStorage.getItem(t);if(!n)return;let s=JSON.parse(n);if(!Array.isArray(s))return;let c=new Set(e),r=s.filter(u=>!c.has(u.id));if(r.length===s.length)return;r.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(r))}catch(n){}}var Yn=500,Zn=56*1024;function Ke(e){return`_snt_retry_${e.slice(0,12)}`}var eo={push:()=>{},flush:()=>{},destroy:()=>{}};function Yt(e){var H,Q,ge;if(typeof window=="undefined")return eo;let t=(H=e.flushIntervalMs)!=null?H:5e3,n=(Q=e.maxBatchSize)!=null?Q:20,s=(ge=e.maxRetrySize)!=null?ge:100,c=e.ingestUrl,r=e.apiKey,u=Ke(r),o=!1,p=me(r),i=(...x)=>{!o&&me(r)===p&&Ge(...x)},a=[],l=new Set,h=[],y=x=>{for(let G of x)S.delete(G),!l.has(G)&&(l.add(G),h.push(G));for(;h.length>Yn;){let G=h.shift();G&&l.delete(G)}Xe(x,u)},S=new Set,v=()=>{for(;a.length>s;){let x=a.shift();x&&S.delete(x.id)}},M=x=>{l.has(x.id)||S.has(x.id)||(S.add(x.id),a.push(x),v())},A=x=>{for(let G of x)l.has(G.id)||(S.add(G.id),a.push(G));v()},K=Ve(u,s);for(let x of K)M(x);let L=0,F=0,B=(x,G=!0)=>{if(x.length===0)return;let fe=JSON.stringify(x),we=x.map(ae=>ae.id),te,he=ue(15e3);try{te=fetch(c,{method:"POST",keepalive:!0,signal:he.signal,body:fe,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}})}catch(ae){i(x,s,u),A(x),F++,L=Date.now()+Se(F);return}Promise.resolve(te).then(he.clear,he.clear);let Me=ae=>{if(Te(ae)!=="retry"){if(!ae.ok&&G){let be=x.filter(re=>re.eventType!=="pageview");if(be.length>0&&be.length<x.length){y(x.filter(re=>re.eventType==="pageview").map(re=>re.id)),B(be,!1);return}}y(we),F=0,L=0;return}i(x,s,u),A(x),F++,L=Date.now()+Se(F)};te&&typeof te.then=="function"?te.then(Me).catch(()=>{i(x,s,u),A(x),F++,L=Date.now()+Se(F)}):Me(te)},ee=typeof TextEncoder!="undefined"?new TextEncoder:null,f=x=>ee?ee.encode(x).length:x.length,b=x=>{let G=[],fe=2;for(let we of x){let te=f(JSON.stringify(we))+1;if(G.length>0&&fe+te>Zn||G.length>=n)break;G.push(we),fe+=te}return G},_=()=>{try{if(Date.now()<L)return;for(;a.length>0&&!(Date.now()<L);){let x=a.filter(fe=>!l.has(fe.id));if(a.length=0,x.length===0)break;let G=b(x);if(G.length===0)break;G.length<x.length&&a.push(...x.slice(G.length)),B(G)}}catch(x){}},m=!0,R=null;R=setInterval(()=>{m&&_()},t);let $=()=>{document.visibilityState==="hidden"&&_()},N=()=>{_()};return document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",N),{push(x){M(x),a.length>=n&&_()},flush:_,destroy(x){x!=null&&x.forget&&(o=!0),m=!1,R!==null&&(clearInterval(R),R=null),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",N),_()}}}var to=200;function $e(e){return`_snt_goal_retry_${e.slice(0,12)}`}var no={send:()=>{},flush:()=>{},destroy:()=>{}};function Zt(e){var f,b,_;if(typeof window=="undefined")return no;let t=(f=e.flushIntervalMs)!=null?f:5e3,n=(b=e.maxRetrySize)!=null?b:100,s=(_=e.maxPerFlush)!=null?_:5,c=$e(e.apiKey),r=!1,u=me(e.apiKey),o=(...m)=>{!r&&me(e.apiKey)===u&&Ge(...m)},p=[],i=new Set,a=new Set,l=[],h=0,y=0,S=!1,v=m=>{for(i.delete(m.id),a.has(m.id)||(a.add(m.id),l.push(m.id));l.length>to;){let R=l.shift();R&&a.delete(R)}Xe([m.id],c)},M=m=>{o([m],n,c),!a.has(m.id)&&!i.has(m.id)&&(i.add(m.id),p.push(m)),Date.now()>=h&&(y++,h=Date.now()+Se(y))},A=m=>{let R,$=ue(15e3);try{R=fetch(e.url,{method:"POST",keepalive:!0,signal:$.signal,body:m.body,headers:e.headers})}catch(H){M(m);return}let N=H=>{var ge;let Q=Te(H);if(Q==="retry"){M(m);return}Q==="dropped"&&((ge=e.onDrop)==null||ge.call(e,m,H.status)),v(m),y=0,h=0};Promise.resolve(R).then($.clear,$.clear),R&&typeof R.then=="function"?R.then(N).catch(()=>M(m)):N(R)},K=()=>{try{if(S||Date.now()<h)return;let m=0;for(;p.length>0&&m<s&&!(Date.now()<h);){let R=p.shift();i.delete(R.id),!a.has(R.id)&&(m++,A(R))}}catch(m){}},L=Ve(c,n);for(let m of L)i.has(m.id)||(i.add(m.id),p.push(m));L.length>0&&Ge(L,n,c);let F=setInterval(K,t),B=()=>{document.visibilityState==="hidden"&&K()},ee=()=>K();return document.addEventListener("visibilitychange",B),window.addEventListener("pagehide",ee),{send(m){if(S){a.has(m.id)||o([m],n,c);return}if(!(a.has(m.id)||i.has(m.id))){if(Date.now()<h){o([m],n,c),i.add(m.id),p.push(m);return}A(m)}},flush:K,destroy(m){m!=null&&m.forget&&(r=!0),clearInterval(F),document.removeEventListener("visibilitychange",B),window.removeEventListener("pagehide",ee),K(),S=!0}}}function en(e){if(typeof window=="undefined"||!e)return!1;ze(e);let t=!1,n=Ee(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let u=location.protocol==="https:"?"; Secure":"";document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${u}`,t=!0}}catch(u){}let s=ie(e),c=[n,"_snt_graph_edges",ye+e,Ke(e),$e(e),`_snt_graph_nodes${s}`],r=[`_snt_asgn${s}_`];for(let u of["localStorage","sessionStorage"])try{let o=window[u];for(let p of c)o.getItem(p)!==null&&(o.removeItem(p),t=!0);for(let p=o.length-1;p>=0;p--){let i=o.key(p);i&&r.some(a=>i.startsWith(a))&&(o.removeItem(i),t=!0)}}catch(o){}try{(new RegExp(`(?:^|; )${pe}=[^;]`).test(document.cookie)||localStorage.getItem(pe)!==null||sessionStorage.getItem(pe)!==null)&&localStorage.setItem(`${pe}_tomb${s}`,"1")}catch(u){}return t}function Qe(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}try{if(typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0"),(n===3||n===5||n===7||n===9)&&(t+="-");return t}}catch(e){}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var tn="_snt_uid",oo=365,_e="_snt_uid";function ro(){return Qe()}function yt(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function ht(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function so(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${ht()}`}catch(s){}}function Je(e){try{return localStorage.getItem(e)}catch(t){return null}}function nn(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function St(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function io(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function ao(e){try{sessionStorage.removeItem(e)}catch(t){}}function co(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${ht()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function lo(e){try{localStorage.removeItem(e)}catch(t){}}function uo(e){try{document.cookie=`${e}=; max-age=0; SameSite=lax; path=/${ht()}`}catch(t){}}var po={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function Ye(e){var S,v,M,A,K,L,F;if(typeof window=="undefined")return po;let t=ie(e==null?void 0:e.apiKey),n=(S=e==null?void 0:e.cookieName)!=null?S:Ee(e==null?void 0:e.apiKey),s=`${_e}${t}`,c=`${_e}_tomb${t}`,u=((v=e==null?void 0:e.cookieTTLDays)!=null?v:oo)*24*60*60,o=B=>B&&B.length>0?B:null,p=()=>{var B,ee;return t&&!(e!=null&&e.cookieName)&&Je(c)===null?(ee=(B=o(yt(tn)))!=null?B:o(Je(_e)))!=null?ee:o(St(_e)):null},i=(F=(L=(K=(A=(M=o(yt(n)))!=null?M:o(Je(s)))!=null?A:o(St(s)))!=null?K:p())!=null?L:o(e==null?void 0:e.ssrSessionId))!=null?F:ro();so(n,i,u);let a=nn(s,i),l=co(n),h=a?!1:io(s,i),y=!a&&!l&&!h;return{getSessionId:()=>i,isEphemeral:()=>y,destroy:()=>{i=null,uo(n),lo(s),ao(s),t&&!(e!=null&&e.cookieName)&&(yt(tn)!==null||Je(_e)!==null||St(_e)!==null)&&nn(c,"1")}}}var go=1800*1e3;function Ze(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function on(e=go,t){let n=new Map,s=`_snt_asgn${ie(t)}_`,c=(i,a)=>`${s}${encodeURIComponent(i)}:${encodeURIComponent(a)}`,r=i=>{let a=i.slice(s.length),l=a.indexOf(":");if(l<0)return null;try{return{componentId:decodeURIComponent(a.slice(0,l)),segment:decodeURIComponent(a.slice(l+1))}}catch(h){return null}},u=()=>{try{let i=[];for(let a=0;a<localStorage.length;a++){let l=localStorage.key(a);l!=null&&l.startsWith(s)&&i.push(l)}return i}catch(i){return[]}},o=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of u())try{let a=localStorage.getItem(i);if(!a)continue;let l=JSON.parse(a);if(o(l)){localStorage.removeItem(i);continue}let h=r(i);if(!h)continue;n.set(Ze(h.componentId,h.segment),l)}catch(a){}})(),{get(i,a){let l=n.get(Ze(i,a));return l?o(l)?(n.delete(Ze(i,a)),null):l:null},set(i,a,l){let h=Ze(i,a);n.set(h,l);try{localStorage.setItem(c(i,a),JSON.stringify(l))}catch(y){}},clear(){n.clear();for(let i of u())try{localStorage.removeItem(i)}catch(a){}}}}var rn=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","PerplexityBot","Perplexity-User","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function et(e){return sn(e)!==null}function sn(e){var n;if(!e)return null;let t=e.toLowerCase();return(n=rn.find(s=>t.includes(s.toLowerCase())))!=null?n:null}function Ae(e){let t=e.toLowerCase();return/ipad|tablet|playbook|kindle|silk/.test(t)?"tablet":/mobi|iphone|ipod|android.*mobile|phone/.test(t)?"mobile":"desktop"}function Re(e,t){if(!e)return"direct";try{let n=new URL(e);if(t)try{if(new URL(t).host===n.host)return"direct"}catch(c){}let s=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(s)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(s)?"social":"referral"}catch(n){return"direct"}}function Oe(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var an=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function bt(e){let t={},n={};try{let s=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([c,r])=>{let u=Array.isArray(r)?r[0]:r;return u===void 0?[]:[[c,u]]});for(let[c,r]of s)c.startsWith("utm_")?c in t||(t[c]=r):an.includes(c)&&(c in n||(n[c]=r))}catch(s){}return{utmParams:t,clickIds:n}}function Pe(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function vt(e){let t=fo("__segment__",e);return`${t.deviceClass}:${t.trafficSource}`}function fo(e,t){var r,u,o,p,i,a,l,h;let n=(u=(r=t==null?void 0:t.userAgent)==null?void 0:r.trim())!=null?u:"",s=(p=(o=t==null?void 0:t.referer)==null?void 0:o.trim())!=null?p:"",c=(i=t==null?void 0:t.now)!=null?i:new Date;return I({sessionId:e,ephemeral:!1,utmParams:(a=t==null?void 0:t.utmParams)!=null?a:{},clickIds:(l=t==null?void 0:t.clickIds)!=null?l:{},deviceClass:n?Ae(n):"desktop",trafficSource:s?Re(s,t==null?void 0:t.appOrigin):"direct",referrerDomain:Oe(s),timeOfDay:Pe(c),dayOfWeek:(h=["sun","mon","tue","wed","thu","fri","sat"][c.getDay()])!=null?h:"sun",automation:(t==null?void 0:t.webdriver)===!0||et(n)},t!=null&&t.landingPath?{landingPath:t.landingPath.split(/[?#]/)[0]}:{})}var De=require("@sentientui/policy");function Ue(e){return I(I(I({id:e.id},e.arms?{arms:[...e.arms]}:{}),e.dims?{dims:Object.fromEntries(Object.entries(e.dims).map(([t,n])=>[t,[...n]]))}:{}),e.baseline!==void 0?{baseline:e.baseline}:{})}function Ne(e){let t=Ue(e);return(0,De.slotResultFor)(t,(0,De.slotBaselineArm)(t))}function cn(e){let t={};for(let n of e)t[n.id]=Ne(n);return t}function tt(e){return typeof e=="string"?e:(0,De.canonicalArm)(e)}var ln=require("@sentientui/policy"),nt="data-sentient-stage";function ot(e,t){return!t||typeof e!="string"||!(e==="returning"||ln.STAGE_KEYS.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function rt(e,t=document){try{e?t.documentElement.setAttribute(nt,e):t.documentElement.removeAttribute(nt)}catch(n){}}var xt=require("@sentientui/policy");var it=require("@sentientui/policy");var dn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",mo="[sentient] Local mode \u2014 decisions are simulated on-device and nothing is sent over the network. Add an API key to learn from real traffic.",un=!1,st=!1;function yo(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function pn(e){var i;let t=Ye({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),n=(i=t.getSessionId())!=null?i:"local",s=yo(),c=import("@sentientui/core/local").then(a=>{let l=a;return l.LOCAL_ENGINE_AVAILABLE?(un||(un=!0,console.info(mo)),l):(st||(st=!0,console.error(dn)),null)}).catch(()=>(st||(st=!0,console.error(dn)),null)),r=null,u={low:.15,medium:.5,high:.85},o=(()=>{var l;if(e.initialPersona)return I({},e.initialPersona);let a=Ie(e.apiKey||"local");return a?{persona:a.persona,confidence:(l=u[a.band])!=null?l:.15}:null})();function p(a){let l=document.documentElement;l.dataset.sentientPersona===void 0&&(l.dataset.sentientPersona=a.persona,l.dataset.sentientConfidence=(0,it.confidenceBand)(a.confidence))}return{isLocal:!0,async decide(a){var y,S,v;let l=await c;if(!l)return null;let h=l.createLocalEngine({sessionId:n,forcedPersona:s}).decide(a);return r=oe(I({},h),{layoutOrder:(S=(y=h.layoutOrder)!=null?y:r==null?void 0:r.layoutOrder)!=null?S:null,slots:I(I({},(v=r==null?void 0:r.slots)!=null?v:{}),h.slots)}),Ce(e.apiKey||"local",{v:1,persona:r.persona,band:(0,it.confidenceBand)(r.confidence),slots:r.slots,layoutOrder:r.layoutOrder,savedAt:Date.now()}),p(h),h},getSlotResult(a){var l,h,y;return(y=(h=r==null?void 0:r.slots[a])!=null?h:(l=e.initialSlots)==null?void 0:l[a])!=null?y:null},getSlotConfig(a){var l,h;return(h=(l=e.initialSlotConfig)==null?void 0:l[a])!=null?h:null},getSitePalette(){var a;return(a=e.initialPalette)!=null?a:null},reportSlots(){},getPersona(){let a=r!=null?r:o;return a?{persona:a.persona,confidence:a.confidence,band:(0,it.confidenceBand)(a.confidence)}:null},async assign(a,l){var S;let h=await c;return!h||!l||l.length===0?l!=null&&l[0]?{variantId:l[0],assignmentTtlMs:0}:null:{variantId:(S=h.createLocalEngine({sessionId:n,forcedPersona:s}).decide({components:[{id:a,variantIds:l}]}).assignments[a])!=null?S:l[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>t.destroy()}}var So=["none","sm","md","lg"],ho=["start","center","end","stretch"],bo=["start","center","end","between"],vo=["sm","md","lg"],Eo=["normal","medium","bold"],wo=["default","muted","accent"],xo=["primary","secondary","ghost"],ko=["left","center","right"],Io=["auto","square","landscape","wide"],Co=["cover","contain"],To=[2,3,4],_o=[1,2,3,4],Ao=["default","raised"],Ro=["none","sm","md","lg"],Oo=["measure"],Po=["input","textarea","select"],Do=["text","email","number","tel"],No=5,Mo=8,Lo=64,Bo=5,Go=12,Ko=4,$o=500;function gn(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="form"?!0:Array.isArray(t.children)?t.children.some(gn):!1}function fn(e,t,n,s){let c=[];{let o=!1,p=[],i=()=>{if(o)return;let a=Date.now();for(p.push(a);p.length>0&&a-p[0]>500;)p.shift();p.length>=3&&(o=!0,e("rage_click"))};t.addEventListener("click",i),c.push(()=>t.removeEventListener("click",i))}{let r=!1,u=o=>{if(r||!(o.target instanceof Node)||!t.contains(o.target)&&t!==o.target)return;r=!0;let p=typeof window!="undefined"?window.getSelection():null,i=p?p.toString().length:0;e("text_copy",{selectionLength:i})};document.addEventListener("copy",u),c.push(()=>document.removeEventListener("copy",u))}{let r=!1,u=!1,o=null,p=()=>{o!==null&&(clearTimeout(o),o=null)},i=()=>{r||!u||(p(),o=setTimeout(()=>{!r&&u&&(r=!0,e("scroll_hesitation"))},3e3))},a=()=>{p(),i()},l=y=>{for(let S of y)u=S.intersectionRatio>.3,u?i():p()},h=new IntersectionObserver(l,{threshold:[.3]});h.observe(t),window.addEventListener("scroll",a,{passive:!0}),c.push(()=>{h.disconnect(),window.removeEventListener("scroll",a),p()})}if((s==null?void 0:s.tabLoss)!==!1){let r=!1,u=n!=null?n:Date.now(),o=()=>{if(r||document.visibilityState!=="hidden")return;let p=Date.now()-u;p<15e3&&(r=!0,e("tab_loss",{timeOnPage:p}))};document.addEventListener("visibilitychange",o),c.push(()=>document.removeEventListener("visibilitychange",o))}return()=>{for(let r of c)r()}}function Uo(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var hn="https://api.sentient-ui.com/v1/events",J=new Map,bn=null;function vn(e,t){let n=J.get(e);n&&n.upgrade&&(n.reinit=t)}function Fo(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var jo=3;function Et(){return Qe()}function at(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Wo(){let e=new WeakMap,t=new Map,n=!1,s=(o,p,i)=>{let a=o.get(p);return i===null?a?!0:(o.set(p,new Set),!1):a?a.has(i)?!0:(a.add(i),!1):(o.set(p,new Set([i])),!1)},c=typeof window!="undefined"&&"event"in window,r=()=>{if(!c)return;let o=window.event;return typeof Event=="function"&&o instanceof Event?o:void 0},u=()=>{if(c){Promise.resolve().then(()=>{n=!1,t.clear()});return}let o=!1,p=()=>{o||(o=!0,n=!1,t.clear())};if(setTimeout(p,0),typeof MessageChannel=="function"){let i=new MessageChannel;i.port1.onmessage=()=>{i.port1.close(),i.port2.close(),p()},i.port2.postMessage(0)}};return{firedBefore(o,p){let i=r();if(i){let l=e.get(i);return l||(l=new Map,e.set(i,l)),s(l,o,p)}let a=s(t,o,p);return!a&&!n&&(n=!0,u()),a}}}var En=new Set;function Ho(e,t,n){let s=typeof window=="undefined"?null:window.history;if(!s)return()=>{};let c=!1,r,u=()=>{if(c)return;let i=at();!i||i===r||(r=i,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${i}`))},o=[];for(let i of["pushState","replaceState"]){let a=s[i],l=function(...h){let y=a.apply(this,h);return u(),y};s[i]=l,o.push([i,a,l])}window.addEventListener("popstate",u);let p=at();return p&&En.has(`${t}:${p}`)?r=p:u(),()=>{if(!c){c=!0,window.removeEventListener("popstate",u);for(let[i,a,l]of o)s[i]===l&&(s[i]=a)}}}var Fe={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}};function qo(){try{return bt(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function wn(e){return e.replace(/\/events\/?$/,"")}function je(){return typeof navigator!="undefined"&&navigator.globalPrivacyControl===!0?!0:[typeof navigator!="undefined"?navigator.doNotTrack:void 0,typeof window!="undefined"?window.doNotTrack:void 0,typeof navigator!="undefined"?navigator.msDoNotTrack:void 0].some(t=>t==="1"||t==="yes")}function xn(e){var p;if(typeof window=="undefined")return;let t=e!=null?e:bn;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=J.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:s,upgrade:c,reinit:r}=n;if(!c){n.upgradeBlockedReason&&console.warn(n.upgradeBlockedReason);return}if(s.respectDoNotTrack!==!1&&je())return;let u=(r!=null?r:It)(oe(I({},s),{consent:!0}));c(u);let o=(p=J.get(t))==null?void 0:p.dispose;J.set(t,{config:oe(I({},s),{consent:!0}),upgrade:null,dispose:o})}function zo(e,t){var ee;let n=e.preConsentBehavior==="statistical_winner",s=wn((ee=e.ingestUrl)!=null?ee:hn),c={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},r=new Map,u=new Map,o={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(f,b,_){if(!n)return Promise.resolve(null);let m=r.get(f);return m?Promise.resolve(m):kt(u,f,async()=>{try{let R=new URLSearchParams({componentId:f});for(let Q of b!=null?b:[])R.append("variantIds[]",Q);let $=ue(5e3),N;try{let Q=await fetch(`${s}/winner?${R.toString()}`,{headers:c,signal:$.signal});if(!Q.ok)return b!=null&&b[0]?{variantId:b[0],assignmentTtlMs:0}:null;N=await Q.json()}finally{$.clear()}let H={variantId:N.variantId,assignmentTtlMs:0};return r.set(f,H),H}catch(R){return b!=null&&b[0]?{variantId:b[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},p=!1,i=new Set,a=[],l=[],h=[],y=()=>{for(let[,,f]of h.splice(0))f(null);S.length=0},S=[],v=!1,M=()=>{if(p)return;v=!0;let f=J.get(e.apiKey);(f==null?void 0:f.upgrade)===B&&J.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},A=[],K=()=>{setTimeout(()=>{var f;try{(f=A.shift())==null||f(o)}catch(b){}A.length&&K()})},L=f=>{p?A.length?A.push(f):f(o):!t&&!v&&S.length<100?S.push(f):v&&e.debug&&console.warn("[sentient] goal dropped: client released")},F={get gated(){return!p&&!t},get released(){return v&&!p},takeHeld:()=>S.splice(0),track:f=>o.track(f),goal:((f,b,_,m)=>L(R=>R.goal(f,b,_,m))),componentGoal:(f,b,_)=>o.componentGoal(f,b,_),identify:f=>o.identify(f),getAssignment:(f,b)=>o.getAssignment(f,b),assign:(f,b,_,m)=>o.assign(f,b,_,m),decide:f=>p?o.decide(f):v||t?Promise.resolve(null):new Promise(b=>h.push([f,Sn(),b])),getSlotResult:f=>o.getSlotResult(f),isSlotDecided:f=>{var b,_;return(_=(b=o.isSlotDecided)==null?void 0:b.call(o,f))!=null?_:!0},getSlotConfig:f=>o.getSlotConfig(f),getSitePalette:()=>o.getSitePalette(),getStyleVocabulary:()=>{var f,b;return(b=(f=o.getStyleVocabulary)==null?void 0:f.call(o))!=null?b:null},reportSlots:(f,b,_,m)=>o.reportSlots(f,b,_,m),reportSkeleton:(f,b)=>{var _;return(_=o.reportSkeleton)==null?void 0:_.call(o,f,b)},reportDrift:(f,b,_,m)=>{var R;return(R=o.reportDrift)==null?void 0:R.call(o,f,b,_,m)},requestSlots:(f,b,_)=>{var m;return p?(m=o.requestSlots)==null?void 0:m.call(o,f,b,_):a.push([f,b,_])},decideSlots:f=>{var b;return p?(b=o.decideSlots)==null?void 0:b.call(o,f):l.push(...f)},cancelSlots:f=>{var _;if(p)return(_=o.cancelSlots)==null?void 0:_.call(o,f);let b=new Set(f);for(let m of a)m[0]=m[0].filter(R=>!b.has(R));l=l.filter(m=>!b.has(m.id))},onSlotsChanged:f=>(i.add(f),()=>{i.delete(f)}),getPersona:()=>o.getPersona(),fetchWeights:()=>o.fetchWeights(),getGraph:()=>o.getGraph(),flush:()=>o.flush(),dispose:()=>(M(),y(),o.dispose()),destroy:()=>(M(),y(),p?o.destroy():en(e.apiKey))};function B(f){var _,m,R;o=f,p=!0,S.length&&(A.push(...S.splice(0)),K());let b=Sn();for(let[$,N,H]of h.splice(0))N!==b?H(null):f.decide($).then(H,()=>H(null));(_=f.onSlotsChanged)==null||_.call(f,()=>i.forEach($=>$()));for(let[$,N,H]of a.splice(0))$.length>0&&((m=f.requestSlots)==null||m.call(f,$,N,H));l.length>0&&((R=f.decideSlots)==null||R.call(f,l.splice(0)))}return{proxy:F,setInner:B}}function Sn(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function kt(e,t,n){let s=e.get(t);if(s)return s;let c=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,c),c}function It(e){var Nt,Mt,Lt,Bt,Gt,Kt,$t,Ut,Ft,jt;if(typeof window=="undefined")return Fe;e.nonce&&Qt(e.nonce),bn=e.apiKey||"local";let t=J.get(e.apiKey||"local");if(t!=null&&t.dispose)try{t.dispose()}catch(d){}let n=e.respectDoNotTrack!==!1&&je(),s=e.consent===!1||n,c=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!c&&e.localMode!==!1)return J.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): this client is keyless/local \u2014 there is no hosted client to upgrade to. Configure a pk_ API key to enable tracking."}),s?Fe:pn(e);if(s){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return e.preConsentBehavior==="statistical_winner"&&console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),J.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): the client was initialized with an invalid apiKey (expected a pk_ public key) \u2014 consent cannot enable tracking."}),Fe;let{proxy:d,setInner:g}=zo(e,n);return J.set(e.apiKey,{config:e,upgrade:n?null:g}),d}if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),Fe;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),Fe;let r=(Nt=e.ingestUrl)!=null?Nt:hn,u=Date.now(),o=Ye({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),p=on(void 0,e.apiKey),i=!1,a=me(e.apiKey),l=()=>!i&&me(e.apiKey)===a,h=oe(I({},p),{set:(...d)=>{l()&&p.set(...d)}}),y=Yt({ingestUrl:r,apiKey:e.apiKey}),S=wn(r),v={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},M=new Set,A=Zt({url:`${S}/goals`,apiKey:e.apiKey,headers:v,onDrop:(d,g)=>{if(!e.debug){if(M.has(g))return;M.add(g)}console.warn(`[sentient] goal dropped (HTTP ${g}) \u2014 this will not be retried. `+(g===400?"The session was not found: call init() and let the session upsert complete before firing goals.":g===401||g===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),d)}}),K=Ae((Mt=navigator.userAgent)!=null?Mt:""),L=window.location.origin,F=Re((Lt=document.referrer)!=null?Lt:"",L),B=(Bt=e.sessionSegment)!=null?Bt:`${K}:${F}`,ee=new Map,f=new Map,b=new Map,_=new Set,m=new Map,R=null,$=null,N=null,H=new Set,Q=new Set,ge=new Map,x=new Map,G=new Set,fe=new Set,we=new Set,te=null,he=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,Me=new Set,ae=new Set,be=new Set,re=new Map,dt=null,He=new Set,Le=new Map,ut=null,Ln=2,Rt=new Map,se=!1,Ot=(d,g,w)=>{var E;let O=new Set,P=1;for(let k of d){g.delete(k);let C=((E=Rt.get(k))!=null?E:0)+1;Rt.set(k,C),C<=Ln&&(O.add(k),C>P&&(P=C))}O.size>0&&setTimeout(()=>{se||w(O)},Se(P))},pt=d=>{for(let g of d)b.has(g.id)||b.set(g.id,Ne(g))};if(e.initialSlots)for(let[d,g]of Object.entries(e.initialSlots))b.set(d,g),_.add(d);if(e.initialSlotConfig)for(let[d,g]of Object.entries(e.initialSlotConfig))m.set(d,g);e.initialPalette&&(R=e.initialPalette),e.initialVocabulary&&($=e.initialVocabulary);let ce=Ie(e.apiKey);if(ce){for(let[d,g]of Object.entries(ce.slots))b.has(d)||b.set(d,g);for(let[d,g]of Object.entries((Gt=ce.slotConfig)!=null?Gt:{}))m.has(d)||m.set(d,g);!R&&ce.palette&&(R=ce.palette),!$&&ce.vocabulary&&($=ce.vocabulary)}let Pt={low:.15,medium:.5,high:.85};if(e.initialPersona)N=I({},e.initialPersona);else{let d=document.documentElement.dataset;d.sentientPersona?N={persona:d.sentientPersona,confidence:($t=Pt[(Kt=d.sentientConfidence)!=null?Kt:"low"])!=null?$t:.15}:ce&&(N={persona:ce.persona,confidence:(Ut=Pt[ce.band])!=null?Ut:.15})}if(e.initialAssignments)for(let[d,g]of Object.entries(e.initialAssignments))h.set(d,B,{variantId:g,assignedAt:Date.now(),segment:B,confidence:1});let ve=Promise.resolve(),Dt=o.getSessionId();if(Dt){let d=Oe((Ft=document.referrer)!=null?Ft:""),{utmParams:g,clickIds:w}=qo(),O=I(I(I(I({sessionId:Dt,deviceClass:K,trafficSource:F,referrerDomain:d,utmParams:g,clickIds:w,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:Pe(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:o.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||et((jt=navigator.userAgent)!=null?jt:"")},e.userId?{userId:e.userId}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),P=async()=>{for(let E=0;;E++){if(se||!l())return;let k=ue(5e3);try{let C=await fetch(`${S}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(O),headers:v,signal:k.signal});if(C.status===402){console.warn("[SentientUI] Session limit exceeded for this project. The bandit will stop learning until the limit resets. Upgrade at sentient-ui.com/pricing");return}if(C.ok||Te(C)==="dropped")return}catch(C){}finally{k.clear()}if(E>=jo){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(C=>setTimeout(C,Se(E+1)))}};try{ve=P()}catch(E){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:y});let Bn=Wo(),xe=null,gt=!1,W={goal(d,g={},w=1,O=0){var V,q,Y,ne,Z,X,T;let P=o.getSessionId();if(!P||se||!l())return;let E=Fo(g)?g:{metadata:g},k=[d,(V=E.externalId)!=null?V:"",(q=E.stepIndex)!=null?q:O,(Y=E.weight)!=null?Y:w].join("\0"),C=E.value!==void 0?`${E.value}\0${(ne=E.currency)!=null?ne:""}`:null;if(Bn.firedBefore(k,C)){e.debug&&console.log(`[sentient] goal("${d}") already recorded for this action \u2014 not sent twice`);return}let U=Et(),D={sessionId:P,name:d,metadata:(Z=E.metadata)!=null?Z:{},weight:(X=E.weight)!=null?X:w,stepIndex:(T=E.stepIndex)!=null?T:O,goalId:U,value:E.value,currency:E.currency,externalId:E.externalId};e.debug&&console.log("[sentient] goal",D);let z={id:U,body:JSON.stringify(D)};ve.then(()=>A.send(z))},componentGoal(d,g,w){var U,D,z;let O=o.getSessionId();if(!O||se||!l())return;let P=h.get(d,B),E=P?null:(U=b.get(d))!=null?U:null;if(!P&&E===null){e.debug&&console.warn(`[sentient] componentGoal("${d}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!P&&!_.has(d)){e.debug&&console.warn(`[sentient] componentGoal("${d}"): slot not decided this session \u2014 not attributed`);return}let k=P?P.variantId:tt(E),C={id:Et(),sessionId:O,projectId:e.apiKey,componentId:d,variantId:k,eventType:"goal_achieved",goalType:g,payload:I({reward:(D=w==null?void 0:w.reward)!=null?D:1,goalValue:w==null?void 0:w.value,currency:w==null?void 0:w.currency},(z=w==null?void 0:w.metadata)!=null?z:{}),timestamp:Date.now(),timeInSession:Date.now()-u,path:at()};e.debug&&console.log("[sentient] componentGoal",C),ve.then(()=>{!se&&l()&&y.push(C)})},identify(d){let g=o.getSessionId();!g||se||!l()||ve.then(()=>{fetch(`${S}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:g,userId:d,ephemeral:o.isEphemeral()}),headers:v}).catch(()=>{})})},track(d){let g=o.getSessionId();if(!g||se||!l()||d.eventType==="variant_assigned"&&b.get(d.componentId)!==void 0&&!_.has(d.componentId)&&!h.get(d.componentId,B))return;let w=oe(I({path:at()},d),{id:Et(),sessionId:g,timestamp:Date.now(),timeInSession:Date.now()-u});e.debug&&console.log("[sentient] track",w),ve.then(()=>y.push(w))},getAssignment(d,g){return h.get(d,g)},async assign(d,g,w,O){let P=o.getSessionId();if(!P)return null;let E=h.get(d,B);if(E&&(g!=null&&g.length||E.content!==void 0)){let k=E.ttlMs&&E.ttlMs>0?Math.max(0,E.assignedAt+E.ttlMs-Date.now()):0;return{variantId:E.variantId,assignmentTtlMs:k,content:E.content}}return kt(ee,d,async()=>{if(!await ft(ve,2500)||se||!l())return null;let k=ue(3e4);try{let C={sessionId:P,componentId:d,variantIds:g};O!==void 0?C.agentDataByVariant=O:w!==void 0&&(C.agentData=w);let U=await fetch(`${S}/assign`,{method:"POST",body:JSON.stringify(C),headers:v,signal:k.signal});if(!U.ok)return null;let D=await U.json();return h.set(d,B,I({variantId:D.variantId,assignedAt:Date.now(),segment:B,confidence:1,content:D.content},D.assignmentTtlMs&&D.assignmentTtlMs>0?{ttlMs:D.assignmentTtlMs}:{})),D}catch(C){return null}finally{k.clear()}})},async decide(d){var E,k;let g=o.getSessionId();if(!g)return null;let w=(E=d.slots)!=null?E:[],O={sessionId:g};d.sections&&d.sections.length>0&&(O.sections=d.sections.map(C=>({id:C}))),O.components=(k=d.components)!=null?k:[],w.length>0&&(O.slots=w.map(Ue)),d.slotsFrom==="registry"&&(O.slotsFrom="registry",d.registrySlotIds&&(O.registrySlotIds=d.registrySlotIds),d.bootstrap===!1&&(O.bootstrap=!1),d.render&&Object.keys(d.render).length>0&&(O.render=d.render)),d.v&&(O.v=d.v),typeof d.pp=="number"&&(O.pp=d.pp),e.persona&&(O.persona=e.persona);let P=JSON.stringify(O);return kt(f,P,async()=>{var U,D,z,V,q,Y,ne,Z;if(!await ft(ve,2500)||se||!l())return pt(w),null;let C=ue(3e4);try{let X=await fetch(`${S}/decide`,{method:"POST",body:P,headers:v,signal:C.signal});if(!X.ok)return pt(w),null;let T=await X.json(),le=ot(T.stage,e.stageAttributes);e.stageAttributes&&rt(le);let ke={};for(let j of w){let de=(U=T.slots)==null?void 0:U[j.id];if(de!==void 0){ke[j.id]=de,b.set(j.id,de),_.add(j.id);continue}let Wt=b.get(j.id);if(Wt!==void 0)ke[j.id]=Wt;else{let Ht=Ne(j);ke[j.id]=Ht,b.set(j.id,Ht)}}if(T.slots)for(let[j,de]of Object.entries(T.slots))j in ke||(ke[j]=de,b.set(j,de),_.add(j));let Gn=N!=null&&N.persona!=="unknown";T.persona&&!(T.persona==="unknown"&&Gn)?N={persona:T.persona,confidence:(D=T.confidence)!=null?D:0}:N||(N={persona:"unknown",confidence:0});for(let[j,de]of Object.entries((z=T.assignments)!=null?z:{}))h.set(j,B,{variantId:de,assignedAt:Date.now(),segment:B,confidence:1});if(T.slotConfig)for(let[j,de]of Object.entries(T.slotConfig))m.set(j,de);T.palette&&(R=T.palette),T.vocabulary&&($=T.vocabulary);for(let j of(V=d.registrySlotIds)!=null?V:[])(q=T.slotConfig)!=null&&q[j]||(m.delete(j),b.delete(j),_.delete(j));return l()&&Ce(e.apiKey,I(I(I(I({v:1,persona:N.persona,band:(0,xt.confidenceBand)(N.confidence),slots:Object.fromEntries(b),layoutOrder:(Y=T.layoutOrder)!=null?Y:null,savedAt:Date.now()},m.size>0?{slotConfig:Object.fromEntries(m)}:{}),R?{palette:R}:{}),$?{vocabulary:$}:{}),le?{stage:le}:{})),I(I(I(I(I(I(I({layoutOrder:(ne=T.layoutOrder)!=null?ne:null,assignments:(Z=T.assignments)!=null?Z:{},slots:ke,persona:N.persona,confidence:N.confidence},T.slotConfig?{slotConfig:T.slotConfig}:{}),T.goals?{goals:T.goals}:{}),T.sectionMap?{sectionMap:T.sectionMap}:{}),T.palette?{palette:T.palette}:{}),T.vocabulary?{vocabulary:T.vocabulary}:{}),T.stage?{stage:T.stage}:{}),T.context?{context:T.context}:{})}catch(X){return pt(w),null}finally{C.clear()}})},getSlotResult(d){var g;return(g=b.get(d))!=null?g:null},isSlotDecided(d){return _.has(d)},getSlotConfig(d){var g;return(g=m.get(d))!=null?g:null},reportSlots(d,g,w,O){var E;let P={};for(let[k,C]of Object.entries(O!=null?O:{}))for(let U of C){let D=`${k}|${U.key}`;!he.test(k)||we.has(D)||(we.add(D),((E=P[k])!=null?E:P[k]=[]).push(U))}Object.keys(P).length>0&&fetch(`${S}/slots/observed`,{method:"POST",headers:v,body:JSON.stringify({slotIds:Object.keys(P),authoredArms:P})}).catch(()=>{});for(let k of d)if(!(typeof k!="string"||k.length===0)){if(!he.test(k)){Uo()&&!Me.has(k)&&(Me.add(k),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(k)} will not register \u2014 ids must start with a letter or digit and contain only letters, digits, '_' or '-' (max 128 chars): /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.`));continue}if(!H.has(k)){H.add(k),Q.add(k);let C=g==null?void 0:g[k];if(typeof C=="string"){let D=C.replace(/\s+/g," ").trim().slice(0,400);D!==""&&ge.set(k,D)}let U=w==null?void 0:w[k];U!==void 0&&x.set(k,U)}}Q.size===0||te!=null||(te=setTimeout(()=>{te=null;let k=[...Q];Q.clear();for(let C=0;C<k.length;C+=20){let U=k.slice(C,C+20),D={},z={};for(let V of U){let q=ge.get(V);q!==void 0&&(D[V]=q,ge.delete(V));let Y=x.get(V);Y!==void 0&&(z[V]=Y,x.delete(V))}fetch(`${S}/slots/observed`,{method:"POST",headers:v,body:JSON.stringify(I(oe(I(I({slotIds:U},Object.keys(D).length>0?{baselineTexts:D}:{}),Object.keys(z).length>0?{baselineSkeletons:z}:{}),{pagePaths:Object.fromEntries(U.map(V=>[V,location.pathname]))}),Object.keys(D).length>0&&o.getSessionId()?{sessionId:o.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(d,g){!he.test(d)||G.has(d)||(G.add(d),fetch(`${S}/slots/observed`,{method:"POST",headers:v,body:JSON.stringify({slotIds:[d],baselineSkeletons:{[d]:g}})}).catch(()=>{}))},reportDrift(d,g,w,O){let P=`${d}|${g}`,E=o.getSessionId();!E||fe.has(P)||(fe.add(P),fetch(`${S}/slots/drift`,{method:"POST",headers:v,body:JSON.stringify({sessionId:E,reports:[{slotId:d,expectedFp:g,observedFp:w,reason:O}]})}).catch(()=>{}))},requestSlots(d,g,w){var O,P;for(let E of d)be.has(E)||(be.add(E),he.test(E)?re.set(E,{text:g==null?void 0:g[E],render:(O=w==null?void 0:w.render)==null?void 0:O[E],skeleton:(P=w==null?void 0:w.skeletons)==null?void 0:P[E]}):W.reportSlots([E]));re.size===0||dt!=null||(dt=setTimeout(()=>{dt=null;let E=[...re];re.clear();for(let k=0;k<E.length;k+=50){let C=E.slice(k,k+50),U={};for(let[D,z]of C)z.render&&(U[D]=z.render);W.decide({slotsFrom:"registry",registrySlotIds:C.map(([D])=>D),bootstrap:!1,render:U}).then(D=>{var z,V;if(D){let q={},Y={},ne=[];for(let[Z,X]of C){let T=(z=D.slotConfig)==null?void 0:z[Z];if(T){T.needsSkeleton&&X.skeleton&&((V=W.reportSkeleton)==null||V.call(W,Z,X.skeleton));continue}ne.push(Z),X.text&&(q[Z]=X.text),X.skeleton&&(Y[Z]=X.skeleton)}ne.length>0&&W.reportSlots(ne,q,Y)}else Ot(C.map(([q])=>q),be,q=>{var X;let Y={},ne={},Z={};for(let[T,le]of C)q.has(T)&&(le.text&&(Y[T]=le.text),le.render&&(ne[T]=le.render),le.skeleton&&(Z[T]=le.skeleton));(X=W.requestSlots)==null||X.call(W,[...q],Y,{render:ne,skeletons:Z})});ae.forEach(q=>q())})}},0))},decideSlots(d){for(let g of d)He.has(g.id)||(He.add(g.id),Le.set(g.id,g));Le.size===0||ut!=null||(ut=setTimeout(()=>{ut=null;let g=[...Le.values()];Le.clear();for(let w=0;w<g.length;w+=30){let O=g.slice(w,w+30);W.decide({slots:O}).then(P=>{P||Ot(O.map(E=>E.id),He,E=>{var k;return(k=W.decideSlots)==null?void 0:k.call(W,O.filter(C=>E.has(C.id)))}),ae.forEach(E=>E())})}},0))},cancelSlots(d){for(let g of d)re.delete(g)&&be.delete(g),Le.delete(g)&&He.delete(g)},onSlotsChanged(d){return ae.add(d),()=>{ae.delete(d)}},getStyleVocabulary(){return $},getSitePalette(){return R},getPersona(){return N?{persona:N.persona,confidence:N.confidence,band:(0,xt.confidenceBand)(N.confidence)}:null},async fetchWeights(){var g;let d=ue(5e3);try{let w=await fetch(`${S}/weights`,{headers:v,signal:d.signal});return w.ok?(g=(await w.json()).components)!=null?g:[]:[]}catch(w){return[]}finally{d.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){y.flush(),A.flush()},dispose(){var d;xe==null||xe(),gt=!0,se=!0,y.destroy(),A.destroy(),((d=J.get(e.apiKey))==null?void 0:d.dispose)===W.dispose&&J.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var d;xe==null||xe(),gt=!0,se=!0,i=!0,ze(e.apiKey),y.destroy({forget:!0}),A.destroy({forget:!0}),o.destroy(),h.clear(),((d=J.get(e.apiKey))==null?void 0:d.dispose)===W.dispose&&J.delete(e.apiKey);try{localStorage.removeItem(ye+e.apiKey),localStorage.removeItem(Ke(e.apiKey)),localStorage.removeItem($e(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${ie(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(g){}e.debug&&console.log("[sentient] destroyed")}};if(J.set(e.apiKey,{config:e,upgrade:null,dispose:W.dispose}),xe=Ho(W,e.apiKey,d=>{ve.then(()=>{gt||En.add(d)})}),e.debug){let d=window;d.__sentient&&(d.__sentient.client=W)}return W}var kn="_snt_graph_edges",Vo={pricing:["features","faq"],features:["pricing"],faq:["pricing"],social_proof:["cta"],cta:["social_proof","hero","trust"],hero:["cta"],comparison:["pricing"],trust:["cta"]};function Xo(e){var t;return(t=Vo[e])!=null?t:[]}function Qo(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch(n){return t}}function Jo(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(n){}}var Yo=new Set(["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"]);function Zo(e){return Yo.has(e)?e:"generic"}function Ct(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch(t){return"/"}}function er(e,t,n){let s=`${e}:${t}:${n.join(",")}`,c=5381;for(let r=0;r<s.length;r++)c=(c<<5)+c+s.charCodeAt(r)&4294967295;return(c>>>0).toString(16).padStart(8,"0")}function In(e){let t=new Map,n=new Map,s=`_snt_graph_nodes${ie(e==null?void 0:e.apiKey)}`,c=()=>{typeof window!="undefined"&&Jo(s,[...t.values()])};if(typeof window!="undefined"){let r=Qo(s,[]);for(let u of r)t.set(u.componentId,u);try{localStorage.removeItem(kn)}catch(u){}}return{addPageNode(r){t.set(r.componentId,r),c()},addStructuralEdge(r){let u=`${r.fromComponentId}->${r.toComponentId}`;n.set(u,r)},syncOnce(){var u,o;if(!(e!=null&&e.syncUrl)||typeof window=="undefined")return;let r=[...t.values()];if(r.length!==0)try{let p=new Map;for(let y of r){let S=(u=p.get(y.semanticType))!=null?u:[];S.push(y),p.set(y.semanticType,S)}let i=[],a=new Set;for(let y of r)for(let S of Xo(y.semanticType)){let v=(o=p.get(S))!=null?o:[];for(let M of v){if(M.componentId===y.componentId)continue;let A=`semantic:${y.componentId}->${M.componentId}`;a.has(A)||(a.add(A),i.push({fromComponentId:y.componentId,toComponentId:M.componentId,type:"semantic",weight:.4,confidence:.9}))}}let l=new Set(r.map(y=>y.componentId));for(let y of n.values()){if(!l.has(y.fromComponentId)||!l.has(y.toComponentId))continue;let S=`structural:${y.fromComponentId}->${y.toComponentId}`;a.has(S)||(a.add(S),i.push({fromComponentId:y.fromComponentId,toComponentId:y.toComponentId,type:"structural",weight:y.weight,confidence:1}))}let h=oe(I(I({pageUrl:Ct(window.location.href)},e.sessionId?{sessionId:e.sessionId}:{}),e.projectId?{projectId:e.projectId}:{}),{nodes:r.map(y=>{let S=Zo(y.semanticType);return{componentId:y.componentId,semanticType:S,answers:y.answers,contentHash:er(y.componentId,S,y.answers),prominenceScore:y.prominenceScore,depthInPage:y.depth}}),edges:i});fetch(e.syncUrl,{method:"POST",keepalive:!0,headers:I({"Content-Type":"application/json"},e.apiKey?{Authorization:`Bearer ${e.apiKey}`}:{}),body:JSON.stringify(h)}).catch(()=>{})}catch(p){}},snapshot(){return{pageNodes:[...t.values()],capturedAt:Date.now()}},destroy(){if(typeof window!="undefined")try{localStorage.removeItem(s),localStorage.removeItem(kn)}catch(r){}}}}var tr=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function Tt(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function nr(e){return{tag:e.tagName.toLowerCase(),text:Tt(e).slice(0,40)}}function Cn(e){return e.replace(/["\\\]]/g,"\\$&")}function We(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function Tn(e,t){var u;let n=e.tagName.toLowerCase();if(!n)return null;let s=((u=e.getAttribute("class"))!=null?u:"").split(/\s+/).filter(o=>/^[a-zA-Z][\w-]*$/.test(o)),c=[n,...s.map(o=>`${n}.${o}`)];for(let o of c)if(We(t,o))return o;let r=e.parentElement;if(r&&r!==t){let o=Tn(r,t);if(o){for(let l of c){let h=`${o} > ${l}`;if(We(t,h))return h}let p=Array.from(r.children).filter(l=>l.tagName.toLowerCase()===n),i=p.indexOf(e),a=p.some(l=>l!==e&&Tt(l)!==Tt(e));if(i>=0&&a){let l=`${o} > ${n}:nth-of-type(${i+1})`;if(We(t,l))return l}}}return null}function ct(e,t){let n=nr(e),s=e.getAttribute("id");if(s&&We(t,`#${Cn(s)}`))return{v:1,id:s,fingerprint:n};for(let r of tr){let u=e.getAttribute(r);if(u&&We(t,`[${r}="${Cn(u)}"]`))return{v:1,dataAttr:{name:r,value:u},fingerprint:n}}let c=Tn(e,t);return c?{v:1,selector:c,fingerprint:n}:null}var An=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],or={banner:"hero",navigation:"navigation",contentinfo:"footer"};function rr(e){let t=e.ariaRole?or[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function sr(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var ir=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],ar=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|free returns?|returns? within|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]],_n={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function cr(e){var n;let t=e.querySelector("h1, h2, h3");return((n=t==null?void 0:t.textContent)!=null?n:"").slice(0,160)}function lr(e){var c,r;let t=rr(e);if(t)return{type:(c=_n[t])!=null?c:"generic",strength:"strong"};let n=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[u,o]of ir)if(o.test(n))return{type:u,strength:"strong"};for(let[u,o]of ar)if(o.test(e.bodyText))return{type:u,strength:"strong"};let s=sr(e);return{type:(r=_n[s])!=null?r:"generic",strength:"weak"}}function dr(e){var s,c;let t=((s=e.textContent)!=null?s:"").replace(/\s+/g," ").trim(),n=e.getAttribute("role");return I({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((c=e.className)!=null?c:"")}`,headingText:cr(e),bodyText:t.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:t.length},n?{ariaRole:n}:{})}function Rn(e){return lr(dr(e)).type}var ur=new Set(["SECTION","ARTICLE","MAIN","DIV","ASIDE"]),pr=200,gr="h1, h2, h3",fr="[data-sentient-id], section[aria-label], article[aria-label], main[aria-label], aside[aria-label]",On=30,mr=1500,yr={scan:async()=>({nodes:[],edges:[],scannedAt:0}),observe:()=>{},getProminenceScore:()=>0,destroy:()=>{}};function Pn(e,t,n){return n<=t?0:Math.max(0,Math.min(1,(e-t)/(n-t)))}function Sr(e){var t,n,s;try{let c=e;for(let r of Object.keys(c)){if(!r.startsWith("__reactFiber")&&!r.startsWith("__reactInternalInstance"))continue;let u=c[r],o=(s=(t=u==null?void 0:u.type)==null?void 0:t.displayName)!=null?s:(n=u==null?void 0:u.type)==null?void 0:n.name;if(o&&o.length>1)return o}}catch(c){}}function hr(e){let t={};for(let n of Array.from(e.attributes))n.name.startsWith("data-")&&(t[n.name]=n.value);return t}var _t=new Set(An);function br(e,t){let n=e.getAttribute("data-sentient-id"),s=n?t==null?void 0:t[n]:void 0;if(s&&_t.has(s))return s;let c=e.getAttribute("data-sentient-type");if(c&&_t.has(c))return c;let r=e.getAttribute("role");return r&&_t.has(r)?r:Rn(e)}function vr(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)&4294967295;return(t>>>0).toString(16).padStart(8,"0")}function Er(e){let t=[],n=e;for(;n;){let s=n.parentElement;if(!s){t.push(n.tagName.toLowerCase());break}let c=Array.prototype.indexOf.call(s.children,n);t.push(`${n.tagName.toLowerCase()}[${c}]`),n=s}return t.reverse().join("/")}function wr(e){var n;let t=(n=e.getAttribute("data-sentient-id"))!=null?n:e.getAttribute("id");return t||`${e.tagName.toLowerCase()}-${vr(Er(e))}`}function xr(e){let t=0,n=e.parentElement;for(;n;)t++,n=n.parentElement;return t}function At(e,t,n){var c,r,u,o;let s=e.querySelector(gr);return{componentId:wr(e),semanticType:br(e,n),ariaLabel:(c=e.getAttribute("aria-label"))!=null?c:void 0,headingText:(u=(r=s==null?void 0:s.textContent)==null?void 0:r.trim())!=null?u:void 0,isAboveFold:e.getBoundingClientRect().top<window.innerHeight,prominenceScore:t(e),depth:xr(e),reactComponentName:Sr(e),dataAttributes:hr(e),locator:(o=ct(e,e.ownerDocument))!=null?o:void 0}}function Dn(e){var r;let t=[],n=new Set,s="__root__",c=new Map;for(let[u,o]of e){let p=u.parentElement,i=s;for(;p;){if(e.has(p)){i=e.get(p);let l=e.get(u),h=`${i}->${l}`;!n.has(h)&&i!==l&&(n.add(h),t.push({fromComponentId:i,toComponentId:l,weight:.6}));break}p=p.parentElement}let a=(r=c.get(i))!=null?r:[];a.push(u),c.set(i,a)}for(let u of c.values()){if(u.length<2)continue;let o=u.length>On?u.slice(0,On):u;for(let p=0;p<o.length;p++)for(let i=p+1;i<o.length;i++){if(t.length>=mr)return t;let a=e.get(o[p]),l=e.get(o[i]);if(a===l)continue;let h=`${a}->${l}::sib`,y=`${l}->${a}::sib`;n.has(h)||(n.add(h),t.push({fromComponentId:a,toComponentId:l,weight:.3})),n.has(y)||(n.add(y),t.push({fromComponentId:l,toComponentId:a,weight:.3}))}}return t}function kr(e,t){let n=[],s=new Set,c=new Map;return document.querySelectorAll("[data-sentient-id]").forEach(o=>{if(o instanceof Element&&!s.has(o)){s.add(o);let p=At(o,e,t);n.push(p),c.set(o,p.componentId)}}),document.querySelectorAll("section, article, main, aside").forEach(o=>{if(!(o instanceof Element)||s.has(o))return;let p=o.hasAttribute("aria-label"),i=o.hasAttribute("data-sentient-id");if(!p&&!i)return;s.add(o);let a=At(o,e,t);n.push(a),c.set(o,a.componentId)}),{nodes:n,edges:Dn(c),elementToId:c}}function Nn(e={}){let{sectionTypes:t}=e;if(typeof window=="undefined")return yr;let n=null,s=0,c=null,r=new Map,u=y=>{try{let S=window.getComputedStyle(y),v=parseFloat(S.fontSize)||12,M=parseFloat(S.zIndex)||0,A=y.getBoundingClientRect(),K=Math.max(A.top,0),L=window.innerHeight||1,F=1/(K/L+1),B=Pn(v,12,48)*.4+F*.4+Pn(M,0,100)*.2;return Math.max(0,Math.min(1,B))}catch(S){return .5}},o=()=>new Promise(y=>{let S=()=>{let{nodes:v,edges:M,elementToId:A}=kr(u,t);r.clear();for(let[K,L]of A)r.set(K,L);y({nodes:v,edges:M,scannedAt:Date.now()})};try{typeof requestIdleCallback=="function"?s=requestIdleCallback(S,{timeout:100}):S()}catch(v){S()}}),p=new Set,i=null,a=()=>{i=null;let y=[...p];p.clear();let S=[],v=new Set;for(let A of y){if(!A.isConnected)continue;let K=[];ur.has(A.tagName)&&(A.hasAttribute("data-sentient-id")||A.hasAttribute("aria-label"))&&K.push(A);try{A.querySelectorAll(fr).forEach(L=>K.push(L))}catch(L){}for(let L of K){if(r.has(L))continue;let F=At(L,u,t);S.push(F),v.add(F.componentId),r.set(L,F.componentId)}}if(S.length===0||!c)return;for(let A of[...r.keys()])A.isConnected||r.delete(A);let M=Dn(r).filter(A=>v.has(A.fromComponentId)||v.has(A.toComponentId));c({nodes:S,edges:M,addedAt:Date.now()})};return{scan:o,observe:y=>{c=y;try{n=new MutationObserver(S=>{for(let v of S)v.type==="childList"&&v.addedNodes.forEach(M=>{M instanceof Element&&p.add(M)});p.size>0&&i===null&&(i=setTimeout(a,pr))}),n.observe(document.body,{childList:!0,subtree:!0})}catch(S){}},getProminenceScore:u,destroy:()=>{if(n&&(n.disconnect(),n=null),i!==null&&clearTimeout(i),i=null,p.clear(),s&&typeof cancelIdleCallback=="function")try{cancelIdleCallback(s)}catch(y){}s=0,c=null,r.clear()}}}var Ir="https://api.sentient-ui.com/v1/events";function Cr(e){var n;let t=s=>{try{let c=document.cookie.match(new RegExp(`(?:^|; )${s}=([^;]*)`));return c?decodeURIComponent(c[1]):void 0}catch(c){return}};return(n=e?t(Ee(e)):void 0)!=null?n:t(pe)}var lt=new Map;function Mn(e){var y;let t=It(e),n=e.respectDoNotTrack!==!1&&je(),s=e.consent===!1||n,c=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_"),r=e.localMode===!0||!c;if(!e.graph||r||typeof window=="undefined")return t;if(s)return n||vn(e.apiKey,S=>Mn(S)),t;let u=lt.get(e.apiKey);if(u)try{u()}catch(S){}let o=Nn({sectionTypes:e.sectionTypes}),p=(y=e.ingestUrl)!=null?y:Ir,i=In({syncUrl:p.replace(/\/events\/?$/,"/graph/sync"),apiKey:e.apiKey,projectId:e.apiKey,sessionId:Cr(e.apiKey)});o.scan().then(S=>{for(let v of S.nodes)i.addPageNode({id:v.componentId,componentId:v.componentId,semanticType:v.semanticType,answers:e.captureDomText&&v.headingText?[v.headingText]:[],prominenceScore:v.prominenceScore,depth:v.depth});for(let v of S.edges)i.addStructuralEdge(v);i.syncOnce()});let a=null,l=()=>{a!==null&&clearTimeout(a),a=setTimeout(()=>{a=null,i.syncOnce()},500)};o.observe(S=>{for(let v of S.nodes)i.addPageNode({id:v.componentId,componentId:v.componentId,semanticType:v.semanticType,answers:e.captureDomText&&v.headingText?[v.headingText]:[],prominenceScore:v.prominenceScore,depth:v.depth});for(let v of S.edges)i.addStructuralEdge(v);l()});let h=()=>{a!==null&&(clearTimeout(a),a=null),o.destroy(),i.destroy(),lt.get(e.apiKey)===h&&lt.delete(e.apiKey)};return lt.set(e.apiKey,h),oe(I({},t),{getGraph:()=>i.snapshot(),dispose:()=>{h(),t.dispose()},destroy:()=>{h(),t.destroy()}})}0&&(module.exports={BLOCK_ALIGNS,BLOCK_EMPHASES,BLOCK_FITS,BLOCK_GAPS,BLOCK_GRID_COLUMNS,BLOCK_HEADING_LEVELS,BLOCK_JUSTIFIES,BLOCK_MAX_WIDTHS,BLOCK_PADS,BLOCK_RATIOS,BLOCK_SIZES,BLOCK_SURFACES,BLOCK_TEXT_ALIGNS,BLOCK_TONES,BLOCK_WEIGHTS,FORM_FIELD_KINDS,FORM_INPUT_TYPES,LEGACY_SESSION_COOKIE_NAME,MAX_BLOCK_ARMS,MAX_BLOCK_CHILDREN,MAX_BLOCK_DEPTH,MAX_BLOCK_NODES,MAX_BLOCK_TEXT_LEN,MAX_FORM_FIELDS,MAX_FORM_SELECT_OPTIONS,SNAPSHOT_STORAGE_KEY_PREFIX,STAGE_ATTRIBUTE,armOfResult,attachMicroSignalDetectors,baselineResultFor,baselineSlots,containsFormBlock,deriveSessionSegment,detectDeviceClass,detectTimeOfDay,detectTrafficSource,exposedStage,grantConsent,init,isDoNotTrackEnabled,locatorFromElement,readSnapshot,referrerDomainFromReferer,renderPrePaintScript,sanitizePageUrl,sessionCookieName,setStageAttribute,toWireSlot,writeSnapshot});
1
+ "use strict";var Fn=Object.create;var Ge=Object.defineProperty,jn=Object.defineProperties,Wn=Object.getOwnPropertyDescriptor,Vn=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols,zn=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable;var Qt=(e,t,n)=>t in e?Ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Jt.call(t,n)&&Qt(e,n,t[n]);if(Xt)for(var n of Xt(t))qn.call(t,n)&&Qt(e,n,t[n]);return e},oe=(e,t)=>jn(e,Vn(t));var Xn=(e,t)=>{for(var n in t)Ge(e,n,{get:t[n],enumerable:!0})},Yt=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of Hn(t))!Jt.call(e,c)&&c!==n&&Ge(e,c,{get:()=>t[c],enumerable:!(s=Wn(t,c))||s.enumerable});return e};var Qn=(e,t,n)=>(n=e!=null?Fn(zn(e)):{},Yt(t||!e||!e.__esModule?Ge(n,"default",{value:e,enumerable:!0}):n,e)),Jn=e=>Yt(Ge({},"__esModule",{value:!0}),e);var Rr={};Xn(Rr,{BLOCK_ALIGNS:()=>Eo,BLOCK_EMPHASES:()=>Co,BLOCK_FITS:()=>_o,BLOCK_GAPS:()=>vo,BLOCK_GRID_COLUMNS:()=>Ro,BLOCK_HEADING_LEVELS:()=>Oo,BLOCK_JUSTIFIES:()=>wo,BLOCK_MAX_WIDTHS:()=>No,BLOCK_PADS:()=>Do,BLOCK_RATIOS:()=>Ao,BLOCK_SIZES:()=>xo,BLOCK_SURFACES:()=>Po,BLOCK_TEXT_ALIGNS:()=>To,BLOCK_TONES:()=>Io,BLOCK_WEIGHTS:()=>ko,FORM_FIELD_KINDS:()=>Mo,FORM_INPUT_TYPES:()=>Lo,LEGACY_SESSION_COOKIE_NAME:()=>ge,MAX_BLOCK_ARMS:()=>Fo,MAX_BLOCK_CHILDREN:()=>Uo,MAX_BLOCK_DEPTH:()=>$o,MAX_BLOCK_NODES:()=>Ko,MAX_BLOCK_TEXT_LEN:()=>jo,MAX_FORM_FIELDS:()=>Bo,MAX_FORM_SELECT_OPTIONS:()=>Go,SNAPSHOT_STORAGE_KEY_PREFIX:()=>ye,STAGE_ATTRIBUTE:()=>rt,armOfResult:()=>ot,attachMicroSignalDetectors:()=>Sn,baselineResultFor:()=>Me,baselineSlots:()=>un,containsFormBlock:()=>yn,deriveSessionSegment:()=>wt,detectDeviceClass:()=>Re,detectTimeOfDay:()=>De,detectTrafficSource:()=>Oe,exposedStage:()=>st,grantConsent:()=>Cn,init:()=>Gn,isDoNotTrackEnabled:()=>We,locatorFromElement:()=>dt,readSnapshot:()=>Ce,referrerDomainFromReferer:()=>Pe,renderPrePaintScript:()=>en,sanitizePageUrl:()=>At,sessionCookieName:()=>be,setStageAttribute:()=>it,toWireSlot:()=>Fe,writeSnapshot:()=>Te});module.exports=Jn(Rr);function pe(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function yt(e,t){return new Promise(n=>{let s=setTimeout(()=>n(!1),t),c=()=>{clearTimeout(s),n(!0)};e.then(c,c)})}var Yn;function Zt(e){Yn=typeof e=="string"&&e!==""?e:void 0}function ie(e){return e?`_${e.slice(0,12)}`:""}var ge="_snt_uid";function be(e){return`${ge}${ie(e)}`}var qe="__sntForgetGen",Zn=()=>{try{return window[qe]}catch(e){return}};function Xe(e){var t,n;try{let s=window,c=(t=s[qe])!=null?t:s[qe]={};c[e]=((n=c[e])!=null?n:0)+1}catch(s){}}function me(e){var t,n;return(n=(t=Zn())==null?void 0:t[e])!=null?n:0}var ye="_snt_snap:";var eo=["low","medium","high"];function Ce(e){try{let t=localStorage.getItem(ye+e);if(!t)return null;let n=JSON.parse(t);if(!n||typeof n!="object"||n.v!==1||typeof n.persona!="string"||typeof n.band!="string"||!eo.includes(n.band)||typeof n.slots!="object"||n.slots===null||Array.isArray(n.slots)||!(n.layoutOrder===null||Array.isArray(n.layoutOrder))||typeof n.savedAt!="number"||!(Date.now()-n.savedAt<2592e6)||!(n.slotConfig===void 0||typeof n.slotConfig=="object"&&n.slotConfig!==null&&!Array.isArray(n.slotConfig)))return null;let s=n.vocabulary;return s!==void 0&&(typeof s!="object"||s===null||!Array.isArray(s.entries)||!Array.isArray(s.images))&&delete n.vocabulary,n.stage!==void 0&&typeof n.stage!="string"&&delete n.stage,n}catch(t){return null}}function Te(e,t){try{localStorage.setItem(ye+e,JSON.stringify(t))}catch(n){}}function en(e,t){return'(function(){try{var N=navigator,W=window;if(N.doNotTrack=="1"||N.doNotTrack=="yes"||W.doNotTrack=="1"||N.msDoNotTrack=="1"||N.globalPrivacyControl)return;var r=localStorage.getItem('+JSON.stringify(ye+e).replace(/</g,"\\u003c")+');if(!r)return;var s=JSON.parse(r);if(!s||s.v!==1||typeof s.persona!=="string"||typeof s.band!=="string")return;if(!('+2592e6+">Date.now()-s.savedAt))return;var d=document.documentElement;"+(t!=null&&t.stage?'if(typeof s.stage=="string"&&!d.hasAttribute("data-sentient-stage"))d.setAttribute("data-sentient-stage",s.stage);':"")+'if(d.hasAttribute("data-sentient-persona"))return;d.setAttribute("data-sentient-persona",s.persona);d.setAttribute("data-sentient-confidence",s.band);}catch(e){}})();'}function Se(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function Ae(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":t>=400&&t<500&&t!==429?"dropped":"retry"}function Qe(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let s=JSON.parse(n);return Array.isArray(s)?(localStorage.removeItem(e),s.slice(-t)):[]}catch(n){return[]}}function Ke(e,t,n){try{let s=(()=>{try{let r=localStorage.getItem(n);if(!r)return[];let u=JSON.parse(r);return Array.isArray(u)?u:[]}catch(r){return[]}})(),c=new Map;for(let r of s)c.set(r.id,r);for(let r of e)c.set(r.id,r);localStorage.setItem(n,JSON.stringify([...c.values()].slice(-t)))}catch(s){}}function Je(e,t){try{let n=localStorage.getItem(t);if(!n)return;let s=JSON.parse(n);if(!Array.isArray(s))return;let c=new Set(e),r=s.filter(u=>!c.has(u.id));if(r.length===s.length)return;r.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(r))}catch(n){}}var to=500,no=56*1024;function $e(e){return`_snt_retry_${e.slice(0,12)}`}var oo={push:()=>{},flush:()=>{},destroy:()=>{}};function tn(e){var N,ee,ae;if(typeof window=="undefined")return oo;let t=(N=e.flushIntervalMs)!=null?N:5e3,n=(ee=e.maxBatchSize)!=null?ee:20,s=(ae=e.maxRetrySize)!=null?ae:100,c=e.ingestUrl,r=e.apiKey,u=$e(r),o=!1,p=me(r),i=(...k)=>{!o&&me(r)===p&&Ke(...k)},a=[],d=new Set,h=[],y=k=>{for(let B of k)S.delete(B),!d.has(B)&&(d.add(B),h.push(B));for(;h.length>to;){let B=h.shift();B&&d.delete(B)}Je(k,u)},S=new Set,b=()=>{for(;a.length>s;){let k=a.shift();k&&S.delete(k.id)}},P=k=>{d.has(k.id)||S.has(k.id)||(S.add(k.id),a.push(k),b())},O=k=>{for(let B of k)d.has(B.id)||(S.add(B.id),a.push(B));b()},K=Qe(u,s);for(let k of K)P(k);let L=0,W=0,H=(k,B=!0)=>{if(k.length===0)return;let fe=JSON.stringify(k),ve=k.map(re=>re.id),te,we=pe(15e3);try{te=fetch(c,{method:"POST",keepalive:!0,signal:we.signal,body:fe,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}})}catch(re){i(k,s,u),O(k),W++,L=Date.now()+Se(W);return}Promise.resolve(te).then(we.clear,we.clear);let xe=re=>{if(Ae(re)!=="retry"){if(!re.ok&&B){let ke=k.filter(le=>le.eventType!=="pageview");if(ke.length>0&&ke.length<k.length){y(k.filter(le=>le.eventType==="pageview").map(le=>le.id)),H(ke,!1);return}}y(ve),W=0,L=0;return}i(k,s,u),O(k),W++,L=Date.now()+Se(W)};te&&typeof te.then=="function"?te.then(xe).catch(()=>{i(k,s,u),O(k),W++,L=Date.now()+Se(W)}):xe(te)},V=typeof TextEncoder!="undefined"?new TextEncoder:null,f=k=>V?V.encode(k).length:k.length,v=k=>{let B=[],fe=2;for(let ve of k){let te=f(JSON.stringify(ve))+1;if(B.length>0&&fe+te>no||B.length>=n)break;B.push(ve),fe+=te}return B},w=()=>{try{if(Date.now()<L)return;for(;a.length>0&&!(Date.now()<L);){let k=a.filter(fe=>!d.has(fe.id));if(a.length=0,k.length===0)break;let B=v(k);if(B.length===0)break;B.length<k.length&&a.push(...k.slice(B.length)),H(B)}}catch(k){}},m=!0,_=null;_=setInterval(()=>{m&&w()},t);let $=()=>{document.visibilityState==="hidden"&&w()},z=()=>{w()};return document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",z),{push(k){P(k),a.length>=n&&w()},flush:w,destroy(k){k!=null&&k.forget&&(o=!0),m=!1,_!==null&&(clearInterval(_),_=null),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",z),w()}}}var ro=200;function Ue(e){return`_snt_goal_retry_${e.slice(0,12)}`}var so={send:()=>{},flush:()=>{},destroy:()=>{}};function nn(e){var f,v,w;if(typeof window=="undefined")return so;let t=(f=e.flushIntervalMs)!=null?f:5e3,n=(v=e.maxRetrySize)!=null?v:100,s=(w=e.maxPerFlush)!=null?w:5,c=Ue(e.apiKey),r=!1,u=me(e.apiKey),o=(...m)=>{!r&&me(e.apiKey)===u&&Ke(...m)},p=[],i=new Set,a=new Set,d=[],h=0,y=0,S=!1,b=m=>{for(i.delete(m.id),a.has(m.id)||(a.add(m.id),d.push(m.id));d.length>ro;){let _=d.shift();_&&a.delete(_)}Je([m.id],c)},P=m=>{o([m],n,c),!a.has(m.id)&&!i.has(m.id)&&(i.add(m.id),p.push(m)),Date.now()>=h&&(y++,h=Date.now()+Se(y))},O=m=>{let _,$=pe(15e3);try{_=fetch(e.url,{method:"POST",keepalive:!0,signal:$.signal,body:m.body,headers:e.headers})}catch(N){P(m);return}let z=N=>{var ae;let ee=Ae(N);if(ee==="retry"){P(m);return}ee==="dropped"&&((ae=e.onDrop)==null||ae.call(e,m,N.status)),b(m),y=0,h=0};Promise.resolve(_).then($.clear,$.clear),_&&typeof _.then=="function"?_.then(z).catch(()=>P(m)):z(_)},K=()=>{try{if(S||Date.now()<h)return;let m=0;for(;p.length>0&&m<s&&!(Date.now()<h);){let _=p.shift();i.delete(_.id),!a.has(_.id)&&(m++,O(_))}}catch(m){}},L=Qe(c,n);for(let m of L)i.has(m.id)||(i.add(m.id),p.push(m));L.length>0&&Ke(L,n,c);let W=setInterval(K,t),H=()=>{document.visibilityState==="hidden"&&K()},V=()=>K();return document.addEventListener("visibilitychange",H),window.addEventListener("pagehide",V),{send(m){if(S){a.has(m.id)||o([m],n,c);return}if(!(a.has(m.id)||i.has(m.id))){if(Date.now()<h){o([m],n,c),i.add(m.id),p.push(m);return}O(m)}},flush:K,destroy(m){m!=null&&m.forget&&(r=!0),clearInterval(W),document.removeEventListener("visibilitychange",H),window.removeEventListener("pagehide",V),K(),S=!0}}}function on(e){if(typeof window=="undefined"||!e)return!1;Xe(e);let t=!1,n=be(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let u=location.protocol==="https:"?"; Secure":"";document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${u}`,t=!0}}catch(u){}let s=ie(e),c=[n,"_snt_graph_edges",ye+e,$e(e),Ue(e),`_snt_graph_nodes${s}`],r=[`_snt_asgn${s}_`];for(let u of["localStorage","sessionStorage"])try{let o=window[u];for(let p of c)o.getItem(p)!==null&&(o.removeItem(p),t=!0);for(let p=o.length-1;p>=0;p--){let i=o.key(p);i&&r.some(a=>i.startsWith(a))&&(o.removeItem(i),t=!0)}}catch(o){}try{(new RegExp(`(?:^|; )${ge}=[^;]`).test(document.cookie)||localStorage.getItem(ge)!==null||sessionStorage.getItem(ge)!==null)&&localStorage.setItem(`${ge}_tomb${s}`,"1")}catch(u){}return t}function Ye(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch(e){}try{if(typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0"),(n===3||n===5||n===7||n===9)&&(t+="-");return t}}catch(e){}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var rn="_snt_uid",io=365,_e="_snt_uid";function ao(){return Ye()}function ht(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function vt(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function lo(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${vt()}`}catch(s){}}function Ze(e){try{return localStorage.getItem(e)}catch(t){return null}}function sn(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function bt(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function co(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function uo(e){try{sessionStorage.removeItem(e)}catch(t){}}function po(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${vt()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function go(e){try{localStorage.removeItem(e)}catch(t){}}function fo(e){try{document.cookie=`${e}=; max-age=0; SameSite=lax; path=/${vt()}`}catch(t){}}var mo={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function et(e){var S,b,P,O,K,L,W;if(typeof window=="undefined")return mo;let t=ie(e==null?void 0:e.apiKey),n=(S=e==null?void 0:e.cookieName)!=null?S:be(e==null?void 0:e.apiKey),s=`${_e}${t}`,c=`${_e}_tomb${t}`,u=((b=e==null?void 0:e.cookieTTLDays)!=null?b:io)*24*60*60,o=H=>H&&H.length>0?H:null,p=()=>{var H,V;return t&&!(e!=null&&e.cookieName)&&Ze(c)===null?(V=(H=o(ht(rn)))!=null?H:o(Ze(_e)))!=null?V:o(bt(_e)):null},i=(W=(L=(K=(O=(P=o(ht(n)))!=null?P:o(Ze(s)))!=null?O:o(bt(s)))!=null?K:p())!=null?L:o(e==null?void 0:e.ssrSessionId))!=null?W:ao();lo(n,i,u);let a=sn(s,i),d=po(n),h=a?!1:co(s,i),y=!a&&!d&&!h;return{getSessionId:()=>i,isEphemeral:()=>y,destroy:()=>{i=null,fo(n),go(s),uo(s),t&&!(e!=null&&e.cookieName)&&(ht(rn)!==null||Ze(_e)!==null||bt(_e)!==null)&&sn(c,"1")}}}var yo=1800*1e3;function tt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function an(e=yo,t){let n=new Map,s=`_snt_asgn${ie(t)}_`,c=(i,a)=>`${s}${encodeURIComponent(i)}:${encodeURIComponent(a)}`,r=i=>{let a=i.slice(s.length),d=a.indexOf(":");if(d<0)return null;try{return{componentId:decodeURIComponent(a.slice(0,d)),segment:decodeURIComponent(a.slice(d+1))}}catch(h){return null}},u=()=>{try{let i=[];for(let a=0;a<localStorage.length;a++){let d=localStorage.key(a);d!=null&&d.startsWith(s)&&i.push(d)}return i}catch(i){return[]}},o=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of u())try{let a=localStorage.getItem(i);if(!a)continue;let d=JSON.parse(a);if(o(d)){localStorage.removeItem(i);continue}let h=r(i);if(!h)continue;n.set(tt(h.componentId,h.segment),d)}catch(a){}})(),{get(i,a){let d=n.get(tt(i,a));return d?o(d)?(n.delete(tt(i,a)),null):d:null},set(i,a,d){let h=tt(i,a);n.set(h,d);try{localStorage.setItem(c(i,a),JSON.stringify(d))}catch(y){}},clear(){n.clear();for(let i of u())try{localStorage.removeItem(i)}catch(a){}}}}var ln=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","PerplexityBot","Perplexity-User","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function nt(e){return cn(e)!==null}function cn(e){var n;if(!e)return null;let t=e.toLowerCase();return(n=ln.find(s=>t.includes(s.toLowerCase())))!=null?n:null}function Re(e){let t=e.toLowerCase();return/ipad|tablet|playbook|kindle|silk/.test(t)?"tablet":/mobi|iphone|ipod|android.*mobile|phone/.test(t)?"mobile":"desktop"}function Oe(e,t){if(!e)return"direct";try{let n=new URL(e);if(t)try{if(new URL(t).host===n.host)return"direct"}catch(c){}let s=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(s)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(s)?"social":"referral"}catch(n){return"direct"}}function Pe(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var dn=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Et(e){let t={},n={};try{let s=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([c,r])=>{let u=Array.isArray(r)?r[0]:r;return u===void 0?[]:[[c,u]]});for(let[c,r]of s)c.startsWith("utm_")?c in t||(t[c]=r):dn.includes(c)&&(c in n||(n[c]=r))}catch(s){}return{utmParams:t,clickIds:n}}function De(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function wt(e){let t=So("__segment__",e);return`${t.deviceClass}:${t.trafficSource}`}function So(e,t){var r,u,o,p,i,a,d,h;let n=(u=(r=t==null?void 0:t.userAgent)==null?void 0:r.trim())!=null?u:"",s=(p=(o=t==null?void 0:t.referer)==null?void 0:o.trim())!=null?p:"",c=(i=t==null?void 0:t.now)!=null?i:new Date;return T({sessionId:e,ephemeral:!1,utmParams:(a=t==null?void 0:t.utmParams)!=null?a:{},clickIds:(d=t==null?void 0:t.clickIds)!=null?d:{},deviceClass:n?Re(n):"desktop",trafficSource:s?Oe(s,t==null?void 0:t.appOrigin):"direct",referrerDomain:Pe(s),timeOfDay:De(c),dayOfWeek:(h=["sun","mon","tue","wed","thu","fri","sat"][c.getDay()])!=null?h:"sun",automation:(t==null?void 0:t.webdriver)===!0||nt(n)},t!=null&&t.landingPath?{landingPath:t.landingPath.split(/[?#]/)[0]}:{})}var Ne=require("@sentientui/policy");function Fe(e){return T(T(T({id:e.id},e.arms?{arms:[...e.arms]}:{}),e.dims?{dims:Object.fromEntries(Object.entries(e.dims).map(([t,n])=>[t,[...n]]))}:{}),e.baseline!==void 0?{baseline:e.baseline}:{})}function Me(e){let t=Fe(e);return(0,Ne.slotResultFor)(t,(0,Ne.slotBaselineArm)(t))}function un(e){let t={};for(let n of e)t[n.id]=Me(n);return t}function ot(e){return typeof e=="string"?e:(0,Ne.canonicalArm)(e)}var pn=require("@sentientui/policy"),rt="data-sentient-stage";function st(e,t){return!t||typeof e!="string"||!(e==="returning"||pn.STAGE_KEYS.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function it(e,t=document){try{e?t.documentElement.setAttribute(rt,e):t.documentElement.removeAttribute(rt)}catch(n){}}var It=require("@sentientui/policy");var lt=require("@sentientui/policy");var gn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",ho="[sentient] Local mode \u2014 decisions are simulated on-device and nothing is sent over the network. Add an API key to learn from real traffic.",fn=!1,at=!1;function bo(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function mn(e){var i;let t=et({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),n=(i=t.getSessionId())!=null?i:"local",s=bo(),c=import("@sentientui/core/local").then(a=>{let d=a;return d.LOCAL_ENGINE_AVAILABLE?(fn||(fn=!0,console.info(ho)),d):(at||(at=!0,console.error(gn)),null)}).catch(()=>(at||(at=!0,console.error(gn)),null)),r=null,u={low:.15,medium:.5,high:.85},o=(()=>{var d;if(e.initialPersona)return T({},e.initialPersona);let a=Ce(e.apiKey||"local");return a?{persona:a.persona,confidence:(d=u[a.band])!=null?d:.15}:null})();function p(a){let d=document.documentElement;d.dataset.sentientPersona===void 0&&(d.dataset.sentientPersona=a.persona,d.dataset.sentientConfidence=(0,lt.confidenceBand)(a.confidence))}return{isLocal:!0,async decide(a){var y,S,b;let d=await c;if(!d)return null;let h=d.createLocalEngine({sessionId:n,forcedPersona:s}).decide(a);return r=oe(T({},h),{layoutOrder:(S=(y=h.layoutOrder)!=null?y:r==null?void 0:r.layoutOrder)!=null?S:null,slots:T(T({},(b=r==null?void 0:r.slots)!=null?b:{}),h.slots)}),Te(e.apiKey||"local",{v:1,persona:r.persona,band:(0,lt.confidenceBand)(r.confidence),slots:r.slots,layoutOrder:r.layoutOrder,savedAt:Date.now()}),p(h),h},getSlotResult(a){var d,h,y;return(y=(h=r==null?void 0:r.slots[a])!=null?h:(d=e.initialSlots)==null?void 0:d[a])!=null?y:null},getSlotConfig(a){var d,h;return(h=(d=e.initialSlotConfig)==null?void 0:d[a])!=null?h:null},getSitePalette(){var a;return(a=e.initialPalette)!=null?a:null},reportSlots(){},getVisitorId:()=>null,getPersona(){let a=r!=null?r:o;return a?{persona:a.persona,confidence:a.confidence,band:(0,lt.confidenceBand)(a.confidence)}:null},async assign(a,d){var S;let h=await c;return!h||!d||d.length===0?d!=null&&d[0]?{variantId:d[0],assignmentTtlMs:0}:null:{variantId:(S=h.createLocalEngine({sessionId:n,forcedPersona:s}).decide({components:[{id:a,variantIds:d}]}).assignments[a])!=null?S:d[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>t.destroy()}}var vo=["none","sm","md","lg"],Eo=["start","center","end","stretch"],wo=["start","center","end","between"],xo=["sm","md","lg"],ko=["normal","medium","bold"],Io=["default","muted","accent"],Co=["primary","secondary","ghost"],To=["left","center","right"],Ao=["auto","square","landscape","wide"],_o=["cover","contain"],Ro=[2,3,4],Oo=[1,2,3,4],Po=["default","raised"],Do=["none","sm","md","lg"],No=["measure"],Mo=["input","textarea","select"],Lo=["text","email","number","tel"],Bo=5,Go=8,Ko=64,$o=5,Uo=12,Fo=4,jo=500;function yn(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="form"?!0:Array.isArray(t.children)?t.children.some(yn):!1}function Sn(e,t,n,s){let c=[];{let o=!1,p=[],i=()=>{if(o)return;let a=Date.now();for(p.push(a);p.length>0&&a-p[0]>500;)p.shift();p.length>=3&&(o=!0,e("rage_click"))};t.addEventListener("click",i),c.push(()=>t.removeEventListener("click",i))}{let r=!1,u=o=>{if(r||!(o.target instanceof Node)||!t.contains(o.target)&&t!==o.target)return;r=!0;let p=typeof window!="undefined"?window.getSelection():null,i=p?p.toString().length:0;e("text_copy",{selectionLength:i})};document.addEventListener("copy",u),c.push(()=>document.removeEventListener("copy",u))}{let r=!1,u=!1,o=null,p=()=>{o!==null&&(clearTimeout(o),o=null)},i=()=>{r||!u||(p(),o=setTimeout(()=>{!r&&u&&(r=!0,e("scroll_hesitation"))},3e3))},a=()=>{p(),i()},d=y=>{for(let S of y)u=S.intersectionRatio>.3,u?i():p()},h=new IntersectionObserver(d,{threshold:[.3]});h.observe(t),window.addEventListener("scroll",a,{passive:!0}),c.push(()=>{h.disconnect(),window.removeEventListener("scroll",a),p()})}if((s==null?void 0:s.tabLoss)!==!1){let r=!1,u=n!=null?n:Date.now(),o=()=>{if(r||document.visibilityState!=="hidden")return;let p=Date.now()-u;p<15e3&&(r=!0,e("tab_loss",{timeOnPage:p}))};document.addEventListener("visibilitychange",o),c.push(()=>document.removeEventListener("visibilitychange",o))}return()=>{for(let r of c)r()}}function Wo(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var En="https://api.sentient-ui.com/v1/events",J=new Map,wn=null;function xn(e,t){let n=J.get(e);n&&n.upgrade&&(n.reinit=t)}function Vo(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Ho=3;function xt(){return Ye()}function ct(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function zo(){let e=new WeakMap,t=new Map,n=!1,s=(o,p,i)=>{let a=o.get(p);return i===null?a?!0:(o.set(p,new Set),!1):a?a.has(i)?!0:(a.add(i),!1):(o.set(p,new Set([i])),!1)},c=typeof window!="undefined"&&"event"in window,r=()=>{if(!c)return;let o=window.event;return typeof Event=="function"&&o instanceof Event?o:void 0},u=()=>{if(c){Promise.resolve().then(()=>{n=!1,t.clear()});return}let o=!1,p=()=>{o||(o=!0,n=!1,t.clear())};if(setTimeout(p,0),typeof MessageChannel=="function"){let i=new MessageChannel;i.port1.onmessage=()=>{i.port1.close(),i.port2.close(),p()},i.port2.postMessage(0)}};return{firedBefore(o,p){let i=r();if(i){let d=e.get(i);return d||(d=new Map,e.set(i,d)),s(d,o,p)}let a=s(t,o,p);return!a&&!n&&(n=!0,u()),a}}}var kn=new Set;function qo(e,t,n){let s=typeof window=="undefined"?null:window.history;if(!s)return()=>{};let c=!1,r,u=()=>{if(c)return;let i=ct();!i||i===r||(r=i,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${i}`))},o=[];for(let i of["pushState","replaceState"]){let a=s[i],d=function(...h){let y=a.apply(this,h);return u(),y};s[i]=d,o.push([i,a,d])}window.addEventListener("popstate",u);let p=ct();return p&&kn.has(`${t}:${p}`)?r=p:u(),()=>{if(!c){c=!0,window.removeEventListener("popstate",u);for(let[i,a,d]of o)s[i]===d&&(s[i]=a)}}}var je={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,assign:()=>Promise.resolve(null),decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getVisitorId:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}};function Xo(){try{return Et(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function In(e){return e.replace(/\/events\/?$/,"")}function We(){return typeof navigator!="undefined"&&navigator.globalPrivacyControl===!0?!0:[typeof navigator!="undefined"?navigator.doNotTrack:void 0,typeof window!="undefined"?window.doNotTrack:void 0,typeof navigator!="undefined"?navigator.msDoNotTrack:void 0].some(t=>t==="1"||t==="yes")}function Cn(e){var p;if(typeof window=="undefined")return;let t=e!=null?e:wn;if(!t){console.warn("[sentient] grantConsent() called before init()");return}let n=J.get(t);if(!n){console.warn("[sentient] grantConsent() called before init()");return}let{config:s,upgrade:c,reinit:r}=n;if(!c){n.upgradeBlockedReason&&console.warn(n.upgradeBlockedReason);return}if(s.respectDoNotTrack!==!1&&We())return;let u=(r!=null?r:Tt)(oe(T({},s),{consent:!0}));c(u);let o=(p=J.get(t))==null?void 0:p.dispose;J.set(t,{config:oe(T({},s),{consent:!0}),upgrade:null,dispose:o})}function Qo(e,t){var V;let n=e.preConsentBehavior==="statistical_winner",s=In((V=e.ingestUrl)!=null?V:En),c={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},r=new Map,u=new Map,o={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(f,v,w){if(!n)return Promise.resolve(null);let m=r.get(f);return m?Promise.resolve(m):Ct(u,f,async()=>{try{let _=new URLSearchParams({componentId:f});for(let ee of v!=null?v:[])_.append("variantIds[]",ee);let $=pe(5e3),z;try{let ee=await fetch(`${s}/winner?${_.toString()}`,{headers:c,signal:$.signal});if(!ee.ok)return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null;z=await ee.json()}finally{$.clear()}let N={variantId:z.variantId,assignmentTtlMs:0};return r.set(f,N),N}catch(_){return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getVisitorId:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},p=!1,i=new Set,a=[],d=[],h=[],y=()=>{for(let[,,f]of h.splice(0))f(null);S.length=0},S=[],b=!1,P=()=>{if(p)return;b=!0;let f=J.get(e.apiKey);(f==null?void 0:f.upgrade)===H&&J.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},O=[],K=()=>{setTimeout(()=>{var f;try{(f=O.shift())==null||f(o)}catch(v){}O.length&&K()})},L=f=>{p?O.length?O.push(f):f(o):!t&&!b&&S.length<100?S.push(f):b&&e.debug&&console.warn("[sentient] goal dropped: client released")},W={get gated(){return!p&&!t},get released(){return b&&!p},takeHeld:()=>S.splice(0),track:f=>o.track(f),goal:((f,v,w,m)=>L(_=>_.goal(f,v,w,m))),componentGoal:(f,v,w)=>o.componentGoal(f,v,w),identify:f=>o.identify(f),getAssignment:(f,v)=>o.getAssignment(f,v),isUnified:f=>{var v,w;return(w=(v=o.isUnified)==null?void 0:v.call(o,f))!=null?w:!1},assign:(f,v,w,m,_)=>o.assign(f,v,w,m,_),decide:f=>p?o.decide(f):b||t?Promise.resolve(null):new Promise(v=>h.push([f,vn(),v])),getSlotResult:f=>o.getSlotResult(f),isSlotDecided:f=>{var v,w;return(w=(v=o.isSlotDecided)==null?void 0:v.call(o,f))!=null?w:!0},getSlotConfig:f=>o.getSlotConfig(f),getSitePalette:()=>o.getSitePalette(),getStyleVocabulary:()=>{var f,v;return(v=(f=o.getStyleVocabulary)==null?void 0:f.call(o))!=null?v:null},reportSlots:(f,v,w,m)=>o.reportSlots(f,v,w,m),reportSkeleton:(f,v)=>{var w;return(w=o.reportSkeleton)==null?void 0:w.call(o,f,v)},reportAgentData:(f,v,w)=>{var m;return(m=o.reportAgentData)==null?void 0:m.call(o,f,v,w)},reportDrift:(f,v,w,m)=>{var _;return(_=o.reportDrift)==null?void 0:_.call(o,f,v,w,m)},requestSlots:(f,v,w)=>{var m;return p?(m=o.requestSlots)==null?void 0:m.call(o,f,v,w):a.push([f,v,w])},decideSlots:f=>{var v;return p?(v=o.decideSlots)==null?void 0:v.call(o,f):d.push(...f)},cancelSlots:f=>{var w;if(p)return(w=o.cancelSlots)==null?void 0:w.call(o,f);let v=new Set(f);for(let m of a)m[0]=m[0].filter(_=>!v.has(_));d=d.filter(m=>!v.has(m.id))},onSlotsChanged:f=>(i.add(f),()=>{i.delete(f)}),getPersona:()=>o.getPersona(),getVisitorId:()=>{var f,v;return(v=(f=o.getVisitorId)==null?void 0:f.call(o))!=null?v:null},fetchWeights:()=>o.fetchWeights(),getGraph:()=>o.getGraph(),flush:()=>o.flush(),dispose:()=>(P(),y(),o.dispose()),destroy:()=>(P(),y(),p?o.destroy():on(e.apiKey))};function H(f){var w,m,_;o=f,p=!0,S.length&&(O.push(...S.splice(0)),K());let v=vn();for(let[$,z,N]of h.splice(0))z!==v?N(null):f.decide($).then(N,()=>N(null));(w=f.onSlotsChanged)==null||w.call(f,()=>i.forEach($=>$()));for(let[$,z,N]of a.splice(0))$.length>0&&((m=f.requestSlots)==null||m.call(f,$,z,N));d.length>0&&((_=f.decideSlots)==null||_.call(f,d.splice(0)))}return{proxy:W,setInner:H}}function vn(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Ct(e,t,n){let s=e.get(t);if(s)return s;let c=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,c),c}function Tt(e){var Lt,Bt,Gt,Kt,$t,Ut,Ft,jt,Wt,Vt,Ht;if(typeof window=="undefined")return je;e.nonce&&Zt(e.nonce),wn=e.apiKey||"local";let t=J.get(e.apiKey||"local");if(t!=null&&t.dispose)try{t.dispose()}catch(l){}let n=e.respectDoNotTrack!==!1&&We(),s=e.consent===!1||n,c=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!c&&e.localMode!==!1)return J.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): this client is keyless/local \u2014 there is no hosted client to upgrade to. Configure a pk_ API key to enable tracking."}),s?je:mn(e);if(s){if(!e.apiKey||!e.apiKey.startsWith("pk_"))return e.preConsentBehavior==="statistical_winner"&&console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),J.set(e.apiKey||"local",{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): the client was initialized with an invalid apiKey (expected a pk_ public key) \u2014 consent cannot enable tracking."}),je;let{proxy:l,setInner:g}=Qo(e,n);return J.set(e.apiKey,{config:e,upgrade:n?null:g}),l}if(!e.apiKey||!e.apiKey.startsWith("pk_"))return console.warn("[sentient] init() called with an invalid apiKey \u2014 expected a pk_ public key. SDK disabled."),je;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),je;let r=(Lt=e.ingestUrl)!=null?Lt:En,u=Date.now(),o=et({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),p=an(void 0,e.apiKey),i=!1,a=me(e.apiKey),d=()=>!i&&me(e.apiKey)===a,h=new Set((Bt=e.initialUnified)!=null?Bt:[]),y=oe(T({},p),{get:(l,g)=>h.has(l)?null:p.get(l,g),set:(...l)=>{d()&&p.set(...l)}}),S=tn({ingestUrl:r,apiKey:e.apiKey}),b=In(r),P={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},O=new Set,K=nn({url:`${b}/goals`,apiKey:e.apiKey,headers:P,onDrop:(l,g)=>{if(!e.debug){if(O.has(g))return;O.add(g)}console.warn(`[sentient] goal dropped (HTTP ${g}) \u2014 this will not be retried. `+(g===400?"The session was not found: call init() and let the session upsert complete before firing goals.":g===401||g===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),l)}}),L=Re((Gt=navigator.userAgent)!=null?Gt:""),W=window.location.origin,H=Oe((Kt=document.referrer)!=null?Kt:"",W),V=($t=e.sessionSegment)!=null?$t:`${L}:${H}`,f=new Map,v=new Map,w=new Map,m=new Set,_=new Map,$=null,z=null,N=null,ee=new Set,ae=new Set,k=new Map,B=new Map,fe=new Set,ve=new Set,te=new Set,we=new Set,xe=null,re=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,ke=new Set,le=new Set,He=new Set,Le=new Map,pt=null,ze=new Set,Be=new Map,gt=null,Kn=2,Pt=new Map,se=!1,Dt=(l,g,E)=>{var x;let R=new Set,D=1;for(let I of l){g.delete(I);let C=((x=Pt.get(I))!=null?x:0)+1;Pt.set(I,C),C<=Kn&&(R.add(I),C>D&&(D=C))}R.size>0&&setTimeout(()=>{se||E(R)},Se(D))},ft=l=>{for(let g of l)w.has(g.id)||w.set(g.id,Me(g))};if(e.initialSlots)for(let[l,g]of Object.entries(e.initialSlots))w.set(l,g),m.add(l);if(e.initialSlotConfig)for(let[l,g]of Object.entries(e.initialSlotConfig))_.set(l,g);e.initialPalette&&($=e.initialPalette),e.initialVocabulary&&(z=e.initialVocabulary);let ce=Ce(e.apiKey);if(ce){for(let[l,g]of Object.entries(ce.slots))w.has(l)||w.set(l,g);for(let[l,g]of Object.entries((Ut=ce.slotConfig)!=null?Ut:{}))_.has(l)||_.set(l,g);!$&&ce.palette&&($=ce.palette),!z&&ce.vocabulary&&(z=ce.vocabulary)}let Nt={low:.15,medium:.5,high:.85};if(e.initialPersona)N=T({},e.initialPersona);else{let l=document.documentElement.dataset;l.sentientPersona?N={persona:l.sentientPersona,confidence:(jt=Nt[(Ft=l.sentientConfidence)!=null?Ft:"low"])!=null?jt:.15}:ce&&(N={persona:ce.persona,confidence:(Wt=Nt[ce.band])!=null?Wt:.15})}if(e.initialAssignments)for(let[l,g]of Object.entries(e.initialAssignments))y.set(l,V,{variantId:g,assignedAt:Date.now(),segment:V,confidence:1});let he=Promise.resolve(),Mt=o.getSessionId();if(Mt){let l=Pe((Vt=document.referrer)!=null?Vt:""),{utmParams:g,clickIds:E}=Xo(),R=T(T(T(T({sessionId:Mt,deviceClass:L,trafficSource:H,referrerDomain:l,utmParams:g,clickIds:E,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:De(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:o.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||nt((Ht=navigator.userAgent)!=null?Ht:"")},e.userId?{userId:e.userId}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),D=async()=>{for(let x=0;;x++){if(se||!d())return;let I=pe(5e3);try{let C=await fetch(`${b}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(R),headers:P,signal:I.signal});if(C.status===402){console.warn("[SentientUI] Session limit exceeded for this project. The bandit will stop learning until the limit resets. Upgrade at sentient-ui.com/pricing");return}if(C.ok||Ae(C)==="dropped")return}catch(C){}finally{I.clear()}if(x>=Ho){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(C=>setTimeout(C,Se(x+1)))}};try{he=D()}catch(x){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:S});let $n=zo(),Ee=null,mt=!1,X={goal(l,g={},E=1,R=0){var q,G,Y,ne,Z,Q,A;let D=o.getSessionId();if(!D||se||!d())return;let x=Vo(g)?g:{metadata:g},I=[l,(q=x.externalId)!=null?q:"",(G=x.stepIndex)!=null?G:R,(Y=x.weight)!=null?Y:E].join("\0"),C=x.value!==void 0?`${x.value}\0${(ne=x.currency)!=null?ne:""}`:null;if($n.firedBefore(I,C)){e.debug&&console.log(`[sentient] goal("${l}") already recorded for this action \u2014 not sent twice`);return}let U=xt(),M={sessionId:D,name:l,metadata:(Z=x.metadata)!=null?Z:{},weight:(Q=x.weight)!=null?Q:E,stepIndex:(A=x.stepIndex)!=null?A:R,goalId:U,value:x.value,currency:x.currency,externalId:x.externalId};e.debug&&console.log("[sentient] goal",M);let F={id:U,body:JSON.stringify(M)};he.then(()=>K.send(F))},componentGoal(l,g,E){var U,M,F;let R=o.getSessionId();if(!R||se||!d())return;let D=y.get(l,V),x=D?null:(U=w.get(l))!=null?U:null;if(!D&&x===null){e.debug&&console.warn(`[sentient] componentGoal("${l}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!D&&!m.has(l)){e.debug&&console.warn(`[sentient] componentGoal("${l}"): slot not decided this session \u2014 not attributed`);return}let I=D?D.variantId:ot(x),C={id:xt(),sessionId:R,projectId:e.apiKey,componentId:l,variantId:I,eventType:"goal_achieved",goalType:g,payload:T({reward:(M=E==null?void 0:E.reward)!=null?M:1,goalValue:E==null?void 0:E.value,currency:E==null?void 0:E.currency},(F=E==null?void 0:E.metadata)!=null?F:{}),timestamp:Date.now(),timeInSession:Date.now()-u,path:ct()};e.debug&&console.log("[sentient] componentGoal",C),he.then(()=>{!se&&d()&&S.push(C)})},identify(l){let g=o.getSessionId();!g||se||!d()||he.then(()=>{fetch(`${b}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:g,userId:l,ephemeral:o.isEphemeral()}),headers:P}).catch(()=>{})})},track(l){let g=o.getSessionId();if(!g||se||!d()||l.eventType==="variant_assigned"&&w.get(l.componentId)!==void 0&&!m.has(l.componentId)&&!y.get(l.componentId,V))return;let E=oe(T({path:ct()},l),{id:xt(),sessionId:g,timestamp:Date.now(),timeInSession:Date.now()-u});e.debug&&console.log("[sentient] track",E),he.then(()=>S.push(E))},getAssignment(l,g){return y.get(l,g)},isUnified:l=>h.has(l),async assign(l,g,E,R,D){var U;let x=o.getSessionId();if(!x)return null;let I=(D==null?void 0:D.unified)===!0;if(I&&h.has(l))return{variantId:(U=g==null?void 0:g[0])!=null?U:"",assignmentTtlMs:0,unified:!0};let C=y.get(l,V);if(C&&(g!=null&&g.length||C.content!==void 0)){let M=C.ttlMs&&C.ttlMs>0?Math.max(0,C.assignedAt+C.ttlMs-Date.now()):0;return{variantId:C.variantId,assignmentTtlMs:M,content:C.content}}return Ct(f,I?`${l}\0unified`:l,async()=>{if(!await yt(he,2500)||se||!d())return null;let M=pe(3e4);try{let F={sessionId:x,componentId:l,variantIds:g};R!==void 0?F.agentDataByVariant=R:E!==void 0&&(F.agentData=E),I&&(F.caps={unified:!0});let q=await fetch(`${b}/assign`,{method:"POST",body:JSON.stringify(F),headers:P,signal:M.signal});if(!q.ok)return null;let G=await q.json();return G.unified===!0?I?(h.add(l),{variantId:G.variantId,assignmentTtlMs:0,unified:!0}):null:(y.set(l,V,T({variantId:G.variantId,assignedAt:Date.now(),segment:V,confidence:1,content:G.content},G.assignmentTtlMs&&G.assignmentTtlMs>0?{ttlMs:G.assignmentTtlMs}:{})),G)}catch(F){return null}finally{M.clear()}})},async decide(l){var x,I;let g=o.getSessionId();if(!g)return null;let E=(x=l.slots)!=null?x:[],R={sessionId:g};l.sections&&l.sections.length>0&&(R.sections=l.sections.map(C=>({id:C}))),R.components=(I=l.components)!=null?I:[],E.length>0&&(R.slots=E.map(Fe)),l.slotsFrom==="registry"&&(R.slotsFrom="registry",l.registrySlotIds&&(R.registrySlotIds=l.registrySlotIds),l.bootstrap===!1&&(R.bootstrap=!1),l.render&&Object.keys(l.render).length>0&&(R.render=l.render)),l.v&&(R.v=l.v),typeof l.pp=="number"&&(R.pp=l.pp),e.persona&&(R.persona=e.persona);let D=JSON.stringify(R);return Ct(v,D,async()=>{var U,M,F,q,G,Y,ne,Z;if(!await yt(he,2500)||se||!d())return ft(E),null;let C=pe(3e4);try{let Q=await fetch(`${b}/decide`,{method:"POST",body:D,headers:P,signal:C.signal});if(!Q.ok)return ft(E),null;let A=await Q.json(),de=st(A.stage,e.stageAttributes);e.stageAttributes&&it(de);let Ie={};for(let j of E){let ue=(U=A.slots)==null?void 0:U[j.id];if(ue!==void 0){Ie[j.id]=ue,w.set(j.id,ue),m.add(j.id);continue}let zt=w.get(j.id);if(zt!==void 0)Ie[j.id]=zt;else{let qt=Me(j);Ie[j.id]=qt,w.set(j.id,qt)}}if(A.slots)for(let[j,ue]of Object.entries(A.slots))j in Ie||(Ie[j]=ue,w.set(j,ue),m.add(j));let Un=N!=null&&N.persona!=="unknown";A.persona&&!(A.persona==="unknown"&&Un)?N={persona:A.persona,confidence:(M=A.confidence)!=null?M:0}:N||(N={persona:"unknown",confidence:0});for(let[j,ue]of Object.entries((F=A.assignments)!=null?F:{}))y.set(j,V,{variantId:ue,assignedAt:Date.now(),segment:V,confidence:1});if(A.slotConfig)for(let[j,ue]of Object.entries(A.slotConfig))_.set(j,ue);A.palette&&($=A.palette),A.vocabulary&&(z=A.vocabulary);for(let j of(q=l.registrySlotIds)!=null?q:[])(G=A.slotConfig)!=null&&G[j]||(_.delete(j),w.delete(j),m.delete(j));return d()&&Te(e.apiKey,T(T(T(T({v:1,persona:N.persona,band:(0,It.confidenceBand)(N.confidence),slots:Object.fromEntries(w),layoutOrder:(Y=A.layoutOrder)!=null?Y:null,savedAt:Date.now()},_.size>0?{slotConfig:Object.fromEntries(_)}:{}),$?{palette:$}:{}),z?{vocabulary:z}:{}),de?{stage:de}:{})),T(T(T(T(T(T(T({layoutOrder:(ne=A.layoutOrder)!=null?ne:null,assignments:(Z=A.assignments)!=null?Z:{},slots:Ie,persona:N.persona,confidence:N.confidence},A.slotConfig?{slotConfig:A.slotConfig}:{}),A.goals?{goals:A.goals}:{}),A.sectionMap?{sectionMap:A.sectionMap}:{}),A.palette?{palette:A.palette}:{}),A.vocabulary?{vocabulary:A.vocabulary}:{}),A.stage?{stage:A.stage}:{}),A.context?{context:A.context}:{})}catch(Q){return ft(E),null}finally{C.clear()}})},getSlotResult(l){var g;return(g=w.get(l))!=null?g:null},isSlotDecided(l){return m.has(l)},getSlotConfig(l){var g;return(g=_.get(l))!=null?g:null},reportSlots(l,g,E,R){var x;let D={};for(let[I,C]of Object.entries(R!=null?R:{}))for(let U of C){let M=`${I}|${U.key}`;!re.test(I)||te.has(M)||(te.add(M),((x=D[I])!=null?x:D[I]=[]).push(U))}Object.keys(D).length>0&&fetch(`${b}/slots/observed`,{method:"POST",headers:P,body:JSON.stringify({slotIds:Object.keys(D),authoredArms:D})}).catch(()=>{});for(let I of l)if(!(typeof I!="string"||I.length===0)){if(!re.test(I)){Wo()&&!ke.has(I)&&(ke.add(I),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(I)} will not register \u2014 ids must start with a letter or digit and contain only letters, digits, '_' or '-' (max 128 chars): /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.`));continue}if(!ee.has(I)){ee.add(I),ae.add(I);let C=g==null?void 0:g[I];if(typeof C=="string"){let M=C.replace(/\s+/g," ").trim().slice(0,400);M!==""&&k.set(I,M)}let U=E==null?void 0:E[I];U!==void 0&&B.set(I,U)}}ae.size===0||xe!=null||(xe=setTimeout(()=>{xe=null;let I=[...ae];ae.clear();for(let C=0;C<I.length;C+=20){let U=I.slice(C,C+20),M={},F={};for(let q of U){let G=k.get(q);G!==void 0&&(M[q]=G,k.delete(q));let Y=B.get(q);Y!==void 0&&(F[q]=Y,B.delete(q))}fetch(`${b}/slots/observed`,{method:"POST",headers:P,body:JSON.stringify(T(oe(T(T({slotIds:U},Object.keys(M).length>0?{baselineTexts:M}:{}),Object.keys(F).length>0?{baselineSkeletons:F}:{}),{pagePaths:Object.fromEntries(U.map(q=>[q,location.pathname]))}),Object.keys(M).length>0&&o.getSessionId()?{sessionId:o.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(l,g){!re.test(l)||fe.has(l)||(fe.add(l),fetch(`${b}/slots/observed`,{method:"POST",headers:P,body:JSON.stringify({slotIds:[l],baselineSkeletons:{[l]:g}})}).catch(()=>{}))},reportAgentData(l,g,E){let R=`${l}|${g}`;!re.test(l)||we.has(R)||(we.add(R),fetch(`${b}/slots/observed`,{method:"POST",headers:P,body:JSON.stringify(T(T({slotIds:[l],agentData:{[l]:{[g]:E}}},g.startsWith("authored.")?{authoredArms:{[l]:[{key:g.slice(9)}]}}:{}),o.getSessionId()?{sessionId:o.getSessionId()}:{}))}).catch(()=>{}))},reportDrift(l,g,E,R){let D=`${l}|${g}`,x=o.getSessionId();!x||ve.has(D)||(ve.add(D),fetch(`${b}/slots/drift`,{method:"POST",headers:P,body:JSON.stringify({sessionId:x,reports:[{slotId:l,expectedFp:g,observedFp:E,reason:R}]})}).catch(()=>{}))},requestSlots(l,g,E){var R,D;for(let x of l)He.has(x)||(He.add(x),re.test(x)?Le.set(x,{text:g==null?void 0:g[x],render:(R=E==null?void 0:E.render)==null?void 0:R[x],skeleton:(D=E==null?void 0:E.skeletons)==null?void 0:D[x]}):X.reportSlots([x]));Le.size===0||pt!=null||(pt=setTimeout(()=>{pt=null;let x=[...Le];Le.clear();for(let I=0;I<x.length;I+=50){let C=x.slice(I,I+50),U={};for(let[M,F]of C)F.render&&(U[M]=F.render);X.decide({slotsFrom:"registry",registrySlotIds:C.map(([M])=>M),bootstrap:!1,render:U}).then(M=>{var F,q;if(M){let G={},Y={},ne=[];for(let[Z,Q]of C){let A=(F=M.slotConfig)==null?void 0:F[Z];if(A){A.needsSkeleton&&Q.skeleton&&((q=X.reportSkeleton)==null||q.call(X,Z,Q.skeleton));continue}ne.push(Z),Q.text&&(G[Z]=Q.text),Q.skeleton&&(Y[Z]=Q.skeleton)}ne.length>0&&X.reportSlots(ne,G,Y)}else Dt(C.map(([G])=>G),He,G=>{var Q;let Y={},ne={},Z={};for(let[A,de]of C)G.has(A)&&(de.text&&(Y[A]=de.text),de.render&&(ne[A]=de.render),de.skeleton&&(Z[A]=de.skeleton));(Q=X.requestSlots)==null||Q.call(X,[...G],Y,{render:ne,skeletons:Z})});le.forEach(G=>G())})}},0))},decideSlots(l){for(let g of l)ze.has(g.id)||(ze.add(g.id),Be.set(g.id,g));Be.size===0||gt!=null||(gt=setTimeout(()=>{gt=null;let g=[...Be.values()];Be.clear();for(let E=0;E<g.length;E+=30){let R=g.slice(E,E+30);X.decide({slots:R}).then(D=>{D||Dt(R.map(x=>x.id),ze,x=>{var I;return(I=X.decideSlots)==null?void 0:I.call(X,R.filter(C=>x.has(C.id)))}),le.forEach(x=>x())})}},0))},cancelSlots(l){for(let g of l)Le.delete(g)&&He.delete(g),Be.delete(g)&&ze.delete(g)},onSlotsChanged(l){return le.add(l),()=>{le.delete(l)}},getStyleVocabulary(){return z},getSitePalette(){return $},getVisitorId:()=>d()?o.getSessionId():null,getPersona(){return N?{persona:N.persona,confidence:N.confidence,band:(0,It.confidenceBand)(N.confidence)}:null},async fetchWeights(){var g;let l=pe(5e3);try{let E=await fetch(`${b}/weights`,{headers:P,signal:l.signal});return E.ok?(g=(await E.json()).components)!=null?g:[]:[]}catch(E){return[]}finally{l.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){S.flush(),K.flush()},dispose(){var l;Ee==null||Ee(),mt=!0,se=!0,S.destroy(),K.destroy(),((l=J.get(e.apiKey))==null?void 0:l.dispose)===X.dispose&&J.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var l;Ee==null||Ee(),mt=!0,se=!0,i=!0,Xe(e.apiKey),S.destroy({forget:!0}),K.destroy({forget:!0}),o.destroy(),y.clear(),((l=J.get(e.apiKey))==null?void 0:l.dispose)===X.dispose&&J.delete(e.apiKey);try{localStorage.removeItem(ye+e.apiKey),localStorage.removeItem($e(e.apiKey)),localStorage.removeItem(Ue(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${ie(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(g){}e.debug&&console.log("[sentient] destroyed")}};if(J.set(e.apiKey,{config:e,upgrade:null,dispose:X.dispose}),Ee=qo(X,e.apiKey,l=>{he.then(()=>{mt||kn.add(l)})}),e.debug){let l=window;l.__sentient&&(l.__sentient.client=X)}return X}var Tn="_snt_graph_edges",Jo={pricing:["features","faq"],features:["pricing"],faq:["pricing"],social_proof:["cta"],cta:["social_proof","hero","trust"],hero:["cta"],comparison:["pricing"],trust:["cta"]};function Yo(e){var t;return(t=Jo[e])!=null?t:[]}function Zo(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch(n){return t}}function er(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(n){}}var tr=new Set(["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"]);function nr(e){return tr.has(e)?e:"generic"}function At(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch(t){return"/"}}function or(e,t,n){let s=`${e}:${t}:${n.join(",")}`,c=5381;for(let r=0;r<s.length;r++)c=(c<<5)+c+s.charCodeAt(r)&4294967295;return(c>>>0).toString(16).padStart(8,"0")}function An(e){let t=new Map,n=new Map,s=`_snt_graph_nodes${ie(e==null?void 0:e.apiKey)}`,c=()=>{typeof window!="undefined"&&er(s,[...t.values()])};if(typeof window!="undefined"){let r=Zo(s,[]);for(let u of r)t.set(u.componentId,u);try{localStorage.removeItem(Tn)}catch(u){}}return{addPageNode(r){t.set(r.componentId,r),c()},addStructuralEdge(r){let u=`${r.fromComponentId}->${r.toComponentId}`;n.set(u,r)},syncOnce(){var u,o;if(!(e!=null&&e.syncUrl)||typeof window=="undefined")return;let r=[...t.values()];if(r.length!==0)try{let p=new Map;for(let y of r){let S=(u=p.get(y.semanticType))!=null?u:[];S.push(y),p.set(y.semanticType,S)}let i=[],a=new Set;for(let y of r)for(let S of Yo(y.semanticType)){let b=(o=p.get(S))!=null?o:[];for(let P of b){if(P.componentId===y.componentId)continue;let O=`semantic:${y.componentId}->${P.componentId}`;a.has(O)||(a.add(O),i.push({fromComponentId:y.componentId,toComponentId:P.componentId,type:"semantic",weight:.4,confidence:.9}))}}let d=new Set(r.map(y=>y.componentId));for(let y of n.values()){if(!d.has(y.fromComponentId)||!d.has(y.toComponentId))continue;let S=`structural:${y.fromComponentId}->${y.toComponentId}`;a.has(S)||(a.add(S),i.push({fromComponentId:y.fromComponentId,toComponentId:y.toComponentId,type:"structural",weight:y.weight,confidence:1}))}let h=oe(T(T({pageUrl:At(window.location.href)},e.sessionId?{sessionId:e.sessionId}:{}),e.projectId?{projectId:e.projectId}:{}),{nodes:r.map(y=>{let S=nr(y.semanticType);return{componentId:y.componentId,semanticType:S,answers:y.answers,contentHash:or(y.componentId,S,y.answers),prominenceScore:y.prominenceScore,depthInPage:y.depth}}),edges:i});fetch(e.syncUrl,{method:"POST",keepalive:!0,headers:T({"Content-Type":"application/json"},e.apiKey?{Authorization:`Bearer ${e.apiKey}`}:{}),body:JSON.stringify(h)}).catch(()=>{})}catch(p){}},snapshot(){return{pageNodes:[...t.values()],capturedAt:Date.now()}},destroy(){if(typeof window!="undefined")try{localStorage.removeItem(s),localStorage.removeItem(Tn)}catch(r){}}}}var rr=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function _t(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function sr(e){return{tag:e.tagName.toLowerCase(),text:_t(e).slice(0,40)}}function _n(e){return e.replace(/["\\\]]/g,"\\$&")}function Ve(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function Rn(e,t){var u;let n=e.tagName.toLowerCase();if(!n)return null;let s=((u=e.getAttribute("class"))!=null?u:"").split(/\s+/).filter(o=>/^[a-zA-Z][\w-]*$/.test(o)),c=[n,...s.map(o=>`${n}.${o}`)];for(let o of c)if(Ve(t,o))return o;let r=e.parentElement;if(r&&r!==t){let o=Rn(r,t);if(o){for(let d of c){let h=`${o} > ${d}`;if(Ve(t,h))return h}let p=Array.from(r.children).filter(d=>d.tagName.toLowerCase()===n),i=p.indexOf(e),a=p.some(d=>d!==e&&_t(d)!==_t(e));if(i>=0&&a){let d=`${o} > ${n}:nth-of-type(${i+1})`;if(Ve(t,d))return d}}}return null}function dt(e,t){let n=sr(e),s=e.getAttribute("id");if(s&&Ve(t,`#${_n(s)}`))return{v:1,id:s,fingerprint:n};for(let r of rr){let u=e.getAttribute(r);if(u&&Ve(t,`[${r}="${_n(u)}"]`))return{v:1,dataAttr:{name:r,value:u},fingerprint:n}}let c=Rn(e,t);return c?{v:1,selector:c,fingerprint:n}:null}var Pn=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],ir={banner:"hero",navigation:"navigation",contentinfo:"footer"};function ar(e){let t=e.ariaRole?ir[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function lr(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var cr=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],dr=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|free returns?|returns? within|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]],On={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function ur(e){var n;let t=e.querySelector("h1, h2, h3");return((n=t==null?void 0:t.textContent)!=null?n:"").slice(0,160)}function pr(e){var c,r;let t=ar(e);if(t)return{type:(c=On[t])!=null?c:"generic",strength:"strong"};let n=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[u,o]of cr)if(o.test(n))return{type:u,strength:"strong"};for(let[u,o]of dr)if(o.test(e.bodyText))return{type:u,strength:"strong"};let s=lr(e);return{type:(r=On[s])!=null?r:"generic",strength:"weak"}}function gr(e){var s,c;let t=((s=e.textContent)!=null?s:"").replace(/\s+/g," ").trim(),n=e.getAttribute("role");return T({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((c=e.className)!=null?c:"")}`,headingText:ur(e),bodyText:t.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:t.length},n?{ariaRole:n}:{})}function Dn(e){return pr(gr(e)).type}var fr=new Set(["SECTION","ARTICLE","MAIN","DIV","ASIDE"]),mr=200,yr="h1, h2, h3",Sr="[data-sentient-id], section[aria-label], article[aria-label], main[aria-label], aside[aria-label]",Nn=30,hr=1500,br={scan:async()=>({nodes:[],edges:[],scannedAt:0}),observe:()=>{},getProminenceScore:()=>0,destroy:()=>{}};function Mn(e,t,n){return n<=t?0:Math.max(0,Math.min(1,(e-t)/(n-t)))}function vr(e){var t,n,s;try{let c=e;for(let r of Object.keys(c)){if(!r.startsWith("__reactFiber")&&!r.startsWith("__reactInternalInstance"))continue;let u=c[r],o=(s=(t=u==null?void 0:u.type)==null?void 0:t.displayName)!=null?s:(n=u==null?void 0:u.type)==null?void 0:n.name;if(o&&o.length>1)return o}}catch(c){}}function Er(e){let t={};for(let n of Array.from(e.attributes))n.name.startsWith("data-")&&(t[n.name]=n.value);return t}var Rt=new Set(Pn);function wr(e,t){let n=e.getAttribute("data-sentient-id"),s=n?t==null?void 0:t[n]:void 0;if(s&&Rt.has(s))return s;let c=e.getAttribute("data-sentient-type");if(c&&Rt.has(c))return c;let r=e.getAttribute("role");return r&&Rt.has(r)?r:Dn(e)}function xr(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)&4294967295;return(t>>>0).toString(16).padStart(8,"0")}function kr(e){let t=[],n=e;for(;n;){let s=n.parentElement;if(!s){t.push(n.tagName.toLowerCase());break}let c=Array.prototype.indexOf.call(s.children,n);t.push(`${n.tagName.toLowerCase()}[${c}]`),n=s}return t.reverse().join("/")}function Ir(e){var n;let t=(n=e.getAttribute("data-sentient-id"))!=null?n:e.getAttribute("id");return t||`${e.tagName.toLowerCase()}-${xr(kr(e))}`}function Cr(e){let t=0,n=e.parentElement;for(;n;)t++,n=n.parentElement;return t}function Ot(e,t,n){var c,r,u,o;let s=e.querySelector(yr);return{componentId:Ir(e),semanticType:wr(e,n),ariaLabel:(c=e.getAttribute("aria-label"))!=null?c:void 0,headingText:(u=(r=s==null?void 0:s.textContent)==null?void 0:r.trim())!=null?u:void 0,isAboveFold:e.getBoundingClientRect().top<window.innerHeight,prominenceScore:t(e),depth:Cr(e),reactComponentName:vr(e),dataAttributes:Er(e),locator:(o=dt(e,e.ownerDocument))!=null?o:void 0}}function Ln(e){var r;let t=[],n=new Set,s="__root__",c=new Map;for(let[u,o]of e){let p=u.parentElement,i=s;for(;p;){if(e.has(p)){i=e.get(p);let d=e.get(u),h=`${i}->${d}`;!n.has(h)&&i!==d&&(n.add(h),t.push({fromComponentId:i,toComponentId:d,weight:.6}));break}p=p.parentElement}let a=(r=c.get(i))!=null?r:[];a.push(u),c.set(i,a)}for(let u of c.values()){if(u.length<2)continue;let o=u.length>Nn?u.slice(0,Nn):u;for(let p=0;p<o.length;p++)for(let i=p+1;i<o.length;i++){if(t.length>=hr)return t;let a=e.get(o[p]),d=e.get(o[i]);if(a===d)continue;let h=`${a}->${d}::sib`,y=`${d}->${a}::sib`;n.has(h)||(n.add(h),t.push({fromComponentId:a,toComponentId:d,weight:.3})),n.has(y)||(n.add(y),t.push({fromComponentId:d,toComponentId:a,weight:.3}))}}return t}function Tr(e,t){let n=[],s=new Set,c=new Map;return document.querySelectorAll("[data-sentient-id]").forEach(o=>{if(o instanceof Element&&!s.has(o)){s.add(o);let p=Ot(o,e,t);n.push(p),c.set(o,p.componentId)}}),document.querySelectorAll("section, article, main, aside").forEach(o=>{if(!(o instanceof Element)||s.has(o))return;let p=o.hasAttribute("aria-label"),i=o.hasAttribute("data-sentient-id");if(!p&&!i)return;s.add(o);let a=Ot(o,e,t);n.push(a),c.set(o,a.componentId)}),{nodes:n,edges:Ln(c),elementToId:c}}function Bn(e={}){let{sectionTypes:t}=e;if(typeof window=="undefined")return br;let n=null,s=0,c=null,r=new Map,u=y=>{try{let S=window.getComputedStyle(y),b=parseFloat(S.fontSize)||12,P=parseFloat(S.zIndex)||0,O=y.getBoundingClientRect(),K=Math.max(O.top,0),L=window.innerHeight||1,W=1/(K/L+1),H=Mn(b,12,48)*.4+W*.4+Mn(P,0,100)*.2;return Math.max(0,Math.min(1,H))}catch(S){return .5}},o=()=>new Promise(y=>{let S=()=>{let{nodes:b,edges:P,elementToId:O}=Tr(u,t);r.clear();for(let[K,L]of O)r.set(K,L);y({nodes:b,edges:P,scannedAt:Date.now()})};try{typeof requestIdleCallback=="function"?s=requestIdleCallback(S,{timeout:100}):S()}catch(b){S()}}),p=new Set,i=null,a=()=>{i=null;let y=[...p];p.clear();let S=[],b=new Set;for(let O of y){if(!O.isConnected)continue;let K=[];fr.has(O.tagName)&&(O.hasAttribute("data-sentient-id")||O.hasAttribute("aria-label"))&&K.push(O);try{O.querySelectorAll(Sr).forEach(L=>K.push(L))}catch(L){}for(let L of K){if(r.has(L))continue;let W=Ot(L,u,t);S.push(W),b.add(W.componentId),r.set(L,W.componentId)}}if(S.length===0||!c)return;for(let O of[...r.keys()])O.isConnected||r.delete(O);let P=Ln(r).filter(O=>b.has(O.fromComponentId)||b.has(O.toComponentId));c({nodes:S,edges:P,addedAt:Date.now()})};return{scan:o,observe:y=>{c=y;try{n=new MutationObserver(S=>{for(let b of S)b.type==="childList"&&b.addedNodes.forEach(P=>{P instanceof Element&&p.add(P)});p.size>0&&i===null&&(i=setTimeout(a,mr))}),n.observe(document.body,{childList:!0,subtree:!0})}catch(S){}},getProminenceScore:u,destroy:()=>{if(n&&(n.disconnect(),n=null),i!==null&&clearTimeout(i),i=null,p.clear(),s&&typeof cancelIdleCallback=="function")try{cancelIdleCallback(s)}catch(y){}s=0,c=null,r.clear()}}}var Ar="https://api.sentient-ui.com/v1/events";function _r(e){var n;let t=s=>{try{let c=document.cookie.match(new RegExp(`(?:^|; )${s}=([^;]*)`));return c?decodeURIComponent(c[1]):void 0}catch(c){return}};return(n=e?t(be(e)):void 0)!=null?n:t(ge)}var ut=new Map;function Gn(e){var y;let t=Tt(e),n=e.respectDoNotTrack!==!1&&We(),s=e.consent===!1||n,c=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_"),r=e.localMode===!0||!c;if(!e.graph||r||typeof window=="undefined")return t;if(s)return n||xn(e.apiKey,S=>Gn(S)),t;let u=ut.get(e.apiKey);if(u)try{u()}catch(S){}let o=Bn({sectionTypes:e.sectionTypes}),p=(y=e.ingestUrl)!=null?y:Ar,i=An({syncUrl:p.replace(/\/events\/?$/,"/graph/sync"),apiKey:e.apiKey,projectId:e.apiKey,sessionId:_r(e.apiKey)});o.scan().then(S=>{for(let b of S.nodes)i.addPageNode({id:b.componentId,componentId:b.componentId,semanticType:b.semanticType,answers:e.captureDomText&&b.headingText?[b.headingText]:[],prominenceScore:b.prominenceScore,depth:b.depth});for(let b of S.edges)i.addStructuralEdge(b);i.syncOnce()});let a=null,d=()=>{a!==null&&clearTimeout(a),a=setTimeout(()=>{a=null,i.syncOnce()},500)};o.observe(S=>{for(let b of S.nodes)i.addPageNode({id:b.componentId,componentId:b.componentId,semanticType:b.semanticType,answers:e.captureDomText&&b.headingText?[b.headingText]:[],prominenceScore:b.prominenceScore,depth:b.depth});for(let b of S.edges)i.addStructuralEdge(b);d()});let h=()=>{a!==null&&(clearTimeout(a),a=null),o.destroy(),i.destroy(),ut.get(e.apiKey)===h&&ut.delete(e.apiKey)};return ut.set(e.apiKey,h),oe(T({},t),{getGraph:()=>i.snapshot(),dispose:()=>{h(),t.dispose()},destroy:()=>{h(),t.destroy()}})}0&&(module.exports={BLOCK_ALIGNS,BLOCK_EMPHASES,BLOCK_FITS,BLOCK_GAPS,BLOCK_GRID_COLUMNS,BLOCK_HEADING_LEVELS,BLOCK_JUSTIFIES,BLOCK_MAX_WIDTHS,BLOCK_PADS,BLOCK_RATIOS,BLOCK_SIZES,BLOCK_SURFACES,BLOCK_TEXT_ALIGNS,BLOCK_TONES,BLOCK_WEIGHTS,FORM_FIELD_KINDS,FORM_INPUT_TYPES,LEGACY_SESSION_COOKIE_NAME,MAX_BLOCK_ARMS,MAX_BLOCK_CHILDREN,MAX_BLOCK_DEPTH,MAX_BLOCK_NODES,MAX_BLOCK_TEXT_LEN,MAX_FORM_FIELDS,MAX_FORM_SELECT_OPTIONS,SNAPSHOT_STORAGE_KEY_PREFIX,STAGE_ATTRIBUTE,armOfResult,attachMicroSignalDetectors,baselineResultFor,baselineSlots,containsFormBlock,deriveSessionSegment,detectDeviceClass,detectTimeOfDay,detectTrafficSource,exposedStage,grantConsent,init,isDoNotTrackEnabled,locatorFromElement,readSnapshot,referrerDomainFromReferer,renderPrePaintScript,sanitizePageUrl,sessionCookieName,setStageAttribute,toWireSlot,writeSnapshot});
2
2
  //# sourceMappingURL=index-graph.js.map