@sentientui/snippet 0.32.3 → 0.33.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.
- package/README.md +36 -8
- package/dist/editor.global.js +9 -9
- package/dist/engagement.global.js +1 -1
- package/dist/install.cjs +2 -2
- package/dist/install.d.cts +28 -5
- package/dist/install.d.ts +28 -5
- package/dist/install.js +2 -2
- package/dist/preview.global.js +1 -1
- package/dist/snippet.global.js +2 -2
- package/package.json +2 -2
package/dist/snippet.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var SentientSnippet=(()=>{var Nt=Object.defineProperty,jo=Object.defineProperties,Go=Object.getOwnPropertyDescriptor,Fo=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertyNames,cr=Object.getOwnPropertySymbols;var fr=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable;var dr=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))fr.call(t,n)&&dr(e,n,t[n]);if(cr)for(var n of cr(t))zo.call(t,n)&&dr(e,n,t[n]);return e},Ke=(e,t)=>jo(e,Fo(t));var pr=(e,t)=>()=>(e&&(t=e(e=0)),t);var mr=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Wo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Uo(t))!fr.call(e,o)&&o!==n&&Nt(e,o,{get:()=>t[o],enumerable:!(r=Go(t,o))||r.enumerable});return e};var Vo=e=>Wo(Nt({},"__esModule",{value:!0}),e);var ei,ti,ni,br,ri,oi,Sr,F,qe,kn=pr(()=>{"use strict";ei=Object.defineProperty,ti=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,br=Object.getOwnPropertySymbols,ri=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,Sr=(e,t,n)=>t in e?ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t)=>{for(var n in t||(t={}))ri.call(t,n)&&Sr(e,n,t[n]);if(br)for(var n of br(t))oi.call(t,n)&&Sr(e,n,t[n]);return e},qe=(e,t)=>ti(e,ni(t))});var Tr={};mr(Tr,{LOCAL_ENGINE_AVAILABLE:()=>li,createLocalEngine:()=>ui});function ui(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var li,Lr=pr(()=>{"use strict";li=!1});var xs={};mr(xs,{applyPersonaAttributes:()=>en,applyRegistrySlots:()=>rn,applySlotArms:()=>nn,applySlotAttributes:()=>tn,consentWatcher:()=>Xe,parseSnippetConfig:()=>Jt,planReorder:()=>sn,reapply:()=>Ot,run:()=>Mo,version:()=>Et});function ze(e){return e?`_${e.slice(0,12)}`:""}var We="_snt_uid";function mt(e){return`${We}${ze(e)}`}var Sn="__sntForgetGen",Ho=()=>{try{return window[Sn]}catch(e){return}};function Dt(e){var t,n;try{let r=window,o=(t=r[Sn])!=null?t:r[Sn]={};o[e]=((n=o[e])!=null?n:0)+1}catch(r){}}function fe(e){var t,n;return(n=(t=Ho())==null?void 0:t[e])!=null?n:0}var rt="_snt_snap:",qo=["low","medium","high"];function ot(e){try{let t=localStorage.getItem(rt+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"||!qo.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 r=n.vocabulary;return r!==void 0&&(typeof r!="object"||r===null||!Array.isArray(r.entries)||!Array.isArray(r.images))&&delete n.vocabulary,n}catch(t){return null}}function He(e,t){try{localStorage.setItem(rt+e,JSON.stringify(t))}catch(n){}}function je(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function _n(e,t){return new Promise(n=>{let r=setTimeout(()=>n(!1),t),o=()=>{clearTimeout(r),n(!0)};e.then(o,o)})}function Ve(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function Mt(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 gr(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let r=JSON.parse(n);return Array.isArray(r)?(localStorage.removeItem(e),r.slice(-t)):[]}catch(n){return[]}}function wn(e,t,n){try{let r=(()=>{try{let s=localStorage.getItem(n);if(!s)return[];let a=JSON.parse(s);return Array.isArray(a)?a:[]}catch(s){return[]}})(),o=new Map;for(let s of r)o.set(s.id,s);for(let s of e)o.set(s.id,s);localStorage.setItem(n,JSON.stringify([...o.values()].slice(-t)))}catch(r){}}function hr(e,t){try{let n=localStorage.getItem(t);if(!n)return;let r=JSON.parse(n);if(!Array.isArray(r))return;let o=new Set(e),s=r.filter(a=>!o.has(a.id));if(s.length===r.length)return;s.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(s))}catch(n){}}var Jo=500,Yo=56*1024;function $t(e){return`_snt_retry_${e.slice(0,12)}`}var Xo={push:()=>{},flush:()=>{},destroy:()=>{}};function yr(e){var t,n,r;if(typeof window=="undefined")return Xo;let o=(t=e.flushIntervalMs)!=null?t:5e3,s=(n=e.maxBatchSize)!=null?n:20,a=(r=e.maxRetrySize)!=null?r:100,u=e.ingestUrl,i=e.apiKey,c=$t(i),l=!1,p=fe(i),h=(...I)=>{!l&&fe(i)===p&&wn(...I)},S=[],w=new Set,b=[],K=I=>{for(let $ of I)L.delete($),!w.has($)&&(w.add($),b.push($));for(;b.length>Jo;){let $=b.shift();$&&w.delete($)}hr(I,c)},L=new Set,D=()=>{for(;S.length>a;){let I=S.shift();I&&L.delete(I.id)}},E=I=>{w.has(I.id)||L.has(I.id)||(L.add(I.id),S.push(I),D())},x=I=>{for(let $ of I)w.has($.id)||(L.add($.id),S.push($));D()},A=gr(c,a);for(let I of A)E(I);let P=0,g=0,v=(I,$=!0)=>{if(I.length===0)return;let ne=JSON.stringify(I),ue=I.map(Me=>Me.id),Q,we=je(15e3);try{Q=fetch(u,{method:"POST",keepalive:!0,signal:we.signal,body:ne,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})}catch(Me){h(I,a,c),x(I),g++,P=Date.now()+Ve(g);return}Promise.resolve(Q).then(we.clear,we.clear);let ee=Me=>{if(Mt(Me)!=="retry"){if(!Me.ok&&$){let $e=I.filter(Le=>Le.eventType!=="pageview");if($e.length>0&&$e.length<I.length){K(I.filter(Le=>Le.eventType==="pageview").map(Le=>Le.id)),v($e,!1);return}}K(ue),g=0,P=0;return}h(I,a,c),x(I),g++,P=Date.now()+Ve(g)};Q&&typeof Q.then=="function"?Q.then(ee).catch(()=>{h(I,a,c),x(I),g++,P=Date.now()+Ve(g)}):ee(Q)},d=typeof TextEncoder!="undefined"?new TextEncoder:null,m=I=>d?d.encode(I).length:I.length,O=I=>{let $=[],ne=2;for(let ue of I){let Q=m(JSON.stringify(ue))+1;if($.length>0&&ne+Q>Yo||$.length>=s)break;$.push(ue),ne+=Q}return $},M=()=>{try{if(Date.now()<P)return;for(;S.length>0&&!(Date.now()<P);){let I=S.filter(ne=>!w.has(ne.id));if(S.length=0,I.length===0)break;let $=O(I);if($.length===0)break;$.length<I.length&&S.push(...I.slice($.length)),v($)}}catch(I){}},q=!0,J=null;J=setInterval(()=>{q&&M()},o);let Y=()=>{document.visibilityState==="hidden"&&M()},Ae=()=>{M()};return document.addEventListener("visibilitychange",Y),window.addEventListener("pagehide",Ae),{push(I){E(I),S.length>=s&&M()},flush:M,destroy(I){I!=null&&I.forget&&(l=!0),q=!1,J!==null&&(clearInterval(J),J=null),document.removeEventListener("visibilitychange",Y),window.removeEventListener("pagehide",Ae),M()}}}var Zo=200;function Bt(e){return`_snt_goal_retry_${e.slice(0,12)}`}var Qo={send:()=>{},flush:()=>{},destroy:()=>{}};function vr(e){var t,n,r;if(typeof window=="undefined")return Qo;let o=(t=e.flushIntervalMs)!=null?t:5e3,s=(n=e.maxRetrySize)!=null?n:100,a=(r=e.maxPerFlush)!=null?r:5,u=Bt(e.apiKey),i=!1,c=fe(e.apiKey),l=(...m)=>{!i&&fe(e.apiKey)===c&&wn(...m)},p=[],h=new Set,S=new Set,w=[],b=0,K=0,L=!1,D=m=>{for(h.delete(m.id),S.has(m.id)||(S.add(m.id),w.push(m.id));w.length>Zo;){let O=w.shift();O&&S.delete(O)}hr([m.id],u)},E=m=>{l([m],s,u),!S.has(m.id)&&!h.has(m.id)&&(h.add(m.id),p.push(m)),Date.now()>=b&&(K++,b=Date.now()+Ve(K))},x=m=>{let O,M=je(15e3);try{O=fetch(e.url,{method:"POST",keepalive:!0,signal:M.signal,body:m.body,headers:e.headers})}catch(J){E(m);return}let q=J=>{var Y;let Ae=Mt(J);if(Ae==="retry"){E(m);return}Ae==="dropped"&&((Y=e.onDrop)==null||Y.call(e,m,J.status)),D(m),K=0,b=0};Promise.resolve(O).then(M.clear,M.clear),O&&typeof O.then=="function"?O.then(q).catch(()=>E(m)):q(O)},A=()=>{try{if(L||Date.now()<b)return;let m=0;for(;p.length>0&&m<a&&!(Date.now()<b);){let O=p.shift();h.delete(O.id),!S.has(O.id)&&(m++,x(O))}}catch(m){}},P=gr(u,s);for(let m of P)h.has(m.id)||(h.add(m.id),p.push(m));P.length>0&&wn(P,s,u);let g=setInterval(A,o),v=()=>{document.visibilityState==="hidden"&&A()},d=()=>A();return document.addEventListener("visibilitychange",v),window.addEventListener("pagehide",d),{send(m){if(L){S.has(m.id)||l([m],s,u);return}if(!(S.has(m.id)||h.has(m.id))){if(Date.now()<b){l([m],s,u),h.add(m.id),p.push(m);return}x(m)}},flush:A,destroy(m){m!=null&&m.forget&&(i=!0),clearInterval(g),document.removeEventListener("visibilitychange",v),window.removeEventListener("pagehide",d),A(),L=!0}}}function it(e){if(typeof window=="undefined"||!e)return!1;Dt(e);let t=!1,n=mt(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let a=location.protocol==="https:"?"; Secure":"";document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${a}`,t=!0}}catch(a){}let r=ze(e),o=[n,"_snt_graph_edges",rt+e,$t(e),Bt(e),`_snt_graph_nodes${r}`],s=[`_snt_asgn${r}_`];for(let a of["localStorage","sessionStorage"])try{let u=window[a];for(let i of o)u.getItem(i)!==null&&(u.removeItem(i),t=!0);for(let i=u.length-1;i>=0;i--){let c=u.key(i);c&&s.some(l=>c.startsWith(l))&&(u.removeItem(c),t=!0)}}catch(u){}try{(new RegExp(`(?:^|; )${We}=[^;]`).test(document.cookie)||localStorage.getItem(We)!==null||sessionStorage.getItem(We)!==null)&&localStorage.setItem(`${We}_tomb${r}`,"1")}catch(a){}return t}kn();function Kt(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function wr(e){if(e.length===0)return null;let t={};for(let n of e.split("|")){let r=n.indexOf("=");if(r<=0||r!==n.lastIndexOf("=")||r===n.length-1)return null;let o=n.slice(0,r);if(o in t)return null;t[o]=n.slice(r+1)}return t}function En(e){var t,n,r;if(e.arms)return typeof e.baseline=="string"?e.baseline:(t=e.arms[0])!=null?t:"";if(e.baseline!==void 0&&typeof e.baseline=="object")return Kt(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[s,a]of Object.entries((n=e.dims)!=null?n:{}))o[s]=(r=a[0])!=null?r:"";return Kt(o)}function _r(e,t){var n,r;return e.dims!=null?(r=(n=wr(t))!=null?n:wr(En(e)))!=null?r:{}:t}function Je(e){return e>=.3?e<.7?"medium":"high":"low"}var ii=["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 kr(e){return si(e)!==null}function si(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=ii.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Er(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 xr(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(o){}let r=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(r)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(r)?"social":"referral"}catch(n){return"direct"}}function Ar(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var ai=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Cr(e){let t={},n={};try{let r=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([o,s])=>{let a=Array.isArray(s)?s[0]:s;return a===void 0?[]:[[o,a]]});for(let[o,s]of r)o.startsWith("utm_")?o in t||(t[o]=s):ai.includes(o)&&(o in n||(n[o]=s))}catch(r){}return{utmParams:t,clickIds:n}}function Ir(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function xn(e){return F(F(F({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 An(e){let t=xn(e);return _r(t,En(t))}function Or(e){return typeof e=="string"?e:Kt(e)}kn();var Pn;function zt(e){Pn=typeof e=="string"&&e!==""?e:void 0}function Mr(e=document){if(Pn)return Pn;try{let t=e.querySelector("script[nonce]");return(t==null?void 0:t.nonce)||(t==null?void 0:t.getAttribute("nonce"))||void 0}catch(t){return}}function Ge(e,t=document){let n=Mr(t);return n&&e.setAttribute("nonce",n),e}function $r(){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 Pr="_snt_uid",ci=365,st="_snt_uid";function di(){return $r()}function Cn(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function Dn(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function fi(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${Dn()}`}catch(r){}}function jt(e){try{return localStorage.getItem(e)}catch(t){return null}}function Rr(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function In(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function pi(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function mi(e){try{sessionStorage.removeItem(e)}catch(t){}}function gi(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${Dn()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function hi(e){try{localStorage.removeItem(e)}catch(t){}}function yi(e){try{document.cookie=`${e}=; max-age=0; SameSite=lax; path=/${Dn()}`}catch(t){}}var vi={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function Br(e){var t,n,r,o,s,a,u;if(typeof window=="undefined")return vi;let i=ze(e==null?void 0:e.apiKey),c=(t=e==null?void 0:e.cookieName)!=null?t:mt(e==null?void 0:e.apiKey),l=`${st}${i}`,p=`${st}_tomb${i}`,h=((n=e==null?void 0:e.cookieTTLDays)!=null?n:ci)*24*60*60,S=x=>x&&x.length>0?x:null,w=()=>{var x,A;return i&&!(e!=null&&e.cookieName)&&jt(p)===null?(A=(x=S(Cn(Pr)))!=null?x:S(jt(st)))!=null?A:S(In(st)):null},b=(u=(a=(s=(o=(r=S(Cn(c)))!=null?r:S(jt(l)))!=null?o:S(In(l)))!=null?s:w())!=null?a:S(e==null?void 0:e.ssrSessionId))!=null?u:di();fi(c,b,h);let K=Rr(l,b),L=gi(c),D=K?!1:pi(l,b),E=!K&&!L&&!D;return{getSessionId:()=>b,isEphemeral:()=>E,destroy:()=>{b=null,yi(c),hi(l),mi(l),i&&!(e!=null&&e.cookieName)&&(Cn(Pr)!==null||jt(st)!==null||In(st)!==null)&&Rr(p,"1")}}}var bi=1800*1e3;function Gt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Si(e=bi,t){let n=new Map,r=`_snt_asgn${ze(t)}_`,o=(i,c)=>`${r}${encodeURIComponent(i)}:${encodeURIComponent(c)}`,s=i=>{let c=i.slice(r.length),l=c.indexOf(":");if(l<0)return null;try{return{componentId:decodeURIComponent(c.slice(0,l)),segment:decodeURIComponent(c.slice(l+1))}}catch(p){return null}},a=()=>{try{let i=[];for(let c=0;c<localStorage.length;c++){let l=localStorage.key(c);l!=null&&l.startsWith(r)&&i.push(l)}return i}catch(i){return[]}},u=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of a())try{let c=localStorage.getItem(i);if(!c)continue;let l=JSON.parse(c);if(u(l)){localStorage.removeItem(i);continue}let p=s(i);if(!p)continue;n.set(Gt(p.componentId,p.segment),l)}catch(c){}})(),{get(i,c){let l=n.get(Gt(i,c));return l?u(l)?(n.delete(Gt(i,c)),null):l:null},set(i,c,l){let p=Gt(i,c);n.set(p,l);try{localStorage.setItem(o(i,c),JSON.stringify(l))}catch(h){}},clear(){n.clear();for(let i of a())try{localStorage.removeItem(i)}catch(c){}}}}var Rn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",Kr="[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.",Nr=!1,Ft=!1;function wi(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function _i(e){var t;let n=Br({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),r=(t=n.getSessionId())!=null?t:"local",o=wi(),s=Promise.resolve().then(()=>(Lr(),Tr)).then(l=>{let p=l;return p.LOCAL_ENGINE_AVAILABLE?(Nr||(Nr=!0,console.info(Kr)),p):(Ft||(Ft=!0,console.error(Rn)),null)}).catch(()=>(Ft||(Ft=!0,console.error(Rn)),null)),a=null,u={low:.15,medium:.5,high:.85},i=(()=>{var l;if(e.initialPersona)return F({},e.initialPersona);let p=ot(e.apiKey||"local");return p?{persona:p.persona,confidence:(l=u[p.band])!=null?l:.15}:null})();function c(l){let p=document.documentElement;p.dataset.sentientPersona===void 0&&(p.dataset.sentientPersona=l.persona,p.dataset.sentientConfidence=Je(l.confidence))}return{isLocal:!0,async decide(l){var p,h,S;let w=await s;if(!w)return null;let b=w.createLocalEngine({sessionId:r,forcedPersona:o}).decide(l);return a=qe(F({},b),{layoutOrder:(h=(p=b.layoutOrder)!=null?p:a==null?void 0:a.layoutOrder)!=null?h:null,slots:F(F({},(S=a==null?void 0:a.slots)!=null?S:{}),b.slots)}),He(e.apiKey||"local",{v:1,persona:a.persona,band:Je(a.confidence),slots:a.slots,layoutOrder:a.layoutOrder,savedAt:Date.now()}),c(b),b},getSlotResult(l){var p,h,S;return(S=(h=a==null?void 0:a.slots[l])!=null?h:(p=e.initialSlots)==null?void 0:p[l])!=null?S:null},getSlotConfig(l){var p,h;return(h=(p=e.initialSlotConfig)==null?void 0:p[l])!=null?h:null},getSitePalette(){var l;return(l=e.initialPalette)!=null?l:null},reportSlots(){},getPersona(){let l=a!=null?a:i;return l?{persona:l.persona,confidence:l.confidence,band:Je(l.confidence)}:null},async assign(l,p){var h;let S=await s;return!S||!p||p.length===0?p!=null&&p[0]?{variantId:p[0],assignmentTtlMs:0}:null:{variantId:(h=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:l,variantIds:p}]}).assignments[l])!=null?h:p[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>n.destroy()}}var Wt=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function On(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Mn(e,t){if(e===void 0||!Wt.test(e))return!1;if(e==="*")return!0;let n=On(t);if(e.endsWith("/*")){let r=On(e.slice(0,-2));return n.startsWith(r==="/"?"/":`${r}/`)&&n!==r}return n===On(e)}function ht(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(ht):!1}var Dr="sentient-reveal",at="sentient-revealed",jr=240,Tn=!1;function ki(e){if(Tn||e.getElementById(Dr)){Tn=!0;return}let t=Ge(e.createElement("style"),e);t.id=Dr,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${at}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${at}{animation:${at} ${jr}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),Tn=!0}function $n(e,t={}){var n;let r=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!r||!(e instanceof Element)||(t.arm!==void 0&&e.setAttribute("data-sentient-arm",t.arm),t.persona!==void 0&&e.setAttribute("data-sentient-persona",t.persona),t.previous!==void 0&&t.previous===e.textContent))return!1;ki(r),e.classList.remove(at),e.offsetWidth,e.classList.add(at);let o=()=>{e.classList.remove(at),e.removeEventListener("animationend",o)};return e.addEventListener("animationend",o),!0}function Bn(e,t,n,r){let o=[];{let s=!1,a=[],u=()=>{if(s)return;let i=Date.now();for(a.push(i);a.length>0&&i-a[0]>500;)a.shift();a.length>=3&&(s=!0,e("rage_click"))};t.addEventListener("click",u),o.push(()=>t.removeEventListener("click",u))}{let s=!1,a=u=>{if(s||!(u.target instanceof Node)||!t.contains(u.target)&&t!==u.target)return;s=!0;let i=typeof window!="undefined"?window.getSelection():null,c=i?i.toString().length:0;e("text_copy",{selectionLength:c})};document.addEventListener("copy",a),o.push(()=>document.removeEventListener("copy",a))}{let s=!1,a=!1,u=null,i=()=>{u!==null&&(clearTimeout(u),u=null)},c=()=>{s||!a||(i(),u=setTimeout(()=>{!s&&a&&(s=!0,e("scroll_hesitation"))},3e3))},l=()=>{i(),c()},p=S=>{for(let w of S)a=w.intersectionRatio>.3,a?c():i()},h=new IntersectionObserver(p,{threshold:[.3]});h.observe(t),window.addEventListener("scroll",l,{passive:!0}),o.push(()=>{h.disconnect(),window.removeEventListener("scroll",l),i()})}if((r==null?void 0:r.tabLoss)!==!1){let s=!1,a=n!=null?n:Date.now(),u=()=>{if(s||document.visibilityState!=="hidden")return;let i=Date.now()-a;i<15e3&&(s=!0,e("tab_loss",{timeOnPage:i}))};document.addEventListener("visibilitychange",u),o.push(()=>document.removeEventListener("visibilitychange",u))}return()=>{for(let s of o)s()}}function Ei(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var Gr="https://api.sentient-ui.com/v1/events",pe=new Map,Fr=null;function xi(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Ai=3;function Ln(){return $r()}function Ut(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Ci(){let e=new WeakMap,t=new Map,n=!1,r=(u,i,c)=>{let l=u.get(i);return c===null?l?!0:(u.set(i,new Set),!1):l?l.has(c)?!0:(l.add(c),!1):(u.set(i,new Set([c])),!1)},o=typeof window!="undefined"&&"event"in window,s=()=>{if(!o)return;let u=window.event;return typeof Event=="function"&&u instanceof Event?u:void 0},a=()=>{if(o){Promise.resolve().then(()=>{n=!1,t.clear()});return}let u=!1,i=()=>{u||(u=!0,n=!1,t.clear())};if(setTimeout(i,0),typeof MessageChannel=="function"){let c=new MessageChannel;c.port1.onmessage=()=>{c.port1.close(),c.port2.close(),i()},c.port2.postMessage(0)}};return{firedBefore(u,i){let c=s();if(c){let p=e.get(c);return p||(p=new Map,e.set(c,p)),r(p,u,i)}let l=r(t,u,i);return!l&&!n&&(n=!0,a()),l}}}var Ur=new Set;function Ii(e,t,n){let r=typeof window=="undefined"?null:window.history;if(!r)return()=>{};let o=!1,s,a=()=>{if(o)return;let c=Ut();!c||c===s||(s=c,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${c}`))},u=[];for(let c of["pushState","replaceState"]){let l=r[c],p=function(...h){let S=l.apply(this,h);return a(),S};r[c]=p,u.push([c,l,p])}window.addEventListener("popstate",a);let i=Ut();return i&&Ur.has(`${t}:${i}`)?s=i:a(),()=>{if(!o){o=!0,window.removeEventListener("popstate",a);for(let[c,l,p]of u)r[c]===p&&(r[c]=l)}}}var gt={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 Oi(){try{return Cr(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function zr(e){return e.replace(/\/events\/?$/,"")}function Ye(){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(e=>e==="1"||e==="yes")}function Kn(e){var t;if(typeof window=="undefined")return;let n=e!=null?e:Fr;if(!n){console.warn("[sentient] grantConsent() called before init()");return}let r=pe.get(n);if(!r){console.warn("[sentient] grantConsent() called before init()");return}let{config:o,upgrade:s,reinit:a}=r;if(!s){r.upgradeBlockedReason&&console.warn(r.upgradeBlockedReason);return}if(o.respectDoNotTrack!==!1&&Ye())return;let u=(a!=null?a:yt)(qe(F({},o),{consent:!0}));s(u);let i=(t=pe.get(n))==null?void 0:t.dispose;pe.set(n,{config:qe(F({},o),{consent:!0}),upgrade:null,dispose:i})}function Ti(e,t){var n;let r=e.preConsentBehavior==="statistical_winner",o=zr((n=e.ingestUrl)!=null?n:Gr),s={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},a=new Map,u=new Map,i={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(g,v,d){if(!r)return Promise.resolve(null);let m=a.get(g);return m?Promise.resolve(m):Nn(u,g,async()=>{try{let O=new URLSearchParams({componentId:g});for(let Y of v!=null?v:[])O.append("variantIds[]",Y);let M=je(5e3),q;try{let Y=await fetch(`${o}/winner?${O.toString()}`,{headers:s,signal:M.signal});if(!Y.ok)return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null;q=await Y.json()}finally{M.clear()}let J={variantId:q.variantId,assignmentTtlMs:0};return a.set(g,J),J}catch(O){return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null}})},decide:()=>Promise.resolve(null),getSlotResult:()=>null,getSlotConfig:()=>null,getSitePalette:()=>null,reportSlots:()=>{},getPersona:()=>null,getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>{}},c=!1,l=new Set,p=[],h=[],S=[],w=()=>{for(let[,,g]of S.splice(0))g(null);b.length=0},b=[],K=!1,L=()=>{if(c)return;K=!0;let g=pe.get(e.apiKey);(g==null?void 0:g.upgrade)===P&&pe.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},D=[],E=()=>{setTimeout(()=>{var g;try{(g=D.shift())==null||g(i)}catch(v){}D.length&&E()})},x=g=>{c?D.length?D.push(g):g(i):!t&&!K&&b.length<100?b.push(g):K&&e.debug&&console.warn("[sentient] goal dropped: client released")},A={get gated(){return!c&&!t},get released(){return K&&!c},takeHeld:()=>b.splice(0),track:g=>i.track(g),goal:((g,v,d,m)=>x(O=>O.goal(g,v,d,m))),componentGoal:(g,v,d)=>i.componentGoal(g,v,d),identify:g=>i.identify(g),getAssignment:(g,v)=>i.getAssignment(g,v),assign:(g,v,d,m)=>i.assign(g,v,d,m),decide:g=>c?i.decide(g):K||t?Promise.resolve(null):new Promise(v=>S.push([g,Oe(),v])),getSlotResult:g=>i.getSlotResult(g),isSlotDecided:g=>{var v,d;return(d=(v=i.isSlotDecided)==null?void 0:v.call(i,g))!=null?d:!0},getSlotConfig:g=>i.getSlotConfig(g),getSitePalette:()=>i.getSitePalette(),getStyleVocabulary:()=>{var g,v;return(v=(g=i.getStyleVocabulary)==null?void 0:g.call(i))!=null?v:null},reportSlots:(g,v,d,m)=>i.reportSlots(g,v,d,m),reportSkeleton:(g,v)=>{var d;return(d=i.reportSkeleton)==null?void 0:d.call(i,g,v)},reportDrift:(g,v,d,m)=>{var O;return(O=i.reportDrift)==null?void 0:O.call(i,g,v,d,m)},requestSlots:(g,v,d)=>{var m;return c?(m=i.requestSlots)==null?void 0:m.call(i,g,v,d):p.push([g,v,d])},decideSlots:g=>{var v;return c?(v=i.decideSlots)==null?void 0:v.call(i,g):h.push(...g)},cancelSlots:g=>{var v;if(c)return(v=i.cancelSlots)==null?void 0:v.call(i,g);let d=new Set(g);for(let m of p)m[0]=m[0].filter(O=>!d.has(O));h=h.filter(m=>!d.has(m.id))},onSlotsChanged:g=>(l.add(g),()=>{l.delete(g)}),getPersona:()=>i.getPersona(),fetchWeights:()=>i.fetchWeights(),getGraph:()=>i.getGraph(),flush:()=>i.flush(),dispose:()=>(L(),w(),i.dispose()),destroy:()=>(L(),w(),c?i.destroy():it(e.apiKey))};function P(g){var v,d,m;i=g,c=!0,b.length&&(D.push(...b.splice(0)),E());let O=Oe();for(let[M,q,J]of S.splice(0))q!==O?J(null):g.decide(M).then(J,()=>J(null));(v=g.onSlotsChanged)==null||v.call(g,()=>l.forEach(M=>M()));for(let[M,q,J]of p.splice(0))M.length>0&&((d=g.requestSlots)==null||d.call(g,M,q,J));h.length>0&&((m=g.decideSlots)==null||m.call(g,h.splice(0)))}return{proxy:A,setInner:P}}function Oe(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Nn(e,t,n){let r=e.get(t);if(r)return r;let o=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,o),o}function yt(e){var t,n,r,o,s,a,u,i,c,l;if(typeof window=="undefined")return gt;e.nonce&&zt(e.nonce),Fr=e.apiKey||"local";let p=pe.get(e.apiKey||"local");if(p!=null&&p.dispose)try{p.dispose()}catch(f){}let h=e.respectDoNotTrack!==!1&&Ye(),S=e.consent===!1||h,w=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!w&&e.localMode!==!1)return pe.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?gt:_i(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."),pe.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."}),gt;let{proxy:f,setInner:y}=Ti(e,h);return pe.set(e.apiKey,{config:e,upgrade:h?null:y}),f}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."),gt;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),gt;let b=(t=e.ingestUrl)!=null?t:Gr,K=Date.now(),L=Br({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),D=Si(void 0,e.apiKey),E=!1,x=fe(e.apiKey),A=()=>!E&&fe(e.apiKey)===x,P=qe(F({},D),{set:(...f)=>{A()&&D.set(...f)}}),g=yr({ingestUrl:b,apiKey:e.apiKey}),v=zr(b),d={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},m=new Set,O=vr({url:`${v}/goals`,apiKey:e.apiKey,headers:d,onDrop:(f,y)=>{if(!e.debug){if(m.has(y))return;m.add(y)}console.warn(`[sentient] goal dropped (HTTP ${y}) \u2014 this will not be retried. `+(y===400?"The session was not found: call init() and let the session upsert complete before firing goals.":y===401||y===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),f)}}),M=Er((n=navigator.userAgent)!=null?n:""),q=window.location.origin,J=xr((r=document.referrer)!=null?r:"",q),Y=(o=e.sessionSegment)!=null?o:`${M}:${J}`,Ae=new Map,I=new Map,$=new Map,ne=new Set,ue=new Map,Q=null,we=null,ee=null,Me=new Set,$e=new Set,Le=new Map,mn=new Map,er=new Set,tr=new Set,nr=new Set,gn=null,Tt=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,rr=new Set,Lt=new Set,Pt=new Set,dt=new Map,hn=null,Rt=new Set,ft=new Map,yn=null,$o=2,or=new Map,_e=!1,ir=(f,y,N)=>{var z;let j=new Set,_=1;for(let C of f){y.delete(C);let T=((z=or.get(C))!=null?z:0)+1;or.set(C,T),T<=$o&&(j.add(C),T>_&&(_=T))}j.size>0&&setTimeout(()=>{_e||N(j)},Ve(_))},vn=f=>{for(let y of f)$.has(y.id)||$.set(y.id,An(y))};if(e.initialSlots)for(let[f,y]of Object.entries(e.initialSlots))$.set(f,y),ne.add(f);if(e.initialSlotConfig)for(let[f,y]of Object.entries(e.initialSlotConfig))ue.set(f,y);e.initialPalette&&(Q=e.initialPalette),e.initialVocabulary&&(we=e.initialVocabulary);let Ce=ot(e.apiKey);if(Ce){for(let[f,y]of Object.entries(Ce.slots))$.has(f)||$.set(f,y);for(let[f,y]of Object.entries((s=Ce.slotConfig)!=null?s:{}))ue.has(f)||ue.set(f,y);!Q&&Ce.palette&&(Q=Ce.palette),!we&&Ce.vocabulary&&(we=Ce.vocabulary)}let sr={low:.15,medium:.5,high:.85};if(e.initialPersona)ee=F({},e.initialPersona);else{let f=document.documentElement.dataset;f.sentientPersona?ee={persona:f.sentientPersona,confidence:(u=sr[(a=f.sentientConfidence)!=null?a:"low"])!=null?u:.15}:Ce&&(ee={persona:Ce.persona,confidence:(i=sr[Ce.band])!=null?i:.15})}if(e.initialAssignments)for(let[f,y]of Object.entries(e.initialAssignments))P.set(f,Y,{variantId:y,assignedAt:Date.now(),segment:Y,confidence:1});let Be=Promise.resolve(),ar=L.getSessionId();if(ar){let f=Ar((c=document.referrer)!=null?c:""),{utmParams:y,clickIds:N}=Oi(),z=F(F(F(F({sessionId:ar,deviceClass:M,trafficSource:J,referrerDomain:f,utmParams:y,clickIds:N,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:Ir(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:L.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||kr((l=navigator.userAgent)!=null?l:"")},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}:{}),j=async()=>{for(let _=0;;_++){if(_e||!A())return;let C=je(5e3);try{let T=await fetch(`${v}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(z),headers:d,signal:C.signal});if(T.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(T.ok||Mt(T)==="dropped")return}catch(T){}finally{C.clear()}if(_>=Ai){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(T=>setTimeout(T,Ve(_+1)))}};try{Be=j()}catch(_){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:g});let Bo=Ci(),pt=null,bn=!1,se={goal(f,y={},N=1,z=0){var j,_,C,T,V,G,te;let re=L.getSessionId();if(!re||_e||!A())return;let W=xi(y)?y:{metadata:y},me=[f,(j=W.externalId)!=null?j:"",(_=W.stepIndex)!=null?_:z,(C=W.weight)!=null?C:N].join("\0"),ke=W.value!==void 0?`${W.value}\0${(T=W.currency)!=null?T:""}`:null;if(Bo.firedBefore(me,ke)){e.debug&&console.log(`[sentient] goal("${f}") already recorded for this action \u2014 not sent twice`);return}let de=Ln(),ae={sessionId:re,name:f,metadata:(V=W.metadata)!=null?V:{},weight:(G=W.weight)!=null?G:N,stepIndex:(te=W.stepIndex)!=null?te:z,goalId:de,value:W.value,currency:W.currency,externalId:W.externalId};e.debug&&console.log("[sentient] goal",ae);let B={id:de,body:JSON.stringify(ae)};Be.then(()=>O.send(B))},componentGoal(f,y,N){var z,j,_;let C=L.getSessionId();if(!C||_e||!A())return;let T=P.get(f,Y),V=T?null:(z=$.get(f))!=null?z:null;if(!T&&V===null){e.debug&&console.warn(`[sentient] componentGoal("${f}"): no assignment or slot decision yet \u2014 render its <Adaptive>/adaptive hook or call assign()/decide() before recording a goal.`);return}if(!T&&!ne.has(f)){e.debug&&console.warn(`[sentient] componentGoal("${f}"): slot not decided this session \u2014 not attributed`);return}let G=T?T.variantId:Or(V),te={id:Ln(),sessionId:C,projectId:e.apiKey,componentId:f,variantId:G,eventType:"goal_achieved",goalType:y,payload:F({reward:(j=N==null?void 0:N.reward)!=null?j:1,goalValue:N==null?void 0:N.value,currency:N==null?void 0:N.currency},(_=N==null?void 0:N.metadata)!=null?_:{}),timestamp:Date.now(),timeInSession:Date.now()-K,path:Ut()};e.debug&&console.log("[sentient] componentGoal",te),Be.then(()=>{!_e&&A()&&g.push(te)})},identify(f){let y=L.getSessionId();!y||_e||!A()||Be.then(()=>{fetch(`${v}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:y,userId:f,ephemeral:L.isEphemeral()}),headers:d}).catch(()=>{})})},track(f){let y=L.getSessionId();if(!y||_e||!A()||f.eventType==="variant_assigned"&&$.get(f.componentId)!==void 0&&!ne.has(f.componentId)&&!P.get(f.componentId,Y))return;let N=qe(F({path:Ut()},f),{id:Ln(),sessionId:y,timestamp:Date.now(),timeInSession:Date.now()-K});e.debug&&console.log("[sentient] track",N),Be.then(()=>g.push(N))},getAssignment(f,y){return P.get(f,y)},async assign(f,y,N,z){let j=L.getSessionId();if(!j)return null;let _=P.get(f,Y);if(_&&(y!=null&&y.length||_.content!==void 0)){let C=_.ttlMs&&_.ttlMs>0?Math.max(0,_.assignedAt+_.ttlMs-Date.now()):0;return{variantId:_.variantId,assignmentTtlMs:C,content:_.content}}return Nn(Ae,f,async()=>{if(!await _n(Be,2500)||_e||!A())return null;let C=je(3e4);try{let T={sessionId:j,componentId:f,variantIds:y};z!==void 0?T.agentDataByVariant=z:N!==void 0&&(T.agentData=N);let V=await fetch(`${v}/assign`,{method:"POST",body:JSON.stringify(T),headers:d,signal:C.signal});if(!V.ok)return null;let G=await V.json();return P.set(f,Y,F({variantId:G.variantId,assignedAt:Date.now(),segment:Y,confidence:1,content:G.content},G.assignmentTtlMs&&G.assignmentTtlMs>0?{ttlMs:G.assignmentTtlMs}:{})),G}catch(T){return null}finally{C.clear()}})},async decide(f){var y,N;let z=L.getSessionId();if(!z)return null;let j=(y=f.slots)!=null?y:[],_={sessionId:z};f.sections&&f.sections.length>0&&(_.sections=f.sections.map(T=>({id:T}))),_.components=(N=f.components)!=null?N:[],j.length>0&&(_.slots=j.map(xn)),f.slotsFrom==="registry"&&(_.slotsFrom="registry",f.registrySlotIds&&(_.registrySlotIds=f.registrySlotIds),f.bootstrap===!1&&(_.bootstrap=!1),f.render&&Object.keys(f.render).length>0&&(_.render=f.render)),f.v&&(_.v=f.v),typeof f.pp=="number"&&(_.pp=f.pp),e.persona&&(_.persona=e.persona);let C=JSON.stringify(_);return Nn(I,C,async()=>{var T,V,G,te,re,W,me,ke;if(!await _n(Be,2500)||_e||!A())return vn(j),null;let de=je(3e4);try{let ae=await fetch(`${v}/decide`,{method:"POST",body:C,headers:d,signal:de.signal});if(!ae.ok)return vn(j),null;let B=await ae.json(),ge={};for(let X of j){let Ie=(T=B.slots)==null?void 0:T[X.id];if(Ie!==void 0){ge[X.id]=Ie,$.set(X.id,Ie),ne.add(X.id);continue}let lr=$.get(X.id);if(lr!==void 0)ge[X.id]=lr;else{let ur=An(X);ge[X.id]=ur,$.set(X.id,ur)}}if(B.slots)for(let[X,Ie]of Object.entries(B.slots))X in ge||(ge[X]=Ie,$.set(X,Ie),ne.add(X));let Ko=ee!=null&&ee.persona!=="unknown";B.persona&&!(B.persona==="unknown"&&Ko)?ee={persona:B.persona,confidence:(V=B.confidence)!=null?V:0}:ee||(ee={persona:"unknown",confidence:0});for(let[X,Ie]of Object.entries((G=B.assignments)!=null?G:{}))P.set(X,Y,{variantId:Ie,assignedAt:Date.now(),segment:Y,confidence:1});if(B.slotConfig)for(let[X,Ie]of Object.entries(B.slotConfig))ue.set(X,Ie);B.palette&&(Q=B.palette),B.vocabulary&&(we=B.vocabulary);for(let X of(te=f.registrySlotIds)!=null?te:[])(re=B.slotConfig)!=null&&re[X]||(ue.delete(X),$.delete(X),ne.delete(X));return A()&&He(e.apiKey,F(F(F({v:1,persona:ee.persona,band:Je(ee.confidence),slots:Object.fromEntries($),layoutOrder:(W=B.layoutOrder)!=null?W:null,savedAt:Date.now()},ue.size>0?{slotConfig:Object.fromEntries(ue)}:{}),Q?{palette:Q}:{}),we?{vocabulary:we}:{})),F(F(F(F(F({layoutOrder:(me=B.layoutOrder)!=null?me:null,assignments:(ke=B.assignments)!=null?ke:{},slots:ge,persona:ee.persona,confidence:ee.confidence},B.slotConfig?{slotConfig:B.slotConfig}:{}),B.goals?{goals:B.goals}:{}),B.sectionMap?{sectionMap:B.sectionMap}:{}),B.palette?{palette:B.palette}:{}),B.vocabulary?{vocabulary:B.vocabulary}:{})}catch(ae){return vn(j),null}finally{de.clear()}})},getSlotResult(f){var y;return(y=$.get(f))!=null?y:null},isSlotDecided(f){return ne.has(f)},getSlotConfig(f){var y;return(y=ue.get(f))!=null?y:null},reportSlots(f,y,N,z){var j;let _={};for(let[C,T]of Object.entries(z!=null?z:{}))for(let V of T){let G=`${C}|${V.key}`;!Tt.test(C)||nr.has(G)||(nr.add(G),((j=_[C])!=null?j:_[C]=[]).push(V))}Object.keys(_).length>0&&fetch(`${v}/slots/observed`,{method:"POST",headers:d,body:JSON.stringify({slotIds:Object.keys(_),authoredArms:_})}).catch(()=>{});for(let C of f)if(!(typeof C!="string"||C.length===0)){if(!Tt.test(C)){Ei()&&!rr.has(C)&&(rr.add(C),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(C)} 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(!Me.has(C)){Me.add(C),$e.add(C);let T=y==null?void 0:y[C];if(typeof T=="string"){let G=T.replace(/\s+/g," ").trim().slice(0,400);G!==""&&Le.set(C,G)}let V=N==null?void 0:N[C];V!==void 0&&mn.set(C,V)}}$e.size===0||gn!=null||(gn=setTimeout(()=>{gn=null;let C=[...$e];$e.clear();for(let T=0;T<C.length;T+=20){let V=C.slice(T,T+20),G={},te={};for(let re of V){let W=Le.get(re);W!==void 0&&(G[re]=W,Le.delete(re));let me=mn.get(re);me!==void 0&&(te[re]=me,mn.delete(re))}fetch(`${v}/slots/observed`,{method:"POST",headers:d,body:JSON.stringify(F(qe(F(F({slotIds:V},Object.keys(G).length>0?{baselineTexts:G}:{}),Object.keys(te).length>0?{baselineSkeletons:te}:{}),{pagePaths:Object.fromEntries(V.map(re=>[re,location.pathname]))}),Object.keys(G).length>0&&L.getSessionId()?{sessionId:L.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(f,y){!Tt.test(f)||er.has(f)||(er.add(f),fetch(`${v}/slots/observed`,{method:"POST",headers:d,body:JSON.stringify({slotIds:[f],baselineSkeletons:{[f]:y}})}).catch(()=>{}))},reportDrift(f,y,N,z){let j=`${f}|${y}`,_=L.getSessionId();!_||tr.has(j)||(tr.add(j),fetch(`${v}/slots/drift`,{method:"POST",headers:d,body:JSON.stringify({sessionId:_,reports:[{slotId:f,expectedFp:y,observedFp:N,reason:z}]})}).catch(()=>{}))},requestSlots(f,y,N){var z,j;for(let _ of f)Pt.has(_)||(Pt.add(_),Tt.test(_)?dt.set(_,{text:y==null?void 0:y[_],render:(z=N==null?void 0:N.render)==null?void 0:z[_],skeleton:(j=N==null?void 0:N.skeletons)==null?void 0:j[_]}):se.reportSlots([_]));dt.size===0||hn!=null||(hn=setTimeout(()=>{hn=null;let _=[...dt];dt.clear();for(let C=0;C<_.length;C+=50){let T=_.slice(C,C+50),V={};for(let[G,te]of T)te.render&&(V[G]=te.render);se.decide({slotsFrom:"registry",registrySlotIds:T.map(([G])=>G),bootstrap:!1,render:V}).then(G=>{var te,re;if(G){let W={},me={},ke=[];for(let[de,ae]of T){let B=(te=G.slotConfig)==null?void 0:te[de];if(B){B.needsSkeleton&&ae.skeleton&&((re=se.reportSkeleton)==null||re.call(se,de,ae.skeleton));continue}ke.push(de),ae.text&&(W[de]=ae.text),ae.skeleton&&(me[de]=ae.skeleton)}ke.length>0&&se.reportSlots(ke,W,me)}else ir(T.map(([W])=>W),Pt,W=>{var me;let ke={},de={},ae={};for(let[B,ge]of T)W.has(B)&&(ge.text&&(ke[B]=ge.text),ge.render&&(de[B]=ge.render),ge.skeleton&&(ae[B]=ge.skeleton));(me=se.requestSlots)==null||me.call(se,[...W],ke,{render:de,skeletons:ae})});Lt.forEach(W=>W())})}},0))},decideSlots(f){for(let y of f)Rt.has(y.id)||(Rt.add(y.id),ft.set(y.id,y));ft.size===0||yn!=null||(yn=setTimeout(()=>{yn=null;let y=[...ft.values()];ft.clear();for(let N=0;N<y.length;N+=30){let z=y.slice(N,N+30);se.decide({slots:z}).then(j=>{j||ir(z.map(_=>_.id),Rt,_=>{var C;return(C=se.decideSlots)==null?void 0:C.call(se,z.filter(T=>_.has(T.id)))}),Lt.forEach(_=>_())})}},0))},cancelSlots(f){for(let y of f)dt.delete(y)&&Pt.delete(y),ft.delete(y)&&Rt.delete(y)},onSlotsChanged(f){return Lt.add(f),()=>{Lt.delete(f)}},getStyleVocabulary(){return we},getSitePalette(){return Q},getPersona(){return ee?{persona:ee.persona,confidence:ee.confidence,band:Je(ee.confidence)}:null},async fetchWeights(){var f;let y=je(5e3);try{let N=await fetch(`${v}/weights`,{headers:d,signal:y.signal});return N.ok?(f=(await N.json()).components)!=null?f:[]:[]}catch(N){return[]}finally{y.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){g.flush(),O.flush()},dispose(){var f;pt==null||pt(),bn=!0,_e=!0,g.destroy(),O.destroy(),((f=pe.get(e.apiKey))==null?void 0:f.dispose)===se.dispose&&pe.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var f;pt==null||pt(),bn=!0,_e=!0,E=!0,Dt(e.apiKey),g.destroy({forget:!0}),O.destroy({forget:!0}),L.destroy(),P.clear(),((f=pe.get(e.apiKey))==null?void 0:f.dispose)===se.dispose&&pe.delete(e.apiKey);try{localStorage.removeItem(rt+e.apiKey),localStorage.removeItem($t(e.apiKey)),localStorage.removeItem(Bt(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${ze(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(y){}e.debug&&console.log("[sentient] destroyed")}};if(pe.set(e.apiKey,{config:e,upgrade:null,dispose:se.dispose}),pt=Ii(se,e.apiKey,f=>{Be.then(()=>{bn||Ur.add(f)})}),e.debug){let f=window;f.__sentient&&(f.__sentient.client=se)}return se}var jn=/(^|\/)snippet(\.global)?(\.min)?\.js(\?|$)/,Li=(()=>{var e,t;try{return(t=(e=document.currentScript)==null?void 0:e.src)!=null?t:""}catch(n){return""}})(),Pi=/@\d+\.\d+\.\d+[^/]*\//;function Gn(e){var t;try{let n=Li||((t=Array.from(document.getElementsByTagName("script")).find(r=>jn.test(r.src)))==null?void 0:t.src);for(let r of n?[n]:[]){let o=jn.test(r)?r.replace(jn,`$1${e}$4`):r.replace(/[^/?#]*([?#].*)?$/,e),s=(e==="consent.global.js"?"sha384-+7/RqBOFLU5bMaQ6bcBAWzG589skmxN8tedG9hkoQQ6HaQkRRBJfoRVD94e/fJcM":e==="editor.global.js"?"sha384-XLLAS7vqqePHuskmX+G5fmU5eciF9fQ3fyv3Vgik9GzlCARhllOEArkRMVjWpI57":e==="preview.global.js"?"sha384-vdxAPgchJj9TyoCfgD43y1powSvyp9HFnq+1YircrnoQ8LsCBH/RCei+cQHMjZ+r":"sha384-IvppyTM8u+UjRX/4uXVUtX6ZJnYYroFQ+KwMkSwhfVKi+ffQfDd1QdJwd7VUNI+e")||"";return Pi.test(o)&&s.indexOf("sha384-")===0?{src:o,integrity:s}:{src:o}}}catch(n){}return null}var Vt=new Map;function lt(e,t,n){let r=window[t];if(r)return Promise.resolve(r);let o=Vt.get(e);return o||(o=new Promise(s=>{var i;let a=n?{src:n}:Gn(e);if(!a)return s(null);let u=Ge(document.createElement("script"));Fn(u,a),u.async=!0,u.onload=()=>{var l;let c=(l=window[t])!=null?l:null;c||Vt.delete(e),s(c)},u.onerror=()=>{Vt.delete(e),s(null)},((i=document.head)!=null?i:document.documentElement).appendChild(u)}),Vt.set(e,o)),o}function Fn(e,t){t.integrity&&(e.integrity=t.integrity,e.crossOrigin="anonymous"),e.src=t.src}var Wr="__sentientConsent",Pe=null,Un=!1,Ht=new Set,zn=()=>{let e=window[Wr];return typeof(e==null?void 0:e.consentWatcher)=="function"?e.consentWatcher:null},vt;function Vr(e){vt=e}function Ri(){Pe||(Pe=zn())||Un||(Un=!0,lt("consent.global.js",Wr,vt).then(e=>{if(Un=!1,!e)return Ni(vt!=null?vt:"consent.global.js");if(Pe=zn(),Pe)for(let t of Array.from(Ht))t()}))}function Ni(e){console.warn(`[sentient] could not load ${e} \u2014 tracking stays off. Set window.sentient.consentSrc to its URL.`)}function Xe(e){Ri();let t=null,n=()=>(!t&&(Pe!=null?Pe:Pe=zn())&&(t=Pe(e)),t);return{read:()=>{var r,o;return(o=(r=n())==null?void 0:r.read())!=null?o:null},refused:()=>{var r,o;return(o=(r=n())==null?void 0:r.refused())!=null?o:!1},subscribe(r){let o,s=!1,a=()=>{Ht.delete(a);let u=n();s||!u||(o=u.subscribe(r),r())};return n()?(o=t.subscribe(r),Promise.resolve().then(()=>{s||r()})):Ht.add(a),()=>{s=!0,Ht.delete(a),o==null||o()}}}}function Di(e){return e.replace(/\s+/g," ").trim().slice(0,300)}function Hr(e,t){let n=t>>>0;for(let r=0;r<e.length;r++)n^=e.charCodeAt(r),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function Mi(e){let t=e.join("");return Hr(t,2166136261)+Hr(t,1523705862)}var $i=new Set(["A","BUTTON"]),Bi=/^H([1-6])$/,Ki=new Set(["P","LI","LABEL","BLOCKQUOTE","FIGCAPTION","DT","DD","TD","TH"]);var ji=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT"]);function Gi(e){return $i.has(e.tagName)||e.getAttribute("role")==="button"?!0:e.tagName==="INPUT"&&/^(submit|button)$/i.test(e.type)}function Fi(e){if(Bi.test(e.tagName)||Ki.has(e.tagName))return!0;let t=e.ownerDocument.defaultView,n=t?t.getComputedStyle(e).display:"";return n!==""&&n!=="inline"&&n!=="contents"}function Ui(e,t){let n=null;for(let r=e.parentElement;r&&r!==t.parentElement;r=r.parentElement){if(Gi(r)){n=r;break}if(r===t)break}if(n)return n;for(let r=e.parentElement;r;r=r.parentElement)if(r===t||Fi(r))return r;return t}function qt(e,t=40){var n,r,o;let s=e.ownerDocument.createTreeWalker(e,4),a=[];for(let l=s.nextNode();l;l=s.nextNode())if(((n=l.nodeValue)!=null?n:"").trim()!==""&&!ji.has((o=(r=l.parentElement)==null?void 0:r.tagName)!=null?o:"")&&(a.push(l),a.length>120))return{reason:"too_large"};if(a.length===0)return{reason:"empty"};let u=[],i=[];for(let l of a){let p=Ui(l,e),h=u.indexOf(p);h===-1&&(u.push(p),h=u.length-1),i.push(h)}if(u.length>t)return{reason:"too_large"};let c=a.map(l=>{var p;return Di((p=l.nodeValue)!=null?p:"")});return{textNodes:a,ownerEls:u,leafToNode:i,leaves:c,fp:Mi(c)}}var qr=["cookiebot","onetrust","cookieyes","tcf","google-consent-mode","shopify"];function zi(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=Object.entries(e);if(t.length<1||t.length>4)return null;let n={};for(let[r,o]of t){if(!Array.isArray(o)||o.length<2||o.length>6||!o.every(s=>typeof s=="string")||/[=|]/.test(r)||o.some(s=>/[=|]/.test(s)))return null;n[r]=o}return n}function Wi(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function Vi(e){try{return e()}catch(t){return}}function Jt(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.apiKey!="string"||!t.apiKey.startsWith("pk_"))return null;let n={};if(typeof t.slots=="object"&&t.slots!==null&&!Array.isArray(t.slots))for(let[u,i]of Object.entries(t.slots)){if(typeof i!="object"||i===null)continue;let c=i,l=zi(c.dims);if(!l||c.target!==void 0&&typeof c.target!="string")continue;let p=c.arms!==void 0?Wi(c.arms):null,h={dims:l};typeof c.target=="string"&&(h.target=c.target),p&&(h.arms=p),n[u]=h}let r={apiKey:t.apiKey,personaAttributes:t.personaAttributes===!0,slots:n};typeof t.consent=="boolean"?r.consent=t.consent:t.consent!==void 0&&s("consent");let o=t.consentFrom;if(typeof o=="string"&&qr.includes(o))r.consentFrom=o;else if(o&&typeof o=="object"&&!Array.isArray(o)){let u=o;typeof u.cmp=="string"&&qr.includes(u.cmp)||u.cmp===void 0&&(typeof u.cookie=="string"||typeof u.check=="function")?r.consentFrom=u:s("consentFrom")}else o!==void 0&&s("consentFrom");function s(u){r.consent=!1,console.warn(`[sentient] invalid ${u} \u2014 tracking stays OFF until it is fixed (sentient-ui.com/docs#consent).`)}(t.preConsentBehavior==="statistical_winner"||t.preConsentBehavior==="control")&&(r.preConsentBehavior=t.preConsentBehavior),t.debug===!0&&(r.debug=!0),typeof t.registry=="boolean"&&(r.registry=t.registry),typeof t.editorSrc=="string"&&(r.editorSrc=t.editorSrc),typeof t.consentSrc=="string"&&(r.consentSrc=t.consentSrc),typeof t.nonce=="string"&&t.nonce!==""&&(r.nonce=t.nonce),typeof t.apiBase=="string"&&(r.apiBase=t.apiBase),typeof t.sectionCapture=="boolean"&&(r.sectionCapture=t.sectionCapture);let a=typeof t.persona=="function"?Vi(t.persona):t.persona;if(typeof a=="string"&&a.trim()!==""&&(r.persona=a),Array.isArray(t.sections)){let u=t.sections.filter(i=>typeof i=="string"&&i.trim()!=="").slice(0,50);u.length>=2&&(r.sections=u)}return r}var Jr=new WeakMap;function Yr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Xr(e,t,n){var s,a,u;let r=Jr.get(e);if(r){if(r.fp!==n.fp||!Yr(r.leafToNode,n.leafToNode))return"mismatch"}else{let i=qt(e);if(!("fp"in i)||(r={fp:i.fp,leafToNode:i.leafToNode,textNodes:i.textNodes,ownerEls:i.ownerEls,classes:i.ownerEls.map(c=>{var l;return(l=c.getAttribute("class"))!=null?l:""})},r.fp!==n.fp||!Yr(r.leafToNode,n.leafToNode)))return"mismatch";Jr.set(e,r)}let o=r;for(let[i,c]of Object.entries(t.nodes)){let l=Number(i),p=o.ownerEls[l];if(p){if(typeof c.text=="string"){let h=!0;o.leafToNode.forEach((S,w)=>{S===l&&(o.textNodes[w].nodeValue=h?c.text:"",h=!1)})}c.like!==void 0&&o.classes[c.like]!==void 0&&p.setAttribute("class",o.classes[c.like]),c.hidden&&((s=p.style)==null||s.setProperty("display","none","important"))}}for(let i of Object.values((a=t.order)!=null?a:{})){let c=i.map(w=>o.ownerEls[w]).filter(w=>!!w),l=(u=c[0])==null?void 0:u.parentElement;if(!l||c.length!==i.length||c.some(w=>w.parentElement!==l))continue;let p=new Set(c),h=0;Array.from(l.children).map(w=>p.has(w)?c[h++]:w).forEach((w,b)=>{var K;l.children[b]!==w&&l.insertBefore(w,(K=l.children[b])!=null?K:null)})}return"applied"}function bt(e){var n,r,o;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(o=t==null?void 0:t.pathname)!=null?o:""}function Hi(e,t){var n;if(t.tag&&e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;if(t.text){let r=((n=e.textContent)!=null?n:"").replace(/\s+/g," ").trim().toLowerCase(),o=t.text.replace(/\s+/g," ").trim().toLowerCase();if(!(r===o||r.startsWith(o)||o.startsWith(r)))return!1}return!0}function Yt(e,t){return!!(e!=null&&e.urlMatch)&&!bt(t).includes(e.urlMatch)}var qi=/^[a-zA-Z_][-a-zA-Z0-9_]*$/;function Zr(e,t){var r;let n=[];if(e.id){let o=t.getElementById(e.id);n=o?[o]:[]}if(n.length===0&&((r=e.dataAttr)!=null&&r.name)&&qi.test(e.dataAttr.name))try{let o=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${o}"]`))}catch(o){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(o){n=[]}return n}function Te(e,t){if(e.urlMatch&&!bt(t).includes(e.urlMatch))return null;let n=Zr(e,t);if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!Hi(r,e.fingerprint)?null:r}function Qr(e,t){return Yt(e,t)?!1:!!e.selector&&!e.dataAttr&&!e.id&&!e.fingerprint&&e.page===void 0?eo(e,t):Te(e,t)!==null}function eo(e,t){return Zr(e,t).length>0}function Xt(e,t){return Yt(e,t)?!1:e.page!==void 0&&Wt.test(e.page)?Mn(e.page,bt(t)):eo(e,t)}var to={color:"color",background:"background",fontSize:"font-size",fontWeight:"font-weight",textAlign:"text-align",padding:"padding",margin:"margin",borderRadius:"border-radius",width:"width",height:"height",maxWidth:"max-width",border:"border",boxShadow:"box-shadow",opacity:"opacity",lineHeight:"line-height",letterSpacing:"letter-spacing",textTransform:"text-transform",gap:"gap",fontFamily:"font-family"},Ji=/^(rgb|rgba|hsl|hsla|calc|var|min|max|clamp)$/i;function no(e){var r;if(e.trim().length===0||/[;{}<>]/.test(e))return!1;let t=/([A-Za-z-]*)\(/g,n;for(;(n=t.exec(e))!==null;)if(!Ji.test((r=n[1])!=null?r:""))return!1;return!0}function Yi(e){var r,o;let t=e.ownerDocument.createTreeWalker(e,4),n=null;for(let s=t.nextNode();s!==null;s=t.nextNode()){if(((r=s.nodeValue)!=null?r:"").trim()==="")continue;let a=(o=s.parentElement)==null?void 0:o.tagName;if(!(a==="SCRIPT"||a==="STYLE"||a==="TEMPLATE")){if(n!==null)return null;n=s}}return n}function St(e,t){let n=Yi(e);n!==null?n.nodeValue=t:e.textContent=t}var Wn=/^https:\/\//i;function Zt(e){return typeof e=="string"&&!/[\s\x00-\x1f\\]/.test(e)&&(Wn.test(e)||e[0]==="/"&&e[1]!=="/")?e:null}var ro=new Map,Fe=null;function Xi(e){return e.replace(/["\\]/g,"\\$&")}function Zi(e){var t;(!Fe||!Fe.isConnected)&&(Fe=e.querySelector("style[data-sentient-ops]"),Fe||(Fe=Ge(e.createElement("style"),e),Fe.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(Fe))),Fe.textContent=[...ro.entries()].map(([n,r])=>`[data-snt-e="${Xi(n)}"]{${r}}`).join(`
|
|
2
|
-
`)}function oo(e,t,n,r){var u;let o=!1,s=(u=t.moveBefore)!=null?u:t.moveAfter;if(s){let i=Te(s,r);!i||i===e||i.parentElement!==e.parentElement||!e.parentElement?o=!0:t.moveBefore?e.parentElement.insertBefore(e,i):e.parentElement.insertBefore(e,i.nextSibling)}typeof t.text=="string"&&St(e,t.text),typeof t.href=="string"&&Wn.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&Wn.test(t.imageSrc)&&e.setAttribute("src",t.imageSrc),typeof t.imageAlt=="string"&&e.setAttribute("alt",t.imageAlt);let a=[];if(t.hidden&&a.push("display:none !important"),t.style)for(let[i,c]of Object.entries(t.style)){let l=to[i];l&&typeof c=="string"&&no(c)&&a.push(`${l}:${c.trim()} !important`)}return a.length>0&&(e.setAttribute("data-snt-e",n),ro.set(n,a.join(";")),Zi(r)),{anchorMiss:o}}var wt="data-sentient-block-arm",R=null;function _t(e){R=e!=null?e:null}var Ze=null;function kt(e){Ze=e!=null?e:null}var lo=e=>{var t;return typeof e=="string"?(t=Ze==null?void 0:Ze.entries.find(n=>n.id===e))==null?void 0:t.classes:void 0},uo=e=>{let t=typeof e=="string"?Ze==null?void 0:Ze.entries.find(n=>n.id===e):void 0;return t!=null&&t.computed.inheritsColor?t.computed.color:void 0},Re="data-sentient-blocks-hid",ut={none:"0",sm:"8px",md:"16px",lg:"24px"},Vn={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},io={sm:"0.875em",md:"1em",lg:"1.25em"},Qi={sm:"1.25em",md:"1.5em",lg:"2em"},es={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},so={sm:"8px",md:"16px",lg:"32px"},ts={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},ns={normal:"400",medium:"500",bold:"700"};function he(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&e.style.setProperty(n,r);return e}function ao(e){return e==="muted"?R!=null&&R.muted?{color:R.muted}:{opacity:"0.7"}:e==="accent"?{"font-weight":"600",color:R==null?void 0:R.accent}:{}}function co(e,t){let n=rs(e,t),r=uo(e.like);return n&&r&&(n.style.color=r),n}function rs(e,t){var n,r,o,s,a,u,i,c,l,p,h,S,w,b,K,L,D,E,x,A;try{let P=lo(e.like),g=e.maxWidth==="measure"?"65ch":void 0,v=d=>(d.className=P,he(d,{"max-width":g}));switch(e.type){case"stack":case"grid":{let d=t.createElement("div");if(e.type==="stack"){let M=e;he(d,{display:"flex","flex-direction":M.direction,gap:(r=ut[(n=M.gap)!=null?n:"md"])!=null?r:ut.md,"align-items":M.align?Vn[M.align]:void 0,"justify-content":M.justify?Vn[M.justify]:void 0,"flex-wrap":M.wrap?"wrap":void 0})}else{let M=e,q=(s=ut[(o=M.gap)!=null?o:"md"])!=null?s:ut.md;he(d,{display:"grid","grid-template-columns":`repeat(auto-fit, minmax(max(200px, calc((100% - ${M.columns-1} * ${q}) / ${M.columns})), 1fr))`,gap:q,"align-items":M.align?Vn[M.align]:void 0})}P&&(d.className=P);let m=!P&&e.type==="stack"&&e.surface==="raised",O=(a=e.pad)!=null?a:m?"md":void 0;O&&he(d,{padding:(u=ut[O])!=null?u:ut.md}),m&&he(d,{background:R==null?void 0:R.surface,color:R!=null&&R.surface?R==null?void 0:R.surfaceText:void 0,border:`1px solid ${(i=R==null?void 0:R.border)!=null?i:"currentColor"}`,"border-radius":(c=R==null?void 0:R.radius)!=null?c:"8px"});for(let M of(l=e.children)!=null?l:[]){let q=co(M,t);q&&d.appendChild(q)}return d}case"text":{let d=t.createElement("p");return d.textContent=e.value,P?v(d):he(d,Ke(U({margin:"0","font-size":e.size?io[e.size]:void 0,"font-weight":e.weight?ns[e.weight]:void 0,"text-align":e.align},ao(e.tone)),{"max-width":e.maxWidth==="measure"?"65ch":void 0}))}case"heading":{let d=t.createElement(`h${e.level}`);return d.textContent=e.value,P?v(d):he(d,{margin:"0","font-size":Qi[(p=e.size)!=null?p:"md"],"text-align":e.align,"max-width":e.maxWidth==="measure"?"65ch":void 0})}case"button":{let d=t.createElement("a");d.textContent=e.label;let m=Zt(e.href);if(m&&(d.href=m),e.tag&&d.setAttribute("data-sentient-tag",e.tag),P)return v(d);let O=(h=e.emphasis)!=null?h:"primary";return he(d,{display:"inline-block",padding:es[(S=e.size)!=null?S:"md"],"border-radius":(w=R==null?void 0:R.radius)!=null?w:"8px",font:"inherit","font-size":e.size?io[e.size]:void 0,"text-decoration":O==="ghost"?"underline":"none",cursor:"pointer",background:O==="primary"?(b=R==null?void 0:R.primaryBg)!=null?b:"#111827":"transparent",color:O==="primary"?(K=R==null?void 0:R.primaryText)!=null?K:"#ffffff":(L=R==null?void 0:R.accent)!=null?L:"inherit",border:O==="secondary"?`1px solid ${(D=R==null?void 0:R.accent)!=null?D:"currentColor"}`:"none"})}case"link":{let d=t.createElement("a");d.textContent=e.label;let m=Zt(e.href);return m&&(d.href=m),e.tag&&d.setAttribute("data-sentient-tag",e.tag),P?v(d):he(d,{color:"inherit","text-decoration":"underline"})}case"image":{let d=t.createElement("img"),m=Zt(e.src);return m&&(d.src=m),d.alt=e.alt,P&&(d.className=P),he(d,{display:"block","max-width":"100%","aspect-ratio":e.ratio&&e.ratio!=="auto"?ts[e.ratio]:void 0,"object-fit":e.fit,width:e.ratio&&e.ratio!=="auto"?"100%":void 0})}case"badge":{let d=t.createElement("span");return d.textContent=e.value,P?v(d):he(d,U({display:"inline-block",padding:"2px 10px","border-radius":"999px","font-size":"0.75em",border:`1px solid ${(E=R==null?void 0:R.border)!=null?E:"currentColor"}`},ao(e.tone)))}case"spacer":return he(t.createElement("div"),{height:(x=so[e.size])!=null?x:so.md});case"divider":return he(t.createElement("hr"),{border:"none","border-top":`1px solid ${(A=R==null?void 0:R.border)!=null?A:"currentColor"}`,margin:"0",width:"100%"});default:return null}}catch(P){return null}}function fo(e,t,n,r){var o,s;try{let a=new Set;for(let i of Array.from(e.children)){let c=i.getAttribute(wt);c!==null&&(t[c]===void 0?i.remove():a.add(c))}for(let[i,c]of Object.entries(t)){if(a.has(i))continue;let l="tree"in c?c:null,p=co(l?l.tree:c,r);if(!p)continue;let h=r.createElement("div");h.setAttribute(wt,i),h.style.display="none";let S=l?lo((o=l.surface)==null?void 0:o.like):void 0;if(S){let w=r.createElement("div");w.className=S;let b=uo((s=l.surface)==null?void 0:s.like);b&&(w.style.color=b),w.appendChild(p),h.appendChild(w)}else h.appendChild(p);e.appendChild(h)}let u=n!==void 0&&t[n]!==void 0;for(let i of Array.from(e.children)){let c=i.getAttribute(wt),l=i;c!==null?l.style.display=u&&c===n?"":"none":u?l.hasAttribute(Re)||(l.setAttribute(Re,l.style.display),l.style.display="none"):l.hasAttribute(Re)&&(l.style.display=l.getAttribute(Re),l.removeAttribute(Re))}}catch(a){}}function os(e){try{for(let t of Array.from(e.children)){let n=t;if(n.getAttribute(wt)!==null){n.remove();continue}n.hasAttribute(Re)&&(n.style.display=n.getAttribute(Re),n.removeAttribute(Re))}}catch(t){}}function Qt(e,t){try{let n=new Set;for(let r of Array.from(e.querySelectorAll(`[${wt}]`)))r.parentElement&&n.add(r.parentElement);for(let r of Array.from(e.querySelectorAll(`[${Re}]`)))r.parentElement&&n.add(r.parentElement);for(let r of n)t.has(r)||os(r)}catch(n){}}function Hn(e,t){if(!e)return[t.documentElement];try{return Array.from(t.querySelectorAll(e))}catch(n){return[]}}function en(e,t,n,r){n.documentElement.setAttribute("data-sentient-persona",e),n.documentElement.setAttribute("data-sentient-confidence",t),r==null||r(n.documentElement,"data-sentient-persona"),r==null||r(n.documentElement,"data-sentient-confidence")}function tn(e,t,n,r){var o;for(let[s,a]of Object.entries(t)){let u=e[s];if(!u||typeof u=="string")continue;let i=Hn(a.target,n);for(let c of i)for(let[l,p]of Object.entries(u))(o=a.dims[l])!=null&&o.includes(p)&&(c.setAttribute(`data-${l}`,p),r==null||r(c,`data-${l}`))}}function nn(e,t,n,r){for(let[o,s]of Object.entries(t)){let a=e[o];if(typeof a!="string"||!s.arms||!s.arms.includes(a))continue;let u=Hn(s.target,n);for(let i of u)i.setAttribute("data-sentient-arm",a),r==null||r(i,"data-sentient-arm")}}function rn(e,t,n,r){var u,i,c,l,p,h,S;let o=new Set,s=(u=r==null?void 0:r.contentAndOps)!=null?u:!0,a=[];for(let[w,b]of Object.entries(t)){if(Yt(b.locator,n))continue;let K;if(b.locator){let D=Te(b.locator,n);K=D?[D]:[],!D&&Xt(b.locator,n)&&a.push(w)}else K=Hn(b.target,n);let L=e[w];for(let D of K){if(L!==void 0)if(typeof L=="string")D.setAttribute("data-sentient-arm",L),(i=r==null?void 0:r.onAttr)==null||i.call(r,D,"data-sentient-arm"),s&&((c=r==null?void 0:r.onApplied)==null||c.call(r,w,L,D));else for(let[x,A]of Object.entries(L))D.setAttribute(`data-${x}`,A),(l=r==null?void 0:r.onAttr)==null||l.call(r,D,`data-${x}`);if((b.blocks||b.compose)&&!ss(n)){let x=Object.fromEntries([...Object.entries((p=b.blocks)!=null?p:{}).filter(([,A])=>!ht(A)),...Object.entries((h=b.compose)!=null?h:{}).filter(([,A])=>!ht(A.tree))]);Object.keys(x).length>0&&(fo(D,x,typeof L=="string"?L:void 0,n),o.add(D))}if(!s)continue;let E=D.textContent;b.edits?Xr(D,b.edits.edits,b.edits)==="mismatch"&&((S=r==null?void 0:r.onDrift)==null||S.call(r,w,b.edits.fp)):typeof b.content=="string"&&St(D,b.content),b.ops&&oo(D,b.ops,w,n).anchorMiss&&!a.includes(w)&&a.push(w),$n(D,Ke(U(U({previous:E},typeof L=="string"?{arm:L}:{}),(r==null?void 0:r.persona)!==void 0?{persona:r.persona}:{}),{doc:n}))}}return Qt(n,o),a}var is=/bot|crawler|spider|crawling|googlebot|bingbot|duckduckbot|baiduspider|yandexbot|slurp|gptbot|claudebot|anthropic|perplexity|ccbot|applebot|headlesschrome/i;function ss(e){var t,n,r;try{let o=(n=(t=e.defaultView)!=null?t:typeof window!="undefined"?window:void 0)==null?void 0:n.navigator;return o?o.webdriver===!0?!0:is.test((r=o.userAgent)!=null?r:""):!1}catch(o){return!1}}var as=800;function on(e,t,n){let r=[];return n.forEach(({slotId:o,arm:s,el:a},u)=>{r.push(Bn((h,S={})=>{try{e.track({projectId:t,componentId:o,variantId:s,eventType:"micro_signal",payload:U({signalType:h},S)})}catch(w){}},a,void 0,{tabLoss:u===0}));let i=null,c=0,l=()=>{c=Date.now(),i=setTimeout(()=>{try{e.track({projectId:t,componentId:o,variantId:s,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-c}})}catch(h){}i=null},as)},p=()=>{i!==null&&(clearTimeout(i),i=null)};a.addEventListener("mouseenter",l),a.addEventListener("mouseleave",p),r.push(()=>{a.removeEventListener("mouseenter",l),a.removeEventListener("mouseleave",p),i!==null&&clearTimeout(i)})}),()=>{for(let o of r)o()}}function ls(e,t){if(!e)return!1;if(e==="/")return t==="/";let n=e.endsWith("/")?e.slice(0,-1):e;return t===n||t.startsWith(`${n}/`)}function mo(e){return e?`_snt_fired_goals_${e.slice(0,12)}`:"_snt_fired_goals"}var us="_snt_fired_goals";function qn(e,t){try{e==null||e.sessionStorage.removeItem(mo(t)),e==null||e.sessionStorage.removeItem(us)}catch(n){}}function po(e){var t;return[(t=e.slotId)!=null?t:"",e.goalId,e.event,e.locator?JSON.stringify(e.locator):""].join("|")}function cs(e,t){try{let n=e==null?void 0:e.sessionStorage.getItem(t);if(!n)return new Set;let r=JSON.parse(n);return Array.isArray(r)?new Set(r.filter(o=>typeof o=="string")):new Set}catch(n){return new Set}}function ds(e,t,n){try{e==null||e.sessionStorage.setItem(t,JSON.stringify([...n]))}catch(r){}}function go(e,t,n,r){var L,D;let o=(L=n.defaultView)!=null?L:typeof window!="undefined"?window:null,s=mo(r),a=cs(o,s),u=E=>{let x=po(E);if(!a.has(x))try{E.slotId?t.componentGoal(E.slotId,E.goalId):t.goal(E.goalId),a.add(x),ds(o,s,a)}catch(A){}},i=e.filter(E=>E.event==="click"),c=e.filter(E=>E.event==="form_submit"),l=e.filter(E=>E.event==="url_reached"),p=e.filter(E=>E.event==="scroll_depth"),h=(E,x)=>{if(!E.locator)return!1;let A=Te(E.locator,n);return!!A&&(A===x||A.contains(x))},S=E=>{let x=E.target;if(!(!x||typeof x.closest!="function"))for(let A of i)h(A,x)&&u(A)},w=E=>{let x=E.target;if(x)for(let A of c)h(A,x)&&u(A)},b=()=>{if(l.length===0)return;let E=bt(n);for(let x of l)x.urlPattern&&ls(x.urlPattern,E)&&u(x)},K=()=>{var A;let E=n.documentElement,x=E.scrollHeight>0?(E.scrollTop+E.clientHeight)/E.scrollHeight:0;for(let P of p)x>=((A=P.threshold)!=null?A:.75)&&u(P);p.every(P=>a.has(po(P)))&&n.removeEventListener("scroll",K)};return n.addEventListener("click",S,!0),n.addEventListener("submit",w,!0),(D=n.defaultView)==null||D.addEventListener("popstate",b),b(),p.length>0&&(n.addEventListener("scroll",K,{passive:!0}),K()),{checkUrl:b,teardown:()=>{var E;n.removeEventListener("click",S,!0),n.removeEventListener("submit",w,!0),(E=n.defaultView)==null||E.removeEventListener("popstate",b),p.length>0&&n.removeEventListener("scroll",K)}}}function sn(e,t){if(!e||e.length<2||t.size!==e.length)return null;let n=[];for(let a of e){let u=t.get(a);if(!u||n.includes(u))return null;n.push(u)}let r=n[0].parentNode;if(!r||!n.every(a=>a.parentNode===r))return null;let o=n.slice().sort((a,u)=>a.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),s=[];for(let a=0;a<n.length;a++){let u=n[a];o[a]!==u&&(s.push({el:u,before:o[a]}),o.splice(o.indexOf(u),1),o.splice(a,0,u))}return s}var fs="__snt_editor_token";function ho(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(fs):null}catch(e){return null}}function yo(e){let t=null;try{let n=location.hash.slice(1),r=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(r){t=r[2];let o=n.slice(r.index+r[0].length);r[1]!="&"&&o[0]=="&"&&(o=r[1]+o.slice(1));let s=n.slice(0,r.index)+o;history.replaceState(history.state,"",s?"#"+s:location.pathname+location.search)}}catch(n){}return t}var Et="0.32.3",un=Et!=="0.0.0-dev"?{name:"snippet",version:Et}:void 0,xo=Et!=="0.0.0-dev"?{v:Et}:{},vo=5e3,ps=50,Ao=(()=>{try{if(typeof window=="undefined")return[];let e=window.SentientSnippet;return Array.isArray(e==null?void 0:e.q)?e.q:[]}catch(e){return[]}})(),Z=null,k=null,be={},ve=null,Se=null,xt=null,oe=null,ie=null,At=0,H=null,Qe=null,bo=!1,Jn=null,an=null,Ct=null,Ee=!1,Ue=!1,cn=!1,dn=0,Co=e=>fe(e)===dn,ct=null,ce=!1,De=null,xe=[],et=null,tt=null,ye=null,ms=3e3,gs=100;function So(e,t){let n,r=new Promise(o=>{n=setTimeout(()=>o(null),t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}function Ne(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function It(e,t){return Z?(Z.personaAttributes&&H&&en(H.persona,H.band,e,t==null?void 0:t.onAttr),tn(be,Z.slots,e,t==null?void 0:t.onAttr),nn(be,Z.slots,e,t==null?void 0:t.onAttr),ve?rn(be,ve,e,U(Ke(U({},t),{onDrift:(n,r)=>{var o,s;return(s=k==null?void 0:k.reportDrift)==null?void 0:s.call(k,n,r,(o=To[n])!=null?o:null,"fp_mismatch")}}),H?{persona:H.persona}:{})):(Qt(e,new Set),[])):[]}function Io(e){var n;let t=new Map;for(let r of(n=Z==null?void 0:Z.sections)!=null?n:[])try{let o=e.querySelectorAll(r);o.length===1&&t.set(r,o[0])}catch(o){}return t}function Yn(e,t){var n,r;try{if(!e||e.length<2)return;for(let o of(n=sn(e,Io(t)))!=null?n:[])(r=o.before.parentNode)==null||r.insertBefore(o.el,o.before)}catch(o){}}function hs(e,t,n){let r=(o,s)=>t.some(([a,u])=>a===o&&u===s);try{if(Array.isArray(e.stamped))for(let o of e.stamped){if(!Array.isArray(o))continue;let[s,a,u]=o;!s||typeof a!="string"||r(s,a)||(u==null?s.removeAttribute(a):s.setAttribute(a,u))}if(Array.isArray(e.html))for(let o of e.html)typeof o!="string"||r(n.documentElement,o)||n.documentElement.removeAttribute(o)}catch(o){}}function ys(){try{let e=window.__sntPP;return e&&typeof e=="object"&&typeof e.v=="number"?e:null}catch(e){return null}}function Oo(e){return e.apiBase?`${e.apiBase.replace(/\/+$/,"")}/v1/events`:void 0}function pn(e){var t;return(t=e.apiBase)!=null?t:"https://api.sentient-ui.com"}function vs(e){return Promise.resolve().then(()=>fetch(`${pn(e)}/v1/registry/locators`,{headers:{authorization:`Bearer ${e.apiKey}`}})).then(t=>t.ok?t.json():null).then(t=>Array.isArray(t==null?void 0:t.slots)?t.slots:null).catch(()=>null)}function Xn(e,t){let n=[],r=[];for(let o of e)try{if(typeof(o==null?void 0:o.id)!="string")continue;!o.locator||Qr(o.locator,t)?n.push(o.id):Xt(o.locator,t)&&r.push(o.id)}catch(s){}return[n,r]}var To={};function Lo(e,t){var r;let n={};for(let o of e){let s=(r=De==null?void 0:De.find(c=>c.id===o))==null?void 0:r.locator,a=s?Te(s,t):null,u=a?qt(a):null,i=u&&"fp"in u?u.fp:void 0;i&&(To[o]=i),n[o]=Ke(U({},i?{fp:i}:{}),{forms:!1,compose:!0,content:!0})}return n}function Po(e,t){let n=null;for(let r of t)e!=null&&e[r]&&((n!=null?n:n={})[r]=e[r]);return n}var le=null;function Ro(){if(!Ee){le&&et!==Oe()&&le(!0);return}!De||et===Oe()||(et=Oe(),bs())}function bs(){ye==null||ye();let e=Z,t=De;if(!e||!t)return;let n,r,o=()=>{clearTimeout(n),clearTimeout(u),r==null||r.disconnect(),ye===o&&(ye=null)},s=null,a=i=>{let[c,l]=Xn(t,document),p=c.filter(h=>!xe.includes(h));s!==null&&c.some(h=>!s.has(h)&&!p.includes(h))&&Ot(),s=new Set(c),p.length>0&&Ss(p).catch(()=>{}),(i||l.length===0&&!t.some(h=>!c.includes(h.id)&&!xe.includes(h.id)))&&(o(),No(e,l))},u=setTimeout(()=>a(!0),ms);if(ye=o,a(),ye===o)try{r=new MutationObserver(()=>{clearTimeout(n),n=setTimeout(a,gs)}),r.observe(document.documentElement,{childList:!0,subtree:!0})}catch(i){}}function fn(e,t){if(!(!e||e.length===0||!t||!Z))try{Se==null||Se.teardown(),Se=go(e,t,document,Z.apiKey)}catch(n){}}async function Ss(e){let t=Z,n=k;if(!t||!n)return;xe=xe.concat(e);let r=await n.decide(U({slotsFrom:"registry",registrySlotIds:e,render:Lo(e,document)},xo));if(r||(xe=xe.filter(s=>!e.includes(s))),!r||ce||k!==n)return;be=U(U({},be),r.slots),!Se&&r.goals&&(t.consent!==!1||Ue)&&fn(xt=r.goals,n);let o=Po(r.slotConfig,e);o&&(ve=U(U({},ve),o)),Ot(),Ne(t,"late decide",e),tt&&Co(t.apiKey)&&He(t.apiKey,tt=U(Ke(U({},tt),{slots:be,savedAt:Date.now()}),ve?{slotConfig:ve}:{}))}function No(e,t){if(t.length!==0)try{fetch(`${pn(e)}/v1/locator-miss`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify({slots:t})}).catch(()=>{})}catch(n){}}function nt(){return!!(Z&&k&&Z.sectionCapture!==!1&&(Z.consent!==!1||Ue)&&!Ye())}function ws(){if(!k||!Z||!nt()||ie)return;let e=[];It(document,{contentAndOps:Ee,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),Qn();try{oe==null||oe(),oe=on(k,Z.apiKey,e)}catch(t){}}function Qn(){if(typeof document=="undefined"||!nt())return;let e;try{if(an&&an.length>0){let r=new Map;for(let o of an){if(o.urlMatch!==window.location.pathname)continue;let s=Te(o.locator,document);s&&r.set(s,o.type)}r.size>0&&(e=o=>{var s;return(s=r.get(o))!=null?s:null})}}catch(r){}let t=k,n=++At;Ct=window.location.pathname,lt("engagement.global.js","__sentientEngagement").then(r=>{if(!(!r||n!==At||k!==t||!t||!nt()))try{ie==null||ie(),ie=r.startEngagementCapture(t,U({apiKey:Z.apiKey,apiBase:Z.apiBase,doc:document,microSignals:!0},e?{typeOf:e}:{}))}catch(o){}})}function Ot(){try{let e=[];if(oe==null||oe(),oe=null,It(document,{contentAndOps:Ee,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),Yn(Qe,document),e.length>0&&nt())try{oe=on(k,Z.apiKey,e)}catch(t){}try{typeof window!="undefined"&&Ct!==null&&window.location.pathname!==Ct&&nt()&&(ie==null||ie(),ie=null,At++,Qn())}catch(t){}}catch(e){}}function wo(){Jn===null&&(Jn=setTimeout(()=>{Jn=null,Ot();try{Se==null||Se.checkUrl()}catch(e){}Ro()},ps))}function Do(){if(!(bo||typeof window=="undefined"||typeof history=="undefined")){bo=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,s){let a=n.call(this,r,o,s!=null?s:null);return wo(),a}};e("pushState"),e("replaceState"),window.addEventListener("popstate",wo)}catch(e){}}}function ln(e){let t={};for(let[n,r]of Object.entries(e.slots))try{t[n]=r.target?document.querySelectorAll(r.target).length:1}catch(o){t[n]=0}return t}function _s(e,t,n){var r;try{window.__sentientEditor={token:t,code:n,apiBase:pn(e)};let o=e.editorSrc?{src:e.editorSrc}:Gn("editor.global.js");if(!o){ko();return}let s=Ge(document.createElement("script"));Fn(s,o),s.async=!0,s.onerror=()=>ko(),((r=document.head)!=null?r:document.documentElement).appendChild(s)}catch(o){}}var _o="sentient-editor-load-notice";function ko(){var e;try{if(document.getElementById(_o))return;let t=document.createElement("div");t.id=_o,t.textContent="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.",t.style.cssText="position:fixed;bottom:16px;right:16px;z-index:2147483647;max-width:320px;padding:14px 16px;border-radius:14px;background:#111827;color:#fff;font:13px/1.45 system-ui,sans-serif;border:1px solid rgba(245,158,11,.6);cursor:pointer",t.onclick=()=>t.remove(),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function ks(e){let t={cfg:e,apiBase:pn(e),set(n){n.slots!==void 0&&(be=n.slots),n.slotConfig!==void 0&&(ve=n.slotConfig),n.persona!==void 0&&(H=n.persona),n.decided&&(Ee=!0),n.look&&(_t(n.look.palette),kt(n.look.vocabulary))},apply:()=>It(document),installSpaHooks:Do,exposeGlobal:()=>{cn=!0,Zn(e)},dbg:(...n)=>Ne(e,...n)};return lt("preview.global.js","__sentientPreview").then(n=>n?n.runPreview(t):Promise.reject()).catch(()=>(t.exposeGlobal(),Ne(e,"preview chunk unavailable \u2014 page left as-is"),!0))}function Zn(e){let t=r=>{try{ie==null||ie(),ie=null,At++,Ct=null,oe==null||oe(),oe=null,ye==null||ye(),Se==null||Se.teardown(),Se=null,r&&qn(typeof window!="undefined"?window:null,e.apiKey),Ue=!1,ce=!0,r?(tt=null,H=null,k?k.destroy():it(e.apiKey)):k==null||k.dispose(),k=null}catch(o){}},n={consentWatcher:Xe,goal(r,o){try{k==null||k.goal(r,o)}catch(s){}},componentGoal(r,o){try{k==null||k.componentGoal(r,o)}catch(s){}},grantConsent(){try{if(!k&&ce||k!=null&&k.released)dn=fe(e.apiKey),k=yt(U({apiKey:e.apiKey,consent:!0,preConsentBehavior:e.preConsentBehavior,debug:e.debug,persona:e.persona,ingestUrl:Oo(e)},un?{sdk:un}:{})),fn(xt,k);else{let r=(k==null?void 0:k.gated)===!0;Kn(e.apiKey),r&&(dn=fe(e.apiKey)),fn(xt,k)}ce=!1,le==null||le()}catch(r){}Ue=!0;try{ws()}catch(r){}},revokeConsent(){t(!0)},reapply:Ot,getState(){var r,o;try{return{apiKey:e.apiKey,persona:(r=H==null?void 0:H.persona)!=null?r:null,band:(o=H==null?void 0:H.band)!=null?o:null,slots:be,matchCounts:ln(e),consent:!ce&&(e.consent!==!1||Ue)}}catch(s){return{apiKey:e.apiKey,persona:null,band:null,slots:{},matchCounts:{},consent:!1}}}};if(window.SentientSnippet=n,window.__sentientApi=n,e.consentFrom&&!ct&&!cn)try{let r=Xe(e.consentFrom),o=!1,s=!1,a=()=>!!k&&!ce&&(k.gated===void 0?e.consent!==!1||Ue:!k.gated);ct=r.subscribe(()=>{try{let u=r.read();u!==null&&(s=!0);let i=u!=null?u:s?!1:null,c=a(),l=!c&&i!==!0&&r.refused();if(l&&!o&&(k!=null&&k.gated?k.destroy():it(e.apiKey),qn(window,e.apiKey),tt=null,H=null),o=l,i===!0&&!c)n.grantConsent();else if(i===!1&&c){let p=r.refused();t(p),p&&(o=!0)}}catch(u){}})}catch(r){}for(let r of Ao.splice(0))try{r[0]==="goal"?n.goal(r[1],r[2]):r[0]==="grantConsent"&&k?n.grantConsent():r[0]==="revokeConsent"&&k&&n.revokeConsent()}catch(o){}}function Eo(){var e;try{if(typeof window=="undefined")return;let t=window;if(typeof((e=t.SentientSnippet)==null?void 0:e.goal)=="function")return;let n=()=>{};t.SentientSnippet={goal:n,componentGoal:n,grantConsent:n,revokeConsent:n,reapply:n,consentWatcher:Xe,getState:()=>({apiKey:"",persona:null,band:null,slots:{},matchCounts:{},consent:!1})},Ao.length=0}catch(t){}}function Es(){try{let e=window.Shopify;return typeof(e==null?void 0:e.shop)=="string"&&e.shop!==""}catch(e){return!1}}async function Mo(){var e,t;try{let n=Jt(window.sentient);if(!n){Eo();return}Z=n,ct==null||ct(),ct=null,!n.consentFrom&&n.consent===void 0&&Es()&&(n.consentFrom="shopify"),Vr(n.consentSrc),zt(n.nonce),cn=!1,Ee=!1,le=null,Qe=null,be={},ve=null,_t(null),kt(null),Ue=!1,ce=!1,xt=null,De=null,xe=[],et=null,tt=null,ye==null||ye(),ie==null||ie(),ie=null,At++,Ct=null;let r=yo("sentient_editor_code"),o=r?null:ho();if(r||o){_s(n,o,r),cn=!0,Zn(n),Ne(n,"editor mode");return}if(typeof window!="undefined"&&/[?&]sentient_(preview|persona)=[^&]/.test(window.location.search)&&await ks(n))return;if(n.consentFrom&&n.consent===void 0)try{n.consent=Xe(n.consentFrom).read()===!0}catch(d){n.consent=!1}n.consent!==!1&&n.sectionCapture!==!1&&!Ye()&<("engagement.global.js","__sentientEngagement");let s=(e=n.registry)!=null?e:Object.keys(n.slots).length===0;n.registry===void 0&&!s&&Ne(n,"slots declared without registry: true, so dashboard-published components are not applied");let a=s?vs(n):null,u=ys();try{(t=u==null?void 0:u.stop)==null||t.call(u)}catch(d){}let i=n.consent!==!1&&!Ye()?ot(n.apiKey):null,c=[];i&&(H={persona:i.persona,band:i.band},be=i.slots,i.slotConfig&&(ve=i.slotConfig),i.palette&&_t(i.palette),i.vocabulary&&kt(i.vocabulary),It(document,U({contentAndOps:!1},u?{onAttr:(d,m)=>c.push([d,m])}:{})),i.layoutOrder&&(Qe=i.layoutOrder,Yn(Qe,document))),u&&hs(u,c,document);let l=yt(U({apiKey:n.apiKey,consent:n.consent,preConsentBehavior:n.preConsentBehavior,debug:n.debug,persona:n.persona,ingestUrl:Oo(n)},un?{sdk:un}:{}));k=l,dn=fe(n.apiKey),Zn(n),Do();let p=Object.entries(n.slots).map(([d,m])=>({id:d,dims:m.dims})),h=xo,S={pp:u?u.v:0},w=[];if(a){let[d]=await Promise.all([So(a,vo),document.readyState==="loading"?new Promise(m=>document.addEventListener("DOMContentLoaded",m,{once:!0})):null]);De=d,d&&(xe=w=Xn(d,document)[0]),Ne(n,"registry scope",d&&w)}let b=(d=l)=>{let m=Array.from(Io(document).keys());return d.decide(U(U(U(U({slots:p},h),S),m.length>=2?{sections:m}:{}),s?{slotsFrom:"registry",registrySlotIds:w,render:Lo(w,document)}:{}))},K=Oe(),L=l.gated===!0,D=!1,E=!1,x=!1,A=!1;le=(d=!1)=>{let m=k;!D||E||A||Ee||ce||!m||m.gated||!d&&!x||(x=!1,A=!0,K=et=Oe(),De&&(xe=w=Xn(De,document)[0]),b(m).then(O=>{A=!1,O&&!Ee&&!ce&&k===m?v(O):(O||(xe=[]),!Ee&&(m.released||k!==m||ce)&&(x=!0))}).catch(()=>{A=!1}))};let P=b();P.then(()=>{D=!0},()=>{D=!0});let g=await So(P,vo),v=d=>{var M,q,J,Y,Ae;E=!0;let m=(k!=null?k:l).getPersona();m?H={persona:m.persona,band:m.band}:d.persona&&(H={persona:d.persona,band:"low"}),be=d.slots,s?ve=Po(d.slotConfig,w):d.slotConfig&&(ve=d.slotConfig),d.palette&&_t(d.palette),d.vocabulary&&kt(d.vocabulary),Qe=(M=d.layoutOrder)!=null?M:Qe;let O=()=>{let I=[],$=It(document,{onApplied:(ne,ue,Q)=>I.push({slotId:ne,arm:ue,el:Q})});if(s||No(n,$),Yn(Qe,document),Ee=!0,nt())try{oe==null||oe(),oe=on(k,n.apiKey,I)}catch(ne){}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",O,{once:!0}):O(),xt=(q=d.goals)!=null?q:null,(n.consent!==!1||Ue)&&!ce&&fn(d.goals,k),an=(J=d.sectionMap)!=null?J:null,nt()&&Qn(),Ne(n,"applied",{persona:H,slots:be,matches:ln(n)}),!ce&&(Co(n.apiKey)&&He(n.apiKey,tt=U(U(U({v:1,persona:(Y=H==null?void 0:H.persona)!=null?Y:d.persona,band:(Ae=H==null?void 0:H.band)!=null?Ae:"low",slots:d.slots,layoutOrder:d.layoutOrder,savedAt:Date.now()},ve?{slotConfig:ve}:{}),d.palette?{palette:d.palette}:{}),d.vocabulary?{vocabulary:d.vocabulary}:{})),et=null,Ro())};if(!g){Ne(n,"decide timeout/null \u2014 snapshot state stands",ln(n)),P.then(d=>{if(!d){if(Ee)return;xe=[],l.released===!0||k!==l||ce||L&&Oe()!==K?(x=!0,le==null||le()):et=K;return}if(!(!d||Ee||ce)){if(k!==l){x=!0,le==null||le();return}v(d),Ne(n,"late decide applied",ln(n))}}).catch(()=>{});return}if(ce||k!==l){x=!0,le==null||le();return}v(g)}catch(n){Eo()}}if(typeof window!="undefined"&&window.sentient){let e=window;if(!e.__sentientInitialized)e.__sentientInitialized=!0,Promise.resolve().then(()=>{Mo()});else{let t=window.__sentientApi;t&&Promise.resolve().then(()=>{window.SentientSnippet=t})}}return Vo(xs);})();
|
|
1
|
+
"use strict";var SentientSnippet=(()=>{var $t=Object.defineProperty,Jo=Object.defineProperties,Yo=Object.getOwnPropertyDescriptor,Xo=Object.getOwnPropertyDescriptors,Zo=Object.getOwnPropertyNames,vr=Object.getOwnPropertySymbols;var Sr=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable;var br=(e,t,n)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))Sr.call(t,n)&&br(e,n,t[n]);if(vr)for(var n of vr(t))Qo.call(t,n)&&br(e,n,t[n]);return e},Ke=(e,t)=>Jo(e,Xo(t));var wr=(e,t)=>()=>(e&&(t=e(e=0)),t);var _r=(e,t)=>{for(var n in t)$t(e,n,{get:t[n],enumerable:!0})},ei=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zo(t))!Sr.call(e,o)&&o!==n&&$t(e,o,{get:()=>t[o],enumerable:!(r=Yo(t,o))||r.enumerable});return e};var ti=e=>ei($t({},"__esModule",{value:!0}),e);var ui,ci,di,Cr,fi,pi,Ir,j,qe,In=wr(()=>{"use strict";ui=Object.defineProperty,ci=Object.defineProperties,di=Object.getOwnPropertyDescriptors,Cr=Object.getOwnPropertySymbols,fi=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable,Ir=(e,t,n)=>t in e?ui(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t)=>{for(var n in t||(t={}))fi.call(t,n)&&Ir(e,n,t[n]);if(Cr)for(var n of Cr(t))pi.call(t,n)&&Ir(e,n,t[n]);return e},qe=(e,t)=>ci(e,di(t))});var Kr={};_r(Kr,{LOCAL_ENGINE_AVAILABLE:()=>yi,createLocalEngine:()=>vi});function vi(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var yi,jr=wr(()=>{"use strict";yi=!1});var Rs={};_r(Rs,{applyPersonaAttributes:()=>on,applyRegistrySlots:()=>ln,applySlotArms:()=>an,applySlotAttributes:()=>sn,consentWatcher:()=>Xe,parseSnippetConfig:()=>Qt,planReorder:()=>cn,reapply:()=>Pt,run:()=>Wo,version:()=>Ct});function Ve(e){return e?`_${e.slice(0,12)}`:""}var We="_snt_uid";function ht(e){return`${We}${Ve(e)}`}var xn="__sntForgetGen",ni=()=>{try{return window[xn]}catch(e){return}};function Bt(e){var t,n;try{let r=window,o=(t=r[xn])!=null?t:r[xn]={};o[e]=((n=o[e])!=null?n:0)+1}catch(r){}}function fe(e){var t,n;return(n=(t=ni())==null?void 0:t[e])!=null?n:0}var ot="_snt_snap:",ri=["low","medium","high"];function it(e){try{let t=localStorage.getItem(ot+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"||!ri.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 r=n.vocabulary;return r!==void 0&&(typeof r!="object"||r===null||!Array.isArray(r.entries)||!Array.isArray(r.images))&&delete n.vocabulary,n.stage!==void 0&&typeof n.stage!="string"&&delete n.stage,n}catch(t){return null}}function He(e,t){try{localStorage.setItem(ot+e,JSON.stringify(t))}catch(n){}}function je(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function Cn(e,t){return new Promise(n=>{let r=setTimeout(()=>n(!1),t),o=()=>{clearTimeout(r),n(!0)};e.then(o,o)})}function ze(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function Kt(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 kr(e,t){try{let n=localStorage.getItem(e);if(!n)return[];let r=JSON.parse(n);return Array.isArray(r)?(localStorage.removeItem(e),r.slice(-t)):[]}catch(n){return[]}}function An(e,t,n){try{let r=(()=>{try{let s=localStorage.getItem(n);if(!s)return[];let a=JSON.parse(s);return Array.isArray(a)?a:[]}catch(s){return[]}})(),o=new Map;for(let s of r)o.set(s.id,s);for(let s of e)o.set(s.id,s);localStorage.setItem(n,JSON.stringify([...o.values()].slice(-t)))}catch(r){}}function Er(e,t){try{let n=localStorage.getItem(t);if(!n)return;let r=JSON.parse(n);if(!Array.isArray(r))return;let o=new Set(e),s=r.filter(a=>!o.has(a.id));if(s.length===r.length)return;s.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(s))}catch(n){}}var oi=500,ii=56*1024;function jt(e){return`_snt_retry_${e.slice(0,12)}`}var si={push:()=>{},flush:()=>{},destroy:()=>{}};function xr(e){var t,n,r;if(typeof window=="undefined")return si;let o=(t=e.flushIntervalMs)!=null?t:5e3,s=(n=e.maxBatchSize)!=null?n:20,a=(r=e.maxRetrySize)!=null?r:100,l=e.ingestUrl,i=e.apiKey,c=jt(i),u=!1,g=fe(i),y=(..._)=>{!u&&fe(i)===g&&An(..._)},S=[],w=new Set,b=[],$=_=>{for(let z of _)K.delete(z),!w.has(z)&&(w.add(z),b.push(z));for(;b.length>oi;){let z=b.shift();z&&w.delete(z)}Er(_,c)},K=new Set,A=()=>{for(;S.length>a;){let _=S.shift();_&&K.delete(_.id)}},C=_=>{w.has(_.id)||K.has(_.id)||(K.add(_.id),S.push(_),A())},I=_=>{for(let z of _)w.has(z.id)||(K.add(z.id),S.push(z));A()},M=kr(c,a);for(let _ of M)C(_);let L=0,m=0,v=(_,z=!0)=>{if(_.length===0)return;let _e=JSON.stringify(_),X=_.map(ge=>ge.id),ne,ce=je(15e3);try{ne=fetch(l,{method:"POST",keepalive:!0,signal:ce.signal,body:_e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})}catch(ge){y(_,a,c),I(_),m++,L=Date.now()+ze(m);return}Promise.resolve(ne).then(ce.clear,ce.clear);let Ce=ge=>{if(Kt(ge)!=="retry"){if(!ge.ok&&z){let Q=_.filter($e=>$e.eventType!=="pageview");if(Q.length>0&&Q.length<_.length){$(_.filter($e=>$e.eventType==="pageview").map($e=>$e.id)),v(Q,!1);return}}$(X),m=0,L=0;return}y(_,a,c),I(_),m++,L=Date.now()+ze(m)};ne&&typeof ne.then=="function"?ne.then(Ce).catch(()=>{y(_,a,c),I(_),m++,L=Date.now()+ze(m)}):Ce(ne)},f=typeof TextEncoder!="undefined"?new TextEncoder:null,p=_=>f?f.encode(_).length:_.length,k=_=>{let z=[],_e=2;for(let X of _){let ne=p(JSON.stringify(X))+1;if(z.length>0&&_e+ne>ii||z.length>=s)break;z.push(X),_e+=ne}return z},D=()=>{try{if(Date.now()<L)return;for(;S.length>0&&!(Date.now()<L);){let _=S.filter(_e=>!w.has(_e.id));if(S.length=0,_.length===0)break;let z=k(_);if(z.length===0)break;z.length<_.length&&S.push(..._.slice(z.length)),v(z)}}catch(_){}},H=!0,Y=null;Y=setInterval(()=>{H&&D()},o);let le=()=>{document.visibilityState==="hidden"&&D()},we=()=>{D()};return document.addEventListener("visibilitychange",le),window.addEventListener("pagehide",we),{push(_){C(_),S.length>=s&&D()},flush:D,destroy(_){_!=null&&_.forget&&(u=!0),H=!1,Y!==null&&(clearInterval(Y),Y=null),document.removeEventListener("visibilitychange",le),window.removeEventListener("pagehide",we),D()}}}var ai=200;function Gt(e){return`_snt_goal_retry_${e.slice(0,12)}`}var li={send:()=>{},flush:()=>{},destroy:()=>{}};function Ar(e){var t,n,r;if(typeof window=="undefined")return li;let o=(t=e.flushIntervalMs)!=null?t:5e3,s=(n=e.maxRetrySize)!=null?n:100,a=(r=e.maxPerFlush)!=null?r:5,l=Gt(e.apiKey),i=!1,c=fe(e.apiKey),u=(...p)=>{!i&&fe(e.apiKey)===c&&An(...p)},g=[],y=new Set,S=new Set,w=[],b=0,$=0,K=!1,A=p=>{for(y.delete(p.id),S.has(p.id)||(S.add(p.id),w.push(p.id));w.length>ai;){let k=w.shift();k&&S.delete(k)}Er([p.id],l)},C=p=>{u([p],s,l),!S.has(p.id)&&!y.has(p.id)&&(y.add(p.id),g.push(p)),Date.now()>=b&&($++,b=Date.now()+ze($))},I=p=>{let k,D=je(15e3);try{k=fetch(e.url,{method:"POST",keepalive:!0,signal:D.signal,body:p.body,headers:e.headers})}catch(Y){C(p);return}let H=Y=>{var le;let we=Kt(Y);if(we==="retry"){C(p);return}we==="dropped"&&((le=e.onDrop)==null||le.call(e,p,Y.status)),A(p),$=0,b=0};Promise.resolve(k).then(D.clear,D.clear),k&&typeof k.then=="function"?k.then(H).catch(()=>C(p)):H(k)},M=()=>{try{if(K||Date.now()<b)return;let p=0;for(;g.length>0&&p<a&&!(Date.now()<b);){let k=g.shift();y.delete(k.id),!S.has(k.id)&&(p++,I(k))}}catch(p){}},L=kr(l,s);for(let p of L)y.has(p.id)||(y.add(p.id),g.push(p));L.length>0&&An(L,s,l);let m=setInterval(M,o),v=()=>{document.visibilityState==="hidden"&&M()},f=()=>M();return document.addEventListener("visibilitychange",v),window.addEventListener("pagehide",f),{send(p){if(K){S.has(p.id)||u([p],s,l);return}if(!(S.has(p.id)||y.has(p.id))){if(Date.now()<b){u([p],s,l),y.add(p.id),g.push(p);return}I(p)}},flush:M,destroy(p){p!=null&&p.forget&&(i=!0),clearInterval(m),document.removeEventListener("visibilitychange",v),window.removeEventListener("pagehide",f),M(),K=!0}}}function st(e){if(typeof window=="undefined"||!e)return!1;Bt(e);let t=!1,n=ht(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let a=location.protocol==="https:"?"; Secure":"";document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${a}`,t=!0}}catch(a){}let r=Ve(e),o=[n,"_snt_graph_edges",ot+e,jt(e),Gt(e),`_snt_graph_nodes${r}`],s=[`_snt_asgn${r}_`];for(let a of["localStorage","sessionStorage"])try{let l=window[a];for(let i of o)l.getItem(i)!==null&&(l.removeItem(i),t=!0);for(let i=l.length-1;i>=0;i--){let c=l.key(i);c&&s.some(u=>c.startsWith(u))&&(l.removeItem(c),t=!0)}}catch(l){}try{(new RegExp(`(?:^|; )${We}=[^;]`).test(document.cookie)||localStorage.getItem(We)!==null||sessionStorage.getItem(We)!==null)&&localStorage.setItem(`${We}_tomb${r}`,"1")}catch(a){}return t}In();function Ft(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function Or(e){if(e.length===0)return null;let t={};for(let n of e.split("|")){let r=n.indexOf("=");if(r<=0||r!==n.lastIndexOf("=")||r===n.length-1)return null;let o=n.slice(0,r);if(o in t)return null;t[o]=n.slice(r+1)}return t}function On(e){var t,n,r;if(e.arms)return typeof e.baseline=="string"?e.baseline:(t=e.arms[0])!=null?t:"";if(e.baseline!==void 0&&typeof e.baseline=="object")return Ft(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[s,a]of Object.entries((n=e.dims)!=null?n:{}))o[s]=(r=a[0])!=null?r:"";return Ft(o)}function Tr(e,t){var n,r;return e.dims!=null?(r=(n=Or(t))!=null?n:Or(On(e)))!=null?r:{}:t}function Je(e){return e>=.3?e<.7?"medium":"high":"low"}var Lr=["new","browsing","carted","customer","lapsed"];var gi=["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 Pr(e){return mi(e)!==null}function mi(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=gi.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Rr(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 Nr(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(o){}let r=n.hostname.toLowerCase();return/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(r)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(r)?"social":"referral"}catch(n){return"direct"}}function Mr(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var hi=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Dr(e){let t={},n={};try{let r=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([o,s])=>{let a=Array.isArray(s)?s[0]:s;return a===void 0?[]:[[o,a]]});for(let[o,s]of r)o.startsWith("utm_")?o in t||(t[o]=s):hi.includes(o)&&(o in n||(n[o]=s))}catch(r){}return{utmParams:t,clickIds:n}}function $r(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function Tn(e){return j(j(j({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 Ln(e){let t=Tn(e);return Tr(t,On(t))}function Br(e){return typeof e=="string"?e:Ft(e)}In();var $n;function Ht(e){$n=typeof e=="string"&&e!==""?e:void 0}function Wr(e=document){if($n)return $n;try{let t=e.querySelector("script[nonce]");return(t==null?void 0:t.nonce)||(t==null?void 0:t.getAttribute("nonce"))||void 0}catch(t){return}}function Ge(e,t=document){let n=Wr(t);return n&&e.setAttribute("nonce",n),e}function zr(){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 Gr="_snt_uid",bi=365,at="_snt_uid";function Si(){return zr()}function Pn(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function Gn(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function wi(e,t,n){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${Gn()}`}catch(r){}}function Ut(e){try{return localStorage.getItem(e)}catch(t){return null}}function Fr(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function Rn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function _i(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function ki(e){try{sessionStorage.removeItem(e)}catch(t){}}function Ei(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${Gn()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function xi(e){try{localStorage.removeItem(e)}catch(t){}}function Ai(e){try{document.cookie=`${e}=; max-age=0; SameSite=lax; path=/${Gn()}`}catch(t){}}var Ci={getSessionId:()=>null,isEphemeral:()=>!1,destroy:()=>{}};function Hr(e){var t,n,r,o,s,a,l;if(typeof window=="undefined")return Ci;let i=Ve(e==null?void 0:e.apiKey),c=(t=e==null?void 0:e.cookieName)!=null?t:ht(e==null?void 0:e.apiKey),u=`${at}${i}`,g=`${at}_tomb${i}`,y=((n=e==null?void 0:e.cookieTTLDays)!=null?n:bi)*24*60*60,S=I=>I&&I.length>0?I:null,w=()=>{var I,M;return i&&!(e!=null&&e.cookieName)&&Ut(g)===null?(M=(I=S(Pn(Gr)))!=null?I:S(Ut(at)))!=null?M:S(Rn(at)):null},b=(l=(a=(s=(o=(r=S(Pn(c)))!=null?r:S(Ut(u)))!=null?o:S(Rn(u)))!=null?s:w())!=null?a:S(e==null?void 0:e.ssrSessionId))!=null?l:Si();wi(c,b,y);let $=Fr(u,b),K=Ei(c),A=$?!1:_i(u,b),C=!$&&!K&&!A;return{getSessionId:()=>b,isEphemeral:()=>C,destroy:()=>{b=null,Ai(c),xi(u),ki(u),i&&!(e!=null&&e.cookieName)&&(Pn(Gr)!==null||Ut(at)!==null||Rn(at)!==null)&&Fr(g,"1")}}}var Ii=1800*1e3;function Vt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Oi(e=Ii,t){let n=new Map,r=`_snt_asgn${Ve(t)}_`,o=(i,c)=>`${r}${encodeURIComponent(i)}:${encodeURIComponent(c)}`,s=i=>{let c=i.slice(r.length),u=c.indexOf(":");if(u<0)return null;try{return{componentId:decodeURIComponent(c.slice(0,u)),segment:decodeURIComponent(c.slice(u+1))}}catch(g){return null}},a=()=>{try{let i=[];for(let c=0;c<localStorage.length;c++){let u=localStorage.key(c);u!=null&&u.startsWith(r)&&i.push(u)}return i}catch(i){return[]}},l=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of a())try{let c=localStorage.getItem(i);if(!c)continue;let u=JSON.parse(c);if(l(u)){localStorage.removeItem(i);continue}let g=s(i);if(!g)continue;n.set(Vt(g.componentId,g.segment),u)}catch(c){}})(),{get(i,c){let u=n.get(Vt(i,c));return u?l(u)?(n.delete(Vt(i,c)),null):u:null},set(i,c,u){let g=Vt(i,c);n.set(g,u);try{localStorage.setItem(o(i,c),JSON.stringify(u))}catch(y){}},clear(){n.clear();for(let i of a())try{localStorage.removeItem(i)}catch(c){}}}}var Bn="data-sentient-stage";function vt(e,t){return!t||typeof e!="string"||!(e==="returning"||Lr.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function qt(e,t=document){try{e?t.documentElement.setAttribute(Bn,e):t.documentElement.removeAttribute(Bn)}catch(n){}}var Kn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.",qr="[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.",Ur=!1,Wt=!1;function Ti(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function Li(e){var t;let n=Hr({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),r=(t=n.getSessionId())!=null?t:"local",o=Ti(),s=Promise.resolve().then(()=>(jr(),Kr)).then(u=>{let g=u;return g.LOCAL_ENGINE_AVAILABLE?(Ur||(Ur=!0,console.info(qr)),g):(Wt||(Wt=!0,console.error(Kn)),null)}).catch(()=>(Wt||(Wt=!0,console.error(Kn)),null)),a=null,l={low:.15,medium:.5,high:.85},i=(()=>{var u;if(e.initialPersona)return j({},e.initialPersona);let g=it(e.apiKey||"local");return g?{persona:g.persona,confidence:(u=l[g.band])!=null?u:.15}:null})();function c(u){let g=document.documentElement;g.dataset.sentientPersona===void 0&&(g.dataset.sentientPersona=u.persona,g.dataset.sentientConfidence=Je(u.confidence))}return{isLocal:!0,async decide(u){var g,y,S;let w=await s;if(!w)return null;let b=w.createLocalEngine({sessionId:r,forcedPersona:o}).decide(u);return a=qe(j({},b),{layoutOrder:(y=(g=b.layoutOrder)!=null?g:a==null?void 0:a.layoutOrder)!=null?y:null,slots:j(j({},(S=a==null?void 0:a.slots)!=null?S:{}),b.slots)}),He(e.apiKey||"local",{v:1,persona:a.persona,band:Je(a.confidence),slots:a.slots,layoutOrder:a.layoutOrder,savedAt:Date.now()}),c(b),b},getSlotResult(u){var g,y,S;return(S=(y=a==null?void 0:a.slots[u])!=null?y:(g=e.initialSlots)==null?void 0:g[u])!=null?S:null},getSlotConfig(u){var g,y;return(y=(g=e.initialSlotConfig)==null?void 0:g[u])!=null?y:null},getSitePalette(){var u;return(u=e.initialPalette)!=null?u:null},reportSlots(){},getVisitorId:()=>null,getPersona(){let u=a!=null?a:i;return u?{persona:u.persona,confidence:u.confidence,band:Je(u.confidence)}:null},async assign(u,g){var y;let S=await s;return!S||!g||g.length===0?g!=null&&g[0]?{variantId:g[0],assignmentTtlMs:0}:null:{variantId:(y=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:u,variantIds:g}]}).assignments[u])!=null?y:g[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>n.destroy()}}var Jt=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function Nn(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Fn(e,t){if(e===void 0||!Jt.test(e))return!1;if(e==="*")return!0;let n=Nn(t);if(e.endsWith("/*")){let r=Nn(e.slice(0,-2));return n.startsWith(r==="/"?"/":`${r}/`)&&n!==r}return n===Nn(e)}function Un(e,t){if(!e)return!1;if(e==="/")return t==="/";let n=e.endsWith("/")?e.slice(0,-1):e;return t===n||t.startsWith(`${n}/`)}function bt(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(bt):!1}var Vr="sentient-reveal",lt="sentient-revealed",Jr=240,Mn=!1;function Pi(e){if(Mn||e.getElementById(Vr)){Mn=!0;return}let t=Ge(e.createElement("style"),e);t.id=Vr,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${lt}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${lt}{animation:${lt} ${Jr}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),Mn=!0}function Vn(e,t={}){var n;let r=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!r||!(e instanceof Element)||(t.arm!==void 0&&e.setAttribute("data-sentient-arm",t.arm),t.persona!==void 0&&e.setAttribute("data-sentient-persona",t.persona),t.previous!==void 0&&t.previous===e.textContent))return!1;Pi(r),e.classList.remove(lt),e.offsetWidth,e.classList.add(lt);let o=()=>{e.classList.remove(lt),e.removeEventListener("animationend",o)};return e.addEventListener("animationend",o),!0}function Wn(e,t,n,r){let o=[];{let s=!1,a=[],l=()=>{if(s)return;let i=Date.now();for(a.push(i);a.length>0&&i-a[0]>500;)a.shift();a.length>=3&&(s=!0,e("rage_click"))};t.addEventListener("click",l),o.push(()=>t.removeEventListener("click",l))}{let s=!1,a=l=>{if(s||!(l.target instanceof Node)||!t.contains(l.target)&&t!==l.target)return;s=!0;let i=typeof window!="undefined"?window.getSelection():null,c=i?i.toString().length:0;e("text_copy",{selectionLength:c})};document.addEventListener("copy",a),o.push(()=>document.removeEventListener("copy",a))}{let s=!1,a=!1,l=null,i=()=>{l!==null&&(clearTimeout(l),l=null)},c=()=>{s||!a||(i(),l=setTimeout(()=>{!s&&a&&(s=!0,e("scroll_hesitation"))},3e3))},u=()=>{i(),c()},g=S=>{for(let w of S)a=w.intersectionRatio>.3,a?c():i()},y=new IntersectionObserver(g,{threshold:[.3]});y.observe(t),window.addEventListener("scroll",u,{passive:!0}),o.push(()=>{y.disconnect(),window.removeEventListener("scroll",u),i()})}if((r==null?void 0:r.tabLoss)!==!1){let s=!1,a=n!=null?n:Date.now(),l=()=>{if(s||document.visibilityState!=="hidden")return;let i=Date.now()-a;i<15e3&&(s=!0,e("tab_loss",{timeOnPage:i}))};document.addEventListener("visibilitychange",l),o.push(()=>document.removeEventListener("visibilitychange",l))}return()=>{for(let s of o)s()}}function Ri(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var Yr="https://api.sentient-ui.com/v1/events",pe=new Map,Xr=null;function Ni(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Mi=3;function Dn(){return zr()}function zt(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Di(){let e=new WeakMap,t=new Map,n=!1,r=(l,i,c)=>{let u=l.get(i);return c===null?u?!0:(l.set(i,new Set),!1):u?u.has(c)?!0:(u.add(c),!1):(l.set(i,new Set([c])),!1)},o=typeof window!="undefined"&&"event"in window,s=()=>{if(!o)return;let l=window.event;return typeof Event=="function"&&l instanceof Event?l:void 0},a=()=>{if(o){Promise.resolve().then(()=>{n=!1,t.clear()});return}let l=!1,i=()=>{l||(l=!0,n=!1,t.clear())};if(setTimeout(i,0),typeof MessageChannel=="function"){let c=new MessageChannel;c.port1.onmessage=()=>{c.port1.close(),c.port2.close(),i()},c.port2.postMessage(0)}};return{firedBefore(l,i){let c=s();if(c){let g=e.get(c);return g||(g=new Map,e.set(c,g)),r(g,l,i)}let u=r(t,l,i);return!u&&!n&&(n=!0,a()),u}}}var Zr=new Set;function $i(e,t,n){let r=typeof window=="undefined"?null:window.history;if(!r)return()=>{};let o=!1,s,a=()=>{if(o)return;let c=zt();!c||c===s||(s=c,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${c}`))},l=[];for(let c of["pushState","replaceState"]){let u=r[c],g=function(...y){let S=u.apply(this,y);return a(),S};r[c]=g,l.push([c,u,g])}window.addEventListener("popstate",a);let i=zt();return i&&Zr.has(`${t}:${i}`)?s=i:a(),()=>{if(!o){o=!0,window.removeEventListener("popstate",a);for(let[c,u,g]of l)r[c]===g&&(r[c]=u)}}}var yt={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 Bi(){try{return Dr(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function Qr(e){return e.replace(/\/events\/?$/,"")}function Ye(){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(e=>e==="1"||e==="yes")}function zn(e){var t;if(typeof window=="undefined")return;let n=e!=null?e:Xr;if(!n){console.warn("[sentient] grantConsent() called before init()");return}let r=pe.get(n);if(!r){console.warn("[sentient] grantConsent() called before init()");return}let{config:o,upgrade:s,reinit:a}=r;if(!s){r.upgradeBlockedReason&&console.warn(r.upgradeBlockedReason);return}if(o.respectDoNotTrack!==!1&&Ye())return;let l=(a!=null?a:St)(qe(j({},o),{consent:!0}));s(l);let i=(t=pe.get(n))==null?void 0:t.dispose;pe.set(n,{config:qe(j({},o),{consent:!0}),upgrade:null,dispose:i})}function Ki(e,t){var n;let r=e.preConsentBehavior==="statistical_winner",o=Qr((n=e.ingestUrl)!=null?n:Yr),s={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},a=new Map,l=new Map,i={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(m,v,f){if(!r)return Promise.resolve(null);let p=a.get(m);return p?Promise.resolve(p):jn(l,m,async()=>{try{let k=new URLSearchParams({componentId:m});for(let le of v!=null?v:[])k.append("variantIds[]",le);let D=je(5e3),H;try{let le=await fetch(`${o}/winner?${k.toString()}`,{headers:s,signal:D.signal});if(!le.ok)return v!=null&&v[0]?{variantId:v[0],assignmentTtlMs:0}:null;H=await le.json()}finally{D.clear()}let Y={variantId:H.variantId,assignmentTtlMs:0};return a.set(m,Y),Y}catch(k){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:()=>{}},c=!1,u=new Set,g=[],y=[],S=[],w=()=>{for(let[,,m]of S.splice(0))m(null);b.length=0},b=[],$=!1,K=()=>{if(c)return;$=!0;let m=pe.get(e.apiKey);(m==null?void 0:m.upgrade)===L&&pe.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},A=[],C=()=>{setTimeout(()=>{var m;try{(m=A.shift())==null||m(i)}catch(v){}A.length&&C()})},I=m=>{c?A.length?A.push(m):m(i):!t&&!$&&b.length<100?b.push(m):$&&e.debug&&console.warn("[sentient] goal dropped: client released")},M={get gated(){return!c&&!t},get released(){return $&&!c},takeHeld:()=>b.splice(0),track:m=>i.track(m),goal:((m,v,f,p)=>I(k=>k.goal(m,v,f,p))),componentGoal:(m,v,f)=>i.componentGoal(m,v,f),identify:m=>i.identify(m),getAssignment:(m,v)=>i.getAssignment(m,v),isUnified:m=>{var v,f;return(f=(v=i.isUnified)==null?void 0:v.call(i,m))!=null?f:!1},assign:(m,v,f,p,k)=>i.assign(m,v,f,p,k),decide:m=>c?i.decide(m):$||t?Promise.resolve(null):new Promise(v=>S.push([m,Le(),v])),getSlotResult:m=>i.getSlotResult(m),isSlotDecided:m=>{var v,f;return(f=(v=i.isSlotDecided)==null?void 0:v.call(i,m))!=null?f:!0},getSlotConfig:m=>i.getSlotConfig(m),getSitePalette:()=>i.getSitePalette(),getStyleVocabulary:()=>{var m,v;return(v=(m=i.getStyleVocabulary)==null?void 0:m.call(i))!=null?v:null},reportSlots:(m,v,f,p)=>i.reportSlots(m,v,f,p),reportSkeleton:(m,v)=>{var f;return(f=i.reportSkeleton)==null?void 0:f.call(i,m,v)},reportAgentData:(m,v,f)=>{var p;return(p=i.reportAgentData)==null?void 0:p.call(i,m,v,f)},reportDrift:(m,v,f,p)=>{var k;return(k=i.reportDrift)==null?void 0:k.call(i,m,v,f,p)},requestSlots:(m,v,f)=>{var p;return c?(p=i.requestSlots)==null?void 0:p.call(i,m,v,f):g.push([m,v,f])},decideSlots:m=>{var v;return c?(v=i.decideSlots)==null?void 0:v.call(i,m):y.push(...m)},cancelSlots:m=>{var v;if(c)return(v=i.cancelSlots)==null?void 0:v.call(i,m);let f=new Set(m);for(let p of g)p[0]=p[0].filter(k=>!f.has(k));y=y.filter(p=>!f.has(p.id))},onSlotsChanged:m=>(u.add(m),()=>{u.delete(m)}),getPersona:()=>i.getPersona(),getVisitorId:()=>{var m,v;return(v=(m=i.getVisitorId)==null?void 0:m.call(i))!=null?v:null},fetchWeights:()=>i.fetchWeights(),getGraph:()=>i.getGraph(),flush:()=>i.flush(),dispose:()=>(K(),w(),i.dispose()),destroy:()=>(K(),w(),c?i.destroy():st(e.apiKey))};function L(m){var v,f,p;i=m,c=!0,b.length&&(A.push(...b.splice(0)),C());let k=Le();for(let[D,H,Y]of S.splice(0))H!==k?Y(null):m.decide(D).then(Y,()=>Y(null));(v=m.onSlotsChanged)==null||v.call(m,()=>u.forEach(D=>D()));for(let[D,H,Y]of g.splice(0))D.length>0&&((f=m.requestSlots)==null||f.call(m,D,H,Y));y.length>0&&((p=m.decideSlots)==null||p.call(m,y.splice(0)))}return{proxy:M,setInner:L}}function Le(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function jn(e,t,n){let r=e.get(t);if(r)return r;let o=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,o),o}function St(e){var t,n,r,o,s,a,l,i,c,u,g;if(typeof window=="undefined")return yt;e.nonce&&Ht(e.nonce),Xr=e.apiKey||"local";let y=pe.get(e.apiKey||"local");if(y!=null&&y.dispose)try{y.dispose()}catch(d){}let S=e.respectDoNotTrack!==!1&&Ye(),w=e.consent===!1||S,b=typeof e.apiKey=="string"&&e.apiKey.startsWith("pk_");if(e.localMode===!0||!b&&e.localMode!==!1)return pe.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."}),w?yt:Li(e);if(w){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."),pe.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."}),yt;let{proxy:d,setInner:h}=Ki(e,S);return pe.set(e.apiKey,{config:e,upgrade:S?null:h}),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."),yt;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),yt;let $=(t=e.ingestUrl)!=null?t:Yr,K=Date.now(),A=Hr({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),C=Oi(void 0,e.apiKey),I=!1,M=fe(e.apiKey),L=()=>!I&&fe(e.apiKey)===M,m=new Set((n=e.initialUnified)!=null?n:[]),v=qe(j({},C),{get:(d,h)=>m.has(d)?null:C.get(d,h),set:(...d)=>{L()&&C.set(...d)}}),f=xr({ingestUrl:$,apiKey:e.apiKey}),p=Qr($),k={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},D=new Set,H=Ar({url:`${p}/goals`,apiKey:e.apiKey,headers:k,onDrop:(d,h)=>{if(!e.debug){if(D.has(h))return;D.add(h)}console.warn(`[sentient] goal dropped (HTTP ${h}) \u2014 this will not be retried. `+(h===400?"The session was not found: call init() and let the session upsert complete before firing goals.":h===401||h===403?"Check the API key and that this origin is on the project allowlist.":"See the response status for the cause."),d)}}),Y=Rr((r=navigator.userAgent)!=null?r:""),le=window.location.origin,we=Nr((o=document.referrer)!=null?o:"",le),_=(s=e.sessionSegment)!=null?s:`${Y}:${we}`,z=new Map,_e=new Map,X=new Map,ne=new Set,ce=new Map,Ce=null,ge=null,Q=null,$e=new Set,Rt=new Set,vn=new Map,bn=new Map,ar=new Set,lr=new Set,ur=new Set,cr=new Set,Sn=null,ft=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,dr=new Set,Nt=new Set,Mt=new Set,pt=new Map,wn=null,Dt=new Set,gt=new Map,_n=null,zo=2,fr=new Map,ke=!1,pr=(d,h,P)=>{var F;let G=new Set,E=1;for(let O of d){h.delete(O);let T=((F=fr.get(O))!=null?F:0)+1;fr.set(O,T),T<=zo&&(G.add(O),T>E&&(E=T))}G.size>0&&setTimeout(()=>{ke||P(G)},ze(E))},kn=d=>{for(let h of d)X.has(h.id)||X.set(h.id,Ln(h))};if(e.initialSlots)for(let[d,h]of Object.entries(e.initialSlots))X.set(d,h),ne.add(d);if(e.initialSlotConfig)for(let[d,h]of Object.entries(e.initialSlotConfig))ce.set(d,h);e.initialPalette&&(Ce=e.initialPalette),e.initialVocabulary&&(ge=e.initialVocabulary);let Ie=it(e.apiKey);if(Ie){for(let[d,h]of Object.entries(Ie.slots))X.has(d)||X.set(d,h);for(let[d,h]of Object.entries((a=Ie.slotConfig)!=null?a:{}))ce.has(d)||ce.set(d,h);!Ce&&Ie.palette&&(Ce=Ie.palette),!ge&&Ie.vocabulary&&(ge=Ie.vocabulary)}let gr={low:.15,medium:.5,high:.85};if(e.initialPersona)Q=j({},e.initialPersona);else{let d=document.documentElement.dataset;d.sentientPersona?Q={persona:d.sentientPersona,confidence:(i=gr[(l=d.sentientConfidence)!=null?l:"low"])!=null?i:.15}:Ie&&(Q={persona:Ie.persona,confidence:(c=gr[Ie.band])!=null?c:.15})}if(e.initialAssignments)for(let[d,h]of Object.entries(e.initialAssignments))v.set(d,_,{variantId:h,assignedAt:Date.now(),segment:_,confidence:1});let Be=Promise.resolve(),mr=A.getSessionId();if(mr){let d=Mr((u=document.referrer)!=null?u:""),{utmParams:h,clickIds:P}=Bi(),F=j(j(j(j({sessionId:mr,deviceClass:Y,trafficSource:we,referrerDomain:d,utmParams:h,clickIds:P,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:$r(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:A.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Pr((g=navigator.userAgent)!=null?g:"")},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}:{}),G=async()=>{for(let E=0;;E++){if(ke||!L())return;let O=je(5e3);try{let T=await fetch(`${p}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(F),headers:k,signal:O.signal});if(T.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(T.ok||Kt(T)==="dropped")return}catch(T){}finally{O.clear()}if(E>=Mi){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(T=>setTimeout(T,ze(E+1)))}};try{Be=G()}catch(E){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:f});let Ho=Di(),mt=null,En=!1,ie={goal(d,h={},P=1,F=0){var G,E,O,T,V,W,q;let ee=A.getSessionId();if(!ee||ke||!L())return;let B=Ni(h)?h:{metadata:h},me=[d,(G=B.externalId)!=null?G:"",(E=B.stepIndex)!=null?E:F,(O=B.weight)!=null?O:P].join("\0"),Ee=B.value!==void 0?`${B.value}\0${(T=B.currency)!=null?T:""}`:null;if(Ho.firedBefore(me,Ee)){e.debug&&console.log(`[sentient] goal("${d}") already recorded for this action \u2014 not sent twice`);return}let de=Dn(),se={sessionId:ee,name:d,metadata:(V=B.metadata)!=null?V:{},weight:(W=B.weight)!=null?W:P,stepIndex:(q=B.stepIndex)!=null?q:F,goalId:de,value:B.value,currency:B.currency,externalId:B.externalId};e.debug&&console.log("[sentient] goal",se);let N={id:de,body:JSON.stringify(se)};Be.then(()=>H.send(N))},componentGoal(d,h,P){var F,G,E;let O=A.getSessionId();if(!O||ke||!L())return;let T=v.get(d,_),V=T?null:(F=X.get(d))!=null?F:null;if(!T&&V===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(!T&&!ne.has(d)){e.debug&&console.warn(`[sentient] componentGoal("${d}"): slot not decided this session \u2014 not attributed`);return}let W=T?T.variantId:Br(V),q={id:Dn(),sessionId:O,projectId:e.apiKey,componentId:d,variantId:W,eventType:"goal_achieved",goalType:h,payload:j({reward:(G=P==null?void 0:P.reward)!=null?G:1,goalValue:P==null?void 0:P.value,currency:P==null?void 0:P.currency},(E=P==null?void 0:P.metadata)!=null?E:{}),timestamp:Date.now(),timeInSession:Date.now()-K,path:zt()};e.debug&&console.log("[sentient] componentGoal",q),Be.then(()=>{!ke&&L()&&f.push(q)})},identify(d){let h=A.getSessionId();!h||ke||!L()||Be.then(()=>{fetch(`${p}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify({sessionId:h,userId:d,ephemeral:A.isEphemeral()}),headers:k}).catch(()=>{})})},track(d){let h=A.getSessionId();if(!h||ke||!L()||d.eventType==="variant_assigned"&&X.get(d.componentId)!==void 0&&!ne.has(d.componentId)&&!v.get(d.componentId,_))return;let P=qe(j({path:zt()},d),{id:Dn(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-K});e.debug&&console.log("[sentient] track",P),Be.then(()=>f.push(P))},getAssignment(d,h){return v.get(d,h)},isUnified:d=>m.has(d),async assign(d,h,P,F,G){var E;let O=A.getSessionId();if(!O)return null;let T=(G==null?void 0:G.unified)===!0;if(T&&m.has(d))return{variantId:(E=h==null?void 0:h[0])!=null?E:"",assignmentTtlMs:0,unified:!0};let V=v.get(d,_);if(V&&(h!=null&&h.length||V.content!==void 0)){let W=V.ttlMs&&V.ttlMs>0?Math.max(0,V.assignedAt+V.ttlMs-Date.now()):0;return{variantId:V.variantId,assignmentTtlMs:W,content:V.content}}return jn(z,T?`${d}\0unified`:d,async()=>{if(!await Cn(Be,2500)||ke||!L())return null;let W=je(3e4);try{let q={sessionId:O,componentId:d,variantIds:h};F!==void 0?q.agentDataByVariant=F:P!==void 0&&(q.agentData=P),T&&(q.caps={unified:!0});let ee=await fetch(`${p}/assign`,{method:"POST",body:JSON.stringify(q),headers:k,signal:W.signal});if(!ee.ok)return null;let B=await ee.json();return B.unified===!0?T?(m.add(d),{variantId:B.variantId,assignmentTtlMs:0,unified:!0}):null:(v.set(d,_,j({variantId:B.variantId,assignedAt:Date.now(),segment:_,confidence:1,content:B.content},B.assignmentTtlMs&&B.assignmentTtlMs>0?{ttlMs:B.assignmentTtlMs}:{})),B)}catch(q){return null}finally{W.clear()}})},async decide(d){var h,P;let F=A.getSessionId();if(!F)return null;let G=(h=d.slots)!=null?h:[],E={sessionId:F};d.sections&&d.sections.length>0&&(E.sections=d.sections.map(T=>({id:T}))),E.components=(P=d.components)!=null?P:[],G.length>0&&(E.slots=G.map(Tn)),d.slotsFrom==="registry"&&(E.slotsFrom="registry",d.registrySlotIds&&(E.registrySlotIds=d.registrySlotIds),d.bootstrap===!1&&(E.bootstrap=!1),d.render&&Object.keys(d.render).length>0&&(E.render=d.render)),d.v&&(E.v=d.v),typeof d.pp=="number"&&(E.pp=d.pp),e.persona&&(E.persona=e.persona);let O=JSON.stringify(E);return jn(_e,O,async()=>{var T,V,W,q,ee,B,me,Ee;if(!await Cn(Be,2500)||ke||!L())return kn(G),null;let de=je(3e4);try{let se=await fetch(`${p}/decide`,{method:"POST",body:O,headers:k,signal:de.signal});if(!se.ok)return kn(G),null;let N=await se.json(),Oe=vt(N.stage,e.stageAttributes);e.stageAttributes&&qt(Oe);let rt={};for(let Z of G){let Te=(T=N.slots)==null?void 0:T[Z.id];if(Te!==void 0){rt[Z.id]=Te,X.set(Z.id,Te),ne.add(Z.id);continue}let hr=X.get(Z.id);if(hr!==void 0)rt[Z.id]=hr;else{let yr=Ln(Z);rt[Z.id]=yr,X.set(Z.id,yr)}}if(N.slots)for(let[Z,Te]of Object.entries(N.slots))Z in rt||(rt[Z]=Te,X.set(Z,Te),ne.add(Z));let qo=Q!=null&&Q.persona!=="unknown";N.persona&&!(N.persona==="unknown"&&qo)?Q={persona:N.persona,confidence:(V=N.confidence)!=null?V:0}:Q||(Q={persona:"unknown",confidence:0});for(let[Z,Te]of Object.entries((W=N.assignments)!=null?W:{}))v.set(Z,_,{variantId:Te,assignedAt:Date.now(),segment:_,confidence:1});if(N.slotConfig)for(let[Z,Te]of Object.entries(N.slotConfig))ce.set(Z,Te);N.palette&&(Ce=N.palette),N.vocabulary&&(ge=N.vocabulary);for(let Z of(q=d.registrySlotIds)!=null?q:[])(ee=N.slotConfig)!=null&&ee[Z]||(ce.delete(Z),X.delete(Z),ne.delete(Z));return L()&&He(e.apiKey,j(j(j(j({v:1,persona:Q.persona,band:Je(Q.confidence),slots:Object.fromEntries(X),layoutOrder:(B=N.layoutOrder)!=null?B:null,savedAt:Date.now()},ce.size>0?{slotConfig:Object.fromEntries(ce)}:{}),Ce?{palette:Ce}:{}),ge?{vocabulary:ge}:{}),Oe?{stage:Oe}:{})),j(j(j(j(j(j(j({layoutOrder:(me=N.layoutOrder)!=null?me:null,assignments:(Ee=N.assignments)!=null?Ee:{},slots:rt,persona:Q.persona,confidence:Q.confidence},N.slotConfig?{slotConfig:N.slotConfig}:{}),N.goals?{goals:N.goals}:{}),N.sectionMap?{sectionMap:N.sectionMap}:{}),N.palette?{palette:N.palette}:{}),N.vocabulary?{vocabulary:N.vocabulary}:{}),N.stage?{stage:N.stage}:{}),N.context?{context:N.context}:{})}catch(se){return kn(G),null}finally{de.clear()}})},getSlotResult(d){var h;return(h=X.get(d))!=null?h:null},isSlotDecided(d){return ne.has(d)},getSlotConfig(d){var h;return(h=ce.get(d))!=null?h:null},reportSlots(d,h,P,F){var G;let E={};for(let[O,T]of Object.entries(F!=null?F:{}))for(let V of T){let W=`${O}|${V.key}`;!ft.test(O)||ur.has(W)||(ur.add(W),((G=E[O])!=null?G:E[O]=[]).push(V))}Object.keys(E).length>0&&fetch(`${p}/slots/observed`,{method:"POST",headers:k,body:JSON.stringify({slotIds:Object.keys(E),authoredArms:E})}).catch(()=>{});for(let O of d)if(!(typeof O!="string"||O.length===0)){if(!ft.test(O)){Ri()&&!dr.has(O)&&(dr.add(O),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(O)} 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(!$e.has(O)){$e.add(O),Rt.add(O);let T=h==null?void 0:h[O];if(typeof T=="string"){let W=T.replace(/\s+/g," ").trim().slice(0,400);W!==""&&vn.set(O,W)}let V=P==null?void 0:P[O];V!==void 0&&bn.set(O,V)}}Rt.size===0||Sn!=null||(Sn=setTimeout(()=>{Sn=null;let O=[...Rt];Rt.clear();for(let T=0;T<O.length;T+=20){let V=O.slice(T,T+20),W={},q={};for(let ee of V){let B=vn.get(ee);B!==void 0&&(W[ee]=B,vn.delete(ee));let me=bn.get(ee);me!==void 0&&(q[ee]=me,bn.delete(ee))}fetch(`${p}/slots/observed`,{method:"POST",headers:k,body:JSON.stringify(j(qe(j(j({slotIds:V},Object.keys(W).length>0?{baselineTexts:W}:{}),Object.keys(q).length>0?{baselineSkeletons:q}:{}),{pagePaths:Object.fromEntries(V.map(ee=>[ee,location.pathname]))}),Object.keys(W).length>0&&A.getSessionId()?{sessionId:A.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(d,h){!ft.test(d)||ar.has(d)||(ar.add(d),fetch(`${p}/slots/observed`,{method:"POST",headers:k,body:JSON.stringify({slotIds:[d],baselineSkeletons:{[d]:h}})}).catch(()=>{}))},reportAgentData(d,h,P){let F=`${d}|${h}`;!ft.test(d)||cr.has(F)||(cr.add(F),fetch(`${p}/slots/observed`,{method:"POST",headers:k,body:JSON.stringify(j({slotIds:[d],agentData:{[d]:{[h]:P}}},h.startsWith("authored.")?{authoredArms:{[d]:[{key:h.slice(9)}]}}:{}))}).catch(()=>{}))},reportDrift(d,h,P,F){let G=`${d}|${h}`,E=A.getSessionId();!E||lr.has(G)||(lr.add(G),fetch(`${p}/slots/drift`,{method:"POST",headers:k,body:JSON.stringify({sessionId:E,reports:[{slotId:d,expectedFp:h,observedFp:P,reason:F}]})}).catch(()=>{}))},requestSlots(d,h,P){var F,G;for(let E of d)Mt.has(E)||(Mt.add(E),ft.test(E)?pt.set(E,{text:h==null?void 0:h[E],render:(F=P==null?void 0:P.render)==null?void 0:F[E],skeleton:(G=P==null?void 0:P.skeletons)==null?void 0:G[E]}):ie.reportSlots([E]));pt.size===0||wn!=null||(wn=setTimeout(()=>{wn=null;let E=[...pt];pt.clear();for(let O=0;O<E.length;O+=50){let T=E.slice(O,O+50),V={};for(let[W,q]of T)q.render&&(V[W]=q.render);ie.decide({slotsFrom:"registry",registrySlotIds:T.map(([W])=>W),bootstrap:!1,render:V}).then(W=>{var q,ee;if(W){let B={},me={},Ee=[];for(let[de,se]of T){let N=(q=W.slotConfig)==null?void 0:q[de];if(N){N.needsSkeleton&&se.skeleton&&((ee=ie.reportSkeleton)==null||ee.call(ie,de,se.skeleton));continue}Ee.push(de),se.text&&(B[de]=se.text),se.skeleton&&(me[de]=se.skeleton)}Ee.length>0&&ie.reportSlots(Ee,B,me)}else pr(T.map(([B])=>B),Mt,B=>{var me;let Ee={},de={},se={};for(let[N,Oe]of T)B.has(N)&&(Oe.text&&(Ee[N]=Oe.text),Oe.render&&(de[N]=Oe.render),Oe.skeleton&&(se[N]=Oe.skeleton));(me=ie.requestSlots)==null||me.call(ie,[...B],Ee,{render:de,skeletons:se})});Nt.forEach(B=>B())})}},0))},decideSlots(d){for(let h of d)Dt.has(h.id)||(Dt.add(h.id),gt.set(h.id,h));gt.size===0||_n!=null||(_n=setTimeout(()=>{_n=null;let h=[...gt.values()];gt.clear();for(let P=0;P<h.length;P+=30){let F=h.slice(P,P+30);ie.decide({slots:F}).then(G=>{G||pr(F.map(E=>E.id),Dt,E=>{var O;return(O=ie.decideSlots)==null?void 0:O.call(ie,F.filter(T=>E.has(T.id)))}),Nt.forEach(E=>E())})}},0))},cancelSlots(d){for(let h of d)pt.delete(h)&&Mt.delete(h),gt.delete(h)&&Dt.delete(h)},onSlotsChanged(d){return Nt.add(d),()=>{Nt.delete(d)}},getStyleVocabulary(){return ge},getSitePalette(){return Ce},getVisitorId:()=>L()?A.getSessionId():null,getPersona(){return Q?{persona:Q.persona,confidence:Q.confidence,band:Je(Q.confidence)}:null},async fetchWeights(){var d;let h=je(5e3);try{let P=await fetch(`${p}/weights`,{headers:k,signal:h.signal});return P.ok?(d=(await P.json()).components)!=null?d:[]:[]}catch(P){return[]}finally{h.clear()}},getGraph(){return{pageNodes:[],capturedAt:0}},flush(){f.flush(),H.flush()},dispose(){var d;mt==null||mt(),En=!0,ke=!0,f.destroy(),H.destroy(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ie.dispose&&pe.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var d;mt==null||mt(),En=!0,ke=!0,I=!0,Bt(e.apiKey),f.destroy({forget:!0}),H.destroy({forget:!0}),A.destroy(),v.clear(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ie.dispose&&pe.delete(e.apiKey);try{localStorage.removeItem(ot+e.apiKey),localStorage.removeItem(jt(e.apiKey)),localStorage.removeItem(Gt(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${Ve(e.apiKey)}`),localStorage.removeItem("_snt_graph_edges")}catch(h){}e.debug&&console.log("[sentient] destroyed")}};if(pe.set(e.apiKey,{config:e,upgrade:null,dispose:ie.dispose}),mt=$i(ie,e.apiKey,d=>{Be.then(()=>{En||Zr.add(d)})}),e.debug){let d=window;d.__sentient&&(d.__sentient.client=ie)}return ie}var Hn=/(^|\/)snippet(\.global)?(\.min)?\.js(\?|$)/,ji=(()=>{var e,t;try{return(t=(e=document.currentScript)==null?void 0:e.src)!=null?t:""}catch(n){return""}})(),Gi=/@\d+\.\d+\.\d+[^/]*\//;function qn(e){var t;try{let n=ji||((t=Array.from(document.getElementsByTagName("script")).find(r=>Hn.test(r.src)))==null?void 0:t.src);for(let r of n?[n]:[]){let o=Hn.test(r)?r.replace(Hn,`$1${e}$4`):r.replace(/[^/?#]*([?#].*)?$/,e),s=(e==="consent.global.js"?"sha384-+7/RqBOFLU5bMaQ6bcBAWzG589skmxN8tedG9hkoQQ6HaQkRRBJfoRVD94e/fJcM":e==="editor.global.js"?"sha384-72Hono7IkRYbjq4IW7kS54x23Y25GgaM7PBrQMFbhkh6hwhPmgMBWkiNA5GQHpgf":e==="preview.global.js"?"sha384-HXVsA3pP+RqWpZ/ydi1iDOLQQsWEQp5owt0/LwaWGSjxzXDFJZxxBuc/w9BkEqNL":"sha384-6/gH6glz7iEKNC/2t8v+wepAu08KsEzNhxY2hifY7Kud2GL4xUnl0ASRESRBtrZ6")||"";return Gi.test(o)&&s.indexOf("sha384-")===0?{src:o,integrity:s}:{src:o}}}catch(n){}return null}var Yt=new Map;function ut(e,t,n){let r=window[t];if(r)return Promise.resolve(r);let o=Yt.get(e);return o||(o=new Promise(s=>{var i;let a=n?{src:n}:qn(e);if(!a)return s(null);let l=Ge(document.createElement("script"));Jn(l,a),l.async=!0,l.onload=()=>{var u;let c=(u=window[t])!=null?u:null;c||Yt.delete(e),s(c)},l.onerror=()=>{Yt.delete(e),s(null)},((i=document.head)!=null?i:document.documentElement).appendChild(l)}),Yt.set(e,o)),o}function Jn(e,t){t.integrity&&(e.integrity=t.integrity,e.crossOrigin="anonymous"),e.src=t.src}var eo="__sentientConsent",Re=null,Yn=!1,Xt=new Set,Xn=()=>{let e=window[eo];return typeof(e==null?void 0:e.consentWatcher)=="function"?e.consentWatcher:null},wt;function to(e){wt=e}function Fi(){Re||(Re=Xn())||Yn||(Yn=!0,ut("consent.global.js",eo,wt).then(e=>{if(Yn=!1,!e)return Ui(wt!=null?wt:"consent.global.js");if(Re=Xn(),Re)for(let t of Array.from(Xt))t()}))}function Ui(e){console.warn(`[sentient] could not load ${e} \u2014 tracking stays off. Set window.sentient.consentSrc to its URL.`)}function Xe(e){Fi();let t=null,n=()=>(!t&&(Re!=null?Re:Re=Xn())&&(t=Re(e)),t);return{read:()=>{var r,o;return(o=(r=n())==null?void 0:r.read())!=null?o:null},refused:()=>{var r,o;return(o=(r=n())==null?void 0:r.refused())!=null?o:!1},subscribe(r){let o,s=!1,a=()=>{Xt.delete(a);let l=n();s||!l||(o=l.subscribe(r),r())};return n()?(o=t.subscribe(r),Promise.resolve().then(()=>{s||r()})):Xt.add(a),()=>{s=!0,Xt.delete(a),o==null||o()}}}}function Vi(e){return e.replace(/\s+/g," ").trim().slice(0,300)}function no(e,t){let n=t>>>0;for(let r=0;r<e.length;r++)n^=e.charCodeAt(r),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function Wi(e){let t=e.join("");return no(t,2166136261)+no(t,1523705862)}var zi=new Set(["A","BUTTON"]),Hi=/^H([1-6])$/,qi=new Set(["P","LI","LABEL","BLOCKQUOTE","FIGCAPTION","DT","DD","TD","TH"]);var Ji=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT"]);function Yi(e){return zi.has(e.tagName)||e.getAttribute("role")==="button"?!0:e.tagName==="INPUT"&&/^(submit|button)$/i.test(e.type)}function Xi(e){if(Hi.test(e.tagName)||qi.has(e.tagName))return!0;let t=e.ownerDocument.defaultView,n=t?t.getComputedStyle(e).display:"";return n!==""&&n!=="inline"&&n!=="contents"}function Zi(e,t){let n=null;for(let r=e.parentElement;r&&r!==t.parentElement;r=r.parentElement){if(Yi(r)){n=r;break}if(r===t)break}if(n)return n;for(let r=e.parentElement;r;r=r.parentElement)if(r===t||Xi(r))return r;return t}function Zt(e,t=40){var n,r,o;let s=e.ownerDocument.createTreeWalker(e,4),a=[];for(let u=s.nextNode();u;u=s.nextNode())if(((n=u.nodeValue)!=null?n:"").trim()!==""&&!Ji.has((o=(r=u.parentElement)==null?void 0:r.tagName)!=null?o:"")&&(a.push(u),a.length>120))return{reason:"too_large"};if(a.length===0)return{reason:"empty"};let l=[],i=[];for(let u of a){let g=Zi(u,e),y=l.indexOf(g);y===-1&&(l.push(g),y=l.length-1),i.push(y)}if(l.length>t)return{reason:"too_large"};let c=a.map(u=>{var g;return Vi((g=u.nodeValue)!=null?g:"")});return{textNodes:a,ownerEls:l,leafToNode:i,leaves:c,fp:Wi(c)}}var ro=["cookiebot","onetrust","cookieyes","tcf","google-consent-mode","shopify"];function Qi(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;let t=Object.entries(e);if(t.length<1||t.length>4)return null;let n={};for(let[r,o]of t){if(!Array.isArray(o)||o.length<2||o.length>6||!o.every(s=>typeof s=="string")||/[=|]/.test(r)||o.some(s=>/[=|]/.test(s)))return null;n[r]=o}return n}function es(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function ts(e){try{return e()}catch(t){return}}function Qt(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.apiKey!="string"||!t.apiKey.startsWith("pk_"))return null;let n={};if(typeof t.slots=="object"&&t.slots!==null&&!Array.isArray(t.slots))for(let[l,i]of Object.entries(t.slots)){if(typeof i!="object"||i===null)continue;let c=i,u=Qi(c.dims);if(!u||c.target!==void 0&&typeof c.target!="string")continue;let g=c.arms!==void 0?es(c.arms):null,y={dims:u};typeof c.target=="string"&&(y.target=c.target),g&&(y.arms=g),n[l]=y}let r={apiKey:t.apiKey,personaAttributes:t.personaAttributes===!0,slots:n};typeof t.consent=="boolean"?r.consent=t.consent:t.consent!==void 0&&s("consent");let o=t.consentFrom;if(typeof o=="string"&&ro.includes(o))r.consentFrom=o;else if(o&&typeof o=="object"&&!Array.isArray(o)){let l=o;typeof l.cmp=="string"&&ro.includes(l.cmp)||l.cmp===void 0&&(typeof l.cookie=="string"||typeof l.check=="function")?r.consentFrom=l:s("consentFrom")}else o!==void 0&&s("consentFrom");function s(l){r.consent=!1,console.warn(`[sentient] invalid ${l} \u2014 tracking stays OFF until it is fixed (sentient-ui.com/docs#consent).`)}(t.preConsentBehavior==="statistical_winner"||t.preConsentBehavior==="control")&&(r.preConsentBehavior=t.preConsentBehavior),t.debug===!0&&(r.debug=!0),(t.stageAttributes===!0||t.stageAttributes==="detailed")&&(r.stageAttributes=t.stageAttributes),typeof t.registry=="boolean"&&(r.registry=t.registry),typeof t.editorSrc=="string"&&(r.editorSrc=t.editorSrc),typeof t.consentSrc=="string"&&(r.consentSrc=t.consentSrc),typeof t.nonce=="string"&&t.nonce!==""&&(r.nonce=t.nonce),typeof t.apiBase=="string"&&(r.apiBase=t.apiBase),typeof t.sectionCapture=="boolean"&&(r.sectionCapture=t.sectionCapture);let a=typeof t.persona=="function"?ts(t.persona):t.persona;if(typeof a=="string"&&a.trim()!==""&&(r.persona=a),Array.isArray(t.sections)){let l=t.sections.filter(i=>typeof i=="string"&&i.trim()!=="").slice(0,50);l.length>=2&&(r.sections=l)}return r}var oo=new WeakMap;function io(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function so(e,t,n){var s,a,l;let r=oo.get(e);if(r){if(r.fp!==n.fp||!io(r.leafToNode,n.leafToNode))return"mismatch"}else{let i=Zt(e);if(!("fp"in i)||(r={fp:i.fp,leafToNode:i.leafToNode,textNodes:i.textNodes,ownerEls:i.ownerEls,classes:i.ownerEls.map(c=>{var u;return(u=c.getAttribute("class"))!=null?u:""})},r.fp!==n.fp||!io(r.leafToNode,n.leafToNode)))return"mismatch";oo.set(e,r)}let o=r;for(let[i,c]of Object.entries(t.nodes)){let u=Number(i),g=o.ownerEls[u];if(g){if(typeof c.text=="string"){let y=!0;o.leafToNode.forEach((S,w)=>{S===u&&(o.textNodes[w].nodeValue=y?c.text:"",y=!1)})}c.like!==void 0&&o.classes[c.like]!==void 0&&g.setAttribute("class",o.classes[c.like]),c.hidden&&((s=g.style)==null||s.setProperty("display","none","important"))}}for(let i of Object.values((a=t.order)!=null?a:{})){let c=i.map(w=>o.ownerEls[w]).filter(w=>!!w),u=(l=c[0])==null?void 0:l.parentElement;if(!u||c.length!==i.length||c.some(w=>w.parentElement!==u))continue;let g=new Set(c),y=0;Array.from(u.children).map(w=>g.has(w)?c[y++]:w).forEach((w,b)=>{var $;u.children[b]!==w&&u.insertBefore(w,($=u.children[b])!=null?$:null)})}return"applied"}function _t(e){var n,r,o;let t=(r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0)==null?void 0:r.location;return(o=t==null?void 0:t.pathname)!=null?o:""}function ns(e,t){var n;if(t.tag&&e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;if(t.text){let r=((n=e.textContent)!=null?n:"").replace(/\s+/g," ").trim().toLowerCase(),o=t.text.replace(/\s+/g," ").trim().toLowerCase();if(!(r===o||r.startsWith(o)||o.startsWith(r)))return!1}return!0}function en(e,t){return!!(e!=null&&e.urlMatch)&&!_t(t).includes(e.urlMatch)}var rs=/^[a-zA-Z_][-a-zA-Z0-9_]*$/;function ao(e,t){var r;let n=[];if(e.id){let o=t.getElementById(e.id);n=o?[o]:[]}if(n.length===0&&((r=e.dataAttr)!=null&&r.name)&&rs.test(e.dataAttr.name))try{let o=e.dataAttr.value.replace(/["\\]/g,"\\$&");n=Array.from(t.querySelectorAll(`[${e.dataAttr.name}="${o}"]`))}catch(o){n=[]}if(n.length===0&&e.selector)try{n=Array.from(t.querySelectorAll(e.selector))}catch(o){n=[]}return n}function Pe(e,t){if(e.urlMatch&&!_t(t).includes(e.urlMatch))return null;let n=ao(e,t);if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!ns(r,e.fingerprint)?null:r}function lo(e,t){return en(e,t)?!1:!!e.selector&&!e.dataAttr&&!e.id&&!e.fingerprint&&e.page===void 0?uo(e,t):Pe(e,t)!==null}function uo(e,t){return ao(e,t).length>0}function tn(e,t){return en(e,t)?!1:e.page!==void 0&&Jt.test(e.page)?Fn(e.page,_t(t)):uo(e,t)}var co={color:"color",background:"background",fontSize:"font-size",fontWeight:"font-weight",textAlign:"text-align",padding:"padding",margin:"margin",borderRadius:"border-radius",width:"width",height:"height",maxWidth:"max-width",border:"border",boxShadow:"box-shadow",opacity:"opacity",lineHeight:"line-height",letterSpacing:"letter-spacing",textTransform:"text-transform",gap:"gap",fontFamily:"font-family"},os=/^(rgb|rgba|hsl|hsla|calc|var|min|max|clamp)$/i;function fo(e){var r;if(e.trim().length===0||/[;{}<>]/.test(e))return!1;let t=/([A-Za-z-]*)\(/g,n;for(;(n=t.exec(e))!==null;)if(!os.test((r=n[1])!=null?r:""))return!1;return!0}function is(e){var r,o;let t=e.ownerDocument.createTreeWalker(e,4),n=null;for(let s=t.nextNode();s!==null;s=t.nextNode()){if(((r=s.nodeValue)!=null?r:"").trim()==="")continue;let a=(o=s.parentElement)==null?void 0:o.tagName;if(!(a==="SCRIPT"||a==="STYLE"||a==="TEMPLATE")){if(n!==null)return null;n=s}}return n}function kt(e,t){let n=is(e);n!==null?n.nodeValue=t:e.textContent=t}var Zn=/^https:\/\//i;function nn(e){return typeof e=="string"&&!/[\s\x00-\x1f\\]/.test(e)&&(Zn.test(e)||e[0]==="/"&&e[1]!=="/")?e:null}var po=new Map,Fe=null;function ss(e){return e.replace(/["\\]/g,"\\$&")}function as(e){var t;(!Fe||!Fe.isConnected)&&(Fe=e.querySelector("style[data-sentient-ops]"),Fe||(Fe=Ge(e.createElement("style"),e),Fe.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(Fe))),Fe.textContent=[...po.entries()].map(([n,r])=>`[data-snt-e="${ss(n)}"]{${r}}`).join(`
|
|
2
|
+
`)}function go(e,t,n,r){var l;let o=!1,s=(l=t.moveBefore)!=null?l:t.moveAfter;if(s){let i=Pe(s,r);!i||i===e||i.parentElement!==e.parentElement||!e.parentElement?o=!0:t.moveBefore?e.parentElement.insertBefore(e,i):e.parentElement.insertBefore(e,i.nextSibling)}typeof t.text=="string"&&kt(e,t.text),typeof t.href=="string"&&Zn.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&Zn.test(t.imageSrc)&&e.setAttribute("src",t.imageSrc),typeof t.imageAlt=="string"&&e.setAttribute("alt",t.imageAlt);let a=[];if(t.hidden&&a.push("display:none !important"),t.style)for(let[i,c]of Object.entries(t.style)){let u=co[i];u&&typeof c=="string"&&fo(c)&&a.push(`${u}:${c.trim()} !important`)}return a.length>0&&(e.setAttribute("data-snt-e",n),po.set(n,a.join(";")),as(r)),{anchorMiss:o}}var Et="data-sentient-block-arm",R=null;function xt(e){R=e!=null?e:null}var Ze=null;function At(e){Ze=e!=null?e:null}var vo=e=>{var t;return typeof e=="string"?(t=Ze==null?void 0:Ze.entries.find(n=>n.id===e))==null?void 0:t.classes:void 0},bo=e=>{let t=typeof e=="string"?Ze==null?void 0:Ze.entries.find(n=>n.id===e):void 0;return t!=null&&t.computed.inheritsColor?t.computed.color:void 0},Ne="data-sentient-blocks-hid",ct={none:"0",sm:"8px",md:"16px",lg:"24px"},Qn={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},mo={sm:"0.875em",md:"1em",lg:"1.25em"},ls={sm:"1.25em",md:"1.5em",lg:"2em"},us={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},ho={sm:"8px",md:"16px",lg:"32px"},cs={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},ds={normal:"400",medium:"500",bold:"700"};function he(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&e.style.setProperty(n,r);return e}function yo(e){return e==="muted"?R!=null&&R.muted?{color:R.muted}:{opacity:"0.7"}:e==="accent"?{"font-weight":"600",color:R==null?void 0:R.accent}:{}}function So(e,t){let n=fs(e,t),r=bo(e.like);return n&&r&&(n.style.color=r),n}function fs(e,t){var n,r,o,s,a,l,i,c,u,g,y,S,w,b,$,K,A,C,I,M;try{let L=vo(e.like),m=e.maxWidth==="measure"?"65ch":void 0,v=f=>(f.className=L,he(f,{"max-width":m}));switch(e.type){case"stack":case"grid":{let f=t.createElement("div");if(e.type==="stack"){let D=e;he(f,{display:"flex","flex-direction":D.direction,gap:(r=ct[(n=D.gap)!=null?n:"md"])!=null?r:ct.md,"align-items":D.align?Qn[D.align]:void 0,"justify-content":D.justify?Qn[D.justify]:void 0,"flex-wrap":D.wrap?"wrap":void 0})}else{let D=e,H=(s=ct[(o=D.gap)!=null?o:"md"])!=null?s:ct.md;he(f,{display:"grid","grid-template-columns":`repeat(auto-fit, minmax(max(200px, calc((100% - ${D.columns-1} * ${H}) / ${D.columns})), 1fr))`,gap:H,"align-items":D.align?Qn[D.align]:void 0})}L&&(f.className=L);let p=!L&&e.type==="stack"&&e.surface==="raised",k=(a=e.pad)!=null?a:p?"md":void 0;k&&he(f,{padding:(l=ct[k])!=null?l:ct.md}),p&&he(f,{background:R==null?void 0:R.surface,color:R!=null&&R.surface?R==null?void 0:R.surfaceText:void 0,border:`1px solid ${(i=R==null?void 0:R.border)!=null?i:"currentColor"}`,"border-radius":(c=R==null?void 0:R.radius)!=null?c:"8px"});for(let D of(u=e.children)!=null?u:[]){let H=So(D,t);H&&f.appendChild(H)}return f}case"text":{let f=t.createElement("p");return f.textContent=e.value,L?v(f):he(f,Ke(U({margin:"0","font-size":e.size?mo[e.size]:void 0,"font-weight":e.weight?ds[e.weight]:void 0,"text-align":e.align},yo(e.tone)),{"max-width":e.maxWidth==="measure"?"65ch":void 0}))}case"heading":{let f=t.createElement(`h${e.level}`);return f.textContent=e.value,L?v(f):he(f,{margin:"0","font-size":ls[(g=e.size)!=null?g:"md"],"text-align":e.align,"max-width":e.maxWidth==="measure"?"65ch":void 0})}case"button":{let f=t.createElement("a");f.textContent=e.label;let p=nn(e.href);if(p&&(f.href=p),e.tag&&f.setAttribute("data-sentient-tag",e.tag),L)return v(f);let k=(y=e.emphasis)!=null?y:"primary";return he(f,{display:"inline-block",padding:us[(S=e.size)!=null?S:"md"],"border-radius":(w=R==null?void 0:R.radius)!=null?w:"8px",font:"inherit","font-size":e.size?mo[e.size]:void 0,"text-decoration":k==="ghost"?"underline":"none",cursor:"pointer",background:k==="primary"?(b=R==null?void 0:R.primaryBg)!=null?b:"#111827":"transparent",color:k==="primary"?($=R==null?void 0:R.primaryText)!=null?$:"#ffffff":(K=R==null?void 0:R.accent)!=null?K:"inherit",border:k==="secondary"?`1px solid ${(A=R==null?void 0:R.accent)!=null?A:"currentColor"}`:"none"})}case"link":{let f=t.createElement("a");f.textContent=e.label;let p=nn(e.href);return p&&(f.href=p),e.tag&&f.setAttribute("data-sentient-tag",e.tag),L?v(f):he(f,{color:"inherit","text-decoration":"underline"})}case"image":{let f=t.createElement("img"),p=nn(e.src);return p&&(f.src=p),f.alt=e.alt,L&&(f.className=L),he(f,{display:"block","max-width":"100%","aspect-ratio":e.ratio&&e.ratio!=="auto"?cs[e.ratio]:void 0,"object-fit":e.fit,width:e.ratio&&e.ratio!=="auto"?"100%":void 0})}case"badge":{let f=t.createElement("span");return f.textContent=e.value,L?v(f):he(f,U({display:"inline-block",padding:"2px 10px","border-radius":"999px","font-size":"0.75em",border:`1px solid ${(C=R==null?void 0:R.border)!=null?C:"currentColor"}`},yo(e.tone)))}case"spacer":return he(t.createElement("div"),{height:(I=ho[e.size])!=null?I:ho.md});case"divider":return he(t.createElement("hr"),{border:"none","border-top":`1px solid ${(M=R==null?void 0:R.border)!=null?M:"currentColor"}`,margin:"0",width:"100%"});default:return null}}catch(L){return null}}function wo(e,t,n,r){var o,s;try{let a=new Set;for(let i of Array.from(e.children)){let c=i.getAttribute(Et);c!==null&&(t[c]===void 0?i.remove():a.add(c))}for(let[i,c]of Object.entries(t)){if(a.has(i))continue;let u="tree"in c?c:null,g=So(u?u.tree:c,r);if(!g)continue;let y=r.createElement("div");y.setAttribute(Et,i),y.style.display="none";let S=u?vo((o=u.surface)==null?void 0:o.like):void 0;if(S){let w=r.createElement("div");w.className=S;let b=bo((s=u.surface)==null?void 0:s.like);b&&(w.style.color=b),w.appendChild(g),y.appendChild(w)}else y.appendChild(g);e.appendChild(y)}let l=n!==void 0&&t[n]!==void 0;for(let i of Array.from(e.children)){let c=i.getAttribute(Et),u=i;c!==null?u.style.display=l&&c===n?"":"none":l?u.hasAttribute(Ne)||(u.setAttribute(Ne,u.style.display),u.style.display="none"):u.hasAttribute(Ne)&&(u.style.display=u.getAttribute(Ne),u.removeAttribute(Ne))}}catch(a){}}function ps(e){try{for(let t of Array.from(e.children)){let n=t;if(n.getAttribute(Et)!==null){n.remove();continue}n.hasAttribute(Ne)&&(n.style.display=n.getAttribute(Ne),n.removeAttribute(Ne))}}catch(t){}}function rn(e,t){try{let n=new Set;for(let r of Array.from(e.querySelectorAll(`[${Et}]`)))r.parentElement&&n.add(r.parentElement);for(let r of Array.from(e.querySelectorAll(`[${Ne}]`)))r.parentElement&&n.add(r.parentElement);for(let r of n)t.has(r)||ps(r)}catch(n){}}function er(e,t){if(!e)return[t.documentElement];try{return Array.from(t.querySelectorAll(e))}catch(n){return[]}}function on(e,t,n,r){n.documentElement.setAttribute("data-sentient-persona",e),n.documentElement.setAttribute("data-sentient-confidence",t),r==null||r(n.documentElement,"data-sentient-persona"),r==null||r(n.documentElement,"data-sentient-confidence")}function sn(e,t,n,r){var o;for(let[s,a]of Object.entries(t)){let l=e[s];if(!l||typeof l=="string")continue;let i=er(a.target,n);for(let c of i)for(let[u,g]of Object.entries(l))(o=a.dims[u])!=null&&o.includes(g)&&(c.setAttribute(`data-${u}`,g),r==null||r(c,`data-${u}`))}}function an(e,t,n,r){for(let[o,s]of Object.entries(t)){let a=e[o];if(typeof a!="string"||!s.arms||!s.arms.includes(a))continue;let l=er(s.target,n);for(let i of l)i.setAttribute("data-sentient-arm",a),r==null||r(i,"data-sentient-arm")}}function ln(e,t,n,r){var l,i,c,u,g,y,S;let o=new Set,s=(l=r==null?void 0:r.contentAndOps)!=null?l:!0,a=[];for(let[w,b]of Object.entries(t)){if(en(b.locator,n))continue;let $;if(b.locator){let A=Pe(b.locator,n);$=A?[A]:[],!A&&tn(b.locator,n)&&a.push(w)}else $=er(b.target,n);let K=e[w];for(let A of $){if(K!==void 0)if(typeof K=="string")A.setAttribute("data-sentient-arm",K),(i=r==null?void 0:r.onAttr)==null||i.call(r,A,"data-sentient-arm"),s&&((c=r==null?void 0:r.onApplied)==null||c.call(r,w,K,A));else for(let[I,M]of Object.entries(K))A.setAttribute(`data-${I}`,M),(u=r==null?void 0:r.onAttr)==null||u.call(r,A,`data-${I}`);if((b.blocks||b.compose)&&!ms(n)){let I=Object.fromEntries([...Object.entries((g=b.blocks)!=null?g:{}).filter(([,M])=>!bt(M)),...Object.entries((y=b.compose)!=null?y:{}).filter(([,M])=>!bt(M.tree))]);Object.keys(I).length>0&&(wo(A,I,typeof K=="string"?K:void 0,n),o.add(A))}if(!s)continue;let C=A.textContent;b.edits?so(A,b.edits.edits,b.edits)==="mismatch"&&((S=r==null?void 0:r.onDrift)==null||S.call(r,w,b.edits.fp)):typeof b.content=="string"&&kt(A,b.content),b.ops&&go(A,b.ops,w,n).anchorMiss&&!a.includes(w)&&a.push(w),Vn(A,Ke(U(U({previous:C},typeof K=="string"?{arm:K}:{}),(r==null?void 0:r.persona)!==void 0?{persona:r.persona}:{}),{doc:n}))}}return rn(n,o),a}var gs=/bot|crawler|spider|crawling|googlebot|bingbot|duckduckbot|baiduspider|yandexbot|slurp|gptbot|claudebot|anthropic|perplexity|ccbot|applebot|headlesschrome/i;function ms(e){var t,n,r;try{let o=(n=(t=e.defaultView)!=null?t:typeof window!="undefined"?window:void 0)==null?void 0:n.navigator;return o?o.webdriver===!0?!0:gs.test((r=o.userAgent)!=null?r:""):!1}catch(o){return!1}}var hs=800;function un(e,t,n){let r=[];return n.forEach(({slotId:o,arm:s,el:a},l)=>{r.push(Wn((y,S={})=>{try{e.track({projectId:t,componentId:o,variantId:s,eventType:"micro_signal",payload:U({signalType:y},S)})}catch(w){}},a,void 0,{tabLoss:l===0}));let i=null,c=0,u=()=>{c=Date.now(),i=setTimeout(()=>{try{e.track({projectId:t,componentId:o,variantId:s,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-c}})}catch(y){}i=null},hs)},g=()=>{i!==null&&(clearTimeout(i),i=null)};a.addEventListener("mouseenter",u),a.addEventListener("mouseleave",g),r.push(()=>{a.removeEventListener("mouseenter",u),a.removeEventListener("mouseleave",g),i!==null&&clearTimeout(i)})}),()=>{for(let o of r)o()}}function ko(e){return e?`_snt_fired_goals_${e.slice(0,12)}`:"_snt_fired_goals"}var ys="_snt_fired_goals";function tr(e,t){try{e==null||e.sessionStorage.removeItem(ko(t)),e==null||e.sessionStorage.removeItem(ys)}catch(n){}}function _o(e){var t;return[(t=e.slotId)!=null?t:"",e.goalId,e.event,e.locator?JSON.stringify(e.locator):""].join("|")}function vs(e,t){try{let n=e==null?void 0:e.sessionStorage.getItem(t);if(!n)return new Set;let r=JSON.parse(n);return Array.isArray(r)?new Set(r.filter(o=>typeof o=="string")):new Set}catch(n){return new Set}}function bs(e,t,n){try{e==null||e.sessionStorage.setItem(t,JSON.stringify([...n]))}catch(r){}}function Eo(e,t,n,r){var K,A;let o=(K=n.defaultView)!=null?K:typeof window!="undefined"?window:null,s=ko(r),a=vs(o,s),l=C=>{let I=_o(C);if(!a.has(I))try{C.slotId?t.componentGoal(C.slotId,C.goalId):t.goal(C.goalId),a.add(I),bs(o,s,a)}catch(M){}},i=e.filter(C=>C.event==="click"),c=e.filter(C=>C.event==="form_submit"),u=e.filter(C=>C.event==="url_reached"),g=e.filter(C=>C.event==="scroll_depth"),y=(C,I)=>{if(!C.locator)return!1;let M=Pe(C.locator,n);return!!M&&(M===I||M.contains(I))},S=C=>{let I=C.target;if(!(!I||typeof I.closest!="function"))for(let M of i)y(M,I)&&l(M)},w=C=>{let I=C.target;if(I)for(let M of c)y(M,I)&&l(M)},b=()=>{if(u.length===0)return;let C=_t(n);for(let I of u)I.urlPattern&&Un(I.urlPattern,C)&&l(I)},$=()=>{var M;let C=n.documentElement,I=C.scrollHeight>0?(C.scrollTop+C.clientHeight)/C.scrollHeight:0;for(let L of g)I>=((M=L.threshold)!=null?M:.75)&&l(L);g.every(L=>a.has(_o(L)))&&n.removeEventListener("scroll",$)};return n.addEventListener("click",S,!0),n.addEventListener("submit",w,!0),(A=n.defaultView)==null||A.addEventListener("popstate",b),b(),g.length>0&&(n.addEventListener("scroll",$,{passive:!0}),$()),{checkUrl:b,teardown:()=>{var C;n.removeEventListener("click",S,!0),n.removeEventListener("submit",w,!0),(C=n.defaultView)==null||C.removeEventListener("popstate",b),g.length>0&&n.removeEventListener("scroll",$)}}}function cn(e,t){if(!e||e.length<2||t.size!==e.length)return null;let n=[];for(let a of e){let l=t.get(a);if(!l||n.includes(l))return null;n.push(l)}let r=n[0].parentNode;if(!r||!n.every(a=>a.parentNode===r))return null;let o=n.slice().sort((a,l)=>a.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),s=[];for(let a=0;a<n.length;a++){let l=n[a];o[a]!==l&&(s.push({el:l,before:o[a]}),o.splice(o.indexOf(l),1),o.splice(a,0,l))}return s}var Ss="__snt_editor_token";function xo(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(Ss):null}catch(e){return null}}function Ao(e){let t=null;try{let n=location.hash.slice(1),r=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(r){t=r[2];let o=n.slice(r.index+r[0].length);r[1]!="&"&&o[0]=="&"&&(o=r[1]+o.slice(1));let s=n.slice(0,r.index)+o;history.replaceState(history.state,"",s?"#"+s:location.pathname+location.search)}}catch(n){}return t}var Ct="0.33.1",pn=Ct!=="0.0.0-dev"?{name:"snippet",version:Ct}:void 0,No=Ct!=="0.0.0-dev"?{v:Ct}:{},Co=5e3,ws=50,Mo=(()=>{try{if(typeof window=="undefined")return[];let e=window.SentientSnippet;return Array.isArray(e==null?void 0:e.q)?e.q:[]}catch(e){return[]}})(),te=null,x=null,be={},ve=null,Se=null,It=null,re=null,oe=null,Ot=0,J=null,Qe=null,Io=!1,nr=null,dn=null,Tt=null,xe=!1,Ue=!1,gn=!1,mn=0,Do=e=>fe(e)===mn,dt=null,ue=!1,De=null,Ae=[],et=null,tt=null,ye=null,_s=3e3,ks=100;function Oo(e,t){let n,r=new Promise(o=>{n=setTimeout(()=>o(null),t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}function Me(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function Lt(e,t){return te?(te.personaAttributes&&J&&on(J.persona,J.band,e,t==null?void 0:t.onAttr),sn(be,te.slots,e,t==null?void 0:t.onAttr),an(be,te.slots,e,t==null?void 0:t.onAttr),ve?ln(be,ve,e,U(Ke(U({},t),{onDrift:(n,r)=>{var o,s;return(s=x==null?void 0:x.reportDrift)==null?void 0:s.call(x,n,r,(o=Ko[n])!=null?o:null,"fp_mismatch")}}),J?{persona:J.persona}:{})):(rn(e,new Set),[])):[]}function $o(e){var n;let t=new Map;for(let r of(n=te==null?void 0:te.sections)!=null?n:[])try{let o=e.querySelectorAll(r);o.length===1&&t.set(r,o[0])}catch(o){}return t}function rr(e,t){var n,r;try{if(!e||e.length<2)return;for(let o of(n=cn(e,$o(t)))!=null?n:[])(r=o.before.parentNode)==null||r.insertBefore(o.el,o.before)}catch(o){}}function Es(e,t,n){let r=(o,s)=>t.some(([a,l])=>a===o&&l===s);try{if(Array.isArray(e.stamped))for(let o of e.stamped){if(!Array.isArray(o))continue;let[s,a,l]=o;!s||typeof a!="string"||r(s,a)||(l==null?s.removeAttribute(a):s.setAttribute(a,l))}if(Array.isArray(e.html))for(let o of e.html)typeof o!="string"||r(n.documentElement,o)||n.documentElement.removeAttribute(o)}catch(o){}}function xs(){try{let e=window.__sntPP;return e&&typeof e=="object"&&typeof e.v=="number"?e:null}catch(e){return null}}function Bo(e){return e.apiBase?`${e.apiBase.replace(/\/+$/,"")}/v1/events`:void 0}function yn(e){var t;return(t=e.apiBase)!=null?t:"https://api.sentient-ui.com"}function As(e){return Promise.resolve().then(()=>fetch(`${yn(e)}/v1/registry/locators`,{headers:{authorization:`Bearer ${e.apiKey}`}})).then(t=>t.ok?t.json():null).then(t=>Array.isArray(t==null?void 0:t.slots)?t.slots:null).catch(()=>null)}function or(e,t){let n=[],r=[];for(let o of e)try{if(typeof(o==null?void 0:o.id)!="string")continue;!o.locator||lo(o.locator,t)?n.push(o.id):tn(o.locator,t)&&r.push(o.id)}catch(s){}return[n,r]}var Ko={};function jo(e,t){var r;let n={};for(let o of e){let s=(r=De==null?void 0:De.find(c=>c.id===o))==null?void 0:r.locator,a=s?Pe(s,t):null,l=a?Zt(a):null,i=l&&"fp"in l?l.fp:void 0;i&&(Ko[o]=i),n[o]=Ke(U({},i?{fp:i}:{}),{forms:!1,compose:!0,content:!0})}return n}function Go(e,t){let n=null;for(let r of t)e!=null&&e[r]&&((n!=null?n:n={})[r]=e[r]);return n}var ae=null;function Fo(){if(!xe){ae&&et!==Le()&&ae(!0);return}!De||et===Le()||(et=Le(),Cs())}function Cs(){ye==null||ye();let e=te,t=De;if(!e||!t)return;let n,r,o=()=>{clearTimeout(n),clearTimeout(l),r==null||r.disconnect(),ye===o&&(ye=null)},s=null,a=i=>{let[c,u]=or(t,document),g=c.filter(y=>!Ae.includes(y));s!==null&&c.some(y=>!s.has(y)&&!g.includes(y))&&Pt(),s=new Set(c),g.length>0&&Is(g).catch(()=>{}),(i||u.length===0&&!t.some(y=>!c.includes(y.id)&&!Ae.includes(y.id)))&&(o(),Uo(e,u))},l=setTimeout(()=>a(!0),_s);if(ye=o,a(),ye===o)try{r=new MutationObserver(()=>{clearTimeout(n),n=setTimeout(a,ks)}),r.observe(document.documentElement,{childList:!0,subtree:!0})}catch(i){}}function hn(e,t){if(!(!e||e.length===0||!t||!te))try{Se==null||Se.teardown(),Se=Eo(e,t,document,te.apiKey)}catch(n){}}async function Is(e){let t=te,n=x;if(!t||!n)return;Ae=Ae.concat(e);let r=await n.decide(U({slotsFrom:"registry",registrySlotIds:e,render:jo(e,document)},No));if(r||(Ae=Ae.filter(s=>!e.includes(s))),!r||ue||x!==n)return;be=U(U({},be),r.slots),!Se&&r.goals&&(t.consent!==!1||Ue)&&hn(It=r.goals,n);let o=Go(r.slotConfig,e);o&&(ve=U(U({},ve),o)),Pt(),Me(t,"late decide",e),tt&&Do(t.apiKey)&&He(t.apiKey,tt=U(Ke(U({},tt),{slots:be,savedAt:Date.now()}),ve?{slotConfig:ve}:{}))}function Uo(e,t){if(t.length!==0)try{fetch(`${yn(e)}/v1/locator-miss`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e.apiKey}`},body:JSON.stringify({slots:t})}).catch(()=>{})}catch(n){}}function nt(){return!!(te&&x&&te.sectionCapture!==!1&&(te.consent!==!1||Ue)&&!Ye())}function Os(){if(!x||!te||!nt()||oe)return;let e=[];Lt(document,{contentAndOps:xe,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),sr();try{re==null||re(),re=un(x,te.apiKey,e)}catch(t){}}function sr(){if(typeof document=="undefined"||!nt())return;let e;try{if(dn&&dn.length>0){let r=new Map;for(let o of dn){if(o.urlMatch!==window.location.pathname)continue;let s=Pe(o.locator,document);s&&r.set(s,o.type)}r.size>0&&(e=o=>{var s;return(s=r.get(o))!=null?s:null})}}catch(r){}let t=x,n=++Ot;Tt=window.location.pathname,ut("engagement.global.js","__sentientEngagement").then(r=>{if(!(!r||n!==Ot||x!==t||!t||!nt()))try{oe==null||oe(),oe=r.startEngagementCapture(t,U({apiKey:te.apiKey,apiBase:te.apiBase,doc:document,microSignals:!0},e?{typeOf:e}:{}))}catch(o){}})}function Pt(){try{let e=[];if(re==null||re(),re=null,Lt(document,{contentAndOps:xe,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),rr(Qe,document),e.length>0&&nt())try{re=un(x,te.apiKey,e)}catch(t){}try{typeof window!="undefined"&&Tt!==null&&window.location.pathname!==Tt&&nt()&&(oe==null||oe(),oe=null,Ot++,sr())}catch(t){}}catch(e){}}function To(){nr===null&&(nr=setTimeout(()=>{nr=null,Pt();try{Se==null||Se.checkUrl()}catch(e){}Fo()},ws))}function Vo(){if(!(Io||typeof window=="undefined"||typeof history=="undefined")){Io=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,s){let a=n.call(this,r,o,s!=null?s:null);return To(),a}};e("pushState"),e("replaceState"),window.addEventListener("popstate",To)}catch(e){}}}function fn(e){let t={};for(let[n,r]of Object.entries(e.slots))try{t[n]=r.target?document.querySelectorAll(r.target).length:1}catch(o){t[n]=0}return t}function Ts(e,t,n){var r;try{window.__sentientEditor={token:t,code:n,apiBase:yn(e)};let o=e.editorSrc?{src:e.editorSrc}:qn("editor.global.js");if(!o){Po();return}let s=Ge(document.createElement("script"));Jn(s,o),s.async=!0,s.onerror=()=>Po(),((r=document.head)!=null?r:document.documentElement).appendChild(s)}catch(o){}}var Lo="sentient-editor-load-notice";function Po(){var e;try{if(document.getElementById(Lo))return;let t=document.createElement("div");t.id=Lo,t.textContent="Couldn\u2019t load the editor \u2014 check your connection and reopen it from your dashboard.",t.style.cssText="position:fixed;bottom:16px;right:16px;z-index:2147483647;max-width:320px;padding:14px 16px;border-radius:14px;background:#111827;color:#fff;font:13px/1.45 system-ui,sans-serif;border:1px solid rgba(245,158,11,.6);cursor:pointer",t.onclick=()=>t.remove(),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Ls(e){let t={cfg:e,apiBase:yn(e),set(n){n.slots!==void 0&&(be=n.slots),n.slotConfig!==void 0&&(ve=n.slotConfig),n.persona!==void 0&&(J=n.persona),n.decided&&(xe=!0),n.look&&(xt(n.look.palette),At(n.look.vocabulary))},apply:()=>Lt(document),installSpaHooks:Vo,exposeGlobal:()=>{gn=!0,ir(e)},dbg:(...n)=>Me(e,...n)};return ut("preview.global.js","__sentientPreview").then(n=>n?n.runPreview(t):Promise.reject()).catch(()=>(t.exposeGlobal(),Me(e,"preview chunk unavailable \u2014 page left as-is"),!0))}function ir(e){let t=r=>{try{oe==null||oe(),oe=null,Ot++,Tt=null,re==null||re(),re=null,ye==null||ye(),Se==null||Se.teardown(),Se=null,r&&tr(typeof window!="undefined"?window:null,e.apiKey),Ue=!1,ue=!0,r?(tt=null,J=null,x?x.destroy():st(e.apiKey)):x==null||x.dispose(),x=null}catch(o){}},n={consentWatcher:Xe,goal(r,o){try{x==null||x.goal(r,o)}catch(s){}},componentGoal(r,o){try{x==null||x.componentGoal(r,o)}catch(s){}},grantConsent(){try{if(!x&&ue||x!=null&&x.released)mn=fe(e.apiKey),x=St(U({apiKey:e.apiKey,consent:!0,preConsentBehavior:e.preConsentBehavior,debug:e.debug,persona:e.persona,ingestUrl:Bo(e)},pn?{sdk:pn}:{})),hn(It,x);else{let r=(x==null?void 0:x.gated)===!0;zn(e.apiKey),r&&(mn=fe(e.apiKey)),hn(It,x)}ue=!1,ae==null||ae()}catch(r){}Ue=!0;try{Os()}catch(r){}},revokeConsent(){t(!0)},reapply:Pt,getState(){var r,o;try{return{apiKey:e.apiKey,persona:(r=J==null?void 0:J.persona)!=null?r:null,band:(o=J==null?void 0:J.band)!=null?o:null,slots:be,matchCounts:fn(e),consent:!ue&&(e.consent!==!1||Ue)}}catch(s){return{apiKey:e.apiKey,persona:null,band:null,slots:{},matchCounts:{},consent:!1}}}};if(window.SentientSnippet=n,window.__sentientApi=n,e.consentFrom&&!dt&&!gn)try{let r=Xe(e.consentFrom),o=!1,s=!1,a=()=>!!x&&!ue&&(x.gated===void 0?e.consent!==!1||Ue:!x.gated);dt=r.subscribe(()=>{try{let l=r.read();l!==null&&(s=!0);let i=l!=null?l:s?!1:null,c=a(),u=!c&&i!==!0&&r.refused();if(u&&!o&&(x!=null&&x.gated?x.destroy():st(e.apiKey),tr(window,e.apiKey),tt=null,J=null),o=u,i===!0&&!c)n.grantConsent();else if(i===!1&&c){let g=r.refused();t(g),g&&(o=!0)}}catch(l){}})}catch(r){}for(let r of Mo.splice(0))try{r[0]==="goal"?n.goal(r[1],r[2]):r[0]==="grantConsent"&&x?n.grantConsent():r[0]==="revokeConsent"&&x&&n.revokeConsent()}catch(o){}}function Ro(){var e;try{if(typeof window=="undefined")return;let t=window;if(typeof((e=t.SentientSnippet)==null?void 0:e.goal)=="function")return;let n=()=>{};t.SentientSnippet={goal:n,componentGoal:n,grantConsent:n,revokeConsent:n,reapply:n,consentWatcher:Xe,getState:()=>({apiKey:"",persona:null,band:null,slots:{},matchCounts:{},consent:!1})},Mo.length=0}catch(t){}}function Ps(){try{let e=window.Shopify;return typeof(e==null?void 0:e.shop)=="string"&&e.shop!==""}catch(e){return!1}}async function Wo(){var e,t;try{let n=Qt(window.sentient);if(!n){Ro();return}te=n,dt==null||dt(),dt=null,!n.consentFrom&&n.consent===void 0&&Ps()&&(n.consentFrom="shopify"),to(n.consentSrc),Ht(n.nonce),gn=!1,xe=!1,ae=null,Qe=null,be={},ve=null,xt(null),At(null),Ue=!1,ue=!1,It=null,De=null,Ae=[],et=null,tt=null,ye==null||ye(),oe==null||oe(),oe=null,Ot++,Tt=null;let r=Ao("sentient_editor_code"),o=r?null:xo();if(r||o){Ts(n,o,r),gn=!0,ir(n),Me(n,"editor mode");return}if(typeof window!="undefined"&&/[?&]sentient_(preview|persona|context)=[^&]/.test(window.location.search)&&await Ls(n))return;if(n.consentFrom&&n.consent===void 0)try{n.consent=Xe(n.consentFrom).read()===!0}catch(f){n.consent=!1}n.consent!==!1&&n.sectionCapture!==!1&&!Ye()&&ut("engagement.global.js","__sentientEngagement");let s=(e=n.registry)!=null?e:Object.keys(n.slots).length===0;n.registry===void 0&&!s&&Me(n,"slots declared without registry: true, so dashboard-published components are not applied");let a=s?As(n):null,l=xs();try{(t=l==null?void 0:l.stop)==null||t.call(l)}catch(f){}let i=n.consent!==!1&&!Ye()?it(n.apiKey):null,c=[];if(i){J={persona:i.persona,band:i.band},be=i.slots,i.slotConfig&&(ve=i.slotConfig),i.palette&&xt(i.palette),i.vocabulary&&At(i.vocabulary),Lt(document,U({contentAndOps:!1},l?{onAttr:(p,k)=>c.push([p,k])}:{})),i.layoutOrder&&(Qe=i.layoutOrder,rr(Qe,document));let f=vt(i.stage,n.stageAttributes);f&&(qt(f),c.push([document.documentElement,"data-sentient-stage"]))}l&&Es(l,c,document);let u=St(U({apiKey:n.apiKey,consent:n.consent,preConsentBehavior:n.preConsentBehavior,debug:n.debug,persona:n.persona,stageAttributes:n.stageAttributes,ingestUrl:Bo(n)},pn?{sdk:pn}:{}));x=u,mn=fe(n.apiKey),ir(n),Vo();let g=Object.entries(n.slots).map(([f,p])=>({id:f,dims:p.dims})),y=No,S={pp:l?l.v:0},w=[];if(a){let[f]=await Promise.all([Oo(a,Co),document.readyState==="loading"?new Promise(p=>document.addEventListener("DOMContentLoaded",p,{once:!0})):null]);De=f,f&&(Ae=w=or(f,document)[0]),Me(n,"registry scope",f&&w)}let b=(f=u)=>{let p=Array.from($o(document).keys());return f.decide(U(U(U(U({slots:g},y),S),p.length>=2?{sections:p}:{}),s?{slotsFrom:"registry",registrySlotIds:w,render:jo(w,document)}:{}))},$=Le(),K=u.gated===!0,A=!1,C=!1,I=!1,M=!1;ae=(f=!1)=>{let p=x;!A||C||M||xe||ue||!p||p.gated||!f&&!I||(I=!1,M=!0,$=et=Le(),De&&(Ae=w=or(De,document)[0]),b(p).then(k=>{M=!1,k&&!xe&&!ue&&x===p?v(k):(k||(Ae=[]),!xe&&(p.released||x!==p||ue)&&(I=!0))}).catch(()=>{M=!1}))};let L=b();L.then(()=>{A=!0},()=>{A=!0});let m=await Oo(L,Co),v=f=>{var D,H,Y,le,we;C=!0;let p=(x!=null?x:u).getPersona();p?J={persona:p.persona,band:p.band}:f.persona&&(J={persona:f.persona,band:"low"}),be=f.slots,s?ve=Go(f.slotConfig,w):f.slotConfig&&(ve=f.slotConfig),f.palette&&xt(f.palette),f.vocabulary&&At(f.vocabulary),Qe=(D=f.layoutOrder)!=null?D:Qe;let k=()=>{var _e;let _=[],z=Lt(document,{onApplied:(X,ne,ce)=>_.push({slotId:X,arm:ne,el:ce})});s||Uo(n,z),rr(Qe,document);try{(_e=l==null?void 0:l.reveal)==null||_e.call(l)}catch(X){}if(xe=!0,nt())try{re==null||re(),re=un(x,n.apiKey,_)}catch(X){}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k,{once:!0}):k(),It=(H=f.goals)!=null?H:null,(n.consent!==!1||Ue)&&!ue&&hn(f.goals,x),dn=(Y=f.sectionMap)!=null?Y:null,nt()&&sr(),Me(n,"applied",{persona:J,slots:be,matches:fn(n)}),!ue&&(Do(n.apiKey)&&He(n.apiKey,tt=U(U(U(U({v:1,persona:(le=J==null?void 0:J.persona)!=null?le:f.persona,band:(we=J==null?void 0:J.band)!=null?we:"low",slots:f.slots,layoutOrder:f.layoutOrder,savedAt:Date.now()},ve?{slotConfig:ve}:{}),f.palette?{palette:f.palette}:{}),f.vocabulary?{vocabulary:f.vocabulary}:{}),(_=>_?{stage:_}:{})(vt(f.stage,n.stageAttributes)))),et=null,Fo())};if(!m){Me(n,"decide timeout/null \u2014 snapshot state stands",fn(n)),L.then(f=>{if(!f){if(xe)return;Ae=[],u.released===!0||x!==u||ue||K&&Le()!==$?(I=!0,ae==null||ae()):et=$;return}if(!(!f||xe||ue)){if(x!==u){I=!0,ae==null||ae();return}v(f),Me(n,"late decide applied",fn(n))}}).catch(()=>{});return}if(ue||x!==u){I=!0,ae==null||ae();return}v(m)}catch(n){Ro()}}if(typeof window!="undefined"&&window.sentient){let e=window;if(!e.__sentientInitialized)e.__sentientInitialized=!0,Promise.resolve().then(()=>{Wo()});else{let t=window.__sentientApi;t&&Promise.resolve().then(()=>{window.SentientSnippet=t})}}return ti(Rs);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentientui/snippet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SentientUI Style-rung snippet for non-React sites — persona attributes and adaptive style tokens from one script tag",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"tsx": "^4.19.2",
|
|
42
42
|
"typescript": "^5.7.2",
|
|
43
43
|
"vitest": "^2.1.8",
|
|
44
|
-
"@sentientui/core": "0.
|
|
44
|
+
"@sentientui/core": "0.39.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup && node scripts/stamp-chunk-sri.mjs",
|