@sentientui/snippet 0.36.3 → 0.36.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __sentientEngagement=(()=>{var J=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Ee=Object.prototype.hasOwnProperty;var q=(e,t)=>()=>(e&&(t=e(e=0)),t);var $e=(e,t)=>{for(var n in t)J(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ae(t))!Ee.call(e,r)&&r!==n&&J(e,r,{get:()=>t[r],enumerable:!(o=Ie(t,r))||o.enumerable});return e};var Oe=e=>Ce(J({},"__esModule",{value:!0}),e);var Te,Me,Ne,ae,De,Ke,oe,P,le,Z=q(()=>{"use strict";Te=Object.defineProperty,Me=Object.defineProperties,Ne=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable,oe=(e,t,n)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&oe(e,n,t[n]);if(ae)for(var n of ae(t))Ke.call(t,n)&&oe(e,n,t[n]);return e},le=(e,t)=>Me(e,Ne(t))});var I,de=q(()=>{"use strict";I="sentient_internal"});function X(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function We(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function H(e,t,n,o){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${o?`; domain=${o}`:""}${We()}`}catch(r){}}function ee(e,t){H(e,"",0,t)}var fe=q(()=>{"use strict"});function et(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase(),[n,o,r]=t.split("@");return n&&o&&r===void 0?t:null}async function ke(e){let t=et(e),n=t==null?void 0:t.split("@")[1];if(!n||n.length>253)return{};try{let o=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t)),r="";for(let i of new Uint8Array(o))r+=i.toString(16).padStart(2,"0");return{emailHash:r,emailDomain:n}}catch(o){return{emailDomain:n}}}function _e(e){try{let t=new URL(location.href),n=t.searchParams.get(I);n!==null&&(ee(I),e&&ee(I,e),n!=="off"&&/^[\w-]{1,128}$/.test(n)&&(H(I,n,Se,e),X(I)!==n&&H(I,n,Se)),t.searchParams.delete(I),history.replaceState(history.state,"",t.pathname+t.search+t.hash))}catch(t){}return X(I)}var Se,xe=q(()=>{"use strict";fe();de();Se=365*24*60*60});var tt={};$e(tt,{emailFields:()=>ke,startEngagementCapture:()=>we,takeInternalToken:()=>_e});var Pe=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function Y(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function Le(e){return{tag:e.tagName.toLowerCase(),text:Y(e).slice(0,40)}}function te(e){return e.replace(/["\\\]]/g,"\\$&")}function W(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function ne(e,t){var n;let o=e.tagName.toLowerCase();if(!o)return null;let r=((n=e.getAttribute("class"))!=null?n:"").split(/\s+/).filter(c=>/^[a-zA-Z][\w-]*$/.test(c)),i=[o,...r.map(c=>`${o}.${c}`)];for(let c of i)if(W(t,c))return c;let s=e.parentElement;if(s&&s!==t){let c=ne(s,t);if(c){for(let g of i){let b=`${c} > ${g}`;if(W(t,b))return b}let d=Array.from(s.children).filter(g=>g.tagName.toLowerCase()===o),y=d.indexOf(e),S=d.some(g=>g!==e&&Y(g)!==Y(e));if(y>=0&&S){let g=`${c} > ${o}:nth-of-type(${y+1})`;if(W(t,g))return g}}}return null}function re(e,t){let n=Le(e),o=e.getAttribute("id");if(o&&W(t,`#${te(o)}`))return{v:1,id:o,fingerprint:n};for(let i of Pe){let s=e.getAttribute(i);if(s&&W(t,`[${i}="${te(s)}"]`))return{v:1,dataAttr:{name:i,value:s},fingerprint:n}}let r=ne(e,t);return r?{v:1,selector:r,fingerprint:n}:null}Z();var se=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],Re={banner:"hero",navigation:"navigation",contentinfo:"footer"};function je(e){let t=e.ariaRole?Re[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function Ue(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var Fe=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],Q=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|free returns?|returns? within|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]],ie={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function Be(e){var t;let n=e.querySelector("h1, h2, h3");return((t=n==null?void 0:n.textContent)!=null?t:"").slice(0,160)}function ue(e){var t,n;let o=je(e);if(o)return{type:(t=ie[o])!=null?t:"generic",strength:"strong"};let r=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[s,c]of Fe)if(c.test(r))return{type:s,strength:"strong"};for(let[s,c]of Q)if(c.test(e.bodyText))return{type:s,strength:"strong"};let i=Ue(e);return{type:(n=ie[i])!=null?n:"generic",strength:"weak"}}function ce(e){var t,n;let o=((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim(),r=e.getAttribute("role");return P({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((n=e.className)!=null?n:"")}`,headingText:Be(e),bodyText:o.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:o.length},r?{ariaRole:r}:{})}function pe(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t}var ct=1800*1e3;function me(e,t,n,o){let r=[];{let i=!1,s=[],c=()=>{if(i)return;let d=Date.now();for(s.push(d);s.length>0&&d-s[0]>500;)s.shift();s.length>=3&&(i=!0,e("rage_click"))};t.addEventListener("click",c),r.push(()=>t.removeEventListener("click",c))}{let i=!1,s=c=>{if(i||!(c.target instanceof Node)||!t.contains(c.target)&&t!==c.target)return;i=!0;let d=typeof window!="undefined"?window.getSelection():null,y=d?d.toString().length:0;e("text_copy",{selectionLength:y})};document.addEventListener("copy",s),r.push(()=>document.removeEventListener("copy",s))}{let i=!1,s=!1,c=null,d=()=>{c!==null&&(clearTimeout(c),c=null)},y=()=>{i||!s||(d(),c=setTimeout(()=>{!i&&s&&(i=!0,e("scroll_hesitation"))},3e3))},S=()=>{d(),y()},g=A=>{for(let E of A)s=E.intersectionRatio>.3,s?y():d()},b=new IntersectionObserver(g,{threshold:[.3]});b.observe(t),window.addEventListener("scroll",S,{passive:!0}),r.push(()=>{b.disconnect(),window.removeEventListener("scroll",S),d()})}if((o==null?void 0:o.tabLoss)!==!1){let i=!1,s=n!=null?n:Date.now(),c=()=>{if(i||document.visibilityState!=="hidden")return;let d=Date.now()-s;d<15e3&&(i=!0,e("tab_loss",{timeOnPage:d}))};document.addEventListener("visibilitychange",c),r.push(()=>document.removeEventListener("visibilitychange",c))}return()=>{for(let i of r)i()}}function ge(){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")}Z();var he=[100,300,1e3,3e3,1e4],Ve=250,ze=1e3,Ge=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function ve(e,t){e.n++;let n=t-e.mean;e.mean+=n/e.n,e.m2+=n*(t-e.mean)}var ye=e=>e.n>1?Math.sqrt(e.m2/e.n):0;function qe(e){var t;try{let n=e.createElement("canvas"),o=n.getContext("webgl")||n.getContext("experimental-webgl");if(!o)return"unknown";let r=o.getExtension("WEBGL_debug_renderer_info"),i=r?String((t=o.getParameter(r.UNMASKED_RENDERER_WEBGL))!=null?t:""):"";return i?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(i)?"sw":"hw":"unknown"}catch(n){return"unknown"}}function He(e,t=Date.now){var n,o;let r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0,i={n:0,mean:0,m2:0},s={n:0,mean:0,m2:0},c=[0,0,0,0,0,0],d=0,y=0,S=0,g=0,b=0,A=0,E=0,N=0,D=0,h=0,V=-1/0,K=-1/0,k=null,L=null,R=null,j=(o=r==null?void 0:r.scrollY)!=null?o:0,z=0,v=e.hidden?null:t(),T=()=>{let l=t();if(R!=null){let m=l-R,_=0;for(;_<he.length&&m>=he[_];)_++;c[_]++}R=l},M=()=>{d++,V=t()},$=()=>{y++,K=t()},U=()=>{k=t()},C=()=>{k!=null&&(ve(i,t()-k),k=null)},F=()=>{let l=t();S++,l-V>Ve&&l-K>ze&&g++,T()},O=()=>{b++},w=()=>{var l;let m=(l=r==null?void 0:r.scrollY)!=null?l:0;A+=Math.abs(m-j),j=m,T()},G=l=>{let m=t();E++,(l.key==="Backspace"||l.key==="Delete")&&D++,Ge.has(l.key)&&h++,L!=null&&ve(s,m-L),L=m,T()},B=l=>{let m=l.data;typeof m=="string"&&(N+=m.length),T()},u=()=>{let l=t();e.hidden?v!=null&&(z+=l-v,v=null):v==null&&(v=l)},a={passive:!0,capture:!0};e.addEventListener("mousemove",M,a),e.addEventListener("touchstart",$,a),e.addEventListener("touchmove",O,a),e.addEventListener("mousedown",U,a),e.addEventListener("mouseup",C,a),e.addEventListener("click",F,a),e.addEventListener("wheel",O,a),e.addEventListener("keydown",G,a),e.addEventListener("input",B,a),e.addEventListener("visibilitychange",u),r==null||r.addEventListener("scroll",w,a);let f=qe(e),p=(()=>{var l;try{return((l=r==null?void 0:r.matchMedia)==null?void 0:l.call(r,"(prefers-reduced-motion: reduce)").matches)===!0}catch(m){return!1}})();return{snapshot(){var l,m;let _=t(),x=z+(v!=null?_-v:0);return{v:1,active_ms:Math.round(x),mm:d,mm_rate:x>0?Number((d*1e3/x).toFixed(2)):0,touches:y,clicks:S,hold_n:i.n,hold_mean:Math.round(i.mean),hold_std:Math.round(ye(i)),teleport:g,wheel:b,scroll_px:Math.round(A),keydowns:E,input_chars:N,ik_cv:s.mean>0?Number((ye(s)/s.mean).toFixed(2)):0,backspaces:D,gaps:[...c],reduced_motion:p,kb_nav:h,renderer:f,vp:[(l=r==null?void 0:r.innerWidth)!=null?l:0,(m=r==null?void 0:r.innerHeight)!=null?m:0],dpr:(r==null?void 0:r.devicePixelRatio)||1}},stop(){e.removeEventListener("mousemove",M,a),e.removeEventListener("touchstart",$,a),e.removeEventListener("touchmove",O,a),e.removeEventListener("mousedown",U,a),e.removeEventListener("mouseup",C,a),e.removeEventListener("click",F,a),e.removeEventListener("wheel",O,a),e.removeEventListener("keydown",G,a),e.removeEventListener("input",B,a),e.removeEventListener("visibilitychange",u),r==null||r.removeEventListener("scroll",w,a)}}}var Je="section, header, footer, nav, main > div, [data-sentient-section]",Ye=2e4,Ze="__session__";function Qe(e){let t=Array.from(e.querySelectorAll(Je)),n=t.filter(o=>t.filter(r=>r!==o&&o.contains(r)).length<2);return n.filter(o=>!n.some(r=>r!==o&&r.contains(o)))}function Xe(e,t,n,o){try{fetch(`${t}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({pageUrl:n,sections:o})}).catch(()=>{})}catch(r){}}var be=()=>{};function we(e,t){var n,o,r,i,s,c,d,y,S,g,b,A,E,N,D;let h=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!h||typeof IntersectionObserver=="undefined"||ge()||!t.apiKey||!t.apiKey.startsWith("pk_"))return be;let V=((o=t.apiBase)!=null?o:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),K=Qe(h);if(K.length===0)return be;let k=new Map,L=[];for(let u of K){let a=(s=[(i=t.sectionTypes)==null?void 0:i[(r=u.getAttribute("data-sentient-id"))!=null?r:""],u.getAttribute("data-sentient-type")].find(x=>se.includes(x)))!=null?s:null,f=ce(u),p=(d=a!=null?a:(c=t.typeOf)==null?void 0:c.call(t,u))!=null?d:ue(f).type,l=re(u,h),m=l?`nc-${p}-${pe(JSON.stringify({id:(y=l.id)!=null?y:null,dataAttr:(S=l.dataAttr)!=null?S:null,selector:(g=l.selector)!=null?g:null})).toString(36)}`:`nc-${p}`;k.set(u,m);let _=Q.filter(([,x])=>x.test(f.bodyText)).map(([x])=>x);L.push(le(P({componentId:m,semanticType:p,source:a?"markup":"auto"},l?{locator:l}:{}),{observation:P(P({tag:f.tag,idClass:f.idClass.slice(0,200),headingText:f.headingText,textLength:f.textLength,actionCount:f.actionCount},f.ariaRole?{ariaRole:f.ariaRole}:{}),_.length>0?{patternFlags:_}:{})}))}let R=(N=(E=(A=(b=h.defaultView)!=null?b:typeof window!="undefined"?window:void 0)==null?void 0:A.location)==null?void 0:E.pathname)!=null?N:"/";Xe(t.apiKey,V,R,L);let j=He(h),z=()=>{let u;try{u=j.snapshot()}catch(a){return}try{e.track({projectId:t.apiKey,componentId:Ze,eventType:"interaction_stats",payload:u})}catch(a){}},v=new Map,T=u=>{let a=v.get(u);return a||(a={ms:0,scroll:0,enterAt:null,intersecting:!1},v.set(u,a)),a},M=new IntersectionObserver(u=>{for(let a of u){let f=k.get(a.target);if(!f)continue;let p=T(f);a.isIntersecting?(p.intersecting=!0,p.enterAt=Date.now(),a.intersectionRatio>p.scroll&&(p.scroll=a.intersectionRatio)):(p.intersecting=!1,p.enterAt!=null&&(p.ms+=Date.now()-p.enterAt,p.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let u of k.keys())M.observe(u);let $=(u=!1)=>{var a;let f=Date.now();for(let[p,l]of v)if(l.enterAt!=null&&(l.ms+=f-l.enterAt,l.enterAt=null),!(l.ms<=0)){try{e.track({projectId:t.apiKey,componentId:p,eventType:"dwell",payload:{dwell_time:Math.round(l.ms),scroll_depth:Number(l.scroll.toFixed(2))}})}catch(m){}l.ms=0}if(z(),u)try{(a=e.flush)==null||a.call(e)}catch(p){}},U=()=>{if(h.hidden)$(!0);else{let u=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=u)}},C=!1,F=u=>{if($(!0),u!=null&&u.persisted){C=!0;return}try{M.disconnect()}catch(a){}},O=u=>{if(!(u!=null&&u.persisted)||!C)return;C=!1;let a=Date.now();for(let f of v.values())f.enterAt=f.intersecting&&!h.hidden?a:null};h.addEventListener("visibilitychange",U);let w=(D=h.defaultView)!=null?D:typeof window!="undefined"?window:void 0;w==null||w.addEventListener("pagehide",F),w==null||w.addEventListener("pageshow",O);let G=setInterval(()=>{if(h.hidden||C)return;$();let u=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=u)},Ye),B=[];return t.microSignals&&[...k.entries()].forEach(([u,a],f)=>{B.push(me((p,l={})=>{try{e.track({projectId:t.apiKey,componentId:a,eventType:"micro_signal",payload:P({signalType:p},l)})}catch(m){}},u,void 0,{tabLoss:f===0}))}),()=>{$(!0),clearInterval(G),j.stop(),h.removeEventListener("visibilitychange",U),w==null||w.removeEventListener("pagehide",F),w==null||w.removeEventListener("pageshow",O);for(let u of B)u();try{M.disconnect()}catch(u){}}}xe();return Oe(tt);})();
|
|
1
|
+
"use strict";var __sentientEngagement=(()=>{var J=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Ee=Object.prototype.hasOwnProperty;var q=(e,t)=>()=>(e&&(t=e(e=0)),t);var $e=(e,t)=>{for(var n in t)J(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ae(t))!Ee.call(e,r)&&r!==n&&J(e,r,{get:()=>t[r],enumerable:!(o=Ie(t,r))||o.enumerable});return e};var Oe=e=>Ce(J({},"__esModule",{value:!0}),e);var Te,Me,Ne,ae,De,Ke,oe,P,le,Z=q(()=>{"use strict";Te=Object.defineProperty,Me=Object.defineProperties,Ne=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable,oe=(e,t,n)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&oe(e,n,t[n]);if(ae)for(var n of ae(t))Ke.call(t,n)&&oe(e,n,t[n]);return e},le=(e,t)=>Me(e,Ne(t))});var I,de=q(()=>{"use strict";I="sentient_internal"});function X(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function We(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function H(e,t,n,o){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${o?`; domain=${o}`:""}${We()}`}catch(r){}}function ee(e,t){H(e,"",0,t)}var fe=q(()=>{"use strict"});function et(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase(),[n,o,r]=t.split("@");return n&&o&&r===void 0?t:null}async function ke(e){let t=et(e),n=t==null?void 0:t.split("@")[1];if(!n||n.length>253)return{};try{let o=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t)),r="";for(let i of new Uint8Array(o))r+=i.toString(16).padStart(2,"0");return{emailHash:r,emailDomain:n}}catch(o){return{emailDomain:n}}}function _e(e){try{let t=new URL(location.href),n=t.searchParams.get(I);n!==null&&(ee(I),e&&ee(I,e),n!=="off"&&/^[\w-]{1,128}$/.test(n)&&(H(I,n,Se,e),X(I)!==n&&H(I,n,Se)),t.searchParams.delete(I),history.replaceState(history.state,"",t.pathname+t.search+t.hash))}catch(t){}return X(I)}var Se,xe=q(()=>{"use strict";fe();de();Se=365*24*60*60});var tt={};$e(tt,{emailFields:()=>ke,startEngagementCapture:()=>we,takeInternalToken:()=>_e});var Pe=["data-sentient-id","data-testid","data-test","data-id","data-name","data-cy"];function Y(e){var t;return((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim()}function Le(e){return{tag:e.tagName.toLowerCase(),text:Y(e).slice(0,40)}}function te(e){return e.replace(/["\\\]]/g,"\\$&")}function W(e,t){try{return e.querySelectorAll(t).length===1}catch(n){return!1}}function ne(e,t){var n;let o=e.tagName.toLowerCase();if(!o)return null;let r=((n=e.getAttribute("class"))!=null?n:"").split(/\s+/).filter(c=>/^[a-zA-Z][\w-]*$/.test(c)),i=[o,...r.map(c=>`${o}.${c}`)];for(let c of i)if(W(t,c))return c;let s=e.parentElement;if(s&&s!==t){let c=ne(s,t);if(c){for(let g of i){let b=`${c} > ${g}`;if(W(t,b))return b}let d=Array.from(s.children).filter(g=>g.tagName.toLowerCase()===o),y=d.indexOf(e),S=d.some(g=>g!==e&&Y(g)!==Y(e));if(y>=0&&S){let g=`${c} > ${o}:nth-of-type(${y+1})`;if(W(t,g))return g}}}return null}function re(e,t){let n=Le(e),o=e.getAttribute("id");if(o&&W(t,`#${te(o)}`))return{v:1,id:o,fingerprint:n};for(let i of Pe){let s=e.getAttribute(i);if(s&&W(t,`[${i}="${te(s)}"]`))return{v:1,dataAttr:{name:i,value:s},fingerprint:n}}let r=ne(e,t);return r?{v:1,selector:r,fingerprint:n}:null}Z();var se=["pricing","hero","social_proof","cta","features","faq","comparison","trust","navigation","generic"],Re={banner:"hero",navigation:"navigation",contentinfo:"footer"};function je(e){let t=e.ariaRole?Re[e.ariaRole.toLowerCase()]:void 0;if(t)return t;if(e.tag==="nav")return"navigation";if(e.tag==="footer")return"footer";if(e.tag==="header")return e.actionCount>=5?"navigation":"hero";let n=`${e.idClass} ${e.headingText}`.toLowerCase();return/\b(navbar|nav-bar|navigation|site-nav|main-nav|topbar|footer)\b/.test(n)?/footer/.test(n)?"footer":"navigation":/\b(hero|masthead|jumbotron)\b/i.test(e.idClass)?"hero":null}function Fe(e){return e.actionCount>=1&&e.textLength>0&&e.textLength<200?"cta":"generic"}var Ue=[["pricing",/\b(pricing|price list|per month|\/mo|subscriptions?)\b|\bplans?\b(?=[^.]{0,40}(from|start|month|year|[$€£]))/i],["faq",/\bfaq\b|frequently asked|common questions?/i],["comparison",/\b(compare|comparison|versus)\b|\bvs\./i],["social_proof",/\b(reviews?|ratings?|testimonial|brands?|galler(y|ies)|logos)\b|trusted by|loved by|case stud|what our customers say/i],["trust",/\b(insurance|warrant(y|ies)|guarantees?|certifi|accredit|security|privacy|compliance|gdpr|encrypt)\b|why choose|about us|our team/i],["cta",/\b(book|booking|reserve|appointments?|newsletter|subscribe)\b|contact us|get in touch|opening hours/i],["features",/\b(features?|benefits?|capabilit|services?|repairs?|menus?|products?)\b|how it works|our process|what we (do|offer)|what you get/i]],Q=[["pricing",/(?:[$€£]\s?\d[\d,.]*\s*(?:\/|per\s)\s*(?:mo|month|yr|year|seat|user))|(?:\b(?:starter|basic|pro|growth|premium|enterprise)\b[^.]{0,60}[$€£]\s?\d)/i],["social_proof",/(?:★{2,})|(?:\b\d(?:\.\d)?\s*(?:out of|\/)\s*5\b)|(?:\brated\b)|(?:["“][^"”]{20,160}["”]\s*[—–-]\s*[A-Z][a-z]+)/],["trust",/\b(?:money[- ]back guarantee|free returns?|returns? within|refund(?:s)? within|encrypted|soc ?2|iso ?27001|gdpr[- ]compliant|cancel anytime)\b/i],["comparison",/\b(?:vs|versus)\b\.?[^.!?]{0,80}\b(?:compare|comparison|plans?|features?|alternative)\b|\bhow (?:we|it) compares?\b/i]],ie={navigation:"navigation",footer:"navigation",hero:"hero",cta:"cta",generic:"generic"};function Be(e){var t;let n=e.querySelector("h1, h2, h3");return((t=n==null?void 0:n.textContent)!=null?t:"").slice(0,160)}function ue(e){var t,n;let o=je(e);if(o)return{type:(t=ie[o])!=null?t:"generic",strength:"strong"};let r=`${e.idClass} ${e.headingText}`.toLowerCase();for(let[s,c]of Ue)if(c.test(r))return{type:s,strength:"strong"};for(let[s,c]of Q)if(c.test(e.bodyText))return{type:s,strength:"strong"};let i=Fe(e);return{type:(n=ie[i])!=null?n:"generic",strength:"weak"}}function ce(e){var t,n;let o=((t=e.textContent)!=null?t:"").replace(/\s+/g," ").trim(),r=e.getAttribute("role");return P({tag:e.tagName.toLowerCase(),idClass:`${e.id} ${String((n=e.className)!=null?n:"")}`,headingText:Be(e),bodyText:o.slice(0,2e3),actionCount:e.querySelectorAll('a, button, [role="button"]').length,textLength:o.length},r?{ariaRole:r}:{})}function pe(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t}var ct=1800*1e3;function me(e,t,n,o){let r=[];{let i=!1,s=[],c=()=>{if(i)return;let d=Date.now();for(s.push(d);s.length>0&&d-s[0]>500;)s.shift();s.length>=3&&(i=!0,e("rage_click"))};t.addEventListener("click",c),r.push(()=>t.removeEventListener("click",c))}{let i=!1,s=c=>{if(i||!(c.target instanceof Node)||!t.contains(c.target)&&t!==c.target)return;i=!0;let d=typeof window!="undefined"?window.getSelection():null,y=d?d.toString().length:0;e("text_copy",{selectionLength:y})};document.addEventListener("copy",s),r.push(()=>document.removeEventListener("copy",s))}{let i=!1,s=!1,c=null,d=()=>{c!==null&&(clearTimeout(c),c=null)},y=()=>{i||!s||(d(),c=setTimeout(()=>{!i&&s&&(i=!0,e("scroll_hesitation"))},3e3))},S=()=>{d(),y()},g=A=>{for(let E of A)s=E.intersectionRatio>.3,s?y():d()},b=new IntersectionObserver(g,{threshold:[.3]});b.observe(t),window.addEventListener("scroll",S,{passive:!0}),r.push(()=>{b.disconnect(),window.removeEventListener("scroll",S),d()})}if((o==null?void 0:o.tabLoss)!==!1){let i=!1,s=n!=null?n:Date.now(),c=()=>{if(i||document.visibilityState!=="hidden")return;let d=Date.now()-s;d<15e3&&(i=!0,e("tab_loss",{timeOnPage:d}))};document.addEventListener("visibilitychange",c),r.push(()=>document.removeEventListener("visibilitychange",c))}return()=>{for(let i of r)i()}}function ge(){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")}Z();var he=[100,300,1e3,3e3,1e4],Ve=250,ze=1e3,Ge=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function ve(e,t){e.n++;let n=t-e.mean;e.mean+=n/e.n,e.m2+=n*(t-e.mean)}var ye=e=>e.n>1?Math.sqrt(e.m2/e.n):0;function qe(e){var t;try{let n=e.createElement("canvas"),o=n.getContext("webgl")||n.getContext("experimental-webgl");if(!o)return"unknown";let r=o.getExtension("WEBGL_debug_renderer_info"),i=r?String((t=o.getParameter(r.UNMASKED_RENDERER_WEBGL))!=null?t:""):"";return i?/swiftshader|llvmpipe|softpipe|software|mesa offscreen/i.test(i)?"sw":"hw":"unknown"}catch(n){return"unknown"}}function He(e,t=Date.now){var n,o;let r=(n=e.defaultView)!=null?n:typeof window!="undefined"?window:void 0,i={n:0,mean:0,m2:0},s={n:0,mean:0,m2:0},c=[0,0,0,0,0,0],d=0,y=0,S=0,g=0,b=0,A=0,E=0,N=0,D=0,h=0,V=-1/0,K=-1/0,k=null,L=null,R=null,j=(o=r==null?void 0:r.scrollY)!=null?o:0,z=0,v=e.hidden?null:t(),T=()=>{let l=t();if(R!=null){let m=l-R,_=0;for(;_<he.length&&m>=he[_];)_++;c[_]++}R=l},M=()=>{d++,V=t()},$=()=>{y++,K=t()},F=()=>{k=t()},C=()=>{k!=null&&(ve(i,t()-k),k=null)},U=()=>{let l=t();S++,l-V>Ve&&l-K>ze&&g++,T()},O=()=>{b++},w=()=>{var l;let m=(l=r==null?void 0:r.scrollY)!=null?l:0;A+=Math.abs(m-j),j=m,T()},G=l=>{let m=t();E++,(l.key==="Backspace"||l.key==="Delete")&&D++,Ge.has(l.key)&&h++,L!=null&&ve(s,m-L),L=m,T()},B=l=>{let m=l.data;typeof m=="string"&&(N+=m.length),T()},u=()=>{let l=t();e.hidden?v!=null&&(z+=l-v,v=null):v==null&&(v=l)},a={passive:!0,capture:!0};e.addEventListener("mousemove",M,a),e.addEventListener("touchstart",$,a),e.addEventListener("touchmove",O,a),e.addEventListener("mousedown",F,a),e.addEventListener("mouseup",C,a),e.addEventListener("click",U,a),e.addEventListener("wheel",O,a),e.addEventListener("keydown",G,a),e.addEventListener("input",B,a),e.addEventListener("visibilitychange",u),r==null||r.addEventListener("scroll",w,a);let f=qe(e),p=(()=>{var l;try{return((l=r==null?void 0:r.matchMedia)==null?void 0:l.call(r,"(prefers-reduced-motion: reduce)").matches)===!0}catch(m){return!1}})();return{snapshot(){var l,m;let _=t(),x=z+(v!=null?_-v:0);return{v:1,active_ms:Math.round(x),mm:d,mm_rate:x>0?Number((d*1e3/x).toFixed(2)):0,touches:y,clicks:S,hold_n:i.n,hold_mean:Math.round(i.mean),hold_std:Math.round(ye(i)),teleport:g,wheel:b,scroll_px:Math.round(A),keydowns:E,input_chars:N,ik_cv:s.mean>0?Number((ye(s)/s.mean).toFixed(2)):0,backspaces:D,gaps:[...c],reduced_motion:p,kb_nav:h,renderer:f,vp:[(l=r==null?void 0:r.innerWidth)!=null?l:0,(m=r==null?void 0:r.innerHeight)!=null?m:0],dpr:(r==null?void 0:r.devicePixelRatio)||1}},stop(){e.removeEventListener("mousemove",M,a),e.removeEventListener("touchstart",$,a),e.removeEventListener("touchmove",O,a),e.removeEventListener("mousedown",F,a),e.removeEventListener("mouseup",C,a),e.removeEventListener("click",U,a),e.removeEventListener("wheel",O,a),e.removeEventListener("keydown",G,a),e.removeEventListener("input",B,a),e.removeEventListener("visibilitychange",u),r==null||r.removeEventListener("scroll",w,a)}}}var Je="section, header, footer, nav, main > div, [data-sentient-section]",Ye=2e4,Ze="__session__";function Qe(e){let t=Array.from(e.querySelectorAll(Je)),n=t.filter(o=>t.filter(r=>r!==o&&o.contains(r)).length<2);return n.filter(o=>!n.some(r=>r!==o&&r.contains(o)))}function Xe(e,t,n,o){try{fetch(`${t}/v1/section-map`,{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({pageUrl:n,sections:o})}).catch(()=>{})}catch(r){}}var be=()=>{};function we(e,t){var n,o,r,i,s,c,d,y,S,g,b,A,E,N,D;let h=(n=t.doc)!=null?n:typeof document!="undefined"?document:void 0;if(!h||typeof IntersectionObserver=="undefined"||ge()||!t.apiKey||!t.apiKey.startsWith("pk_"))return be;let V=((o=t.apiBase)!=null?o:"https://api.sentient-ui.com").replace(/\/+$/,"").replace(/\/v1$/,""),K=Qe(h);if(K.length===0)return be;let k=new Map,L=[];for(let u of K){let a=(s=[(i=t.sectionTypes)==null?void 0:i[(r=u.getAttribute("data-sentient-id"))!=null?r:""],u.getAttribute("data-sentient-type")].find(x=>se.includes(x)))!=null?s:null,f=ce(u),p=(d=a!=null?a:(c=t.typeOf)==null?void 0:c.call(t,u))!=null?d:ue(f).type,l=re(u,h),m=l?`nc-${p}-${pe(JSON.stringify({id:(y=l.id)!=null?y:null,dataAttr:(S=l.dataAttr)!=null?S:null,selector:(g=l.selector)!=null?g:null})).toString(36)}`:`nc-${p}`;k.set(u,m);let _=Q.filter(([,x])=>x.test(f.bodyText)).map(([x])=>x);L.push(le(P({componentId:m,semanticType:p,source:a?"markup":"auto"},l?{locator:l}:{}),{observation:P(P({tag:f.tag,idClass:f.idClass.slice(0,200),headingText:f.headingText,textLength:f.textLength,actionCount:f.actionCount},f.ariaRole?{ariaRole:f.ariaRole}:{}),_.length>0?{patternFlags:_}:{})}))}let R=(N=(E=(A=(b=h.defaultView)!=null?b:typeof window!="undefined"?window:void 0)==null?void 0:A.location)==null?void 0:E.pathname)!=null?N:"/";Xe(t.apiKey,V,R,L);let j=He(h),z=()=>{let u;try{u=j.snapshot()}catch(a){return}try{e.track({projectId:t.apiKey,componentId:Ze,eventType:"interaction_stats",payload:u})}catch(a){}},v=new Map,T=u=>{let a=v.get(u);return a||(a={ms:0,scroll:0,enterAt:null,intersecting:!1},v.set(u,a)),a},M=new IntersectionObserver(u=>{for(let a of u){let f=k.get(a.target);if(!f)continue;let p=T(f);a.isIntersecting?(p.intersecting=!0,p.enterAt=Date.now(),a.intersectionRatio>p.scroll&&(p.scroll=a.intersectionRatio)):(p.intersecting=!1,p.enterAt!=null&&(p.ms+=Date.now()-p.enterAt,p.enterAt=null))}},{threshold:[0,.25,.5,.75,1]});for(let u of k.keys())M.observe(u);let $=(u=!1)=>{var a;let f=Date.now();for(let[p,l]of v)if(l.enterAt!=null&&(l.ms+=f-l.enterAt,l.enterAt=null),!(l.ms<=0)){try{e.track({projectId:t.apiKey,componentId:p,eventType:"dwell",payload:{dwell_time:Math.round(l.ms),scroll_depth:Number(l.scroll.toFixed(2))}})}catch(m){}l.ms=0}if(z(),u)try{(a=e.flush)==null||a.call(e)}catch(p){}},F=()=>{if(h.hidden)$(!0);else{let u=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=u)}},C=!1,U=u=>{if($(!0),u!=null&&u.persisted){C=!0;return}try{M.disconnect()}catch(a){}},O=u=>{if(!(u!=null&&u.persisted)||!C)return;C=!1;let a=Date.now();for(let f of v.values())f.enterAt=f.intersecting&&!h.hidden?a:null};h.addEventListener("visibilitychange",F);let w=(D=h.defaultView)!=null?D:typeof window!="undefined"?window:void 0;w==null||w.addEventListener("pagehide",U),w==null||w.addEventListener("pageshow",O);let G=setInterval(()=>{if(h.hidden||C)return;$();let u=Date.now();for(let a of v.values())a.intersecting&&(a.enterAt=u)},Ye),B=[];return t.microSignals&&[...k.entries()].forEach(([u,a],f)=>{B.push(me((p,l={})=>{try{e.track({projectId:t.apiKey,componentId:a,eventType:"micro_signal",payload:P({signalType:p},l)})}catch(m){}},u,void 0,{tabLoss:f===0}))}),()=>{$(!0),clearInterval(G),j.stop(),h.removeEventListener("visibilitychange",F),w==null||w.removeEventListener("pagehide",U),w==null||w.removeEventListener("pageshow",O);for(let u of B)u();try{M.disconnect()}catch(u){}}}xe();return Oe(tt);})();
|
package/dist/snippet.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var SentientSnippet=(()=>{var jt=Object.defineProperty,li=Object.defineProperties,ui=Object.getOwnPropertyDescriptor,ci=Object.getOwnPropertyDescriptors,di=Object.getOwnPropertyNames,Tr=Object.getOwnPropertySymbols;var Lr=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable;var Pr=(e,t,n)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t)=>{for(var n in t||(t={}))Lr.call(t,n)&&Pr(e,n,t[n]);if(Tr)for(var n of Tr(t))fi.call(t,n)&&Pr(e,n,t[n]);return e},je=(e,t)=>li(e,ci(t));var Pn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ln=(e,t)=>{for(var n in t)jt(e,n,{get:t[n],enumerable:!0})},pi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of di(t))!Lr.call(e,o)&&o!==n&&jt(e,o,{get:()=>t[o],enumerable:!(r=ui(t,o))||r.enumerable});return e};var gi=e=>pi(jt({},"__esModule",{value:!0}),e);var Ti,Pi,Li,jr,Ri,Ni,Gr,$,Ue,Bn=Pn(()=>{"use strict";Ti=Object.defineProperty,Pi=Object.defineProperties,Li=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,Ri=Object.prototype.hasOwnProperty,Ni=Object.prototype.propertyIsEnumerable,Gr=(e,t,n)=>t in e?Ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))Ri.call(t,n)&&Gr(e,n,t[n]);if(jr)for(var n of jr(t))Ni.call(t,n)&&Gr(e,n,t[n]);return e},Ue=(e,t)=>Pi(e,Li(t))});var Zr={};Ln(Zr,{LOCAL_ENGINE_AVAILABLE:()=>Bi,createLocalEngine:()=>Ki});function Ki(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var Bi,Qr=Pn(()=>{"use strict";Bi=!1});var no={};Ln(no,{emailFields:()=>Gi,setInternalLoader:()=>Fn,takeInternalToken:()=>ji});function Fn(e){eo=e}var eo,to,ji,Gi,Un=Pn(()=>{"use strict";eo=()=>Promise.resolve(null);to=()=>eo().then(e=>e!=null&&e.emailFields?e:Promise.reject()),ji=e=>to().then(t=>t.takeInternalToken(e)),Gi=e=>to().then(t=>t.emailFields(e))});var za={};Ln(za,{applyPersonaAttributes:()=>dn,applyRegistrySlots:()=>gn,applySlotArms:()=>pn,applySlotAttributes:()=>fn,consentWatcher:()=>Qe,parseSnippetConfig:()=>sn,planReorder:()=>hn,reapply:()=>Dt,run:()=>oi,version:()=>Tt});function Gt(e){let t=(e||"").toLowerCase();if(!t.includes(".")||/^[\d.]+$|:/.test(t))return[];let n=t.split("."),r=[];for(let o=n.length-2;o>=0;o--)r.push(n.slice(o).join("."));return r}function Ge(e){return e?`_${e.slice(0,12)}`:""}var ze="_snt_uid";function vt(e){return`${ze}${Ge(e)}`}var Rn="__sntForgetGen",mi=()=>{try{return window[Rn]}catch(e){return}};function Ft(e){var t,n;try{let r=window,o=(t=r[Rn])!=null?t:r[Rn]={};o[e]=((n=o[e])!=null?n:0)+1}catch(r){}}function fe(e){var t,n;return(n=(t=mi())==null?void 0:t[e])!=null?n:0}var at="_snt_snap:",hi=["low","medium","high"];function st(e){try{let t=localStorage.getItem(at+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"||!hi.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 Je(e,t){try{localStorage.setItem(at+e,JSON.stringify(t))}catch(n){}}function Fe(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function Ut(e,t){return new Promise(n=>{let r=setTimeout(()=>n(!1),t),o=()=>{clearTimeout(r),n(!0)};e.then(o,o)})}function qe(e){return Math.min(6e4,1e3*2**Math.min(e,6))}function Wt(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 Rr(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 Nn(e,t,n){try{let r=(()=>{try{let a=localStorage.getItem(n);if(!a)return[];let s=JSON.parse(a);return Array.isArray(s)?s:[]}catch(a){return[]}})(),o=new Map;for(let a of r)o.set(a.id,a);for(let a of e)o.set(a.id,a);localStorage.setItem(n,JSON.stringify([...o.values()].slice(-t)))}catch(r){}}function Nr(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),a=r.filter(s=>!o.has(s.id));if(a.length===r.length)return;a.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(a))}catch(n){}}var yi=500,vi=56*1024;function Ht(e){return`_snt_retry_${e.slice(0,12)}`}var bi={push:()=>{},flush:()=>{},destroy:()=>{}};function Dr(e){var t,n,r;if(typeof window=="undefined")return bi;let o=(t=e.flushIntervalMs)!=null?t:5e3,a=(n=e.maxBatchSize)!=null?n:20,s=(r=e.maxRetrySize)!=null?r:100,c=e.ingestUrl,i=e.apiKey,l=Ht(i),u=!1,p=fe(i),v=(...C)=>{!u&&fe(i)===p&&Nn(...C)},b=[],S=new Set,w=[],K=C=>{for(let z of C)j.delete(z),!S.has(z)&&(S.add(z),w.push(z));for(;w.length>yi;){let z=w.shift();z&&S.delete(z)}Nr(C,l)},j=new Set,_=()=>{for(;b.length>s;){let C=b.shift();C&&j.delete(C.id)}},E=C=>{S.has(C.id)||j.has(C.id)||(j.add(C.id),b.push(C),_())},O=C=>{for(let z of C)S.has(z.id)||(j.add(z.id),b.push(z));_()},N=Rr(l,s);for(let C of N)E(C);let M=0,m=0,y=(C,z=!0)=>{if(C.length===0)return;let te=JSON.stringify(C),Ie=C.map(ce=>ce.id),ge,Z=Fe(15e3);try{ge=fetch(c,{method:"POST",keepalive:!0,signal:Z.signal,body:te,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})}catch(ce){v(C,s,l),O(C),m++,M=Date.now()+qe(m);return}Promise.resolve(ge).then(Z.clear,Z.clear);let Oe=ce=>{if(Wt(ce)!=="retry"){if(!ce.ok&&z){let ke=C.filter(me=>me.eventType!=="pageview");if(ke.length>0&&ke.length<C.length){K(C.filter(me=>me.eventType==="pageview").map(me=>me.id)),y(ke,!1);return}}K(Ie),m=0,M=0;return}v(C,s,l),O(C),m++,M=Date.now()+qe(m)};ge&&typeof ge.then=="function"?ge.then(Oe).catch(()=>{v(C,s,l),O(C),m++,M=Date.now()+qe(m)}):Oe(ge)},f=typeof TextEncoder!="undefined"?new TextEncoder:null,g=C=>f?f.encode(C).length:C.length,A=C=>{let z=[],te=2;for(let Ie of C){let ge=g(JSON.stringify(Ie))+1;if(z.length>0&&te+ge>vi||z.length>=a)break;z.push(Ie),te+=ge}return z},I=()=>{try{if(Date.now()<M)return;for(;b.length>0&&!(Date.now()<M);){let C=b.filter(te=>!S.has(te.id));if(b.length=0,C.length===0)break;let z=A(C);if(z.length===0)break;z.length<C.length&&b.push(...C.slice(z.length)),y(z)}}catch(C){}},F=!0,Y=null;Y=setInterval(()=>{F&&I()},o);let ne=()=>{document.visibilityState==="hidden"&&I()},_e=()=>{I()};return document.addEventListener("visibilitychange",ne),window.addEventListener("pagehide",_e),{push(C){E(C),b.length>=a&&I()},flush:I,destroy(C){C!=null&&C.forget&&(u=!0),F=!1,Y!==null&&(clearInterval(Y),Y=null),document.removeEventListener("visibilitychange",ne),window.removeEventListener("pagehide",_e),I()}}}var Si=200;function Vt(e){return`_snt_goal_retry_${e.slice(0,12)}`}var wi={send:()=>{},flush:()=>{},destroy:()=>{}};function Mr(e){var t,n,r;if(typeof window=="undefined")return wi;let o=(t=e.flushIntervalMs)!=null?t:5e3,a=(n=e.maxRetrySize)!=null?n:100,s=(r=e.maxPerFlush)!=null?r:5,c=Vt(e.apiKey),i=!1,l=fe(e.apiKey),u=(...g)=>{!i&&fe(e.apiKey)===l&&Nn(...g)},p=[],v=new Set,b=new Set,S=[],w=0,K=0,j=!1,_=g=>{for(v.delete(g.id),b.has(g.id)||(b.add(g.id),S.push(g.id));S.length>Si;){let A=S.shift();A&&b.delete(A)}Nr([g.id],c)},E=g=>{u([g],a,c),!b.has(g.id)&&!v.has(g.id)&&(v.add(g.id),p.push(g)),Date.now()>=w&&(K++,w=Date.now()+qe(K))},O=g=>{let A,I=Fe(15e3);try{A=fetch(e.url,{method:"POST",keepalive:!0,signal:I.signal,body:g.body,headers:e.headers})}catch(Y){E(g);return}let F=Y=>{var ne;let _e=Wt(Y);if(_e==="retry"){E(g);return}_e==="dropped"&&((ne=e.onDrop)==null||ne.call(e,g,Y.status)),_(g),K=0,w=0};Promise.resolve(A).then(I.clear,I.clear),A&&typeof A.then=="function"?A.then(F).catch(()=>E(g)):F(A)},N=()=>{try{if(j||Date.now()<w)return;let g=0;for(;p.length>0&&g<s&&!(Date.now()<w);){let A=p.shift();v.delete(A.id),!b.has(A.id)&&(g++,O(A))}}catch(g){}},M=Rr(c,a);for(let g of M)v.has(g.id)||(v.add(g.id),p.push(g));M.length>0&&Nn(M,a,c);let m=setInterval(N,o),y=()=>{document.visibilityState==="hidden"&&N()},f=()=>N();return document.addEventListener("visibilitychange",y),window.addEventListener("pagehide",f),{send(g){if(j){b.has(g.id)||u([g],a,c);return}if(!(b.has(g.id)||v.has(g.id))){if(Date.now()<w){u([g],a,c),v.add(g.id),p.push(g);return}O(g)}},flush:N,destroy(g){g!=null&&g.forget&&(i=!0),clearInterval(m),document.removeEventListener("visibilitychange",y),window.removeEventListener("pagehide",f),N(),j=!0}}}function lt(e){if(typeof window=="undefined"||!e)return!1;Ft(e);let t=!1,n=vt(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let s=location.protocol==="https:"?"; Secure":"";for(let c of["",...Gt(location.hostname)])document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${c?`; domain=${c}`:""}${s}`;t=!0}}catch(s){}let r=Ge(e),o=[n,"_snt_graph_edges",at+e,Ht(e),Vt(e),`_snt_graph_nodes${r}`],a=[`_snt_asgn${r}_`];for(let s of["localStorage","sessionStorage"])try{let c=window[s];for(let i of o)c.getItem(i)!==null&&(c.removeItem(i),t=!0);for(let i=c.length-1;i>=0;i--){let l=c.key(i);l&&a.some(u=>l.startsWith(u))&&(c.removeItem(l),t=!0)}}catch(c){}try{(new RegExp(`(?:^|; )${ze}=[^;]`).test(document.cookie)||localStorage.getItem(ze)!==null||sessionStorage.getItem(ze)!==null)&&localStorage.setItem(`${ze}_tomb${r}`,"1")}catch(s){}return t}function Mn(){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 $r="_snt_uid",_i=365,ut="_snt_uid";function ki(){return Mn()}function ct(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function Kr(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function Jt(e,t,n,r){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${r?`; domain=${r}`:""}${Kr()}`}catch(o){}}function zt(e){try{return localStorage.getItem(e)}catch(t){return null}}function Br(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function Dn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function Ei(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function xi(e){try{sessionStorage.removeItem(e)}catch(t){}}function Ai(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${Kr()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function Ci(e){try{localStorage.removeItem(e)}catch(t){}}function qt(e,t){Jt(e,"",0,t)}var Ii={getSessionId:()=>null,isEphemeral:()=>!1,domain:null,destroy:()=>{}};function Oi(e,t){if(e===!1)return null;if(typeof e=="string")return e.replace(/^\./,"");for(let n of Gt(location.hostname))if(Jt(t,"1",10,n),ct(t)==="1")return qt(t,n),n;return null}function $n(e){var t,n,r,o,a,s,c;if(typeof window=="undefined")return Ii;let i=Ge(e==null?void 0:e.apiKey),l=(t=e==null?void 0:e.cookieName)!=null?t:vt(e==null?void 0:e.apiKey),u=`${ut}${i}`,p=`${ut}_tomb${i}`,v=((n=e==null?void 0:e.cookieTTLDays)!=null?n:_i)*24*60*60,b=m=>m&&m.length>0?m:null,S=()=>{var m,y;return i&&!(e!=null&&e.cookieName)&&zt(p)===null?(y=(m=b(ct($r)))!=null?m:b(zt(ut)))!=null?y:b(Dn(ut)):null},w=Oi(e==null?void 0:e.cookieDomain,`${l}_dom`),K=b(ct(l)),j=w?(qt(l),b(ct(l))):null,_=(c=(s=(a=(o=(r=j!=null?j:K)!=null?r:b(zt(u)))!=null?o:b(Dn(u)))!=null?a:S())!=null?s:b(e==null?void 0:e.ssrSessionId))!=null?c:ki();Jt(l,_,v,w),w&&ct(l)!==_&&(w=null,Jt(l,_,v));let E=Br(u,_),O=Ai(l),N=E?!1:Ei(u,_),M=!E&&!O&&!N;return{getSessionId:()=>_,isEphemeral:()=>M,domain:w,destroy:()=>{_=null,qt(l),qt(l,w),Ci(u),xi(u),i&&!(e!=null&&e.cookieName)&&(ct($r)!==null||zt(ut)!==null||Dn(ut)!==null)&&Br(p,"1")}}}Bn();function Yt(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function Fr(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 Kn(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 Yt(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[a,s]of Object.entries((n=e.dims)!=null?n:{}))o[a]=(r=s[0])!=null?r:"";return Yt(o)}function Ur(e,t){var n,r;return e.dims!=null?(r=(n=Fr(t))!=null?n:Fr(Kn(e)))!=null?r:{}:t}function Ye(e){return e>=.3?e<.7?"medium":"high":"low"}var Wr=["new","browsing","carted","customer","lapsed"];var Di=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","Claude-Agent","PerplexityBot","Perplexity-User","Google-Agent","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function Hr(e){return Mi(e)!==null}function Mi(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=Di.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function Vr(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 zr(e,t,n){if(!e)return"direct";try{let r=new URL(e);if(t)try{if(new URL(t).host===r.host)return"direct"}catch(a){}let o=r.hostname.toLowerCase();return n&&`.${o}`.endsWith(`.${n}`)?"direct":/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(o)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(o)?"social":"referral"}catch(r){return"direct"}}function qr(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var $i=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Jr(e){let t={},n={};try{let r=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([o,a])=>{let s=Array.isArray(a)?a[0]:a;return s===void 0?[]:[[o,s]]});for(let[o,a]of r)o.startsWith("utm_")?o in t||(t[o]=a):$i.includes(o)&&(o in n||(n[o]=a))}catch(r){}return{utmParams:t,clickIds:n}}function Yr(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function jn(e){return $($($({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 Gn(e){let t=jn(e);return Ur(t,Kn(t))}function Xr(e){return typeof e=="string"?e:Yt(e)}Bn();var zn;function en(e){zn=typeof e=="string"&&e!==""?e:void 0}function ao(e=document){if(zn)return zn;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 We(e,t=document){let n=ao(t);return n&&e.setAttribute("nonce",n),e}var Fi=1800*1e3;function Xt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Ui(e=Fi,t){let n=new Map,r=`_snt_asgn${Ge(t)}_`,o=(i,l)=>`${r}${encodeURIComponent(i)}:${encodeURIComponent(l)}`,a=i=>{let l=i.slice(r.length),u=l.indexOf(":");if(u<0)return null;try{return{componentId:decodeURIComponent(l.slice(0,u)),segment:decodeURIComponent(l.slice(u+1))}}catch(p){return null}},s=()=>{try{let i=[];for(let l=0;l<localStorage.length;l++){let u=localStorage.key(l);u!=null&&u.startsWith(r)&&i.push(u)}return i}catch(i){return[]}},c=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of s())try{let l=localStorage.getItem(i);if(!l)continue;let u=JSON.parse(l);if(c(u)){localStorage.removeItem(i);continue}let p=a(i);if(!p)continue;n.set(Xt(p.componentId,p.segment),u)}catch(l){}})(),{get(i,l){let u=n.get(Xt(i,l));return u?c(u)?(n.delete(Xt(i,l)),null):u:null},set(i,l,u){let p=Xt(i,l);n.set(p,u);try{localStorage.setItem(o(i,l),JSON.stringify(u))}catch(v){}},clear(){n.clear();for(let i of s())try{localStorage.removeItem(i)}catch(l){}}}}var qn="data-sentient-stage";function St(e,t){return!t||typeof e!="string"||!(e==="returning"||Wr.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function tn(e,t=document){try{e?t.documentElement.setAttribute(qn,e):t.documentElement.removeAttribute(qn)}catch(n){}}var Jn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY (Vite: VITE_SENTIENT_API_KEY) or localMode: true.",so="[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.",ro=!1,Zt=!1;function Wi(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function Hi(e){var t;let n=$n({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),r=(t=n.getSessionId())!=null?t:"local",o=Wi(),a=Promise.resolve().then(()=>(Qr(),Zr)).then(u=>{let p=u;return p.LOCAL_ENGINE_AVAILABLE?(ro||(ro=!0,console.info(so)),p):(Zt||(Zt=!0,console.error(Jn)),null)}).catch(()=>(Zt||(Zt=!0,console.error(Jn)),null)),s=null,c={low:.15,medium:.5,high:.85},i=(()=>{var u;if(e.initialPersona)return $({},e.initialPersona);let p=st(e.apiKey||"local");return p?{persona:p.persona,confidence:(u=c[p.band])!=null?u:.15}:null})();function l(u){let p=document.documentElement;p.dataset.sentientPersona===void 0&&(p.dataset.sentientPersona=u.persona,p.dataset.sentientConfidence=Ye(u.confidence))}return{isLocal:!0,async decide(u){var p,v,b;let S=await a;if(!S)return null;let w=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide(u);return s=Ue($({},w),{layoutOrder:(v=(p=w.layoutOrder)!=null?p:s==null?void 0:s.layoutOrder)!=null?v:null,slots:$($({},(b=s==null?void 0:s.slots)!=null?b:{}),w.slots)}),Je(e.apiKey||"local",{v:1,persona:s.persona,band:Ye(s.confidence),slots:s.slots,layoutOrder:s.layoutOrder,savedAt:Date.now()}),l(w),w},getSlotResult(u){var p,v,b;return(b=(v=s==null?void 0:s.slots[u])!=null?v:(p=e.initialSlots)==null?void 0:p[u])!=null?b:null},getSlotConfig(u){var p,v;return(v=(p=e.initialSlotConfig)==null?void 0:p[u])!=null?v:null},getSitePalette(){var u;return(u=e.initialPalette)!=null?u:null},reportSlots(){},getVisitorId:()=>null,getPersona(){let u=s!=null?s:i;return u?{persona:u.persona,confidence:u.confidence,band:Ye(u.confidence)}:null},async assign(u,p){var v;let b=await a;return!b||!p||p.length===0?p!=null&&p[0]?{variantId:p[0],assignmentTtlMs:0}:null:{variantId:(v=b.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:u,variantIds:p}]}).assignments[u])!=null?v:p[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>n.destroy()}}var nn=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function Wn(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Xn(e,t){if(e===void 0||!nn.test(e))return!1;if(e==="*")return!0;let n=Wn(t);if(e.endsWith("/*")){let r=Wn(e.slice(0,-2));return n.startsWith(r==="/"?"/":`${r}/`)&&n!==r}return n===Wn(e)}function Zn(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 wt(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(wt):!1}var oo="sentient-reveal",dt="sentient-revealed",lo=240,Hn=!1;function Vi(e){if(Hn||e.getElementById(oo)){Hn=!0;return}let t=We(e.createElement("style"),e);t.id=oo,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${dt}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${dt}{animation:${dt} ${lo}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),Hn=!0}function Qn(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;Vi(r),e.classList.remove(dt),e.offsetWidth,e.classList.add(dt);let o=()=>{e.classList.remove(dt),e.removeEventListener("animationend",o)};return e.addEventListener("animationend",o),!0}function er(e,t,n,r){let o=[];{let a=!1,s=[],c=()=>{if(a)return;let i=Date.now();for(s.push(i);s.length>0&&i-s[0]>500;)s.shift();s.length>=3&&(a=!0,e("rage_click"))};t.addEventListener("click",c),o.push(()=>t.removeEventListener("click",c))}{let a=!1,s=c=>{if(a||!(c.target instanceof Node)||!t.contains(c.target)&&t!==c.target)return;a=!0;let i=typeof window!="undefined"?window.getSelection():null,l=i?i.toString().length:0;e("text_copy",{selectionLength:l})};document.addEventListener("copy",s),o.push(()=>document.removeEventListener("copy",s))}{let a=!1,s=!1,c=null,i=()=>{c!==null&&(clearTimeout(c),c=null)},l=()=>{a||!s||(i(),c=setTimeout(()=>{!a&&s&&(a=!0,e("scroll_hesitation"))},3e3))},u=()=>{i(),l()},p=b=>{for(let S of b)s=S.intersectionRatio>.3,s?l():i()},v=new IntersectionObserver(p,{threshold:[.3]});v.observe(t),window.addEventListener("scroll",u,{passive:!0}),o.push(()=>{v.disconnect(),window.removeEventListener("scroll",u),i()})}if((r==null?void 0:r.tabLoss)!==!1){let a=!1,s=n!=null?n:Date.now(),c=()=>{if(a||document.visibilityState!=="hidden")return;let i=Date.now()-s;i<15e3&&(a=!0,e("tab_loss",{timeOnPage:i}))};document.addEventListener("visibilitychange",c),o.push(()=>document.removeEventListener("visibilitychange",c))}return()=>{for(let a of o)a()}}function zi(){try{return!1}catch(e){return!0}}var uo="https://api.sentient-ui.com/v1/events",io=()=>Promise.resolve().then(()=>(Un(),no)),pe=new Map,co=null;function qi(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Ji=3;function Vn(){return Mn()}function Qt(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Yi(){let e=new WeakMap,t=new Map,n=!1,r=(c,i,l)=>{let u=c.get(i);return l===null?u?!0:(c.set(i,new Set),!1):u?u.has(l)?!0:(u.add(l),!1):(c.set(i,new Set([l])),!1)},o=typeof window!="undefined"&&"event"in window,a=()=>{if(!o)return;let c=window.event;return typeof Event=="function"&&c instanceof Event?c:void 0},s=()=>{if(o){Promise.resolve().then(()=>{n=!1,t.clear()});return}let c=!1,i=()=>{c||(c=!0,n=!1,t.clear())};if(setTimeout(i,0),typeof MessageChannel=="function"){let l=new MessageChannel;l.port1.onmessage=()=>{l.port1.close(),l.port2.close(),i()},l.port2.postMessage(0)}};return{firedBefore(c,i){let l=a();if(l){let p=e.get(l);return p||(p=new Map,e.set(l,p)),r(p,c,i)}let u=r(t,c,i);return!u&&!n&&(n=!0,s()),u}}}var fo=new Set;function Xi(e,t,n){let r=typeof window=="undefined"?null:window.history;if(!r)return()=>{};let o=!1,a,s=()=>{if(o)return;let l=Qt();!l||l===a||(a=l,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${l}`))},c=[];for(let l of["pushState","replaceState"]){let u=r[l],p=function(...v){let b=u.apply(this,v);return s(),b};r[l]=p,c.push([l,u,p])}window.addEventListener("popstate",s);let i=Qt();return i&&fo.has(`${t}:${i}`)?a=i:s(),()=>{if(!o){o=!0,window.removeEventListener("popstate",s);for(let[l,u,p]of c)r[l]===p&&(r[l]=u)}}}var bt={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 Zi(){try{return Jr(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function po(e){return e.replace(/\/events\/?$/,"")}function Xe(){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 tr(e){var t;if(typeof window=="undefined")return;let n=e!=null?e:co;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:a,reinit:s}=r;if(!a){r.upgradeBlockedReason&&console.warn(r.upgradeBlockedReason);return}if(o.respectDoNotTrack!==!1&&Xe())return;let c=(s!=null?s:_t)(Ue($({},o),{consent:!0}));a(c);let i=(t=pe.get(n))==null?void 0:t.dispose;pe.set(n,{config:Ue($({},o),{consent:!0}),upgrade:null,dispose:i})}function Qi(e,t){var n;let r=e.preConsentBehavior==="statistical_winner",o=po((n=e.ingestUrl)!=null?n:uo),a={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},s=new Map,c=new Map,i={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(m,y,f){if(!r)return Promise.resolve(null);let g=s.get(m);return g?Promise.resolve(g):Yn(c,m,async()=>{try{let A=new URLSearchParams({componentId:m});for(let ne of y!=null?y:[])A.append("variantIds[]",ne);let I=Fe(5e3),F;try{let ne=await fetch(`${o}/winner?${A.toString()}`,{headers:a,signal:I.signal});if(!ne.ok)return y!=null&&y[0]?{variantId:y[0],assignmentTtlMs:0}:null;F=await ne.json()}finally{I.clear()}let Y={variantId:F.variantId,assignmentTtlMs:0};return s.set(m,Y),Y}catch(A){return y!=null&&y[0]?{variantId:y[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:()=>{}},l=!1,u=new Set,p=[],v=[],b=[],S=()=>{for(let[,,m]of b.splice(0))m(null);w.length=0},w=[],K=!1,j=()=>{if(l)return;K=!0;let m=pe.get(e.apiKey);(m==null?void 0:m.upgrade)===M&&pe.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},_=[],E=()=>{setTimeout(()=>{var m;try{(m=_.shift())==null||m(i)}catch(y){}_.length&&E()})},O=m=>{l?_.length?_.push(m):m(i):!t&&!K&&w.length<100?w.push(m):K&&e.debug&&console.warn("[sentient] goal dropped: client released")},N={get gated(){return!l&&!t},get released(){return K&&!l},takeHeld:()=>w.splice(0),track:m=>i.track(m),goal:((m,y,f,g)=>O(A=>A.goal(m,y,f,g))),componentGoal:(m,y,f)=>i.componentGoal(m,y,f),identify:(m,y)=>i.identify(m,y),getAssignment:(m,y)=>i.getAssignment(m,y),isUnified:m=>{var y,f;return(f=(y=i.isUnified)==null?void 0:y.call(i,m))!=null?f:!1},assign:(m,y,f,g,A)=>i.assign(m,y,f,g,A),decide:m=>l?i.decide(m):K||t?Promise.resolve(null):new Promise(y=>b.push([m,Re(),y])),getSlotResult:m=>i.getSlotResult(m),isSlotDecided:m=>{var y,f;return(f=(y=i.isSlotDecided)==null?void 0:y.call(i,m))!=null?f:!0},getSlotConfig:m=>i.getSlotConfig(m),getSitePalette:()=>i.getSitePalette(),getStyleVocabulary:()=>{var m,y;return(y=(m=i.getStyleVocabulary)==null?void 0:m.call(i))!=null?y:null},reportSlots:(m,y,f,g)=>i.reportSlots(m,y,f,g),reportSkeleton:(m,y)=>{var f;return(f=i.reportSkeleton)==null?void 0:f.call(i,m,y)},reportAgentData:(m,y,f)=>{var g;return(g=i.reportAgentData)==null?void 0:g.call(i,m,y,f)},reportDrift:(m,y,f,g)=>{var A;return(A=i.reportDrift)==null?void 0:A.call(i,m,y,f,g)},requestSlots:(m,y,f)=>{var g;return l?(g=i.requestSlots)==null?void 0:g.call(i,m,y,f):p.push([m,y,f])},decideSlots:m=>{var y;return l?(y=i.decideSlots)==null?void 0:y.call(i,m):v.push(...m)},cancelSlots:m=>{var y;if(l)return(y=i.cancelSlots)==null?void 0:y.call(i,m);let f=new Set(m);for(let g of p)g[0]=g[0].filter(A=>!f.has(A));v=v.filter(g=>!f.has(g.id))},onSlotsChanged:m=>(u.add(m),()=>{u.delete(m)}),getPersona:()=>i.getPersona(),getVisitorId:()=>{var m,y;return(y=(m=i.getVisitorId)==null?void 0:m.call(i))!=null?y:null},fetchWeights:()=>i.fetchWeights(),getGraph:()=>i.getGraph(),flush:()=>i.flush(),dispose:()=>(j(),S(),i.dispose()),destroy:()=>(j(),S(),l?i.destroy():lt(e.apiKey))};function M(m){var y,f,g;i=m,l=!0,w.length&&(_.push(...w.splice(0)),E());let A=Re();for(let[I,F,Y]of b.splice(0))F!==A?Y(null):m.decide(I).then(Y,()=>Y(null));(y=m.onSlotsChanged)==null||y.call(m,()=>u.forEach(I=>I()));for(let[I,F,Y]of p.splice(0))I.length>0&&((f=m.requestSlots)==null||f.call(m,I,F,Y));v.length>0&&((g=m.decideSlots)==null||g.call(m,v.splice(0)))}return{proxy:N,setInner:M}}function Re(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Yn(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 _t(e){var t,n,r,o,a,s,c,i,l,u,p;if(typeof window=="undefined")return bt;e.nonce&&en(e.nonce),co=e.apiKey||"local";let v=pe.get(e.apiKey||"local");if(v!=null&&v.dispose)try{v.dispose()}catch(d){}let b=e.respectDoNotTrack!==!1&&Xe(),S=e.consent===!1||b,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?bt:Hi(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."}),bt;let{proxy:d,setInner:h}=Qi(e,b);return pe.set(e.apiKey,{config:e,upgrade:b?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."),bt;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),bt;let K=(t=e.ingestUrl)!=null?t:uo,j=Date.now(),_=$n({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey,cookieDomain:e.cookieDomain}),E={},O;try{/sentient_internal=/.test(location.search+document.cookie)&&(O=io().then(async d=>{E.internalToken=await d.takeInternalToken(_.domain)||void 0}).catch(()=>{})),(typeof e.internal=="function"?e.internal():e.internal)===!0&&(E.internal=!0)}catch(d){}let N=Ui(void 0,e.apiKey),M=!1,m=fe(e.apiKey),y=()=>!M&&fe(e.apiKey)===m,f=new Set((n=e.initialUnified)!=null?n:[]),g=Ue($({},N),{get:(d,h)=>f.has(d)?null:N.get(d,h),set:(...d)=>{y()&&N.set(...d)}}),A=Dr({ingestUrl:K,apiKey:e.apiKey}),I=po(K),F={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},Y=new Set,ne=Mr({url:`${I}/goals`,apiKey:e.apiKey,headers:F,onDrop:(d,h)=>{if(!e.debug){if(Y.has(h))return;Y.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)}}),_e=Vr((r=navigator.userAgent)!=null?r:""),C=window.location.origin,z=zr((o=document.referrer)!=null?o:"",C,_.domain),te=(a=e.sessionSegment)!=null?a:`${_e}:${z}`,Ie=new Map,ge=new Map,Z=new Map,Oe=new Set,ce=new Map,ke=null,me=null,ie=null,vr=new Set,Mt=new Set,En=new Map,xn=new Map,br=new Set,Sr=new Set,wr=new Set,_r=new Set,An=null,gt=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,kr=new Set,$t=new Set,Bt=new Set,mt=new Map,Cn=null,Kt=new Set,ht=new Map,In=null,ii=2,Er=new Map,Ee=!1,xr=(d,h,P)=>{var U;let G=new Set,x=1;for(let T of d){h.delete(T);let L=((U=Er.get(T))!=null?U:0)+1;Er.set(T,L),L<=ii&&(G.add(T),L>x&&(x=L))}G.size>0&&setTimeout(()=>{Ee||P(G)},qe(x))},On=d=>{for(let h of d)Z.has(h.id)||Z.set(h.id,Gn(h))};if(e.initialSlots)for(let[d,h]of Object.entries(e.initialSlots))Z.set(d,h),Oe.add(d);if(e.initialSlotConfig)for(let[d,h]of Object.entries(e.initialSlotConfig))ce.set(d,h);e.initialPalette&&(ke=e.initialPalette),e.initialVocabulary&&(me=e.initialVocabulary);let Te=st(e.apiKey);if(Te){for(let[d,h]of Object.entries(Te.slots))Z.has(d)||Z.set(d,h);for(let[d,h]of Object.entries((s=Te.slotConfig)!=null?s:{}))ce.has(d)||ce.set(d,h);!ke&&Te.palette&&(ke=Te.palette),!me&&Te.vocabulary&&(me=Te.vocabulary)}let Ar={low:.15,medium:.5,high:.85};if(e.initialPersona)ie=$({},e.initialPersona);else{let d=document.documentElement.dataset;d.sentientPersona?ie={persona:d.sentientPersona,confidence:(i=Ar[(c=d.sentientConfidence)!=null?c:"low"])!=null?i:.15}:Te&&(ie={persona:Te.persona,confidence:(l=Ar[Te.band])!=null?l:.15})}if(e.initialAssignments)for(let[d,h]of Object.entries(e.initialAssignments))g.set(d,te,{variantId:h,assignedAt:Date.now(),segment:te,confidence:1});let Ke=Promise.resolve(),Cr=_.getSessionId();if(Cr){let d=qr((u=document.referrer)!=null?u:""),{utmParams:h,clickIds:P}=Zi(),U=$($($($({sessionId:Cr,deviceClass:_e,trafficSource:z,referrerDomain:d,utmParams:h,clickIds:P,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:Yr(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:_.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Hr((p=navigator.userAgent)!=null?p:"")},e.userId?{userId:e.userId,userHash:e.userHash}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),G=async()=>{O&&await Ut(O,2500);for(let x=0;;x++){if(Ee||!y())return;let T=Fe(5e3);try{let L=await fetch(`${I}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(Object.assign(U,E)),headers:F,signal:T.signal});if(L.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(L.ok||Wt(L)==="dropped")return}catch(L){}finally{T.clear()}if(x>=Ji){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(L=>setTimeout(L,qe(x+1)))}};try{Ke=G()}catch(x){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:A});let ai=Yi(),yt=null,Tn=!1,ae={goal(d,h={},P=1,U=0){var G,x,T,L,H,V,q;let Q=_.getSessionId();if(!Q||Ee||!y())return;let B=qi(h)?h:{metadata:h},he=[d,(G=B.externalId)!=null?G:"",(x=B.stepIndex)!=null?x:U,(T=B.weight)!=null?T:P].join("\0"),xe=B.value!==void 0?`${B.value}\0${(L=B.currency)!=null?L:""}`:null;if(ai.firedBefore(he,xe)){e.debug&&console.log(`[sentient] goal("${d}") already recorded for this action \u2014 not sent twice`);return}let de=Vn(),se={sessionId:Q,name:d,metadata:(H=B.metadata)!=null?H:{},weight:(V=B.weight)!=null?V:P,stepIndex:(q=B.stepIndex)!=null?q:U,goalId:de,value:B.value,currency:B.currency,externalId:B.externalId};e.debug&&console.log("[sentient] goal",se);let D={id:de,body:JSON.stringify(se)};Ke.then(()=>ne.send(D))},componentGoal(d,h,P){var U,G,x;let T=_.getSessionId();if(!T||Ee||!y())return;let L=g.get(d,te),H=L?null:(U=Z.get(d))!=null?U:null;if(!L&&H===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(!L&&!Oe.has(d)){e.debug&&console.warn(`[sentient] componentGoal("${d}"): slot not decided this session \u2014 not attributed`);return}let V=L?L.variantId:Xr(H),q={id:Vn(),sessionId:T,projectId:e.apiKey,componentId:d,variantId:V,eventType:"goal_achieved",goalType:h,payload:$({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},(x=P==null?void 0:P.metadata)!=null?x:{}),timestamp:Date.now(),timeInSession:Date.now()-j,path:Qt()};e.debug&&console.log("[sentient] componentGoal",q),Ke.then(()=>{!Ee&&y()&&A.push(q)})},identify(d,h){let P=_.getSessionId();if(!P||Ee||!y())return;let U=(h==null?void 0:h.email)!==void 0?io().then(G=>G.emailFields(h.email)).catch(()=>({})):{};Promise.all([Ke,U]).then(([,G])=>{fetch(`${I}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(Ue($($({sessionId:P,userId:d,userHash:h==null?void 0:h.userHash},G),E),{ephemeral:_.isEphemeral()})),headers:F}).catch(()=>{})})},track(d){let h=_.getSessionId();if(!h||Ee||!y()||d.eventType==="variant_assigned"&&Z.get(d.componentId)!==void 0&&!Oe.has(d.componentId)&&!g.get(d.componentId,te))return;let P=Ue($({path:Qt()},d),{id:Vn(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-j});e.debug&&console.log("[sentient] track",P),Ke.then(()=>A.push(P))},getAssignment(d,h){return g.get(d,h)},isUnified:d=>f.has(d),async assign(d,h,P,U,G){var x;let T=_.getSessionId();if(!T)return null;let L=(G==null?void 0:G.unified)===!0;if(L&&f.has(d))return{variantId:(x=h==null?void 0:h[0])!=null?x:"",assignmentTtlMs:0,unified:!0};let H=g.get(d,te);if(H&&(h!=null&&h.length||H.content!==void 0)){let V=H.ttlMs&&H.ttlMs>0?Math.max(0,H.assignedAt+H.ttlMs-Date.now()):0;return{variantId:H.variantId,assignmentTtlMs:V,content:H.content}}return Yn(Ie,L?`${d}\0unified`:d,async()=>{if(!await Ut(Ke,2500)||Ee||!y())return null;let V=Fe(3e4);try{let q={sessionId:T,componentId:d,variantIds:h};U!==void 0?q.agentDataByVariant=U:P!==void 0&&(q.agentData=P),L&&(q.caps={unified:!0});let Q=await fetch(`${I}/assign`,{method:"POST",body:JSON.stringify(q),headers:F,signal:V.signal});if(!Q.ok)return null;let B=await Q.json();return B.unified===!0?L?(f.add(d),{variantId:B.variantId,assignmentTtlMs:0,unified:!0}):null:(g.set(d,te,$({variantId:B.variantId,assignedAt:Date.now(),segment:te,confidence:1,content:B.content},B.assignmentTtlMs&&B.assignmentTtlMs>0?{ttlMs:B.assignmentTtlMs}:{})),B)}catch(q){return null}finally{V.clear()}})},async decide(d){var h,P;let U=_.getSessionId();if(!U)return null;let G=(h=d.slots)!=null?h:[],x={sessionId:U};d.sections&&d.sections.length>0&&(x.sections=d.sections.map(L=>({id:L}))),x.components=(P=d.components)!=null?P:[],G.length>0&&(x.slots=G.map(jn)),d.slotsFrom==="registry"&&(x.slotsFrom="registry",d.registrySlotIds&&(x.registrySlotIds=d.registrySlotIds),d.bootstrap===!1&&(x.bootstrap=!1),d.render&&Object.keys(d.render).length>0&&(x.render=d.render)),d.v&&(x.v=d.v),typeof d.pp=="number"&&(x.pp=d.pp),e.persona&&(x.persona=e.persona),Object.assign(x,E);let T=JSON.stringify(x);return Yn(ge,T,async()=>{var L,H,V,q,Q,B,he,xe;if(!await Ut(Ke,2500)||Ee||!y())return On(G),null;let de=Fe(3e4);try{let se=await fetch(`${I}/decide`,{method:"POST",body:T,headers:F,signal:de.signal});if(!se.ok)return On(G),null;let D=await se.json(),Pe=St(D.stage,e.stageAttributes);e.stageAttributes&&tn(Pe);let it={};for(let X of G){let Le=(L=D.slots)==null?void 0:L[X.id];if(Le!==void 0){it[X.id]=Le,Z.set(X.id,Le),Oe.add(X.id);continue}let Ir=Z.get(X.id);if(Ir!==void 0)it[X.id]=Ir;else{let Or=Gn(X);it[X.id]=Or,Z.set(X.id,Or)}}if(D.slots)for(let[X,Le]of Object.entries(D.slots))X in it||(it[X]=Le,Z.set(X,Le),Oe.add(X));let si=ie!=null&&ie.persona!=="unknown";D.persona&&!(D.persona==="unknown"&&si)?ie={persona:D.persona,confidence:(H=D.confidence)!=null?H:0}:ie||(ie={persona:"unknown",confidence:0});for(let[X,Le]of Object.entries((V=D.assignments)!=null?V:{}))g.set(X,te,{variantId:Le,assignedAt:Date.now(),segment:te,confidence:1});if(D.slotConfig)for(let[X,Le]of Object.entries(D.slotConfig))ce.set(X,Le);D.palette&&(ke=D.palette),D.vocabulary&&(me=D.vocabulary);for(let X of(q=d.registrySlotIds)!=null?q:[])(Q=D.slotConfig)!=null&&Q[X]||(ce.delete(X),Z.delete(X),Oe.delete(X));return y()&&Je(e.apiKey,$($($($({v:1,persona:ie.persona,band:Ye(ie.confidence),slots:Object.fromEntries(Z),layoutOrder:(B=D.layoutOrder)!=null?B:null,savedAt:Date.now()},ce.size>0?{slotConfig:Object.fromEntries(ce)}:{}),ke?{palette:ke}:{}),me?{vocabulary:me}:{}),Pe?{stage:Pe}:{})),$($($($($($($({layoutOrder:(he=D.layoutOrder)!=null?he:null,assignments:(xe=D.assignments)!=null?xe:{},slots:it,persona:ie.persona,confidence:ie.confidence},D.slotConfig?{slotConfig:D.slotConfig}:{}),D.goals?{goals:D.goals}:{}),D.sectionMap?{sectionMap:D.sectionMap}:{}),D.palette?{palette:D.palette}:{}),D.vocabulary?{vocabulary:D.vocabulary}:{}),D.stage?{stage:D.stage}:{}),D.context?{context:D.context}:{})}catch(se){return On(G),null}finally{de.clear()}})},getSlotResult(d){var h;return(h=Z.get(d))!=null?h:null},isSlotDecided(d){return Oe.has(d)},getSlotConfig(d){var h;return(h=ce.get(d))!=null?h:null},reportSlots(d,h,P,U){var G;let x={};for(let[T,L]of Object.entries(U!=null?U:{}))for(let H of L){let V=`${T}|${H.key}`;!gt.test(T)||wr.has(V)||(wr.add(V),((G=x[T])!=null?G:x[T]=[]).push(H))}Object.keys(x).length>0&&fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify({slotIds:Object.keys(x),authoredArms:x})}).catch(()=>{});for(let T of d)if(!(typeof T!="string"||T.length===0)){if(!gt.test(T)){zi()&&!kr.has(T)&&(kr.add(T),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(T)} 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(!vr.has(T)){vr.add(T),Mt.add(T);let L=h==null?void 0:h[T];if(typeof L=="string"){let V=L.replace(/\s+/g," ").trim().slice(0,400);V!==""&&En.set(T,V)}let H=P==null?void 0:P[T];H!==void 0&&xn.set(T,H)}}Mt.size===0||An!=null||(An=setTimeout(()=>{An=null;let T=[...Mt];Mt.clear();for(let L=0;L<T.length;L+=20){let H=T.slice(L,L+20),V={},q={};for(let Q of H){let B=En.get(Q);B!==void 0&&(V[Q]=B,En.delete(Q));let he=xn.get(Q);he!==void 0&&(q[Q]=he,xn.delete(Q))}fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify($(Ue($($({slotIds:H},Object.keys(V).length>0?{baselineTexts:V}:{}),Object.keys(q).length>0?{baselineSkeletons:q}:{}),{pagePaths:Object.fromEntries(H.map(Q=>[Q,location.pathname]))}),Object.keys(V).length>0&&_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(d,h){!gt.test(d)||br.has(d)||(br.add(d),fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify({slotIds:[d],baselineSkeletons:{[d]:h}})}).catch(()=>{}))},reportAgentData(d,h,P){let U=`${d}|${h}`;!gt.test(d)||_r.has(U)||(_r.add(U),fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify($($({slotIds:[d],agentData:{[d]:{[h]:P}}},h.startsWith("authored.")?{authoredArms:{[d]:[{key:h.slice(9)}]}}:{}),_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{}))},reportDrift(d,h,P,U){let G=`${d}|${h}`,x=_.getSessionId();!x||Sr.has(G)||(Sr.add(G),fetch(`${I}/slots/drift`,{method:"POST",headers:F,body:JSON.stringify({sessionId:x,reports:[{slotId:d,expectedFp:h,observedFp:P,reason:U}]})}).catch(()=>{}))},requestSlots(d,h,P){var U,G;for(let x of d)Bt.has(x)||(Bt.add(x),gt.test(x)?mt.set(x,{text:h==null?void 0:h[x],render:(U=P==null?void 0:P.render)==null?void 0:U[x],skeleton:(G=P==null?void 0:P.skeletons)==null?void 0:G[x]}):ae.reportSlots([x]));mt.size===0||Cn!=null||(Cn=setTimeout(()=>{Cn=null;let x=[...mt];mt.clear();for(let T=0;T<x.length;T+=50){let L=x.slice(T,T+50),H={};for(let[V,q]of L)q.render&&(H[V]=q.render);ae.decide({slotsFrom:"registry",registrySlotIds:L.map(([V])=>V),bootstrap:!1,render:H}).then(V=>{var q,Q;if(V){let B={},he={},xe=[];for(let[de,se]of L){let D=(q=V.slotConfig)==null?void 0:q[de];if(D){D.needsSkeleton&&se.skeleton&&((Q=ae.reportSkeleton)==null||Q.call(ae,de,se.skeleton));continue}xe.push(de),se.text&&(B[de]=se.text),se.skeleton&&(he[de]=se.skeleton)}xe.length>0&&ae.reportSlots(xe,B,he)}else xr(L.map(([B])=>B),Bt,B=>{var he;let xe={},de={},se={};for(let[D,Pe]of L)B.has(D)&&(Pe.text&&(xe[D]=Pe.text),Pe.render&&(de[D]=Pe.render),Pe.skeleton&&(se[D]=Pe.skeleton));(he=ae.requestSlots)==null||he.call(ae,[...B],xe,{render:de,skeletons:se})});$t.forEach(B=>B())})}},0))},decideSlots(d){for(let h of d)Kt.has(h.id)||(Kt.add(h.id),ht.set(h.id,h));ht.size===0||In!=null||(In=setTimeout(()=>{In=null;let h=[...ht.values()];ht.clear();for(let P=0;P<h.length;P+=30){let U=h.slice(P,P+30);ae.decide({slots:U}).then(G=>{G||xr(U.map(x=>x.id),Kt,x=>{var T;return(T=ae.decideSlots)==null?void 0:T.call(ae,U.filter(L=>x.has(L.id)))}),$t.forEach(x=>x())})}},0))},cancelSlots(d){for(let h of d)mt.delete(h)&&Bt.delete(h),ht.delete(h)&&Kt.delete(h)},onSlotsChanged(d){return $t.add(d),()=>{$t.delete(d)}},getStyleVocabulary(){return me},getSitePalette(){return ke},getVisitorId:()=>y()?_.getSessionId():null,getPersona(){return ie?{persona:ie.persona,confidence:ie.confidence,band:Ye(ie.confidence)}:null},async fetchWeights(){var d;let h=Fe(5e3);try{let P=await fetch(`${I}/weights`,{headers:F,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(){A.flush(),ne.flush()},dispose(){var d;yt==null||yt(),Tn=!0,Ee=!0,A.destroy(),ne.destroy(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ae.dispose&&pe.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var d;yt==null||yt(),Tn=!0,Ee=!0,M=!0,Ft(e.apiKey),A.destroy({forget:!0}),ne.destroy({forget:!0}),_.destroy(),g.clear(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ae.dispose&&pe.delete(e.apiKey);try{localStorage.removeItem(at+e.apiKey),localStorage.removeItem(Ht(e.apiKey)),localStorage.removeItem(Vt(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${Ge(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:ae.dispose}),yt=Xi(ae,e.apiKey,d=>{Ke.then(()=>{Tn||fo.add(d)})}),e.debug){let d=window;d.__sentient&&(d.__sentient.client=ae)}return ae}var nr=/(^|\/)snippet(\.global)?(\.min)?\.js(\?|$)/,ea=(()=>{var e,t;try{return(t=(e=document.currentScript)==null?void 0:e.src)!=null?t:""}catch(n){return""}})(),ta=/@\d+\.\d+\.\d+[^/]*\//;function rr(e){var t;try{let n=ea||((t=Array.from(document.getElementsByTagName("script")).find(r=>nr.test(r.src)))==null?void 0:t.src);for(let r of n?[n]:[]){let o=nr.test(r)?r.replace(nr,`$1${e}$4`):r.replace(/[^/?#]*([?#].*)?$/,e),a=(e==="consent.global.js"?"sha384-+7/RqBOFLU5bMaQ6bcBAWzG589skmxN8tedG9hkoQQ6HaQkRRBJfoRVD94e/fJcM":e==="editor.global.js"?"sha384-PCGH0rGbUEHjzeQnSC1rCfh9guh69PEVO5X3f39xVbZ7AhyE3eEk5NkmNBMPK/Ey":e==="preview.global.js"?"sha384-kA/hCRMTGTk3+tbBlDLjgUJmeAKIG8WXAELsHHGSCmyiYCAu4yGrsUYbRnNFJ/vT":"sha384-yo1YcjxOTV7efFxBAw7Y3cYATG+UwDC85rctizAFARPdceZfWRI336j0wHYDeRsA")||"";return ta.test(o)&&a.indexOf("sha384-")===0?{src:o,integrity:a}:{src:o}}}catch(n){}return null}var rn=new Map;function Ze(e,t,n){let r=window[t];if(r)return Promise.resolve(r);let o=rn.get(e);return o||(o=new Promise(a=>{var i;let s=n?{src:n}:rr(e);if(!s)return a(null);let c=We(document.createElement("script"));or(c,s),c.async=!0,c.onload=()=>{var u;let l=(u=window[t])!=null?u:null;l||rn.delete(e),a(l)},c.onerror=()=>{rn.delete(e),a(null)},((i=document.head)!=null?i:document.documentElement).appendChild(c)}),rn.set(e,o)),o}function or(e,t){t.integrity&&(e.integrity=t.integrity,e.crossOrigin="anonymous"),e.src=t.src}var go="__sentientConsent",Ne=null,ir=!1,on=new Set,ar=()=>{let e=window[go];return typeof(e==null?void 0:e.consentWatcher)=="function"?e.consentWatcher:null},kt;function mo(e){kt=e}function na(){Ne||(Ne=ar())||ir||(ir=!0,Ze("consent.global.js",go,kt).then(e=>{if(ir=!1,!e)return ra(kt!=null?kt:"consent.global.js");if(Ne=ar(),Ne)for(let t of Array.from(on))t()}))}function ra(e){console.warn(`[sentient] could not load ${e} \u2014 tracking stays off. Set window.sentient.consentSrc to its URL.`)}function Qe(e){na();let t=null,n=()=>(!t&&(Ne!=null?Ne:Ne=ar())&&(t=Ne(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,a=!1,s=()=>{on.delete(s);let c=n();a||!c||(o=c.subscribe(r),r())};return n()?(o=t.subscribe(r),Promise.resolve().then(()=>{a||r()})):on.add(s),()=>{a=!0,on.delete(s),o==null||o()}}}}function oa(e){return e.replace(/\s+/g," ").trim().slice(0,300)}function ho(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 ia(e){let t=e.join("");return ho(t,2166136261)+ho(t,1523705862)}var aa=new Set(["A","BUTTON"]),sa=/^H([1-6])$/,la=new Set(["P","LI","LABEL","BLOCKQUOTE","FIGCAPTION","DT","DD","TD","TH"]);var ua=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT"]);function ca(e){return aa.has(e.tagName)||e.getAttribute("role")==="button"?!0:e.tagName==="INPUT"&&/^(submit|button)$/i.test(e.type)}function da(e){if(sa.test(e.tagName)||la.has(e.tagName))return!0;let t=e.ownerDocument.defaultView,n=t?t.getComputedStyle(e).display:"";return n!==""&&n!=="inline"&&n!=="contents"}function fa(e,t){let n=null;for(let r=e.parentElement;r&&r!==t.parentElement;r=r.parentElement){if(ca(r)){n=r;break}if(r===t)break}if(n)return n;for(let r=e.parentElement;r;r=r.parentElement)if(r===t||da(r))return r;return t}function an(e,t=40){var n,r,o;let a=e.ownerDocument.createTreeWalker(e,4),s=[];for(let u=a.nextNode();u;u=a.nextNode())if(((n=u.nodeValue)!=null?n:"").trim()!==""&&!ua.has((o=(r=u.parentElement)==null?void 0:r.tagName)!=null?o:"")&&(s.push(u),s.length>120))return{reason:"too_large"};if(s.length===0)return{reason:"empty"};let c=[],i=[];for(let u of s){let p=fa(u,e),v=c.indexOf(p);v===-1&&(c.push(p),v=c.length-1),i.push(v)}if(c.length>t)return{reason:"too_large"};let l=s.map(u=>{var p;return oa((p=u.nodeValue)!=null?p:"")});return{textNodes:s,ownerEls:c,leafToNode:i,leaves:l,fp:ia(l)}}var yo=["cookiebot","onetrust","cookieyes","tcf","google-consent-mode","shopify"];function pa(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(a=>typeof a=="string")||/[=|]/.test(r)||o.some(a=>/[=|]/.test(a)))return null;n[r]=o}return n}function ga(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function sr(e){try{return e()}catch(t){return}}function sn(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,u]of Object.entries(t.slots)){if(typeof u!="object"||u===null)continue;let p=u,v=pa(p.dims);if(!v||p.target!==void 0&&typeof p.target!="string")continue;let b=p.arms!==void 0?ga(p.arms):null,S={dims:v};typeof p.target=="string"&&(S.target=p.target),b&&(S.arms=b),n[l]=S}let r={apiKey:t.apiKey,personaAttributes:t.personaAttributes===!0,slots:n};typeof t.consent=="boolean"?r.consent=t.consent:t.consent!==void 0&&a("consent");let o=t.consentFrom;if(typeof o=="string"&&yo.includes(o))r.consentFrom=o;else if(o&&typeof o=="object"&&!Array.isArray(o)){let l=o;typeof l.cmp=="string"&&yo.includes(l.cmp)||l.cmp===void 0&&(typeof l.cookie=="string"||typeof l.check=="function")?r.consentFrom=l:a("consentFrom")}else o!==void 0&&a("consentFrom");function a(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 s=typeof t.persona=="function"?sr(t.persona):t.persona;typeof s=="string"&&s.trim()!==""&&(r.persona=s);let c=typeof t.userId=="function"?sr(t.userId):t.userId,i=typeof c=="number"||typeof c=="string"?String(c).trim():"";if(i&&i.length<=256&&!i.includes("@")&&(r.userId=i,typeof t.userHash=="string"&&t.userHash&&(r.userHash=t.userHash)),(typeof t.internal=="function"?sr(t.internal):t.internal)===!0&&(r.internal=!0),Array.isArray(t.sections)){let l=t.sections.filter(u=>typeof u=="string"&&u.trim()!=="").slice(0,50);l.length>=2&&(r.sections=l)}return r}var vo=new WeakMap;function bo(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function So(e,t,n){var a,s,c;let r=vo.get(e);if(r){if(r.fp!==n.fp||!bo(r.leafToNode,n.leafToNode))return"mismatch"}else{let i=an(e);if(!("fp"in i)||(r={fp:i.fp,leafToNode:i.leafToNode,textNodes:i.textNodes,ownerEls:i.ownerEls,classes:i.ownerEls.map(l=>{var u;return(u=l.getAttribute("class"))!=null?u:""})},r.fp!==n.fp||!bo(r.leafToNode,n.leafToNode)))return"mismatch";vo.set(e,r)}let o=r;for(let[i,l]of Object.entries(t.nodes)){let u=Number(i),p=o.ownerEls[u];if(p){if(typeof l.text=="string"){let v=!0;o.leafToNode.forEach((b,S)=>{b===u&&(o.textNodes[S].nodeValue=v?l.text:"",v=!1)})}l.like!==void 0&&o.classes[l.like]!==void 0&&p.setAttribute("class",o.classes[l.like]),l.hidden&&((a=p.style)==null||a.setProperty("display","none","important"))}}for(let i of Object.values((s=t.order)!=null?s:{})){let l=i.map(S=>o.ownerEls[S]).filter(S=>!!S),u=(c=l[0])==null?void 0:c.parentElement;if(!u||l.length!==i.length||l.some(S=>S.parentElement!==u))continue;let p=new Set(l),v=0;Array.from(u.children).map(S=>p.has(S)?l[v++]:S).forEach((S,w)=>{var K;u.children[w]!==S&&u.insertBefore(S,(K=u.children[w])!=null?K:null)})}return"applied"}function Et(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 ma(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 xt(e,t){return!!(e!=null&&e.urlMatch)&&!Et(t).includes(e.urlMatch)}var ha=/^[a-zA-Z_][-a-zA-Z0-9_]*$/;function lr(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)&&ha.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 De(e,t){if(e.urlMatch&&!Et(t).includes(e.urlMatch))return null;let n=lr(e,t);if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!ma(r,e.fingerprint)?null:r}var ya=12;function wo(e,t){var c;let n=De(e,t),r=e.fingerprint,o=i=>(i!=null?i:"").replace(/\s+/g," ").trim().toLowerCase(),a=o((c=r==null?void 0:r.text)!=null?c:"");if(n||!(r!=null&&r.tag)||a.length<ya||xt(e,t)||lr(e,t).length)return n;let s=Array.from(t.getElementsByTagName(r.tag)).filter(i=>o(i.textContent)===a);return s.length===1?s[0]:null}function _o(e,t){return xt(e,t)?!1:!!e.selector&&!e.dataAttr&&!e.id&&!e.fingerprint&&e.page===void 0?ko(e,t):De(e,t)!==null}function ko(e,t){return lr(e,t).length>0}function ln(e,t){return xt(e,t)?!1:e.page!==void 0&&nn.test(e.page)?Xn(e.page,Et(t)):ko(e,t)}var Eo={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"},va=/^(rgb|rgba|hsl|hsla|calc|var|min|max|clamp)$/i;function xo(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(!va.test((r=n[1])!=null?r:""))return!1;return!0}function ba(e){var r,o;let t=e.ownerDocument.createTreeWalker(e,4),n=null;for(let a=t.nextNode();a!==null;a=t.nextNode()){if(((r=a.nodeValue)!=null?r:"").trim()==="")continue;let s=(o=a.parentElement)==null?void 0:o.tagName;if(!(s==="SCRIPT"||s==="STYLE"||s==="TEMPLATE")){if(n!==null)return null;n=a}}return n}function At(e,t){let n=ba(e);n!==null?n.nodeValue=t:e.textContent=t}var ur=/^https:\/\//i;function un(e){return typeof e=="string"&&!/[\s\x00-\x1f\\]/.test(e)&&(ur.test(e)||e[0]==="/"&&e[1]!=="/")?e:null}var Ao=new Map,He=null;function Sa(e){return e.replace(/["\\]/g,"\\$&")}function wa(e){var t;(!He||!He.isConnected)&&(He=e.querySelector("style[data-sentient-ops]"),He||(He=We(e.createElement("style"),e),He.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(He))),He.textContent=[...Ao.entries()].map(([n,r])=>`[data-snt-e="${Sa(n)}"]{${r}}`).join(`
|
|
2
|
-
`)}function Co(e,t,n,r){var c;let o=!1,a=(c=t.moveBefore)!=null?c:t.moveAfter;if(a){let i=De(a,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"&&At(e,t.text),typeof t.href=="string"&&ur.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&ur.test(t.imageSrc)&&e.setAttribute("src",t.imageSrc),typeof t.imageAlt=="string"&&e.setAttribute("alt",t.imageAlt);let s=[];if(t.hidden&&s.push("display:none !important"),t.style)for(let[i,l]of Object.entries(t.style)){let u=Eo[i];u&&typeof l=="string"&&xo(l)&&s.push(`${u}:${l.trim()} !important`)}return s.length>0&&(e.setAttribute("data-snt-e",n),Ao.set(n,s.join(";")),wa(r)),{anchorMiss:o}}var Ct="data-sentient-block-arm",R=null;function It(e){R=e!=null?e:null}var et=null;function Ot(e){et=e!=null?e:null}var Po=e=>{var t;return typeof e=="string"?(t=et==null?void 0:et.entries.find(n=>n.id===e))==null?void 0:t.classes:void 0},Lo=e=>{let t=typeof e=="string"?et==null?void 0:et.entries.find(n=>n.id===e):void 0;return t!=null&&t.computed.inheritsColor?t.computed.color:void 0},Me="data-sentient-blocks-hid",ft={none:"0",sm:"8px",md:"16px",lg:"24px"},cr={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},Io={sm:"0.875em",md:"1em",lg:"1.25em"},_a={sm:"1.25em",md:"1.5em",lg:"2em"},ka={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},Oo={sm:"8px",md:"16px",lg:"32px"},Ea={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},xa={normal:"400",medium:"500",bold:"700"};function ye(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&e.style.setProperty(n,r);return e}function To(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 Ro(e,t){let n=Aa(e,t),r=Lo(e.like);return n&&r&&(n.style.color=r),n}function Aa(e,t){var n,r,o,a,s,c,i,l,u,p,v,b,S,w,K,j,_,E,O,N;try{let M=Po(e.like),m=e.maxWidth==="measure"?"65ch":void 0,y=f=>(f.className=M,ye(f,{"max-width":m}));switch(e.type){case"stack":case"grid":{let f=t.createElement("div");if(e.type==="stack"){let I=e;ye(f,{display:"flex","flex-direction":I.direction,gap:(r=ft[(n=I.gap)!=null?n:"md"])!=null?r:ft.md,"align-items":I.align?cr[I.align]:void 0,"justify-content":I.justify?cr[I.justify]:void 0,"flex-wrap":I.wrap?"wrap":void 0})}else{let I=e,F=(a=ft[(o=I.gap)!=null?o:"md"])!=null?a:ft.md;ye(f,{display:"grid","grid-template-columns":`repeat(auto-fit, minmax(max(200px, calc((100% - ${I.columns-1} * ${F}) / ${I.columns})), 1fr))`,gap:F,"align-items":I.align?cr[I.align]:void 0})}M&&(f.className=M);let g=!M&&e.type==="stack"&&e.surface==="raised",A=(s=e.pad)!=null?s:g?"md":void 0;A&&ye(f,{padding:(c=ft[A])!=null?c:ft.md}),g&&ye(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":(l=R==null?void 0:R.radius)!=null?l:"8px"});for(let I of(u=e.children)!=null?u:[]){let F=Ro(I,t);F&&f.appendChild(F)}return f}case"text":{let f=t.createElement("p");return f.textContent=e.value,M?y(f):ye(f,je(W({margin:"0","font-size":e.size?Io[e.size]:void 0,"font-weight":e.weight?xa[e.weight]:void 0,"text-align":e.align},To(e.tone)),{"max-width":e.maxWidth==="measure"?"65ch":void 0}))}case"heading":{let f=t.createElement(`h${e.level}`);return f.textContent=e.value,M?y(f):ye(f,{margin:"0","font-size":_a[(p=e.size)!=null?p:"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 g=un(e.href);if(g&&(f.href=g),e.tag&&f.setAttribute("data-sentient-tag",e.tag),M)return y(f);let A=(v=e.emphasis)!=null?v:"primary";return ye(f,{display:"inline-block",padding:ka[(b=e.size)!=null?b:"md"],"border-radius":(S=R==null?void 0:R.radius)!=null?S:"8px",font:"inherit","font-size":e.size?Io[e.size]:void 0,"text-decoration":A==="ghost"?"underline":"none",cursor:"pointer",background:A==="primary"?(w=R==null?void 0:R.primaryBg)!=null?w:"#111827":"transparent",color:A==="primary"?(K=R==null?void 0:R.primaryText)!=null?K:"#ffffff":(j=R==null?void 0:R.accent)!=null?j:"inherit",border:A==="secondary"?`1px solid ${(_=R==null?void 0:R.accent)!=null?_:"currentColor"}`:"none"})}case"link":{let f=t.createElement("a");f.textContent=e.label;let g=un(e.href);return g&&(f.href=g),e.tag&&f.setAttribute("data-sentient-tag",e.tag),M?y(f):ye(f,{color:"inherit","text-decoration":"underline"})}case"image":{let f=t.createElement("img"),g=un(e.src);return g&&(f.src=g),f.alt=e.alt,M&&(f.className=M),ye(f,{display:"block","max-width":"100%","aspect-ratio":e.ratio&&e.ratio!=="auto"?Ea[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,M?y(f):ye(f,W({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"}`},To(e.tone)))}case"spacer":return ye(t.createElement("div"),{height:(O=Oo[e.size])!=null?O:Oo.md});case"divider":return ye(t.createElement("hr"),{border:"none","border-top":`1px solid ${(N=R==null?void 0:R.border)!=null?N:"currentColor"}`,margin:"0",width:"100%"});default:return null}}catch(M){return null}}function No(e,t,n,r){var o,a;try{let s=new Set;for(let i of Array.from(e.children)){let l=i.getAttribute(Ct);l!==null&&(t[l]===void 0?i.remove():s.add(l))}for(let[i,l]of Object.entries(t)){if(s.has(i))continue;let u="tree"in l?l:null,p=Ro(u?u.tree:l,r);if(!p)continue;let v=r.createElement("div");v.setAttribute(Ct,i),v.style.display="none";let b=u?Po((o=u.surface)==null?void 0:o.like):void 0;if(b){let S=r.createElement("div");S.className=b;let w=Lo((a=u.surface)==null?void 0:a.like);w&&(S.style.color=w),S.appendChild(p),v.appendChild(S)}else v.appendChild(p);e.appendChild(v)}let c=n!==void 0&&t[n]!==void 0;for(let i of Array.from(e.children)){let l=i.getAttribute(Ct),u=i;l!==null?u.style.display=c&&l===n?"":"none":c?u.hasAttribute(Me)||(u.setAttribute(Me,u.style.display),u.style.display="none"):u.hasAttribute(Me)&&(u.style.display=u.getAttribute(Me),u.removeAttribute(Me))}}catch(s){}}function Ca(e){try{for(let t of Array.from(e.children)){let n=t;if(n.getAttribute(Ct)!==null){n.remove();continue}n.hasAttribute(Me)&&(n.style.display=n.getAttribute(Me),n.removeAttribute(Me))}}catch(t){}}function cn(e,t){try{let n=new Set;for(let r of Array.from(e.querySelectorAll(`[${Ct}]`)))r.parentElement&&n.add(r.parentElement);for(let r of Array.from(e.querySelectorAll(`[${Me}]`)))r.parentElement&&n.add(r.parentElement);for(let r of n)t.has(r)||Ca(r)}catch(n){}}function dr(e,t){if(!e)return[t.documentElement];try{return Array.from(t.querySelectorAll(e))}catch(n){return[]}}function dn(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 fn(e,t,n,r){var o;for(let[a,s]of Object.entries(t)){let c=e[a];if(!c||typeof c=="string")continue;let i=dr(s.target,n);for(let l of i)for(let[u,p]of Object.entries(c))(o=s.dims[u])!=null&&o.includes(p)&&(l.setAttribute(`data-${u}`,p),r==null||r(l,`data-${u}`))}}function pn(e,t,n,r){for(let[o,a]of Object.entries(t)){let s=e[o];if(typeof s!="string"||!a.arms||!a.arms.includes(s))continue;let c=dr(a.target,n);for(let i of c)i.setAttribute("data-sentient-arm",s),r==null||r(i,"data-sentient-arm")}}function gn(e,t,n,r){var c,i,l,u,p,v,b;let o=new Set,a=(c=r==null?void 0:r.contentAndOps)!=null?c:!0,s=[];for(let[S,w]of Object.entries(t)){if(xt(w.locator,n))continue;let K;if(w.locator){let _=De(w.locator,n);K=_?[_]:[],!_&&ln(w.locator,n)&&s.push(S)}else K=dr(w.target,n);let j=e[S];for(let _ of K){if(j!==void 0)if(typeof j=="string")_.setAttribute("data-sentient-arm",j),(i=r==null?void 0:r.onAttr)==null||i.call(r,_,"data-sentient-arm"),a&&((l=r==null?void 0:r.onApplied)==null||l.call(r,S,j,_));else for(let[O,N]of Object.entries(j))_.setAttribute(`data-${O}`,N),(u=r==null?void 0:r.onAttr)==null||u.call(r,_,`data-${O}`);if((w.blocks||w.compose)&&!Oa(n)){let O=Object.fromEntries([...Object.entries((p=w.blocks)!=null?p:{}).filter(([,N])=>!wt(N)),...Object.entries((v=w.compose)!=null?v:{}).filter(([,N])=>!wt(N.tree))]);Object.keys(O).length>0&&(No(_,O,typeof j=="string"?j:void 0,n),o.add(_))}if(!a)continue;let E=_.textContent;w.edits?So(_,w.edits.edits,w.edits)==="mismatch"&&((b=r==null?void 0:r.onDrift)==null||b.call(r,S,w.edits.fp)):typeof w.content=="string"&&At(_,w.content),w.ops&&Co(_,w.ops,S,n).anchorMiss&&!s.includes(S)&&s.push(S),Qn(_,je(W(W({previous:E},typeof j=="string"?{arm:j}:{}),(r==null?void 0:r.persona)!==void 0?{persona:r.persona}:{}),{doc:n}))}}return cn(n,o),s}var Ia=/bot|crawler|spider|crawling|googlebot|bingbot|duckduckbot|baiduspider|yandexbot|slurp|gptbot|claudebot|anthropic|perplexity|ccbot|applebot|headlesschrome/i;function Oa(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:Ia.test((r=o.userAgent)!=null?r:""):!1}catch(o){return!1}}var Ta=800;function mn(e,t,n){let r=[];return n.forEach(({slotId:o,arm:a,el:s},c)=>{r.push(er((v,b={})=>{try{e.track({projectId:t,componentId:o,variantId:a,eventType:"micro_signal",payload:W({signalType:v},b)})}catch(S){}},s,void 0,{tabLoss:c===0}));let i=null,l=0,u=()=>{l=Date.now(),i=setTimeout(()=>{try{e.track({projectId:t,componentId:o,variantId:a,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-l}})}catch(v){}i=null},Ta)},p=()=>{i!==null&&(clearTimeout(i),i=null)};s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",p),r.push(()=>{s.removeEventListener("mouseenter",u),s.removeEventListener("mouseleave",p),i!==null&&clearTimeout(i)})}),()=>{for(let o of r)o()}}function Mo(e){return e?`_snt_fired_goals_${e.slice(0,12)}`:"_snt_fired_goals"}var Pa="_snt_fired_goals";function fr(e,t){try{e==null||e.sessionStorage.removeItem(Mo(t)),e==null||e.sessionStorage.removeItem(Pa)}catch(n){}}function Do(e){var t;return[(t=e.slotId)!=null?t:"",e.goalId,e.event,e.locator?JSON.stringify(e.locator):""].join("|")}function La(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 Ra(e,t,n){try{e==null||e.sessionStorage.setItem(t,JSON.stringify([...n]))}catch(r){}}function $o(e,t,n,r){var j,_;let o=(j=n.defaultView)!=null?j:typeof window!="undefined"?window:null,a=Mo(r),s=La(o,a),c=E=>{let O=Do(E);if(!s.has(O))try{E.slotId?t.componentGoal(E.slotId,E.goalId):t.goal(E.goalId),s.add(O),Ra(o,a,s)}catch(N){}},i=e.filter(E=>E.event==="click"),l=e.filter(E=>E.event==="form_submit"),u=e.filter(E=>E.event==="url_reached"),p=e.filter(E=>E.event==="scroll_depth"),v=(E,O)=>{if(!E.locator)return!1;let N=wo(E.locator,n);return!!N&&(N===O||N.contains(O))},b=E=>{let O=E.target;if(!(!O||typeof O.closest!="function"))for(let N of i)v(N,O)&&c(N)},S=E=>{let O=E.target;if(O)for(let N of l)v(N,O)&&c(N)},w=()=>{if(u.length===0)return;let E=Et(n);for(let O of u)O.urlPattern&&Zn(O.urlPattern,E)&&c(O)},K=()=>{var N;let E=n.documentElement,O=E.scrollHeight>0?(E.scrollTop+E.clientHeight)/E.scrollHeight:0;for(let M of p)O>=((N=M.threshold)!=null?N:.75)&&c(M);p.every(M=>s.has(Do(M)))&&n.removeEventListener("scroll",K)};return n.addEventListener("click",b,!0),n.addEventListener("submit",S,!0),(_=n.defaultView)==null||_.addEventListener("popstate",w),w(),p.length>0&&(n.addEventListener("scroll",K,{passive:!0}),K()),{checkUrl:w,teardown:()=>{var E;n.removeEventListener("click",b,!0),n.removeEventListener("submit",S,!0),(E=n.defaultView)==null||E.removeEventListener("popstate",w),p.length>0&&n.removeEventListener("scroll",K)}}}function hn(e,t){if(!e||e.length<2||t.size!==e.length)return null;let n=[];for(let s of e){let c=t.get(s);if(!c||n.includes(c))return null;n.push(c)}let r=n[0].parentNode;if(!r||!n.every(s=>s.parentNode===r))return null;let o=n.slice().sort((s,c)=>s.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),a=[];for(let s=0;s<n.length;s++){let c=n[s];o[s]!==c&&(a.push({el:c,before:o[s]}),o.splice(o.indexOf(c),1),o.splice(s,0,c))}return a}var Na="__snt_editor_token";function Bo(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(Na):null}catch(e){return null}}function Ko(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 a=n.slice(0,r.index)+o;history.replaceState(history.state,"",a?"#"+a:location.pathname+location.search)}}catch(n){}return t}Un();Fn(()=>Ze("engagement.global.js","__sentientEngagement"));var Tt="0.36.3",bn=Tt!=="0.0.0-dev"?{name:"snippet",version:Tt}:void 0,zo=Tt!=="0.0.0-dev"?{v:Tt}:{},jo=5e3,Da=50,qo=(()=>{try{if(typeof window=="undefined")return[];let e=window.SentientSnippet;return Array.isArray(e==null?void 0:e.q)?e.q:[]}catch(e){return[]}})(),ee=null,k=null,Se={},be=null,we=null,Pt=null,re=null,oe=null,Lt=0,J=null,tt=null,Go=!1,pr=null,yn=null,Rt=null,Ae=!1,Ve=!1,Sn=!1,wn=0,Jo=e=>fe(e)===wn,pt=null,ue=!1,Be=null,Ce=[],nt=null,rt=null,ve=null,Ma=3e3,$a=100;function Fo(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 $e(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function Nt(e,t){return ee?(ee.personaAttributes&&J&&dn(J.persona,J.band,e,t==null?void 0:t.onAttr),fn(Se,ee.slots,e,t==null?void 0:t.onAttr),pn(Se,ee.slots,e,t==null?void 0:t.onAttr),be?gn(Se,be,e,W(je(W({},t),{onDrift:(n,r)=>{var o,a;return(a=k==null?void 0:k.reportDrift)==null?void 0:a.call(k,n,r,(o=Zo[n])!=null?o:null,"fp_mismatch")}}),J?{persona:J.persona}:{})):(cn(e,new Set),[])):[]}function Yo(e){var n;let t=new Map;for(let r of(n=ee==null?void 0:ee.sections)!=null?n:[])try{let o=e.querySelectorAll(r);o.length===1&&t.set(r,o[0])}catch(o){}return t}function gr(e,t){var n,r;try{if(!e||e.length<2)return;for(let o of(n=hn(e,Yo(t)))!=null?n:[])(r=o.before.parentNode)==null||r.insertBefore(o.el,o.before)}catch(o){}}function Ba(e,t,n){let r=(o,a)=>t.some(([s,c])=>s===o&&c===a);try{if(Array.isArray(e.stamped))for(let o of e.stamped){if(!Array.isArray(o))continue;let[a,s,c]=o;!a||typeof s!="string"||r(a,s)||(c==null?a.removeAttribute(s):a.setAttribute(s,c))}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 Ka(){try{let e=window.__sntPP;return e&&typeof e=="object"&&typeof e.v=="number"?e:null}catch(e){return null}}function Xo(e){return e.apiBase?`${e.apiBase.replace(/\/+$/,"")}/v1/events`:void 0}function kn(e){var t;return(t=e.apiBase)!=null?t:"https://api.sentient-ui.com"}function ja(e){return Promise.resolve().then(()=>fetch(`${kn(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 mr(e,t){let n=[],r=[];for(let o of e)try{if(typeof(o==null?void 0:o.id)!="string")continue;!o.locator||_o(o.locator,t)?n.push(o.id):ln(o.locator,t)&&r.push(o.id)}catch(a){}return[n,r]}var Zo={};function Qo(e,t){var r;let n={};for(let o of e){let a=(r=Be==null?void 0:Be.find(l=>l.id===o))==null?void 0:r.locator,s=a?De(a,t):null,c=s?an(s):null,i=c&&"fp"in c?c.fp:void 0;i&&(Zo[o]=i),n[o]=je(W({},i?{fp:i}:{}),{forms:!1,compose:!0,content:!0})}return n}function ei(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 ti(){if(!Ae){le&&nt!==Re()&&le(!0);return}!Be||nt===Re()||(nt=Re(),Ga())}function Ga(){ve==null||ve();let e=ee,t=Be;if(!e||!t)return;let n,r,o=()=>{clearTimeout(n),clearTimeout(c),r==null||r.disconnect(),ve===o&&(ve=null)},a=null,s=i=>{let[l,u]=mr(t,document),p=l.filter(v=>!Ce.includes(v));a!==null&&l.some(v=>!a.has(v)&&!p.includes(v))&&Dt(),a=new Set(l),p.length>0&&Fa(p).catch(()=>{}),(i||u.length===0&&!t.some(v=>!l.includes(v.id)&&!Ce.includes(v.id)))&&(o(),ni(e,u))},c=setTimeout(()=>s(!0),Ma);if(ve=o,s(),ve===o)try{r=new MutationObserver(()=>{clearTimeout(n),n=setTimeout(s,$a)}),r.observe(document.documentElement,{childList:!0,subtree:!0})}catch(i){}}function _n(e,t){if(!(!e||e.length===0||!t||!ee))try{we==null||we.teardown(),we=$o(e,t,document,ee.apiKey)}catch(n){}}async function Fa(e){let t=ee,n=k;if(!t||!n)return;Ce=Ce.concat(e);let r=await n.decide(W({slotsFrom:"registry",registrySlotIds:e,render:Qo(e,document)},zo));if(r||(Ce=Ce.filter(a=>!e.includes(a))),!r||ue||k!==n)return;Se=W(W({},Se),r.slots),!we&&r.goals&&(t.consent!==!1||Ve)&&_n(Pt=r.goals,n);let o=ei(r.slotConfig,e);o&&(be=W(W({},be),o)),Dt(),$e(t,"late decide",e),rt&&Jo(t.apiKey)&&Je(t.apiKey,rt=W(je(W({},rt),{slots:Se,savedAt:Date.now()}),be?{slotConfig:be}:{}))}function ni(e,t){if(t.length!==0)try{fetch(`${kn(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 ot(){return!!(ee&&k&&ee.sectionCapture!==!1&&(ee.consent!==!1||Ve)&&!Xe())}function Ua(){if(!k||!ee||!ot()||oe)return;let e=[];Nt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),yr();try{re==null||re(),re=mn(k,ee.apiKey,e)}catch(t){}}function yr(){if(typeof document=="undefined"||!ot())return;let e;try{if(yn&&yn.length>0){let r=new Map;for(let o of yn){if(o.urlMatch!==window.location.pathname)continue;let a=De(o.locator,document);a&&r.set(a,o.type)}r.size>0&&(e=o=>{var a;return(a=r.get(o))!=null?a:null})}}catch(r){}let t=k,n=++Lt;Rt=window.location.pathname,Ze("engagement.global.js","__sentientEngagement").then(r=>{if(!(!r||n!==Lt||k!==t||!t||!ot()))try{oe==null||oe(),oe=r.startEngagementCapture(t,W({apiKey:ee.apiKey,apiBase:ee.apiBase,doc:document,microSignals:!0},e?{typeOf:e}:{}))}catch(o){}})}function Dt(){try{let e=[];if(re==null||re(),re=null,Nt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),gr(tt,document),e.length>0&&ot())try{re=mn(k,ee.apiKey,e)}catch(t){}try{typeof window!="undefined"&&Rt!==null&&window.location.pathname!==Rt&&ot()&&(oe==null||oe(),oe=null,Lt++,yr())}catch(t){}}catch(e){}}function Uo(){pr===null&&(pr=setTimeout(()=>{pr=null,Dt();try{we==null||we.checkUrl()}catch(e){}ti()},Da))}function ri(){if(!(Go||typeof window=="undefined"||typeof history=="undefined")){Go=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,a){let s=n.call(this,r,o,a!=null?a:null);return Uo(),s}};e("pushState"),e("replaceState"),window.addEventListener("popstate",Uo)}catch(e){}}}function vn(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 Wa(e,t,n){var r;try{window.__sentientEditor={token:t,code:n,apiBase:kn(e)};let o=e.editorSrc?{src:e.editorSrc}:rr("editor.global.js");if(!o){Ho();return}let a=We(document.createElement("script"));or(a,o),a.async=!0,a.onerror=()=>Ho(),((r=document.head)!=null?r:document.documentElement).appendChild(a)}catch(o){}}var Wo="sentient-editor-load-notice";function Ho(){var e;try{if(document.getElementById(Wo))return;let t=document.createElement("div");t.id=Wo,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;padding:12px;background:#111;color:#fff;font:13px system-ui",t.onclick=()=>t.remove(),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Ha(e){let t={cfg:e,apiBase:kn(e),set(n){n.slots!==void 0&&(Se=n.slots),n.slotConfig!==void 0&&(be=n.slotConfig),n.persona!==void 0&&(J=n.persona),n.decided&&(Ae=!0),n.look&&(It(n.look.palette),Ot(n.look.vocabulary))},apply:()=>Nt(document),installSpaHooks:ri,exposeGlobal:()=>{Sn=!0,hr(e)},dbg:(...n)=>$e(e,...n)};return Ze("preview.global.js","__sentientPreview").then(n=>n?n.runPreview(t):Promise.reject()).catch(()=>(t.exposeGlobal(),$e(e,"preview chunk unavailable \u2014 page left as-is"),!0))}function hr(e){let t=r=>{try{oe==null||oe(),oe=null,Lt++,Rt=null,re==null||re(),re=null,ve==null||ve(),we==null||we.teardown(),we=null,r&&fr(typeof window!="undefined"?window:null,e.apiKey),Ve=!1,ue=!0,r?(rt=null,J=null,k?k.destroy():lt(e.apiKey)):k==null||k.dispose(),k=null}catch(o){}},n={consentWatcher:Qe,goal(r,o){try{k==null||k.goal(r,o)}catch(a){}},componentGoal(r,o){try{k==null||k.componentGoal(r,o)}catch(a){}},identify(r,o){try{k==null||k.identify(r,o)}catch(a){}},grantConsent(){try{if(!k&&ue||k!=null&&k.released)wn=fe(e.apiKey),k=_t(W({apiKey:e.apiKey,consent:!0,preConsentBehavior:e.preConsentBehavior,debug:e.debug,persona:e.persona,internal:e.internal,ingestUrl:Xo(e)},bn?{sdk:bn}:{})),_n(Pt,k);else{let r=(k==null?void 0:k.gated)===!0;tr(e.apiKey),r&&(wn=fe(e.apiKey)),_n(Pt,k)}ue=!1,le==null||le()}catch(r){}Ve=!0;try{Ua()}catch(r){}},revokeConsent(){t(!0)},reapply:Dt,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:Se,matchCounts:vn(e),consent:!ue&&(e.consent!==!1||Ve)}}catch(a){return{apiKey:e.apiKey,persona:null,band:null,slots:{},matchCounts:{},consent:!1}}}};if(window.SentientSnippet=n,window.__sentientApi=n,e.consentFrom&&!pt&&!Sn)try{let r=Qe(e.consentFrom),o=!1,a=!1,s=()=>!!k&&!ue&&(k.gated===void 0?e.consent!==!1||Ve:!k.gated);pt=r.subscribe(()=>{try{let c=r.read();c!==null&&(a=!0);let i=c!=null?c:a?!1:null,l=s(),u=!l&&i!==!0&&r.refused();if(u&&!o&&(k!=null&&k.gated?k.destroy():lt(e.apiKey),fr(window,e.apiKey),rt=null,J=null),o=u,i===!0&&!l)n.grantConsent();else if(i===!1&&l){let p=r.refused();t(p),p&&(o=!0)}}catch(c){}})}catch(r){}for(let r of qo.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 Vo(){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,identify:n,grantConsent:n,revokeConsent:n,reapply:n,consentWatcher:Qe,getState:()=>({apiKey:"",persona:null,band:null,slots:{},matchCounts:{},consent:!1})},qo.length=0}catch(t){}}function Va(){try{let e=window.Shopify;return typeof(e==null?void 0:e.shop)=="string"&&e.shop!==""}catch(e){return!1}}async function oi(){var e,t;try{let n=sn(window.sentient);if(!n){Vo();return}ee=n,pt==null||pt(),pt=null,!n.consentFrom&&n.consent===void 0&&Va()&&(n.consentFrom="shopify"),mo(n.consentSrc),en(n.nonce),Sn=!1,Ae=!1,le=null,tt=null,Se={},be=null,It(null),Ot(null),Ve=!1,ue=!1,Pt=null,Be=null,Ce=[],nt=null,rt=null,ve==null||ve(),oe==null||oe(),oe=null,Lt++,Rt=null;let r=Ko("sentient_editor_code"),o=r?null:Bo();if(r||o){Wa(n,o,r),Sn=!0,hr(n),$e(n,"editor mode");return}if(typeof window!="undefined"&&/[?&]sentient_(preview|persona|context)=[^&]/.test(window.location.search)&&await Ha(n))return;if(n.consentFrom&&n.consent===void 0)try{n.consent=Qe(n.consentFrom).read()===!0}catch(f){n.consent=!1}n.consent!==!1&&n.sectionCapture!==!1&&!Xe()&&Ze("engagement.global.js","__sentientEngagement");let a=(e=n.registry)!=null?e:Object.keys(n.slots).length===0;n.registry===void 0&&!a&&$e(n,"slots declared without registry: true, so dashboard-published components are not applied");let s=a?ja(n):null,c=Ka();try{(t=c==null?void 0:c.stop)==null||t.call(c)}catch(f){}let i=n.consent!==!1&&!Xe()?st(n.apiKey):null,l=[];if(i){J={persona:i.persona,band:i.band},Se=i.slots,i.slotConfig&&(be=i.slotConfig),i.palette&&It(i.palette),i.vocabulary&&Ot(i.vocabulary),Nt(document,W({contentAndOps:!1},c?{onAttr:(g,A)=>l.push([g,A])}:{})),i.layoutOrder&&(tt=i.layoutOrder,gr(tt,document));let f=St(i.stage,n.stageAttributes);f&&(tn(f),l.push([document.documentElement,"data-sentient-stage"]))}c&&Ba(c,l,document);let u=_t(W({apiKey:n.apiKey,consent:n.consent,preConsentBehavior:n.preConsentBehavior,debug:n.debug,persona:n.persona,userId:n.userId,userHash:n.userHash,internal:n.internal,stageAttributes:n.stageAttributes,ingestUrl:Xo(n)},bn?{sdk:bn}:{}));k=u,wn=fe(n.apiKey),hr(n),ri();let p=Object.entries(n.slots).map(([f,g])=>({id:f,dims:g.dims})),v=zo,b={pp:c?c.v:0},S=[];if(s){let[f]=await Promise.all([Fo(s,jo),document.readyState==="loading"?new Promise(g=>document.addEventListener("DOMContentLoaded",g,{once:!0})):null]);Be=f,f&&(Ce=S=mr(f,document)[0]),$e(n,"registry scope",f&&S)}let w=(f=u)=>{let g=Array.from(Yo(document).keys());return f.decide(W(W(W(W({slots:p},v),b),g.length>=2?{sections:g}:{}),a?{slotsFrom:"registry",registrySlotIds:S,render:Qo(S,document)}:{}))},K=Re(),j=u.gated===!0,_=!1,E=!1,O=!1,N=!1;le=(f=!1)=>{let g=k;!_||E||N||Ae||ue||!g||g.gated||!f&&!O||(O=!1,N=!0,K=nt=Re(),Be&&(Ce=S=mr(Be,document)[0]),w(g).then(A=>{N=!1,A&&!Ae&&!ue&&k===g?y(A):(A||(Ce=[]),!Ae&&(g.released||k!==g||ue)&&(O=!0))}).catch(()=>{N=!1}))};let M=w();M.then(()=>{_=!0},()=>{_=!0});let m=await Fo(M,jo),y=f=>{var I,F,Y,ne,_e;E=!0;let g=(k!=null?k:u).getPersona();g?J={persona:g.persona,band:g.band}:f.persona&&(J={persona:f.persona,band:"low"}),Se=f.slots,a?be=ei(f.slotConfig,S):f.slotConfig&&(be=f.slotConfig),f.palette&&It(f.palette),f.vocabulary&&Ot(f.vocabulary),tt=(I=f.layoutOrder)!=null?I:tt;let A=()=>{var te;let C=[],z=Nt(document,{onApplied:(Ie,ge,Z)=>C.push({slotId:Ie,arm:ge,el:Z})});a||ni(n,z),gr(tt,document);try{(te=c==null?void 0:c.reveal)==null||te.call(c)}catch(Ie){}if(Ae=!0,ot())try{re==null||re(),re=mn(k,n.apiKey,C)}catch(Ie){}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A,{once:!0}):A(),Pt=(F=f.goals)!=null?F:null,(n.consent!==!1||Ve)&&!ue&&_n(f.goals,k),yn=(Y=f.sectionMap)!=null?Y:null,ot()&&yr(),$e(n,"applied",{persona:J,slots:Se,matches:vn(n)}),!ue&&(Jo(n.apiKey)&&Je(n.apiKey,rt=W(W(W(W({v:1,persona:(ne=J==null?void 0:J.persona)!=null?ne:f.persona,band:(_e=J==null?void 0:J.band)!=null?_e:"low",slots:f.slots,layoutOrder:f.layoutOrder,savedAt:Date.now()},be?{slotConfig:be}:{}),f.palette?{palette:f.palette}:{}),f.vocabulary?{vocabulary:f.vocabulary}:{}),(C=>C?{stage:C}:{})(St(f.stage,n.stageAttributes)))),nt=null,ti())};if(!m){$e(n,"decide timeout/null \u2014 snapshot state stands",vn(n)),M.then(f=>{if(!f){if(Ae)return;Ce=[],u.released===!0||k!==u||ue||j&&Re()!==K?(O=!0,le==null||le()):nt=K;return}if(!(!f||Ae||ue)){if(k!==u){O=!0,le==null||le();return}y(f),$e(n,"late decide applied",vn(n))}}).catch(()=>{});return}if(ue||k!==u){O=!0,le==null||le();return}y(m)}catch(n){Vo()}}if(typeof window!="undefined"&&window.sentient){let e=window;if(!e.__sentientInitialized)e.__sentientInitialized=!0,Promise.resolve().then(()=>{oi()});else{let t=window.__sentientApi;t&&Promise.resolve().then(()=>{window.SentientSnippet=t})}}return gi(za);})();
|
|
1
|
+
"use strict";var SentientSnippet=(()=>{var jt=Object.defineProperty,ui=Object.defineProperties,ci=Object.getOwnPropertyDescriptor,di=Object.getOwnPropertyDescriptors,fi=Object.getOwnPropertyNames,Tr=Object.getOwnPropertySymbols;var Lr=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable;var Pr=(e,t,n)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t)=>{for(var n in t||(t={}))Lr.call(t,n)&&Pr(e,n,t[n]);if(Tr)for(var n of Tr(t))pi.call(t,n)&&Pr(e,n,t[n]);return e},je=(e,t)=>ui(e,di(t));var Pn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ln=(e,t)=>{for(var n in t)jt(e,n,{get:t[n],enumerable:!0})},gi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fi(t))!Lr.call(e,o)&&o!==n&&jt(e,o,{get:()=>t[o],enumerable:!(r=ci(t,o))||r.enumerable});return e};var mi=e=>gi(jt({},"__esModule",{value:!0}),e);var Pi,Li,Ri,Gr,Ni,Di,Fr,$,Ue,Bn=Pn(()=>{"use strict";Pi=Object.defineProperty,Li=Object.defineProperties,Ri=Object.getOwnPropertyDescriptors,Gr=Object.getOwnPropertySymbols,Ni=Object.prototype.hasOwnProperty,Di=Object.prototype.propertyIsEnumerable,Fr=(e,t,n)=>t in e?Pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))Ni.call(t,n)&&Fr(e,n,t[n]);if(Gr)for(var n of Gr(t))Di.call(t,n)&&Fr(e,n,t[n]);return e},Ue=(e,t)=>Li(e,Ri(t))});var Qr={};Ln(Qr,{LOCAL_ENGINE_AVAILABLE:()=>Ki,createLocalEngine:()=>ji});function ji(e){throw new Error("[sentient] createLocalEngine is not available in production builds. The local engine only exists under the `development` export condition.")}var Ki,eo=Pn(()=>{"use strict";Ki=!1});var ro={};Ln(ro,{emailFields:()=>Fi,setInternalLoader:()=>Fn,takeInternalToken:()=>Gi});function Fn(e){to=e}var to,no,Gi,Fi,Un=Pn(()=>{"use strict";to=()=>Promise.resolve(null);no=()=>to().then(e=>e!=null&&e.emailFields?e:Promise.reject()),Gi=e=>no().then(t=>t.takeInternalToken(e)),Fi=e=>no().then(t=>t.emailFields(e))});var qa={};Ln(qa,{applyPersonaAttributes:()=>dn,applyRegistrySlots:()=>gn,applySlotArms:()=>pn,applySlotAttributes:()=>fn,consentWatcher:()=>Qe,parseSnippetConfig:()=>sn,planReorder:()=>hn,reapply:()=>Dt,run:()=>ii,version:()=>Tt});function Gt(e){let t=(e||"").toLowerCase();if(!t.includes(".")||/^[\d.]+$|:/.test(t))return[];let n=t.split("."),r=[];for(let o=n.length-2;o>=0;o--)r.push(n.slice(o).join("."));return r}function Ge(e){return e?`_${e.slice(0,12)}`:""}var ze="_snt_uid";function vt(e){return`${ze}${Ge(e)}`}var Rn="__sntForgetGen",hi=()=>{try{return window[Rn]}catch(e){return}};function Ft(e){var t,n;try{let r=window,o=(t=r[Rn])!=null?t:r[Rn]={};o[e]=((n=o[e])!=null?n:0)+1}catch(r){}}function fe(e){var t,n;return(n=(t=hi())==null?void 0:t[e])!=null?n:0}var at="_snt_snap:",yi=["low","medium","high"];function st(e){try{let t=localStorage.getItem(at+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"||!yi.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 Je(e,t){try{localStorage.setItem(at+e,JSON.stringify(t))}catch(n){}}function Fe(e){if(typeof AbortController!="function")return{clear:()=>{}};let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function Ut(e,t){return new Promise(n=>{let r=setTimeout(()=>n(!1),t),o=()=>{clearTimeout(r),n(!0)};e.then(o,o)})}function qe(e){return Math.min(6e4,1e3*2**Math.min(e,6))}var Rr=!1;function Wt(e){if(e.ok===!0)return"delivered";let{status:t}=e;return typeof t!="number"?"retry":t>=200&&t<300?"delivered":(t===403&&!Rr&&(Rr=!0,console.warn("[sentient] Not in Allowed domains (MCP add_origin):",location.origin)),t>=400&&t<500&&t!==429?"dropped":"retry")}function Nr(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 Nn(e,t,n){try{let r=(()=>{try{let a=localStorage.getItem(n);if(!a)return[];let s=JSON.parse(a);return Array.isArray(s)?s:[]}catch(a){return[]}})(),o=new Map;for(let a of r)o.set(a.id,a);for(let a of e)o.set(a.id,a);localStorage.setItem(n,JSON.stringify([...o.values()].slice(-t)))}catch(r){}}function Dr(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),a=r.filter(s=>!o.has(s.id));if(a.length===r.length)return;a.length===0?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(a))}catch(n){}}var vi=500,bi=56*1024;function Ht(e){return`_snt_retry_${e.slice(0,12)}`}var Si={push:()=>{},flush:()=>{},destroy:()=>{}};function Mr(e){var t,n,r;if(typeof window=="undefined")return Si;let o=(t=e.flushIntervalMs)!=null?t:5e3,a=(n=e.maxBatchSize)!=null?n:20,s=(r=e.maxRetrySize)!=null?r:100,c=e.ingestUrl,i=e.apiKey,l=Ht(i),u=!1,p=fe(i),v=(...C)=>{!u&&fe(i)===p&&Nn(...C)},b=[],S=new Set,w=[],K=C=>{for(let z of C)j.delete(z),!S.has(z)&&(S.add(z),w.push(z));for(;w.length>vi;){let z=w.shift();z&&S.delete(z)}Dr(C,l)},j=new Set,_=()=>{for(;b.length>s;){let C=b.shift();C&&j.delete(C.id)}},E=C=>{S.has(C.id)||j.has(C.id)||(j.add(C.id),b.push(C),_())},O=C=>{for(let z of C)S.has(z.id)||(j.add(z.id),b.push(z));_()},N=Nr(l,s);for(let C of N)E(C);let M=0,m=0,y=(C,z=!0)=>{if(C.length===0)return;let te=JSON.stringify(C),Ie=C.map(ce=>ce.id),ge,Z=Fe(15e3);try{ge=fetch(c,{method:"POST",keepalive:!0,signal:Z.signal,body:te,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})}catch(ce){v(C,s,l),O(C),m++,M=Date.now()+qe(m);return}Promise.resolve(ge).then(Z.clear,Z.clear);let Oe=ce=>{if(Wt(ce)!=="retry"){if(!ce.ok&&z){let ke=C.filter(me=>me.eventType!=="pageview");if(ke.length>0&&ke.length<C.length){K(C.filter(me=>me.eventType==="pageview").map(me=>me.id)),y(ke,!1);return}}K(Ie),m=0,M=0;return}v(C,s,l),O(C),m++,M=Date.now()+qe(m)};ge&&typeof ge.then=="function"?ge.then(Oe).catch(()=>{v(C,s,l),O(C),m++,M=Date.now()+qe(m)}):Oe(ge)},f=typeof TextEncoder!="undefined"?new TextEncoder:null,g=C=>f?f.encode(C).length:C.length,A=C=>{let z=[],te=2;for(let Ie of C){let ge=g(JSON.stringify(Ie))+1;if(z.length>0&&te+ge>bi||z.length>=a)break;z.push(Ie),te+=ge}return z},I=()=>{try{if(Date.now()<M)return;for(;b.length>0&&!(Date.now()<M);){let C=b.filter(te=>!S.has(te.id));if(b.length=0,C.length===0)break;let z=A(C);if(z.length===0)break;z.length<C.length&&b.push(...C.slice(z.length)),y(z)}}catch(C){}},F=!0,Y=null;Y=setInterval(()=>{F&&I()},o);let ne=()=>{document.visibilityState==="hidden"&&I()},_e=()=>{I()};return document.addEventListener("visibilitychange",ne),window.addEventListener("pagehide",_e),{push(C){E(C),b.length>=a&&I()},flush:I,destroy(C){C!=null&&C.forget&&(u=!0),F=!1,Y!==null&&(clearInterval(Y),Y=null),document.removeEventListener("visibilitychange",ne),window.removeEventListener("pagehide",_e),I()}}}var wi=200;function Vt(e){return`_snt_goal_retry_${e.slice(0,12)}`}var _i={send:()=>{},flush:()=>{},destroy:()=>{}};function $r(e){var t,n,r;if(typeof window=="undefined")return _i;let o=(t=e.flushIntervalMs)!=null?t:5e3,a=(n=e.maxRetrySize)!=null?n:100,s=(r=e.maxPerFlush)!=null?r:5,c=Vt(e.apiKey),i=!1,l=fe(e.apiKey),u=(...g)=>{!i&&fe(e.apiKey)===l&&Nn(...g)},p=[],v=new Set,b=new Set,S=[],w=0,K=0,j=!1,_=g=>{for(v.delete(g.id),b.has(g.id)||(b.add(g.id),S.push(g.id));S.length>wi;){let A=S.shift();A&&b.delete(A)}Dr([g.id],c)},E=g=>{u([g],a,c),!b.has(g.id)&&!v.has(g.id)&&(v.add(g.id),p.push(g)),Date.now()>=w&&(K++,w=Date.now()+qe(K))},O=g=>{let A,I=Fe(15e3);try{A=fetch(e.url,{method:"POST",keepalive:!0,signal:I.signal,body:g.body,headers:e.headers})}catch(Y){E(g);return}let F=Y=>{var ne;let _e=Wt(Y);if(_e==="retry"){E(g);return}_e==="dropped"&&((ne=e.onDrop)==null||ne.call(e,g,Y.status)),_(g),K=0,w=0};Promise.resolve(A).then(I.clear,I.clear),A&&typeof A.then=="function"?A.then(F).catch(()=>E(g)):F(A)},N=()=>{try{if(j||Date.now()<w)return;let g=0;for(;p.length>0&&g<s&&!(Date.now()<w);){let A=p.shift();v.delete(A.id),!b.has(A.id)&&(g++,O(A))}}catch(g){}},M=Nr(c,a);for(let g of M)v.has(g.id)||(v.add(g.id),p.push(g));M.length>0&&Nn(M,a,c);let m=setInterval(N,o),y=()=>{document.visibilityState==="hidden"&&N()},f=()=>N();return document.addEventListener("visibilitychange",y),window.addEventListener("pagehide",f),{send(g){if(j){b.has(g.id)||u([g],a,c);return}if(!(b.has(g.id)||v.has(g.id))){if(Date.now()<w){u([g],a,c),v.add(g.id),p.push(g);return}O(g)}},flush:N,destroy(g){g!=null&&g.forget&&(i=!0),clearInterval(m),document.removeEventListener("visibilitychange",y),window.removeEventListener("pagehide",f),N(),j=!0}}}function lt(e){if(typeof window=="undefined"||!e)return!1;Ft(e);let t=!1,n=vt(e);try{if(new RegExp(`(?:^|; )${n}=`).test(document.cookie)){let s=location.protocol==="https:"?"; Secure":"";for(let c of["",...Gt(location.hostname)])document.cookie=`${n}=; max-age=0; SameSite=lax; path=/${c?`; domain=${c}`:""}${s}`;t=!0}}catch(s){}let r=Ge(e),o=[n,"_snt_graph_edges",at+e,Ht(e),Vt(e),`_snt_graph_nodes${r}`],a=[`_snt_asgn${r}_`];for(let s of["localStorage","sessionStorage"])try{let c=window[s];for(let i of o)c.getItem(i)!==null&&(c.removeItem(i),t=!0);for(let i=c.length-1;i>=0;i--){let l=c.key(i);l&&a.some(u=>l.startsWith(u))&&(c.removeItem(l),t=!0)}}catch(c){}try{(new RegExp(`(?:^|; )${ze}=[^;]`).test(document.cookie)||localStorage.getItem(ze)!==null||sessionStorage.getItem(ze)!==null)&&localStorage.setItem(`${ze}_tomb${r}`,"1")}catch(s){}return t}function Mn(){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 Br="_snt_uid",ki=365,ut="_snt_uid";function Ei(){return Mn()}function ct(e){try{let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}catch(t){return null}}function jr(){try{return location.protocol==="https:"?"; Secure":""}catch(e){return""}}function Jt(e,t,n,r){try{document.cookie=`${e}=${encodeURIComponent(t)}; max-age=${n}; SameSite=lax; path=/${r?`; domain=${r}`:""}${jr()}`}catch(o){}}function zt(e){try{return localStorage.getItem(e)}catch(t){return null}}function Kr(e,t){try{return localStorage.setItem(e,t),!0}catch(n){return!1}}function Dn(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function xi(e,t){try{return sessionStorage.setItem(e,t),!0}catch(n){return!1}}function Ai(e){try{sessionStorage.removeItem(e)}catch(t){}}function Ci(e){try{return document.cookie=`${e}_probe=1; max-age=1; SameSite=lax; path=/${jr()}`,document.cookie.indexOf(`${e}_probe=1`)!==-1}catch(t){return!1}}function Ii(e){try{localStorage.removeItem(e)}catch(t){}}function qt(e,t){Jt(e,"",0,t)}var Oi={getSessionId:()=>null,isEphemeral:()=>!1,domain:null,destroy:()=>{}};function Ti(e,t){if(e===!1)return null;if(typeof e=="string")return e.replace(/^\./,"");for(let n of Gt(location.hostname))if(Jt(t,"1",10,n),ct(t)==="1")return qt(t,n),n;return null}function $n(e){var t,n,r,o,a,s,c;if(typeof window=="undefined")return Oi;let i=Ge(e==null?void 0:e.apiKey),l=(t=e==null?void 0:e.cookieName)!=null?t:vt(e==null?void 0:e.apiKey),u=`${ut}${i}`,p=`${ut}_tomb${i}`,v=((n=e==null?void 0:e.cookieTTLDays)!=null?n:ki)*24*60*60,b=m=>m&&m.length>0?m:null,S=()=>{var m,y;return i&&!(e!=null&&e.cookieName)&&zt(p)===null?(y=(m=b(ct(Br)))!=null?m:b(zt(ut)))!=null?y:b(Dn(ut)):null},w=Ti(e==null?void 0:e.cookieDomain,`${l}_dom`),K=b(ct(l)),j=w?(qt(l),b(ct(l))):null,_=(c=(s=(a=(o=(r=j!=null?j:K)!=null?r:b(zt(u)))!=null?o:b(Dn(u)))!=null?a:S())!=null?s:b(e==null?void 0:e.ssrSessionId))!=null?c:Ei();Jt(l,_,v,w),w&&ct(l)!==_&&(w=null,Jt(l,_,v));let E=Kr(u,_),O=Ci(l),N=E?!1:xi(u,_),M=!E&&!O&&!N;return{getSessionId:()=>_,isEphemeral:()=>M,domain:w,destroy:()=>{_=null,qt(l),qt(l,w),Ii(u),Ai(u),i&&!(e!=null&&e.cookieName)&&(ct(Br)!==null||zt(ut)!==null||Dn(ut)!==null)&&Kr(p,"1")}}}Bn();function Yt(e){return Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("|")}function Ur(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 Kn(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 Yt(e.baseline);if(typeof e.baseline=="string")return e.baseline;let o={};for(let[a,s]of Object.entries((n=e.dims)!=null?n:{}))o[a]=(r=s[0])!=null?r:"";return Yt(o)}function Wr(e,t){var n,r;return e.dims!=null?(r=(n=Ur(t))!=null?n:Ur(Kn(e)))!=null?r:{}:t}function Ye(e){return e>=.3?e<.7?"medium":"high":"low"}var Hr=["new","browsing","carted","customer","lapsed"];var Mi=["GPTBot","ChatGPT-User","OAI-SearchBot","ClaudeBot","Claude-User","Claude-SearchBot","Claude-Agent","PerplexityBot","Perplexity-User","Google-Agent","Google-Extended","Applebot-Extended","Meta-ExternalAgent","Bytespider","CCBot","Amazonbot","cohere-ai","Diffbot"];function Vr(e){return $i(e)!==null}function $i(e){var t;if(!e)return null;let n=e.toLowerCase();return(t=Mi.find(r=>n.includes(r.toLowerCase())))!=null?t:null}function zr(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 qr(e,t,n){if(!e)return"direct";try{let r=new URL(e);if(t)try{if(new URL(t).host===r.host)return"direct"}catch(a){}let o=r.hostname.toLowerCase();return n&&`.${o}`.endsWith(`.${n}`)?"direct":/(^|\.)(google|bing|duckduckgo|yahoo)\./.test(o)?"search":/(^|\.)(twitter\.com|x\.com|facebook\.com|linkedin\.com|reddit\.com|t\.co)$/.test(o)?"social":"referral"}catch(r){return"direct"}}function Jr(e){if(!e)return null;try{return new URL(e).hostname}catch(t){return null}}var Bi=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","twclid","li_fat_id"];function Yr(e){let t={},n={};try{let r=typeof e=="string"||e instanceof URLSearchParams?new URLSearchParams(e):Object.entries(e).flatMap(([o,a])=>{let s=Array.isArray(a)?a[0]:a;return s===void 0?[]:[[o,s]]});for(let[o,a]of r)o.startsWith("utm_")?o in t||(t[o]=a):Bi.includes(o)&&(o in n||(n[o]=a))}catch(r){}return{utmParams:t,clickIds:n}}function Xr(e){let t=e.getHours();return t<6?"night":t<12?"morning":t<18?"afternoon":"evening"}function jn(e){return $($($({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 Gn(e){let t=jn(e);return Wr(t,Kn(t))}function Zr(e){return typeof e=="string"?e:Yt(e)}Bn();var zn;function en(e){zn=typeof e=="string"&&e!==""?e:void 0}function so(e=document){if(zn)return zn;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 We(e,t=document){let n=so(t);return n&&e.setAttribute("nonce",n),e}var Ui=1800*1e3;function Xt(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Wi(e=Ui,t){let n=new Map,r=`_snt_asgn${Ge(t)}_`,o=(i,l)=>`${r}${encodeURIComponent(i)}:${encodeURIComponent(l)}`,a=i=>{let l=i.slice(r.length),u=l.indexOf(":");if(u<0)return null;try{return{componentId:decodeURIComponent(l.slice(0,u)),segment:decodeURIComponent(l.slice(u+1))}}catch(p){return null}},s=()=>{try{let i=[];for(let l=0;l<localStorage.length;l++){let u=localStorage.key(l);u!=null&&u.startsWith(r)&&i.push(u)}return i}catch(i){return[]}},c=i=>i.assignedAt+(i.ttlMs&&i.ttlMs>0?i.ttlMs:e)<Date.now();return typeof window!="undefined"&&(()=>{for(let i of s())try{let l=localStorage.getItem(i);if(!l)continue;let u=JSON.parse(l);if(c(u)){localStorage.removeItem(i);continue}let p=a(i);if(!p)continue;n.set(Xt(p.componentId,p.segment),u)}catch(l){}})(),{get(i,l){let u=n.get(Xt(i,l));return u?c(u)?(n.delete(Xt(i,l)),null):u:null},set(i,l,u){let p=Xt(i,l);n.set(p,u);try{localStorage.setItem(o(i,l),JSON.stringify(u))}catch(v){}},clear(){n.clear();for(let i of s())try{localStorage.removeItem(i)}catch(l){}}}}var qn="data-sentient-stage";function St(e,t){return!t||typeof e!="string"||!(e==="returning"||Hr.includes(e))?null:t!=="detailed"&&(e==="customer"||e==="lapsed")?"returning":e}function tn(e,t=document){try{e?t.documentElement.setAttribute(qn,e):t.documentElement.removeAttribute(qn)}catch(n){}}var Jn="[sentient] No API key configured \u2014 nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY (Vite: VITE_SENTIENT_API_KEY) or localMode: true.",lo="[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.",oo=!1,Zt=!1;function Hi(){var e;try{return(e=new URLSearchParams(window.location.search).get("sentient_persona"))!=null?e:void 0}catch(t){return}}function Vi(e){var t;let n=$n({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey}),r=(t=n.getSessionId())!=null?t:"local",o=Hi(),a=Promise.resolve().then(()=>(eo(),Qr)).then(u=>{let p=u;return p.LOCAL_ENGINE_AVAILABLE?(oo||(oo=!0,console.info(lo)),p):(Zt||(Zt=!0,console.error(Jn)),null)}).catch(()=>(Zt||(Zt=!0,console.error(Jn)),null)),s=null,c={low:.15,medium:.5,high:.85},i=(()=>{var u;if(e.initialPersona)return $({},e.initialPersona);let p=st(e.apiKey||"local");return p?{persona:p.persona,confidence:(u=c[p.band])!=null?u:.15}:null})();function l(u){let p=document.documentElement;p.dataset.sentientPersona===void 0&&(p.dataset.sentientPersona=u.persona,p.dataset.sentientConfidence=Ye(u.confidence))}return{isLocal:!0,async decide(u){var p,v,b;let S=await a;if(!S)return null;let w=S.createLocalEngine({sessionId:r,forcedPersona:o}).decide(u);return s=Ue($({},w),{layoutOrder:(v=(p=w.layoutOrder)!=null?p:s==null?void 0:s.layoutOrder)!=null?v:null,slots:$($({},(b=s==null?void 0:s.slots)!=null?b:{}),w.slots)}),Je(e.apiKey||"local",{v:1,persona:s.persona,band:Ye(s.confidence),slots:s.slots,layoutOrder:s.layoutOrder,savedAt:Date.now()}),l(w),w},getSlotResult(u){var p,v,b;return(b=(v=s==null?void 0:s.slots[u])!=null?v:(p=e.initialSlots)==null?void 0:p[u])!=null?b:null},getSlotConfig(u){var p,v;return(v=(p=e.initialSlotConfig)==null?void 0:p[u])!=null?v:null},getSitePalette(){var u;return(u=e.initialPalette)!=null?u:null},reportSlots(){},getVisitorId:()=>null,getPersona(){let u=s!=null?s:i;return u?{persona:u.persona,confidence:u.confidence,band:Ye(u.confidence)}:null},async assign(u,p){var v;let b=await a;return!b||!p||p.length===0?p!=null&&p[0]?{variantId:p[0],assignmentTtlMs:0}:null:{variantId:(v=b.createLocalEngine({sessionId:r,forcedPersona:o}).decide({components:[{id:u,variantIds:p}]}).assignments[u])!=null?v:p[0],assignmentTtlMs:0}},track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),getGraph:()=>({pageNodes:[],capturedAt:0}),flush:()=>{},dispose:()=>{},destroy:()=>n.destroy()}}var nn=/^(\*|\/[^\s?#*]*(\/\*)?)$/;function Wn(e){let t=e.split(/[?#]/)[0]||"/";return t.length>1?t.replace(/\/+$/,"")||"/":t}function Xn(e,t){if(e===void 0||!nn.test(e))return!1;if(e==="*")return!0;let n=Wn(t);if(e.endsWith("/*")){let r=Wn(e.slice(0,-2));return n.startsWith(r==="/"?"/":`${r}/`)&&n!==r}return n===Wn(e)}function Zn(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 wt(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(wt):!1}var io="sentient-reveal",dt="sentient-revealed",uo=240,Hn=!1;function zi(e){if(Hn||e.getElementById(io)){Hn=!0;return}let t=We(e.createElement("style"),e);t.id=io,t.textContent=`@media (prefers-reduced-motion: no-preference){@keyframes ${dt}{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}.${dt}{animation:${dt} ${uo}ms cubic-bezier(.2,.6,.2,1) both}}`,e.head.appendChild(t),Hn=!0}function Qn(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;zi(r),e.classList.remove(dt),e.offsetWidth,e.classList.add(dt);let o=()=>{e.classList.remove(dt),e.removeEventListener("animationend",o)};return e.addEventListener("animationend",o),!0}function er(e,t,n,r){let o=[];{let a=!1,s=[],c=()=>{if(a)return;let i=Date.now();for(s.push(i);s.length>0&&i-s[0]>500;)s.shift();s.length>=3&&(a=!0,e("rage_click"))};t.addEventListener("click",c),o.push(()=>t.removeEventListener("click",c))}{let a=!1,s=c=>{if(a||!(c.target instanceof Node)||!t.contains(c.target)&&t!==c.target)return;a=!0;let i=typeof window!="undefined"?window.getSelection():null,l=i?i.toString().length:0;e("text_copy",{selectionLength:l})};document.addEventListener("copy",s),o.push(()=>document.removeEventListener("copy",s))}{let a=!1,s=!1,c=null,i=()=>{c!==null&&(clearTimeout(c),c=null)},l=()=>{a||!s||(i(),c=setTimeout(()=>{!a&&s&&(a=!0,e("scroll_hesitation"))},3e3))},u=()=>{i(),l()},p=b=>{for(let S of b)s=S.intersectionRatio>.3,s?l():i()},v=new IntersectionObserver(p,{threshold:[.3]});v.observe(t),window.addEventListener("scroll",u,{passive:!0}),o.push(()=>{v.disconnect(),window.removeEventListener("scroll",u),i()})}if((r==null?void 0:r.tabLoss)!==!1){let a=!1,s=n!=null?n:Date.now(),c=()=>{if(a||document.visibilityState!=="hidden")return;let i=Date.now()-s;i<15e3&&(a=!0,e("tab_loss",{timeOnPage:i}))};document.addEventListener("visibilitychange",c),o.push(()=>document.removeEventListener("visibilitychange",c))}return()=>{for(let a of o)a()}}function qi(){try{return!1}catch(e){return!0}}var co="https://api.sentient-ui.com/v1/events",ao=()=>Promise.resolve().then(()=>(Un(),ro)),pe=new Map,fo=null;function Ji(e){return"value"in e||"currency"in e||"externalId"in e||"metadata"in e||"weight"in e||"stepIndex"in e}var Yi=3;function Vn(){return Mn()}function Qt(){var e;if(typeof window!="undefined")return((e=window.location)==null?void 0:e.pathname)||void 0}function Xi(){let e=new WeakMap,t=new Map,n=!1,r=(c,i,l)=>{let u=c.get(i);return l===null?u?!0:(c.set(i,new Set),!1):u?u.has(l)?!0:(u.add(l),!1):(c.set(i,new Set([l])),!1)},o=typeof window!="undefined"&&"event"in window,a=()=>{if(!o)return;let c=window.event;return typeof Event=="function"&&c instanceof Event?c:void 0},s=()=>{if(o){Promise.resolve().then(()=>{n=!1,t.clear()});return}let c=!1,i=()=>{c||(c=!0,n=!1,t.clear())};if(setTimeout(i,0),typeof MessageChannel=="function"){let l=new MessageChannel;l.port1.onmessage=()=>{l.port1.close(),l.port2.close(),i()},l.port2.postMessage(0)}};return{firedBefore(c,i){let l=a();if(l){let p=e.get(l);return p||(p=new Map,e.set(l,p)),r(p,c,i)}let u=r(t,c,i);return!u&&!n&&(n=!0,s()),u}}}var po=new Set;function Zi(e,t,n){let r=typeof window=="undefined"?null:window.history;if(!r)return()=>{};let o=!1,a,s=()=>{if(o)return;let l=Qt();!l||l===a||(a=l,e.track({projectId:t,componentId:"__page__",eventType:"pageview",payload:{}}),n(`${t}:${l}`))},c=[];for(let l of["pushState","replaceState"]){let u=r[l],p=function(...v){let b=u.apply(this,v);return s(),b};r[l]=p,c.push([l,u,p])}window.addEventListener("popstate",s);let i=Qt();return i&&po.has(`${t}:${i}`)?a=i:s(),()=>{if(!o){o=!0,window.removeEventListener("popstate",s);for(let[l,u,p]of c)r[l]===p&&(r[l]=u)}}}var bt={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 Qi(){try{return Yr(window.location.search)}catch(e){return{utmParams:{},clickIds:{}}}}function go(e){return e.replace(/\/events\/?$/,"")}function Xe(){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 tr(e){var t;if(typeof window=="undefined")return;let n=e!=null?e:fo;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:a,reinit:s}=r;if(!a){r.upgradeBlockedReason&&console.warn(r.upgradeBlockedReason);return}if(o.respectDoNotTrack!==!1&&Xe())return;let c=(s!=null?s:_t)(Ue($({},o),{consent:!0}));a(c);let i=(t=pe.get(n))==null?void 0:t.dispose;pe.set(n,{config:Ue($({},o),{consent:!0}),upgrade:null,dispose:i})}function ea(e,t){var n;let r=e.preConsentBehavior==="statistical_winner",o=go((n=e.ingestUrl)!=null?n:co),a={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},s=new Map,c=new Map,i={track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},getAssignment:()=>null,fetchWeights:()=>Promise.resolve([]),assign(m,y,f){if(!r)return Promise.resolve(null);let g=s.get(m);return g?Promise.resolve(g):Yn(c,m,async()=>{try{let A=new URLSearchParams({componentId:m});for(let ne of y!=null?y:[])A.append("variantIds[]",ne);let I=Fe(5e3),F;try{let ne=await fetch(`${o}/winner?${A.toString()}`,{headers:a,signal:I.signal});if(!ne.ok)return y!=null&&y[0]?{variantId:y[0],assignmentTtlMs:0}:null;F=await ne.json()}finally{I.clear()}let Y={variantId:F.variantId,assignmentTtlMs:0};return s.set(m,Y),Y}catch(A){return y!=null&&y[0]?{variantId:y[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:()=>{}},l=!1,u=new Set,p=[],v=[],b=[],S=()=>{for(let[,,m]of b.splice(0))m(null);w.length=0},w=[],K=!1,j=()=>{if(l)return;K=!0;let m=pe.get(e.apiKey);(m==null?void 0:m.upgrade)===M&&pe.set(e.apiKey,{config:e,upgrade:null,upgradeBlockedReason:"[sentient] grantConsent(): client released before consent; call init() again"})},_=[],E=()=>{setTimeout(()=>{var m;try{(m=_.shift())==null||m(i)}catch(y){}_.length&&E()})},O=m=>{l?_.length?_.push(m):m(i):!t&&!K&&w.length<100?w.push(m):K&&e.debug&&console.warn("[sentient] goal dropped: client released")},N={get gated(){return!l&&!t},get released(){return K&&!l},takeHeld:()=>w.splice(0),track:m=>i.track(m),goal:((m,y,f,g)=>O(A=>A.goal(m,y,f,g))),componentGoal:(m,y,f)=>i.componentGoal(m,y,f),identify:(m,y)=>i.identify(m,y),getAssignment:(m,y)=>i.getAssignment(m,y),isUnified:m=>{var y,f;return(f=(y=i.isUnified)==null?void 0:y.call(i,m))!=null?f:!1},assign:(m,y,f,g,A)=>i.assign(m,y,f,g,A),decide:m=>l?i.decide(m):K||t?Promise.resolve(null):new Promise(y=>b.push([m,Re(),y])),getSlotResult:m=>i.getSlotResult(m),isSlotDecided:m=>{var y,f;return(f=(y=i.isSlotDecided)==null?void 0:y.call(i,m))!=null?f:!0},getSlotConfig:m=>i.getSlotConfig(m),getSitePalette:()=>i.getSitePalette(),getStyleVocabulary:()=>{var m,y;return(y=(m=i.getStyleVocabulary)==null?void 0:m.call(i))!=null?y:null},reportSlots:(m,y,f,g)=>i.reportSlots(m,y,f,g),reportSkeleton:(m,y)=>{var f;return(f=i.reportSkeleton)==null?void 0:f.call(i,m,y)},reportAgentData:(m,y,f)=>{var g;return(g=i.reportAgentData)==null?void 0:g.call(i,m,y,f)},reportDrift:(m,y,f,g)=>{var A;return(A=i.reportDrift)==null?void 0:A.call(i,m,y,f,g)},requestSlots:(m,y,f)=>{var g;return l?(g=i.requestSlots)==null?void 0:g.call(i,m,y,f):p.push([m,y,f])},decideSlots:m=>{var y;return l?(y=i.decideSlots)==null?void 0:y.call(i,m):v.push(...m)},cancelSlots:m=>{var y;if(l)return(y=i.cancelSlots)==null?void 0:y.call(i,m);let f=new Set(m);for(let g of p)g[0]=g[0].filter(A=>!f.has(A));v=v.filter(g=>!f.has(g.id))},onSlotsChanged:m=>(u.add(m),()=>{u.delete(m)}),getPersona:()=>i.getPersona(),getVisitorId:()=>{var m,y;return(y=(m=i.getVisitorId)==null?void 0:m.call(i))!=null?y:null},fetchWeights:()=>i.fetchWeights(),getGraph:()=>i.getGraph(),flush:()=>i.flush(),dispose:()=>(j(),S(),i.dispose()),destroy:()=>(j(),S(),l?i.destroy():lt(e.apiKey))};function M(m){var y,f,g;i=m,l=!0,w.length&&(_.push(...w.splice(0)),E());let A=Re();for(let[I,F,Y]of b.splice(0))F!==A?Y(null):m.decide(I).then(Y,()=>Y(null));(y=m.onSlotsChanged)==null||y.call(m,()=>u.forEach(I=>I()));for(let[I,F,Y]of p.splice(0))I.length>0&&((f=m.requestSlots)==null||f.call(m,I,F,Y));v.length>0&&((g=m.decideSlots)==null||g.call(m,v.splice(0)))}return{proxy:N,setInner:M}}function Re(){return typeof location=="undefined"?"":location.pathname+(/^#!?\//.test(location.hash)?location.hash:"")}function Yn(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 _t(e){var t,n,r,o,a,s,c,i,l,u,p;if(typeof window=="undefined")return bt;e.nonce&&en(e.nonce),fo=e.apiKey||"local";let v=pe.get(e.apiKey||"local");if(v!=null&&v.dispose)try{v.dispose()}catch(d){}let b=e.respectDoNotTrack!==!1&&Xe(),S=e.consent===!1||b,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?bt:Vi(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."}),bt;let{proxy:d,setInner:h}=ea(e,b);return pe.set(e.apiKey,{config:e,upgrade:b?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."),bt;if(e.ingestUrl==="")return console.warn("[sentient] init() called with an empty ingestUrl. SDK disabled."),bt;let K=(t=e.ingestUrl)!=null?t:co,j=Date.now(),_=$n({ssrSessionId:e.ssrSessionId,apiKey:e.apiKey,cookieDomain:e.cookieDomain}),E={},O;try{/sentient_internal=/.test(location.search+document.cookie)&&(O=ao().then(async d=>{E.internalToken=await d.takeInternalToken(_.domain)||void 0}).catch(()=>{})),(typeof e.internal=="function"?e.internal():e.internal)===!0&&(E.internal=!0)}catch(d){}let N=Wi(void 0,e.apiKey),M=!1,m=fe(e.apiKey),y=()=>!M&&fe(e.apiKey)===m,f=new Set((n=e.initialUnified)!=null?n:[]),g=Ue($({},N),{get:(d,h)=>f.has(d)?null:N.get(d,h),set:(...d)=>{y()&&N.set(...d)}}),A=Mr({ingestUrl:K,apiKey:e.apiKey}),I=go(K),F={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},Y=new Set,ne=$r({url:`${I}/goals`,apiKey:e.apiKey,headers:F,onDrop:(d,h)=>{if(!e.debug){if(Y.has(h))return;Y.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?"Check the API key.":"See the response status for the cause."),d)}}),_e=zr((r=navigator.userAgent)!=null?r:""),C=window.location.origin,z=qr((o=document.referrer)!=null?o:"",C,_.domain),te=(a=e.sessionSegment)!=null?a:`${_e}:${z}`,Ie=new Map,ge=new Map,Z=new Map,Oe=new Set,ce=new Map,ke=null,me=null,ie=null,vr=new Set,Mt=new Set,En=new Map,xn=new Map,br=new Set,Sr=new Set,wr=new Set,_r=new Set,An=null,gt=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/,kr=new Set,$t=new Set,Bt=new Set,mt=new Map,Cn=null,Kt=new Set,ht=new Map,In=null,ai=2,Er=new Map,Ee=!1,xr=(d,h,P)=>{var U;let G=new Set,x=1;for(let T of d){h.delete(T);let L=((U=Er.get(T))!=null?U:0)+1;Er.set(T,L),L<=ai&&(G.add(T),L>x&&(x=L))}G.size>0&&setTimeout(()=>{Ee||P(G)},qe(x))},On=d=>{for(let h of d)Z.has(h.id)||Z.set(h.id,Gn(h))};if(e.initialSlots)for(let[d,h]of Object.entries(e.initialSlots))Z.set(d,h),Oe.add(d);if(e.initialSlotConfig)for(let[d,h]of Object.entries(e.initialSlotConfig))ce.set(d,h);e.initialPalette&&(ke=e.initialPalette),e.initialVocabulary&&(me=e.initialVocabulary);let Te=st(e.apiKey);if(Te){for(let[d,h]of Object.entries(Te.slots))Z.has(d)||Z.set(d,h);for(let[d,h]of Object.entries((s=Te.slotConfig)!=null?s:{}))ce.has(d)||ce.set(d,h);!ke&&Te.palette&&(ke=Te.palette),!me&&Te.vocabulary&&(me=Te.vocabulary)}let Ar={low:.15,medium:.5,high:.85};if(e.initialPersona)ie=$({},e.initialPersona);else{let d=document.documentElement.dataset;d.sentientPersona?ie={persona:d.sentientPersona,confidence:(i=Ar[(c=d.sentientConfidence)!=null?c:"low"])!=null?i:.15}:Te&&(ie={persona:Te.persona,confidence:(l=Ar[Te.band])!=null?l:.15})}if(e.initialAssignments)for(let[d,h]of Object.entries(e.initialAssignments))g.set(d,te,{variantId:h,assignedAt:Date.now(),segment:te,confidence:1});let Ke=Promise.resolve(),Cr=_.getSessionId();if(Cr){let d=Jr((u=document.referrer)!=null?u:""),{utmParams:h,clickIds:P}=Qi(),U=$($($($({sessionId:Cr,deviceClass:_e,trafficSource:z,referrerDomain:d,utmParams:h,clickIds:P,landingPath:typeof location!="undefined"?location.pathname:void 0,timeOfDay:Xr(new Date),dayOfWeek:["sun","mon","tue","wed","thu","fri","sat"][new Date().getDay()],ephemeral:_.isEphemeral(),automation:typeof navigator!="undefined"&&navigator.webdriver===!0||Vr((p=navigator.userAgent)!=null?p:"")},e.userId?{userId:e.userId,userHash:e.userHash}:{}),e.persona?{persona:e.persona}:{}),e.country?{country:e.country}:{}),e.sdk?{sdk:e.sdk.name,sdkVersion:e.sdk.version}:{}),G=async()=>{O&&await Ut(O,2500);for(let x=0;;x++){if(Ee||!y())return;let T=Fe(5e3);try{let L=await fetch(`${I}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(Object.assign(U,E)),headers:F,signal:T.signal});if(L.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(L.ok||Wt(L)==="dropped")return}catch(L){}finally{T.clear()}if(x>=Yi){console.warn("[SentientUI] Could not register the session after retries. Conversions in this visit may not be recorded.");return}await new Promise(L=>setTimeout(L,qe(x+1)))}};try{Ke=G()}catch(x){}}e.debug&&(console.log("[sentient] initialized",{context:e.context}),window.__sentient={client:null,queue:A});let si=Xi(),yt=null,Tn=!1,ae={goal(d,h={},P=1,U=0){var G,x,T,L,H,V,q;let Q=_.getSessionId();if(!Q||Ee||!y())return;let B=Ji(h)?h:{metadata:h},he=[d,(G=B.externalId)!=null?G:"",(x=B.stepIndex)!=null?x:U,(T=B.weight)!=null?T:P].join("\0"),xe=B.value!==void 0?`${B.value}\0${(L=B.currency)!=null?L:""}`:null;if(si.firedBefore(he,xe)){e.debug&&console.log(`[sentient] goal("${d}") already recorded for this action \u2014 not sent twice`);return}let de=Vn(),se={sessionId:Q,name:d,metadata:(H=B.metadata)!=null?H:{},weight:(V=B.weight)!=null?V:P,stepIndex:(q=B.stepIndex)!=null?q:U,goalId:de,value:B.value,currency:B.currency,externalId:B.externalId};e.debug&&console.log("[sentient] goal",se);let D={id:de,body:JSON.stringify(se)};Ke.then(()=>ne.send(D))},componentGoal(d,h,P){var U,G,x;let T=_.getSessionId();if(!T||Ee||!y())return;let L=g.get(d,te),H=L?null:(U=Z.get(d))!=null?U:null;if(!L&&H===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(!L&&!Oe.has(d)){e.debug&&console.warn(`[sentient] componentGoal("${d}"): slot not decided this session \u2014 not attributed`);return}let V=L?L.variantId:Zr(H),q={id:Vn(),sessionId:T,projectId:e.apiKey,componentId:d,variantId:V,eventType:"goal_achieved",goalType:h,payload:$({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},(x=P==null?void 0:P.metadata)!=null?x:{}),timestamp:Date.now(),timeInSession:Date.now()-j,path:Qt()};e.debug&&console.log("[sentient] componentGoal",q),Ke.then(()=>{!Ee&&y()&&A.push(q)})},identify(d,h){let P=_.getSessionId();if(!P||Ee||!y())return;let U=(h==null?void 0:h.email)!==void 0?ao().then(G=>G.emailFields(h.email)).catch(()=>({})):{};Promise.all([Ke,U]).then(([,G])=>{fetch(`${I}/sessions`,{method:"POST",keepalive:!0,body:JSON.stringify(Ue($($({sessionId:P,userId:d,userHash:h==null?void 0:h.userHash},G),E),{ephemeral:_.isEphemeral()})),headers:F}).catch(()=>{})})},track(d){let h=_.getSessionId();if(!h||Ee||!y()||d.eventType==="variant_assigned"&&Z.get(d.componentId)!==void 0&&!Oe.has(d.componentId)&&!g.get(d.componentId,te))return;let P=Ue($({path:Qt()},d),{id:Vn(),sessionId:h,timestamp:Date.now(),timeInSession:Date.now()-j});e.debug&&console.log("[sentient] track",P),Ke.then(()=>A.push(P))},getAssignment(d,h){return g.get(d,h)},isUnified:d=>f.has(d),async assign(d,h,P,U,G){var x;let T=_.getSessionId();if(!T)return null;let L=(G==null?void 0:G.unified)===!0;if(L&&f.has(d))return{variantId:(x=h==null?void 0:h[0])!=null?x:"",assignmentTtlMs:0,unified:!0};let H=g.get(d,te);if(H&&(h!=null&&h.length||H.content!==void 0)){let V=H.ttlMs&&H.ttlMs>0?Math.max(0,H.assignedAt+H.ttlMs-Date.now()):0;return{variantId:H.variantId,assignmentTtlMs:V,content:H.content}}return Yn(Ie,L?`${d}\0unified`:d,async()=>{if(!await Ut(Ke,2500)||Ee||!y())return null;let V=Fe(3e4);try{let q={sessionId:T,componentId:d,variantIds:h};U!==void 0?q.agentDataByVariant=U:P!==void 0&&(q.agentData=P),L&&(q.caps={unified:!0});let Q=await fetch(`${I}/assign`,{method:"POST",body:JSON.stringify(q),headers:F,signal:V.signal});if(!Q.ok)return null;let B=await Q.json();return B.unified===!0?L?(f.add(d),{variantId:B.variantId,assignmentTtlMs:0,unified:!0}):null:(g.set(d,te,$({variantId:B.variantId,assignedAt:Date.now(),segment:te,confidence:1,content:B.content},B.assignmentTtlMs&&B.assignmentTtlMs>0?{ttlMs:B.assignmentTtlMs}:{})),B)}catch(q){return null}finally{V.clear()}})},async decide(d){var h,P;let U=_.getSessionId();if(!U)return null;let G=(h=d.slots)!=null?h:[],x={sessionId:U};d.sections&&d.sections.length>0&&(x.sections=d.sections.map(L=>({id:L}))),x.components=(P=d.components)!=null?P:[],G.length>0&&(x.slots=G.map(jn)),d.slotsFrom==="registry"&&(x.slotsFrom="registry",d.registrySlotIds&&(x.registrySlotIds=d.registrySlotIds),d.bootstrap===!1&&(x.bootstrap=!1),d.render&&Object.keys(d.render).length>0&&(x.render=d.render)),d.v&&(x.v=d.v),typeof d.pp=="number"&&(x.pp=d.pp),e.persona&&(x.persona=e.persona),Object.assign(x,E);let T=JSON.stringify(x);return Yn(ge,T,async()=>{var L,H,V,q,Q,B,he,xe;if(!await Ut(Ke,2500)||Ee||!y())return On(G),null;let de=Fe(3e4);try{let se=await fetch(`${I}/decide`,{method:"POST",body:T,headers:F,signal:de.signal});if(!se.ok)return On(G),null;let D=await se.json(),Pe=St(D.stage,e.stageAttributes);e.stageAttributes&&tn(Pe);let it={};for(let X of G){let Le=(L=D.slots)==null?void 0:L[X.id];if(Le!==void 0){it[X.id]=Le,Z.set(X.id,Le),Oe.add(X.id);continue}let Ir=Z.get(X.id);if(Ir!==void 0)it[X.id]=Ir;else{let Or=Gn(X);it[X.id]=Or,Z.set(X.id,Or)}}if(D.slots)for(let[X,Le]of Object.entries(D.slots))X in it||(it[X]=Le,Z.set(X,Le),Oe.add(X));let li=ie!=null&&ie.persona!=="unknown";D.persona&&!(D.persona==="unknown"&&li)?ie={persona:D.persona,confidence:(H=D.confidence)!=null?H:0}:ie||(ie={persona:"unknown",confidence:0});for(let[X,Le]of Object.entries((V=D.assignments)!=null?V:{}))g.set(X,te,{variantId:Le,assignedAt:Date.now(),segment:te,confidence:1});if(D.slotConfig)for(let[X,Le]of Object.entries(D.slotConfig))ce.set(X,Le);D.palette&&(ke=D.palette),D.vocabulary&&(me=D.vocabulary);for(let X of(q=d.registrySlotIds)!=null?q:[])(Q=D.slotConfig)!=null&&Q[X]||(ce.delete(X),Z.delete(X),Oe.delete(X));return y()&&Je(e.apiKey,$($($($({v:1,persona:ie.persona,band:Ye(ie.confidence),slots:Object.fromEntries(Z),layoutOrder:(B=D.layoutOrder)!=null?B:null,savedAt:Date.now()},ce.size>0?{slotConfig:Object.fromEntries(ce)}:{}),ke?{palette:ke}:{}),me?{vocabulary:me}:{}),Pe?{stage:Pe}:{})),$($($($($($($({layoutOrder:(he=D.layoutOrder)!=null?he:null,assignments:(xe=D.assignments)!=null?xe:{},slots:it,persona:ie.persona,confidence:ie.confidence},D.slotConfig?{slotConfig:D.slotConfig}:{}),D.goals?{goals:D.goals}:{}),D.sectionMap?{sectionMap:D.sectionMap}:{}),D.palette?{palette:D.palette}:{}),D.vocabulary?{vocabulary:D.vocabulary}:{}),D.stage?{stage:D.stage}:{}),D.context?{context:D.context}:{})}catch(se){return On(G),null}finally{de.clear()}})},getSlotResult(d){var h;return(h=Z.get(d))!=null?h:null},isSlotDecided(d){return Oe.has(d)},getSlotConfig(d){var h;return(h=ce.get(d))!=null?h:null},reportSlots(d,h,P,U){var G;let x={};for(let[T,L]of Object.entries(U!=null?U:{}))for(let H of L){let V=`${T}|${H.key}`;!gt.test(T)||wr.has(V)||(wr.add(V),((G=x[T])!=null?G:x[T]=[]).push(H))}Object.keys(x).length>0&&fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify({slotIds:Object.keys(x),authoredArms:x})}).catch(()=>{});for(let T of d)if(!(typeof T!="string"||T.length===0)){if(!gt.test(T)){qi()&&!kr.has(T)&&(kr.add(T),console.warn(`[sentient] reportSlots: slot id ${JSON.stringify(T)} 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(!vr.has(T)){vr.add(T),Mt.add(T);let L=h==null?void 0:h[T];if(typeof L=="string"){let V=L.replace(/\s+/g," ").trim().slice(0,400);V!==""&&En.set(T,V)}let H=P==null?void 0:P[T];H!==void 0&&xn.set(T,H)}}Mt.size===0||An!=null||(An=setTimeout(()=>{An=null;let T=[...Mt];Mt.clear();for(let L=0;L<T.length;L+=20){let H=T.slice(L,L+20),V={},q={};for(let Q of H){let B=En.get(Q);B!==void 0&&(V[Q]=B,En.delete(Q));let he=xn.get(Q);he!==void 0&&(q[Q]=he,xn.delete(Q))}fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify($(Ue($($({slotIds:H},Object.keys(V).length>0?{baselineTexts:V}:{}),Object.keys(q).length>0?{baselineSkeletons:q}:{}),{pagePaths:Object.fromEntries(H.map(Q=>[Q,location.pathname]))}),Object.keys(V).length>0&&_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{})}},1e3))},reportSkeleton(d,h){!gt.test(d)||br.has(d)||(br.add(d),fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify({slotIds:[d],baselineSkeletons:{[d]:h}})}).catch(()=>{}))},reportAgentData(d,h,P){let U=`${d}|${h}`;!gt.test(d)||_r.has(U)||(_r.add(U),fetch(`${I}/slots/observed`,{method:"POST",headers:F,body:JSON.stringify($($({slotIds:[d],agentData:{[d]:{[h]:P}}},h.startsWith("authored.")?{authoredArms:{[d]:[{key:h.slice(9)}]}}:{}),_.getSessionId()?{sessionId:_.getSessionId()}:{}))}).catch(()=>{}))},reportDrift(d,h,P,U){let G=`${d}|${h}`,x=_.getSessionId();!x||Sr.has(G)||(Sr.add(G),fetch(`${I}/slots/drift`,{method:"POST",headers:F,body:JSON.stringify({sessionId:x,reports:[{slotId:d,expectedFp:h,observedFp:P,reason:U}]})}).catch(()=>{}))},requestSlots(d,h,P){var U,G;for(let x of d)Bt.has(x)||(Bt.add(x),gt.test(x)?mt.set(x,{text:h==null?void 0:h[x],render:(U=P==null?void 0:P.render)==null?void 0:U[x],skeleton:(G=P==null?void 0:P.skeletons)==null?void 0:G[x]}):ae.reportSlots([x]));mt.size===0||Cn!=null||(Cn=setTimeout(()=>{Cn=null;let x=[...mt];mt.clear();for(let T=0;T<x.length;T+=50){let L=x.slice(T,T+50),H={};for(let[V,q]of L)q.render&&(H[V]=q.render);ae.decide({slotsFrom:"registry",registrySlotIds:L.map(([V])=>V),bootstrap:!1,render:H}).then(V=>{var q,Q;if(V){let B={},he={},xe=[];for(let[de,se]of L){let D=(q=V.slotConfig)==null?void 0:q[de];if(D){D.needsSkeleton&&se.skeleton&&((Q=ae.reportSkeleton)==null||Q.call(ae,de,se.skeleton));continue}xe.push(de),se.text&&(B[de]=se.text),se.skeleton&&(he[de]=se.skeleton)}xe.length>0&&ae.reportSlots(xe,B,he)}else xr(L.map(([B])=>B),Bt,B=>{var he;let xe={},de={},se={};for(let[D,Pe]of L)B.has(D)&&(Pe.text&&(xe[D]=Pe.text),Pe.render&&(de[D]=Pe.render),Pe.skeleton&&(se[D]=Pe.skeleton));(he=ae.requestSlots)==null||he.call(ae,[...B],xe,{render:de,skeletons:se})});$t.forEach(B=>B())})}},0))},decideSlots(d){for(let h of d)Kt.has(h.id)||(Kt.add(h.id),ht.set(h.id,h));ht.size===0||In!=null||(In=setTimeout(()=>{In=null;let h=[...ht.values()];ht.clear();for(let P=0;P<h.length;P+=30){let U=h.slice(P,P+30);ae.decide({slots:U}).then(G=>{G||xr(U.map(x=>x.id),Kt,x=>{var T;return(T=ae.decideSlots)==null?void 0:T.call(ae,U.filter(L=>x.has(L.id)))}),$t.forEach(x=>x())})}},0))},cancelSlots(d){for(let h of d)mt.delete(h)&&Bt.delete(h),ht.delete(h)&&Kt.delete(h)},onSlotsChanged(d){return $t.add(d),()=>{$t.delete(d)}},getStyleVocabulary(){return me},getSitePalette(){return ke},getVisitorId:()=>y()?_.getSessionId():null,getPersona(){return ie?{persona:ie.persona,confidence:ie.confidence,band:Ye(ie.confidence)}:null},async fetchWeights(){var d;let h=Fe(5e3);try{let P=await fetch(`${I}/weights`,{headers:F,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(){A.flush(),ne.flush()},dispose(){var d;yt==null||yt(),Tn=!0,Ee=!0,A.destroy(),ne.destroy(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ae.dispose&&pe.delete(e.apiKey),e.debug&&console.log("[sentient] disposed")},destroy(){var d;yt==null||yt(),Tn=!0,Ee=!0,M=!0,Ft(e.apiKey),A.destroy({forget:!0}),ne.destroy({forget:!0}),_.destroy(),g.clear(),((d=pe.get(e.apiKey))==null?void 0:d.dispose)===ae.dispose&&pe.delete(e.apiKey);try{localStorage.removeItem(at+e.apiKey),localStorage.removeItem(Ht(e.apiKey)),localStorage.removeItem(Vt(e.apiKey)),localStorage.removeItem(`_snt_graph_nodes${Ge(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:ae.dispose}),yt=Zi(ae,e.apiKey,d=>{Ke.then(()=>{Tn||po.add(d)})}),e.debug){let d=window;d.__sentient&&(d.__sentient.client=ae)}return ae}var nr=/(^|\/)snippet(\.global)?(\.min)?\.js(\?|$)/,ta=(()=>{var e,t;try{return(t=(e=document.currentScript)==null?void 0:e.src)!=null?t:""}catch(n){return""}})(),na=/@\d+\.\d+\.\d+[^/]*\//;function rr(e){var t;try{let n=ta||((t=Array.from(document.getElementsByTagName("script")).find(r=>nr.test(r.src)))==null?void 0:t.src);for(let r of n?[n]:[]){let o=nr.test(r)?r.replace(nr,`$1${e}$4`):r.replace(/[^/?#]*([?#].*)?$/,e),a=(e==="consent.global.js"?"sha384-+7/RqBOFLU5bMaQ6bcBAWzG589skmxN8tedG9hkoQQ6HaQkRRBJfoRVD94e/fJcM":e==="editor.global.js"?"sha384-PCGH0rGbUEHjzeQnSC1rCfh9guh69PEVO5X3f39xVbZ7AhyE3eEk5NkmNBMPK/Ey":e==="preview.global.js"?"sha384-kA/hCRMTGTk3+tbBlDLjgUJmeAKIG8WXAELsHHGSCmyiYCAu4yGrsUYbRnNFJ/vT":"sha384-avLvKr5c8cXC2JR+FTWpRi9HUBSSWMEXPxqsrMuetUqix4IM5yOi7z4jRDHoy4Rj")||"";return na.test(o)&&a.indexOf("sha384-")===0?{src:o,integrity:a}:{src:o}}}catch(n){}return null}var rn=new Map;function Ze(e,t,n){let r=window[t];if(r)return Promise.resolve(r);let o=rn.get(e);return o||(o=new Promise(a=>{var i;let s=n?{src:n}:rr(e);if(!s)return a(null);let c=We(document.createElement("script"));or(c,s),c.async=!0,c.onload=()=>{var u;let l=(u=window[t])!=null?u:null;l||rn.delete(e),a(l)},c.onerror=()=>{rn.delete(e),a(null)},((i=document.head)!=null?i:document.documentElement).appendChild(c)}),rn.set(e,o)),o}function or(e,t){t.integrity&&(e.integrity=t.integrity,e.crossOrigin="anonymous"),e.src=t.src}var mo="__sentientConsent",Ne=null,ir=!1,on=new Set,ar=()=>{let e=window[mo];return typeof(e==null?void 0:e.consentWatcher)=="function"?e.consentWatcher:null},kt;function ho(e){kt=e}function ra(){Ne||(Ne=ar())||ir||(ir=!0,Ze("consent.global.js",mo,kt).then(e=>{if(ir=!1,!e)return oa(kt!=null?kt:"consent.global.js");if(Ne=ar(),Ne)for(let t of Array.from(on))t()}))}function oa(e){console.warn(`[sentient] could not load ${e} \u2014 tracking stays off. Set window.sentient.consentSrc to its URL.`)}function Qe(e){ra();let t=null,n=()=>(!t&&(Ne!=null?Ne:Ne=ar())&&(t=Ne(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,a=!1,s=()=>{on.delete(s);let c=n();a||!c||(o=c.subscribe(r),r())};return n()?(o=t.subscribe(r),Promise.resolve().then(()=>{a||r()})):on.add(s),()=>{a=!0,on.delete(s),o==null||o()}}}}function ia(e){return e.replace(/\s+/g," ").trim().slice(0,300)}function yo(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 aa(e){let t=e.join("");return yo(t,2166136261)+yo(t,1523705862)}var sa=new Set(["A","BUTTON"]),la=/^H([1-6])$/,ua=new Set(["P","LI","LABEL","BLOCKQUOTE","FIGCAPTION","DT","DD","TD","TH"]);var ca=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT"]);function da(e){return sa.has(e.tagName)||e.getAttribute("role")==="button"?!0:e.tagName==="INPUT"&&/^(submit|button)$/i.test(e.type)}function fa(e){if(la.test(e.tagName)||ua.has(e.tagName))return!0;let t=e.ownerDocument.defaultView,n=t?t.getComputedStyle(e).display:"";return n!==""&&n!=="inline"&&n!=="contents"}function pa(e,t){let n=null;for(let r=e.parentElement;r&&r!==t.parentElement;r=r.parentElement){if(da(r)){n=r;break}if(r===t)break}if(n)return n;for(let r=e.parentElement;r;r=r.parentElement)if(r===t||fa(r))return r;return t}function an(e,t=40){var n,r,o;let a=e.ownerDocument.createTreeWalker(e,4),s=[];for(let u=a.nextNode();u;u=a.nextNode())if(((n=u.nodeValue)!=null?n:"").trim()!==""&&!ca.has((o=(r=u.parentElement)==null?void 0:r.tagName)!=null?o:"")&&(s.push(u),s.length>120))return{reason:"too_large"};if(s.length===0)return{reason:"empty"};let c=[],i=[];for(let u of s){let p=pa(u,e),v=c.indexOf(p);v===-1&&(c.push(p),v=c.length-1),i.push(v)}if(c.length>t)return{reason:"too_large"};let l=s.map(u=>{var p;return ia((p=u.nodeValue)!=null?p:"")});return{textNodes:s,ownerEls:c,leafToNode:i,leaves:l,fp:aa(l)}}var vo=["cookiebot","onetrust","cookieyes","tcf","google-consent-mode","shopify"];function ga(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(a=>typeof a=="string")||/[=|]/.test(r)||o.some(a=>/[=|]/.test(a)))return null;n[r]=o}return n}function ma(e){return!Array.isArray(e)||e.length<2||e.length>12||!e.every(t=>typeof t=="string")?null:e}function sr(e){try{return e()}catch(t){return}}function sn(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,u]of Object.entries(t.slots)){if(typeof u!="object"||u===null)continue;let p=u,v=ga(p.dims);if(!v||p.target!==void 0&&typeof p.target!="string")continue;let b=p.arms!==void 0?ma(p.arms):null,S={dims:v};typeof p.target=="string"&&(S.target=p.target),b&&(S.arms=b),n[l]=S}let r={apiKey:t.apiKey,personaAttributes:t.personaAttributes===!0,slots:n};typeof t.consent=="boolean"?r.consent=t.consent:t.consent!==void 0&&a("consent");let o=t.consentFrom;if(typeof o=="string"&&vo.includes(o))r.consentFrom=o;else if(o&&typeof o=="object"&&!Array.isArray(o)){let l=o;typeof l.cmp=="string"&&vo.includes(l.cmp)||l.cmp===void 0&&(typeof l.cookie=="string"||typeof l.check=="function")?r.consentFrom=l:a("consentFrom")}else o!==void 0&&a("consentFrom");function a(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 s=typeof t.persona=="function"?sr(t.persona):t.persona;typeof s=="string"&&s.trim()!==""&&(r.persona=s);let c=typeof t.userId=="function"?sr(t.userId):t.userId,i=typeof c=="number"||typeof c=="string"?String(c).trim():"";if(i&&i.length<=256&&!i.includes("@")&&(r.userId=i,typeof t.userHash=="string"&&t.userHash&&(r.userHash=t.userHash)),(typeof t.internal=="function"?sr(t.internal):t.internal)===!0&&(r.internal=!0),Array.isArray(t.sections)){let l=t.sections.filter(u=>typeof u=="string"&&u.trim()!=="").slice(0,50);l.length>=2&&(r.sections=l)}return r}var bo=new WeakMap;function So(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function wo(e,t,n){var a,s,c;let r=bo.get(e);if(r){if(r.fp!==n.fp||!So(r.leafToNode,n.leafToNode))return"mismatch"}else{let i=an(e);if(!("fp"in i)||(r={fp:i.fp,leafToNode:i.leafToNode,textNodes:i.textNodes,ownerEls:i.ownerEls,classes:i.ownerEls.map(l=>{var u;return(u=l.getAttribute("class"))!=null?u:""})},r.fp!==n.fp||!So(r.leafToNode,n.leafToNode)))return"mismatch";bo.set(e,r)}let o=r;for(let[i,l]of Object.entries(t.nodes)){let u=Number(i),p=o.ownerEls[u];if(p){if(typeof l.text=="string"){let v=!0;o.leafToNode.forEach((b,S)=>{b===u&&(o.textNodes[S].nodeValue=v?l.text:"",v=!1)})}l.like!==void 0&&o.classes[l.like]!==void 0&&p.setAttribute("class",o.classes[l.like]),l.hidden&&((a=p.style)==null||a.setProperty("display","none","important"))}}for(let i of Object.values((s=t.order)!=null?s:{})){let l=i.map(S=>o.ownerEls[S]).filter(S=>!!S),u=(c=l[0])==null?void 0:c.parentElement;if(!u||l.length!==i.length||l.some(S=>S.parentElement!==u))continue;let p=new Set(l),v=0;Array.from(u.children).map(S=>p.has(S)?l[v++]:S).forEach((S,w)=>{var K;u.children[w]!==S&&u.insertBefore(S,(K=u.children[w])!=null?K:null)})}return"applied"}function Et(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 ha(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 xt(e,t){return!!(e!=null&&e.urlMatch)&&!Et(t).includes(e.urlMatch)}var ya=/^[a-zA-Z_][-a-zA-Z0-9_]*$/;function lr(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)&&ya.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 De(e,t){if(e.urlMatch&&!Et(t).includes(e.urlMatch))return null;let n=lr(e,t);if(n.length!==1)return null;let r=n[0];return e.fingerprint&&!ha(r,e.fingerprint)?null:r}var va=12;function _o(e,t){var c;let n=De(e,t),r=e.fingerprint,o=i=>(i!=null?i:"").replace(/\s+/g," ").trim().toLowerCase(),a=o((c=r==null?void 0:r.text)!=null?c:"");if(n||!(r!=null&&r.tag)||a.length<va||xt(e,t)||lr(e,t).length)return n;let s=Array.from(t.getElementsByTagName(r.tag)).filter(i=>o(i.textContent)===a);return s.length===1?s[0]:null}function ko(e,t){return xt(e,t)?!1:!!e.selector&&!e.dataAttr&&!e.id&&!e.fingerprint&&e.page===void 0?Eo(e,t):De(e,t)!==null}function Eo(e,t){return lr(e,t).length>0}function ln(e,t){return xt(e,t)?!1:e.page!==void 0&&nn.test(e.page)?Xn(e.page,Et(t)):Eo(e,t)}var xo={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"},ba=/^(rgb|rgba|hsl|hsla|calc|var|min|max|clamp)$/i;function Ao(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(!ba.test((r=n[1])!=null?r:""))return!1;return!0}function Sa(e){var r,o;let t=e.ownerDocument.createTreeWalker(e,4),n=null;for(let a=t.nextNode();a!==null;a=t.nextNode()){if(((r=a.nodeValue)!=null?r:"").trim()==="")continue;let s=(o=a.parentElement)==null?void 0:o.tagName;if(!(s==="SCRIPT"||s==="STYLE"||s==="TEMPLATE")){if(n!==null)return null;n=a}}return n}function At(e,t){let n=Sa(e);n!==null?n.nodeValue=t:e.textContent=t}var ur=/^https:\/\//i;function un(e){return typeof e=="string"&&!/[\s\x00-\x1f\\]/.test(e)&&(ur.test(e)||e[0]==="/"&&e[1]!=="/")?e:null}var Co=new Map,He=null;function wa(e){return e.replace(/["\\]/g,"\\$&")}function _a(e){var t;(!He||!He.isConnected)&&(He=e.querySelector("style[data-sentient-ops]"),He||(He=We(e.createElement("style"),e),He.setAttribute("data-sentient-ops",""),((t=e.head)!=null?t:e.documentElement).appendChild(He))),He.textContent=[...Co.entries()].map(([n,r])=>`[data-snt-e="${wa(n)}"]{${r}}`).join(`
|
|
2
|
+
`)}function Io(e,t,n,r){var c;let o=!1,a=(c=t.moveBefore)!=null?c:t.moveAfter;if(a){let i=De(a,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"&&At(e,t.text),typeof t.href=="string"&&ur.test(t.href)&&e.setAttribute("href",t.href),typeof t.imageSrc=="string"&&ur.test(t.imageSrc)&&e.setAttribute("src",t.imageSrc),typeof t.imageAlt=="string"&&e.setAttribute("alt",t.imageAlt);let s=[];if(t.hidden&&s.push("display:none !important"),t.style)for(let[i,l]of Object.entries(t.style)){let u=xo[i];u&&typeof l=="string"&&Ao(l)&&s.push(`${u}:${l.trim()} !important`)}return s.length>0&&(e.setAttribute("data-snt-e",n),Co.set(n,s.join(";")),_a(r)),{anchorMiss:o}}var Ct="data-sentient-block-arm",R=null;function It(e){R=e!=null?e:null}var et=null;function Ot(e){et=e!=null?e:null}var Lo=e=>{var t;return typeof e=="string"?(t=et==null?void 0:et.entries.find(n=>n.id===e))==null?void 0:t.classes:void 0},Ro=e=>{let t=typeof e=="string"?et==null?void 0:et.entries.find(n=>n.id===e):void 0;return t!=null&&t.computed.inheritsColor?t.computed.color:void 0},Me="data-sentient-blocks-hid",ft={none:"0",sm:"8px",md:"16px",lg:"24px"},cr={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",between:"space-between"},Oo={sm:"0.875em",md:"1em",lg:"1.25em"},ka={sm:"1.25em",md:"1.5em",lg:"2em"},Ea={sm:"6px 14px",md:"10px 20px",lg:"14px 28px"},To={sm:"8px",md:"16px",lg:"32px"},xa={square:"1 / 1",landscape:"4 / 3",wide:"16 / 9"},Aa={normal:"400",medium:"500",bold:"700"};function ye(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&e.style.setProperty(n,r);return e}function Po(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 No(e,t){let n=Ca(e,t),r=Ro(e.like);return n&&r&&(n.style.color=r),n}function Ca(e,t){var n,r,o,a,s,c,i,l,u,p,v,b,S,w,K,j,_,E,O,N;try{let M=Lo(e.like),m=e.maxWidth==="measure"?"65ch":void 0,y=f=>(f.className=M,ye(f,{"max-width":m}));switch(e.type){case"stack":case"grid":{let f=t.createElement("div");if(e.type==="stack"){let I=e;ye(f,{display:"flex","flex-direction":I.direction,gap:(r=ft[(n=I.gap)!=null?n:"md"])!=null?r:ft.md,"align-items":I.align?cr[I.align]:void 0,"justify-content":I.justify?cr[I.justify]:void 0,"flex-wrap":I.wrap?"wrap":void 0})}else{let I=e,F=(a=ft[(o=I.gap)!=null?o:"md"])!=null?a:ft.md;ye(f,{display:"grid","grid-template-columns":`repeat(auto-fit, minmax(max(200px, calc((100% - ${I.columns-1} * ${F}) / ${I.columns})), 1fr))`,gap:F,"align-items":I.align?cr[I.align]:void 0})}M&&(f.className=M);let g=!M&&e.type==="stack"&&e.surface==="raised",A=(s=e.pad)!=null?s:g?"md":void 0;A&&ye(f,{padding:(c=ft[A])!=null?c:ft.md}),g&&ye(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":(l=R==null?void 0:R.radius)!=null?l:"8px"});for(let I of(u=e.children)!=null?u:[]){let F=No(I,t);F&&f.appendChild(F)}return f}case"text":{let f=t.createElement("p");return f.textContent=e.value,M?y(f):ye(f,je(W({margin:"0","font-size":e.size?Oo[e.size]:void 0,"font-weight":e.weight?Aa[e.weight]:void 0,"text-align":e.align},Po(e.tone)),{"max-width":e.maxWidth==="measure"?"65ch":void 0}))}case"heading":{let f=t.createElement(`h${e.level}`);return f.textContent=e.value,M?y(f):ye(f,{margin:"0","font-size":ka[(p=e.size)!=null?p:"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 g=un(e.href);if(g&&(f.href=g),e.tag&&f.setAttribute("data-sentient-tag",e.tag),M)return y(f);let A=(v=e.emphasis)!=null?v:"primary";return ye(f,{display:"inline-block",padding:Ea[(b=e.size)!=null?b:"md"],"border-radius":(S=R==null?void 0:R.radius)!=null?S:"8px",font:"inherit","font-size":e.size?Oo[e.size]:void 0,"text-decoration":A==="ghost"?"underline":"none",cursor:"pointer",background:A==="primary"?(w=R==null?void 0:R.primaryBg)!=null?w:"#111827":"transparent",color:A==="primary"?(K=R==null?void 0:R.primaryText)!=null?K:"#ffffff":(j=R==null?void 0:R.accent)!=null?j:"inherit",border:A==="secondary"?`1px solid ${(_=R==null?void 0:R.accent)!=null?_:"currentColor"}`:"none"})}case"link":{let f=t.createElement("a");f.textContent=e.label;let g=un(e.href);return g&&(f.href=g),e.tag&&f.setAttribute("data-sentient-tag",e.tag),M?y(f):ye(f,{color:"inherit","text-decoration":"underline"})}case"image":{let f=t.createElement("img"),g=un(e.src);return g&&(f.src=g),f.alt=e.alt,M&&(f.className=M),ye(f,{display:"block","max-width":"100%","aspect-ratio":e.ratio&&e.ratio!=="auto"?xa[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,M?y(f):ye(f,W({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"}`},Po(e.tone)))}case"spacer":return ye(t.createElement("div"),{height:(O=To[e.size])!=null?O:To.md});case"divider":return ye(t.createElement("hr"),{border:"none","border-top":`1px solid ${(N=R==null?void 0:R.border)!=null?N:"currentColor"}`,margin:"0",width:"100%"});default:return null}}catch(M){return null}}function Do(e,t,n,r){var o,a;try{let s=new Set;for(let i of Array.from(e.children)){let l=i.getAttribute(Ct);l!==null&&(t[l]===void 0?i.remove():s.add(l))}for(let[i,l]of Object.entries(t)){if(s.has(i))continue;let u="tree"in l?l:null,p=No(u?u.tree:l,r);if(!p)continue;let v=r.createElement("div");v.setAttribute(Ct,i),v.style.display="none";let b=u?Lo((o=u.surface)==null?void 0:o.like):void 0;if(b){let S=r.createElement("div");S.className=b;let w=Ro((a=u.surface)==null?void 0:a.like);w&&(S.style.color=w),S.appendChild(p),v.appendChild(S)}else v.appendChild(p);e.appendChild(v)}let c=n!==void 0&&t[n]!==void 0;for(let i of Array.from(e.children)){let l=i.getAttribute(Ct),u=i;l!==null?u.style.display=c&&l===n?"":"none":c?u.hasAttribute(Me)||(u.setAttribute(Me,u.style.display),u.style.display="none"):u.hasAttribute(Me)&&(u.style.display=u.getAttribute(Me),u.removeAttribute(Me))}}catch(s){}}function Ia(e){try{for(let t of Array.from(e.children)){let n=t;if(n.getAttribute(Ct)!==null){n.remove();continue}n.hasAttribute(Me)&&(n.style.display=n.getAttribute(Me),n.removeAttribute(Me))}}catch(t){}}function cn(e,t){try{let n=new Set;for(let r of Array.from(e.querySelectorAll(`[${Ct}]`)))r.parentElement&&n.add(r.parentElement);for(let r of Array.from(e.querySelectorAll(`[${Me}]`)))r.parentElement&&n.add(r.parentElement);for(let r of n)t.has(r)||Ia(r)}catch(n){}}function dr(e,t){if(!e)return[t.documentElement];try{return Array.from(t.querySelectorAll(e))}catch(n){return[]}}function dn(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 fn(e,t,n,r){var o;for(let[a,s]of Object.entries(t)){let c=e[a];if(!c||typeof c=="string")continue;let i=dr(s.target,n);for(let l of i)for(let[u,p]of Object.entries(c))(o=s.dims[u])!=null&&o.includes(p)&&(l.setAttribute(`data-${u}`,p),r==null||r(l,`data-${u}`))}}function pn(e,t,n,r){for(let[o,a]of Object.entries(t)){let s=e[o];if(typeof s!="string"||!a.arms||!a.arms.includes(s))continue;let c=dr(a.target,n);for(let i of c)i.setAttribute("data-sentient-arm",s),r==null||r(i,"data-sentient-arm")}}function gn(e,t,n,r){var c,i,l,u,p,v,b;let o=new Set,a=(c=r==null?void 0:r.contentAndOps)!=null?c:!0,s=[];for(let[S,w]of Object.entries(t)){if(xt(w.locator,n))continue;let K;if(w.locator){let _=De(w.locator,n);K=_?[_]:[],!_&&ln(w.locator,n)&&s.push(S)}else K=dr(w.target,n);let j=e[S];for(let _ of K){if(j!==void 0)if(typeof j=="string")_.setAttribute("data-sentient-arm",j),(i=r==null?void 0:r.onAttr)==null||i.call(r,_,"data-sentient-arm"),a&&((l=r==null?void 0:r.onApplied)==null||l.call(r,S,j,_));else for(let[O,N]of Object.entries(j))_.setAttribute(`data-${O}`,N),(u=r==null?void 0:r.onAttr)==null||u.call(r,_,`data-${O}`);if((w.blocks||w.compose)&&!Ta(n)){let O=Object.fromEntries([...Object.entries((p=w.blocks)!=null?p:{}).filter(([,N])=>!wt(N)),...Object.entries((v=w.compose)!=null?v:{}).filter(([,N])=>!wt(N.tree))]);Object.keys(O).length>0&&(Do(_,O,typeof j=="string"?j:void 0,n),o.add(_))}if(!a)continue;let E=_.textContent;w.edits?wo(_,w.edits.edits,w.edits)==="mismatch"&&((b=r==null?void 0:r.onDrift)==null||b.call(r,S,w.edits.fp)):typeof w.content=="string"&&At(_,w.content),w.ops&&Io(_,w.ops,S,n).anchorMiss&&!s.includes(S)&&s.push(S),Qn(_,je(W(W({previous:E},typeof j=="string"?{arm:j}:{}),(r==null?void 0:r.persona)!==void 0?{persona:r.persona}:{}),{doc:n}))}}return cn(n,o),s}var Oa=/bot|crawler|spider|crawling|googlebot|bingbot|duckduckbot|baiduspider|yandexbot|slurp|gptbot|claudebot|anthropic|perplexity|ccbot|applebot|headlesschrome/i;function Ta(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:Oa.test((r=o.userAgent)!=null?r:""):!1}catch(o){return!1}}var Pa=800;function mn(e,t,n){let r=[];return n.forEach(({slotId:o,arm:a,el:s},c)=>{r.push(er((v,b={})=>{try{e.track({projectId:t,componentId:o,variantId:a,eventType:"micro_signal",payload:W({signalType:v},b)})}catch(S){}},s,void 0,{tabLoss:c===0}));let i=null,l=0,u=()=>{l=Date.now(),i=setTimeout(()=>{try{e.track({projectId:t,componentId:o,variantId:a,eventType:"cursor_signal",payload:{hoverDuration:Date.now()-l}})}catch(v){}i=null},Pa)},p=()=>{i!==null&&(clearTimeout(i),i=null)};s.addEventListener("mouseenter",u),s.addEventListener("mouseleave",p),r.push(()=>{s.removeEventListener("mouseenter",u),s.removeEventListener("mouseleave",p),i!==null&&clearTimeout(i)})}),()=>{for(let o of r)o()}}function $o(e){return e?`_snt_fired_goals_${e.slice(0,12)}`:"_snt_fired_goals"}var La="_snt_fired_goals";function fr(e,t){try{e==null||e.sessionStorage.removeItem($o(t)),e==null||e.sessionStorage.removeItem(La)}catch(n){}}function Mo(e){var t;return[(t=e.slotId)!=null?t:"",e.goalId,e.event,e.locator?JSON.stringify(e.locator):""].join("|")}function Ra(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 Na(e,t,n){try{e==null||e.sessionStorage.setItem(t,JSON.stringify([...n]))}catch(r){}}function Bo(e,t,n,r){var j,_;let o=(j=n.defaultView)!=null?j:typeof window!="undefined"?window:null,a=$o(r),s=Ra(o,a),c=E=>{let O=Mo(E);if(!s.has(O))try{E.slotId?t.componentGoal(E.slotId,E.goalId):t.goal(E.goalId),s.add(O),Na(o,a,s)}catch(N){}},i=e.filter(E=>E.event==="click"),l=e.filter(E=>E.event==="form_submit"),u=e.filter(E=>E.event==="url_reached"),p=e.filter(E=>E.event==="scroll_depth"),v=(E,O)=>{if(!E.locator)return!1;let N=_o(E.locator,n);return!!N&&(N===O||N.contains(O))},b=E=>{let O=E.target;if(!(!O||typeof O.closest!="function"))for(let N of i)v(N,O)&&c(N)},S=E=>{let O=E.target;if(O)for(let N of l)v(N,O)&&c(N)},w=()=>{if(u.length===0)return;let E=Et(n);for(let O of u)O.urlPattern&&Zn(O.urlPattern,E)&&c(O)},K=()=>{var N;let E=n.documentElement,O=E.scrollHeight>0?(E.scrollTop+E.clientHeight)/E.scrollHeight:0;for(let M of p)O>=((N=M.threshold)!=null?N:.75)&&c(M);p.every(M=>s.has(Mo(M)))&&n.removeEventListener("scroll",K)};return n.addEventListener("click",b,!0),n.addEventListener("submit",S,!0),(_=n.defaultView)==null||_.addEventListener("popstate",w),w(),p.length>0&&(n.addEventListener("scroll",K,{passive:!0}),K()),{checkUrl:w,teardown:()=>{var E;n.removeEventListener("click",b,!0),n.removeEventListener("submit",S,!0),(E=n.defaultView)==null||E.removeEventListener("popstate",w),p.length>0&&n.removeEventListener("scroll",K)}}}function hn(e,t){if(!e||e.length<2||t.size!==e.length)return null;let n=[];for(let s of e){let c=t.get(s);if(!c||n.includes(c))return null;n.push(c)}let r=n[0].parentNode;if(!r||!n.every(s=>s.parentNode===r))return null;let o=n.slice().sort((s,c)=>s.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),a=[];for(let s=0;s<n.length;s++){let c=n[s];o[s]!==c&&(a.push({el:c,before:o[s]}),o.splice(o.indexOf(c),1),o.splice(s,0,c))}return a}var Da="__snt_editor_token";function Ko(){try{return typeof sessionStorage!="undefined"?sessionStorage.getItem(Da):null}catch(e){return null}}function jo(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 a=n.slice(0,r.index)+o;history.replaceState(history.state,"",a?"#"+a:location.pathname+location.search)}}catch(n){}return t}Un();Fn(()=>Ze("engagement.global.js","__sentientEngagement"));var Tt="0.36.4",bn=Tt!=="0.0.0-dev"?{name:"snippet",version:Tt}:void 0,qo=Tt!=="0.0.0-dev"?{v:Tt}:{},Go=5e3,Ma=50,Jo=(()=>{try{if(typeof window=="undefined")return[];let e=window.SentientSnippet;return Array.isArray(e==null?void 0:e.q)?e.q:[]}catch(e){return[]}})(),ee=null,k=null,Se={},be=null,we=null,Pt=null,re=null,oe=null,Lt=0,J=null,tt=null,Fo=!1,pr=null,yn=null,Rt=null,Ae=!1,Ve=!1,Sn=!1,wn=0,Yo=e=>fe(e)===wn,pt=null,ue=!1,Be=null,Ce=[],nt=null,rt=null,ve=null,$a=3e3,Ba=100;function Uo(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 $e(e,...t){e!=null&&e.debug&&console.log("[sentient-snippet]",...t)}function Nt(e,t){return ee?(ee.personaAttributes&&J&&dn(J.persona,J.band,e,t==null?void 0:t.onAttr),fn(Se,ee.slots,e,t==null?void 0:t.onAttr),pn(Se,ee.slots,e,t==null?void 0:t.onAttr),be?gn(Se,be,e,W(je(W({},t),{onDrift:(n,r)=>{var o,a;return(a=k==null?void 0:k.reportDrift)==null?void 0:a.call(k,n,r,(o=Qo[n])!=null?o:null,"fp_mismatch")}}),J?{persona:J.persona}:{})):(cn(e,new Set),[])):[]}function Xo(e){var n;let t=new Map;for(let r of(n=ee==null?void 0:ee.sections)!=null?n:[])try{let o=e.querySelectorAll(r);o.length===1&&t.set(r,o[0])}catch(o){}return t}function gr(e,t){var n,r;try{if(!e||e.length<2)return;for(let o of(n=hn(e,Xo(t)))!=null?n:[])(r=o.before.parentNode)==null||r.insertBefore(o.el,o.before)}catch(o){}}function Ka(e,t,n){let r=(o,a)=>t.some(([s,c])=>s===o&&c===a);try{if(Array.isArray(e.stamped))for(let o of e.stamped){if(!Array.isArray(o))continue;let[a,s,c]=o;!a||typeof s!="string"||r(a,s)||(c==null?a.removeAttribute(s):a.setAttribute(s,c))}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 ja(){try{let e=window.__sntPP;return e&&typeof e=="object"&&typeof e.v=="number"?e:null}catch(e){return null}}function Zo(e){return e.apiBase?`${e.apiBase.replace(/\/+$/,"")}/v1/events`:void 0}function kn(e){var t;return(t=e.apiBase)!=null?t:"https://api.sentient-ui.com"}function Ga(e){return Promise.resolve().then(()=>fetch(`${kn(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 mr(e,t){let n=[],r=[];for(let o of e)try{if(typeof(o==null?void 0:o.id)!="string")continue;!o.locator||ko(o.locator,t)?n.push(o.id):ln(o.locator,t)&&r.push(o.id)}catch(a){}return[n,r]}var Qo={};function ei(e,t){var r;let n={};for(let o of e){let a=(r=Be==null?void 0:Be.find(l=>l.id===o))==null?void 0:r.locator,s=a?De(a,t):null,c=s?an(s):null,i=c&&"fp"in c?c.fp:void 0;i&&(Qo[o]=i),n[o]=je(W({},i?{fp:i}:{}),{forms:!1,compose:!0,content:!0})}return n}function ti(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 ni(){if(!Ae){le&&nt!==Re()&&le(!0);return}!Be||nt===Re()||(nt=Re(),Fa())}function Fa(){ve==null||ve();let e=ee,t=Be;if(!e||!t)return;let n,r,o=()=>{clearTimeout(n),clearTimeout(c),r==null||r.disconnect(),ve===o&&(ve=null)},a=null,s=i=>{let[l,u]=mr(t,document),p=l.filter(v=>!Ce.includes(v));a!==null&&l.some(v=>!a.has(v)&&!p.includes(v))&&Dt(),a=new Set(l),p.length>0&&Ua(p).catch(()=>{}),(i||u.length===0&&!t.some(v=>!l.includes(v.id)&&!Ce.includes(v.id)))&&(o(),ri(e,u))},c=setTimeout(()=>s(!0),$a);if(ve=o,s(),ve===o)try{r=new MutationObserver(()=>{clearTimeout(n),n=setTimeout(s,Ba)}),r.observe(document.documentElement,{childList:!0,subtree:!0})}catch(i){}}function _n(e,t){if(!(!e||e.length===0||!t||!ee))try{we==null||we.teardown(),we=Bo(e,t,document,ee.apiKey)}catch(n){}}async function Ua(e){let t=ee,n=k;if(!t||!n)return;Ce=Ce.concat(e);let r=await n.decide(W({slotsFrom:"registry",registrySlotIds:e,render:ei(e,document)},qo));if(r||(Ce=Ce.filter(a=>!e.includes(a))),!r||ue||k!==n)return;Se=W(W({},Se),r.slots),!we&&r.goals&&(t.consent!==!1||Ve)&&_n(Pt=r.goals,n);let o=ti(r.slotConfig,e);o&&(be=W(W({},be),o)),Dt(),$e(t,"late decide",e),rt&&Yo(t.apiKey)&&Je(t.apiKey,rt=W(je(W({},rt),{slots:Se,savedAt:Date.now()}),be?{slotConfig:be}:{}))}function ri(e,t){if(t.length!==0)try{fetch(`${kn(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 ot(){return!!(ee&&k&&ee.sectionCapture!==!1&&(ee.consent!==!1||Ve)&&!Xe())}function Wa(){if(!k||!ee||!ot()||oe)return;let e=[];Nt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),yr();try{re==null||re(),re=mn(k,ee.apiKey,e)}catch(t){}}function yr(){if(typeof document=="undefined"||!ot())return;let e;try{if(yn&&yn.length>0){let r=new Map;for(let o of yn){if(o.urlMatch!==window.location.pathname)continue;let a=De(o.locator,document);a&&r.set(a,o.type)}r.size>0&&(e=o=>{var a;return(a=r.get(o))!=null?a:null})}}catch(r){}let t=k,n=++Lt;Rt=window.location.pathname,Ze("engagement.global.js","__sentientEngagement").then(r=>{if(!(!r||n!==Lt||k!==t||!t||!ot()))try{oe==null||oe(),oe=r.startEngagementCapture(t,W({apiKey:ee.apiKey,apiBase:ee.apiBase,doc:document,microSignals:!0},e?{typeOf:e}:{}))}catch(o){}})}function Dt(){try{let e=[];if(re==null||re(),re=null,Nt(document,{contentAndOps:Ae,onApplied:(t,n,r)=>e.push({slotId:t,arm:n,el:r})}),gr(tt,document),e.length>0&&ot())try{re=mn(k,ee.apiKey,e)}catch(t){}try{typeof window!="undefined"&&Rt!==null&&window.location.pathname!==Rt&&ot()&&(oe==null||oe(),oe=null,Lt++,yr())}catch(t){}}catch(e){}}function Wo(){pr===null&&(pr=setTimeout(()=>{pr=null,Dt();try{we==null||we.checkUrl()}catch(e){}ni()},Ma))}function oi(){if(!(Fo||typeof window=="undefined"||typeof history=="undefined")){Fo=!0;try{let e=t=>{let n=history[t];history[t]=function(r,o,a){let s=n.call(this,r,o,a!=null?a:null);return Wo(),s}};e("pushState"),e("replaceState"),window.addEventListener("popstate",Wo)}catch(e){}}}function vn(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 Ha(e,t,n){var r;try{window.__sentientEditor={token:t,code:n,apiBase:kn(e)};let o=e.editorSrc?{src:e.editorSrc}:rr("editor.global.js");if(!o){Vo();return}let a=We(document.createElement("script"));or(a,o),a.async=!0,a.onerror=()=>Vo(),((r=document.head)!=null?r:document.documentElement).appendChild(a)}catch(o){}}var Ho="sentient-editor-load-notice";function Vo(){var e;try{if(document.getElementById(Ho))return;let t=document.createElement("div");t.id=Ho,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;padding:12px;background:#111;color:#fff;font:13px system-ui",t.onclick=()=>t.remove(),((e=document.body)!=null?e:document.documentElement).appendChild(t),setTimeout(()=>t.remove(),1e4)}catch(t){}}function Va(e){let t={cfg:e,apiBase:kn(e),set(n){n.slots!==void 0&&(Se=n.slots),n.slotConfig!==void 0&&(be=n.slotConfig),n.persona!==void 0&&(J=n.persona),n.decided&&(Ae=!0),n.look&&(It(n.look.palette),Ot(n.look.vocabulary))},apply:()=>Nt(document),installSpaHooks:oi,exposeGlobal:()=>{Sn=!0,hr(e)},dbg:(...n)=>$e(e,...n)};return Ze("preview.global.js","__sentientPreview").then(n=>n?n.runPreview(t):Promise.reject()).catch(()=>(t.exposeGlobal(),$e(e,"preview chunk unavailable \u2014 page left as-is"),!0))}function hr(e){let t=r=>{try{oe==null||oe(),oe=null,Lt++,Rt=null,re==null||re(),re=null,ve==null||ve(),we==null||we.teardown(),we=null,r&&fr(typeof window!="undefined"?window:null,e.apiKey),Ve=!1,ue=!0,r?(rt=null,J=null,k?k.destroy():lt(e.apiKey)):k==null||k.dispose(),k=null}catch(o){}},n={consentWatcher:Qe,goal(r,o){try{k==null||k.goal(r,o)}catch(a){}},componentGoal(r,o){try{k==null||k.componentGoal(r,o)}catch(a){}},identify(r,o){try{k==null||k.identify(r,o)}catch(a){}},grantConsent(){try{if(!k&&ue||k!=null&&k.released)wn=fe(e.apiKey),k=_t(W({apiKey:e.apiKey,consent:!0,preConsentBehavior:e.preConsentBehavior,debug:e.debug,persona:e.persona,internal:e.internal,ingestUrl:Zo(e)},bn?{sdk:bn}:{})),_n(Pt,k);else{let r=(k==null?void 0:k.gated)===!0;tr(e.apiKey),r&&(wn=fe(e.apiKey)),_n(Pt,k)}ue=!1,le==null||le()}catch(r){}Ve=!0;try{Wa()}catch(r){}},revokeConsent(){t(!0)},reapply:Dt,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:Se,matchCounts:vn(e),consent:!ue&&(e.consent!==!1||Ve)}}catch(a){return{apiKey:e.apiKey,persona:null,band:null,slots:{},matchCounts:{},consent:!1}}}};if(window.SentientSnippet=n,window.__sentientApi=n,e.consentFrom&&!pt&&!Sn)try{let r=Qe(e.consentFrom),o=!1,a=!1,s=()=>!!k&&!ue&&(k.gated===void 0?e.consent!==!1||Ve:!k.gated);pt=r.subscribe(()=>{try{let c=r.read();c!==null&&(a=!0);let i=c!=null?c:a?!1:null,l=s(),u=!l&&i!==!0&&r.refused();if(u&&!o&&(k!=null&&k.gated?k.destroy():lt(e.apiKey),fr(window,e.apiKey),rt=null,J=null),o=u,i===!0&&!l)n.grantConsent();else if(i===!1&&l){let p=r.refused();t(p),p&&(o=!0)}}catch(c){}})}catch(r){}for(let r of Jo.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 zo(){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,identify:n,grantConsent:n,revokeConsent:n,reapply:n,consentWatcher:Qe,getState:()=>({apiKey:"",persona:null,band:null,slots:{},matchCounts:{},consent:!1})},Jo.length=0}catch(t){}}function za(){try{let e=window.Shopify;return typeof(e==null?void 0:e.shop)=="string"&&e.shop!==""}catch(e){return!1}}async function ii(){var e,t;try{let n=sn(window.sentient);if(!n){zo();return}ee=n,pt==null||pt(),pt=null,!n.consentFrom&&n.consent===void 0&&za()&&(n.consentFrom="shopify"),ho(n.consentSrc),en(n.nonce),Sn=!1,Ae=!1,le=null,tt=null,Se={},be=null,It(null),Ot(null),Ve=!1,ue=!1,Pt=null,Be=null,Ce=[],nt=null,rt=null,ve==null||ve(),oe==null||oe(),oe=null,Lt++,Rt=null;let r=jo("sentient_editor_code"),o=r?null:Ko();if(r||o){Ha(n,o,r),Sn=!0,hr(n),$e(n,"editor mode");return}if(typeof window!="undefined"&&/[?&]sentient_(preview|persona|context)=[^&]/.test(window.location.search)&&await Va(n))return;if(n.consentFrom&&n.consent===void 0)try{n.consent=Qe(n.consentFrom).read()===!0}catch(f){n.consent=!1}n.consent!==!1&&n.sectionCapture!==!1&&!Xe()&&Ze("engagement.global.js","__sentientEngagement");let a=(e=n.registry)!=null?e:Object.keys(n.slots).length===0;n.registry===void 0&&!a&&$e(n,"slots declared without registry: true, so dashboard-published components are not applied");let s=a?Ga(n):null,c=ja();try{(t=c==null?void 0:c.stop)==null||t.call(c)}catch(f){}let i=n.consent!==!1&&!Xe()?st(n.apiKey):null,l=[];if(i){J={persona:i.persona,band:i.band},Se=i.slots,i.slotConfig&&(be=i.slotConfig),i.palette&&It(i.palette),i.vocabulary&&Ot(i.vocabulary),Nt(document,W({contentAndOps:!1},c?{onAttr:(g,A)=>l.push([g,A])}:{})),i.layoutOrder&&(tt=i.layoutOrder,gr(tt,document));let f=St(i.stage,n.stageAttributes);f&&(tn(f),l.push([document.documentElement,"data-sentient-stage"]))}c&&Ka(c,l,document);let u=_t(W({apiKey:n.apiKey,consent:n.consent,preConsentBehavior:n.preConsentBehavior,debug:n.debug,persona:n.persona,userId:n.userId,userHash:n.userHash,internal:n.internal,stageAttributes:n.stageAttributes,ingestUrl:Zo(n)},bn?{sdk:bn}:{}));k=u,wn=fe(n.apiKey),hr(n),oi();let p=Object.entries(n.slots).map(([f,g])=>({id:f,dims:g.dims})),v=qo,b={pp:c?c.v:0},S=[];if(s){let[f]=await Promise.all([Uo(s,Go),document.readyState==="loading"?new Promise(g=>document.addEventListener("DOMContentLoaded",g,{once:!0})):null]);Be=f,f&&(Ce=S=mr(f,document)[0]),$e(n,"registry scope",f&&S)}let w=(f=u)=>{let g=Array.from(Xo(document).keys());return f.decide(W(W(W(W({slots:p},v),b),g.length>=2?{sections:g}:{}),a?{slotsFrom:"registry",registrySlotIds:S,render:ei(S,document)}:{}))},K=Re(),j=u.gated===!0,_=!1,E=!1,O=!1,N=!1;le=(f=!1)=>{let g=k;!_||E||N||Ae||ue||!g||g.gated||!f&&!O||(O=!1,N=!0,K=nt=Re(),Be&&(Ce=S=mr(Be,document)[0]),w(g).then(A=>{N=!1,A&&!Ae&&!ue&&k===g?y(A):(A||(Ce=[]),!Ae&&(g.released||k!==g||ue)&&(O=!0))}).catch(()=>{N=!1}))};let M=w();M.then(()=>{_=!0},()=>{_=!0});let m=await Uo(M,Go),y=f=>{var I,F,Y,ne,_e;E=!0;let g=(k!=null?k:u).getPersona();g?J={persona:g.persona,band:g.band}:f.persona&&(J={persona:f.persona,band:"low"}),Se=f.slots,a?be=ti(f.slotConfig,S):f.slotConfig&&(be=f.slotConfig),f.palette&&It(f.palette),f.vocabulary&&Ot(f.vocabulary),tt=(I=f.layoutOrder)!=null?I:tt;let A=()=>{var te;let C=[],z=Nt(document,{onApplied:(Ie,ge,Z)=>C.push({slotId:Ie,arm:ge,el:Z})});a||ri(n,z),gr(tt,document);try{(te=c==null?void 0:c.reveal)==null||te.call(c)}catch(Ie){}if(Ae=!0,ot())try{re==null||re(),re=mn(k,n.apiKey,C)}catch(Ie){}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A,{once:!0}):A(),Pt=(F=f.goals)!=null?F:null,(n.consent!==!1||Ve)&&!ue&&_n(f.goals,k),yn=(Y=f.sectionMap)!=null?Y:null,ot()&&yr(),$e(n,"applied",{persona:J,slots:Se,matches:vn(n)}),!ue&&(Yo(n.apiKey)&&Je(n.apiKey,rt=W(W(W(W({v:1,persona:(ne=J==null?void 0:J.persona)!=null?ne:f.persona,band:(_e=J==null?void 0:J.band)!=null?_e:"low",slots:f.slots,layoutOrder:f.layoutOrder,savedAt:Date.now()},be?{slotConfig:be}:{}),f.palette?{palette:f.palette}:{}),f.vocabulary?{vocabulary:f.vocabulary}:{}),(C=>C?{stage:C}:{})(St(f.stage,n.stageAttributes)))),nt=null,ni())};if(!m){$e(n,"decide timeout/null \u2014 snapshot state stands",vn(n)),M.then(f=>{if(!f){if(Ae)return;Ce=[],u.released===!0||k!==u||ue||j&&Re()!==K?(O=!0,le==null||le()):nt=K;return}if(!(!f||Ae||ue)){if(k!==u){O=!0,le==null||le();return}y(f),$e(n,"late decide applied",vn(n))}}).catch(()=>{});return}if(ue||k!==u){O=!0,le==null||le();return}y(m)}catch(n){zo()}}if(typeof window!="undefined"&&window.sentient){let e=window;if(!e.__sentientInitialized)e.__sentientInitialized=!0,Promise.resolve().then(()=>{ii()});else{let t=window.__sentientApi;t&&Promise.resolve().then(()=>{window.SentientSnippet=t})}}return mi(qa);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentientui/snippet",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.4",
|
|
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.
|
|
44
|
+
"@sentientui/core": "0.44.1"
|
|
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",
|