@syntrologie/runtime-sdk 2.7.0 → 2.8.0-canary.10

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,33 +1,33 @@
1
- var SyntrologieSDK=(()=>{var KE=Object.create;var rl=Object.defineProperty;var QE=Object.getOwnPropertyDescriptor;var JE=Object.getOwnPropertyNames;var eT=Object.getPrototypeOf,tT=Object.prototype.hasOwnProperty;var xS=t=>{throw TypeError(t)};var aT=(t,e,a)=>e in t?rl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var tr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bS=(t,e)=>{for(var a in e)rl(t,a,{get:e[a],enumerable:!0})},SS=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of JE(e))!tT.call(t,n)&&n!==a&&rl(t,n,{get:()=>e[n],enumerable:!(r=QE(e,n))||r.enumerable});return t};var K=(t,e,a)=>(a=t!=null?KE(eT(t)):{},SS(e||!t||!t.__esModule?rl(a,"default",{value:t,enumerable:!0}):a,t)),rT=t=>SS(rl({},"__esModule",{value:!0}),t);var j=(t,e,a)=>aT(t,typeof e!="symbol"?e+"":e,a),CS=(t,e,a)=>e.has(t)||xS("Cannot "+a);var me=(t,e,a)=>(CS(t,e,"read from private field"),a?a.call(t):e.get(t)),pn=(t,e,a)=>e.has(t)?xS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),ar=(t,e,a,r)=>(CS(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var DS=tr(oe=>{"use strict";var Vh=Symbol.for("react.transitional.element"),nT=Symbol.for("react.portal"),oT=Symbol.for("react.fragment"),iT=Symbol.for("react.strict_mode"),sT=Symbol.for("react.profiler"),lT=Symbol.for("react.consumer"),uT=Symbol.for("react.context"),cT=Symbol.for("react.forward_ref"),dT=Symbol.for("react.suspense"),fT=Symbol.for("react.memo"),AS=Symbol.for("react.lazy"),pT=Symbol.for("react.activity"),_S=Symbol.iterator;function hT(t){return t===null||typeof t!="object"?null:(t=_S&&t[_S]||t["@@iterator"],typeof t=="function"?t:null)}var kS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ES=Object.assign,TS={};function mi(t,e,a){this.props=t,this.context=e,this.refs=TS,this.updater=a||kS}mi.prototype.isReactComponent={};mi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};mi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function RS(){}RS.prototype=mi.prototype;function $h(t,e,a){this.props=t,this.context=e,this.refs=TS,this.updater=a||kS}var jh=$h.prototype=new RS;jh.constructor=$h;ES(jh,mi.prototype);jh.isPureReactComponent=!0;var wS=Array.isArray;function zh(){}var Be={H:null,A:null,T:null,S:null},MS=Object.prototype.hasOwnProperty;function Gh(t,e,a){var r=a.ref;return{$$typeof:Vh,type:t,key:e,ref:r!==void 0?r:null,props:a}}function mT(t,e){return Gh(t.type,e,t.props)}function Wh(t){return typeof t=="object"&&t!==null&&t.$$typeof===Vh}function gT(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var LS=/\/+/g;function qh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?gT(""+t.key):e.toString(36)}function vT(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(zh,zh):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function hi(t,e,a,r,n){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case Vh:case nT:i=!0;break;case AS:return i=t._init,hi(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+qh(t,0):r,wS(n)?(a="",i!=null&&(a=i.replace(LS,"$&/")+"/"),hi(n,e,a,"",function(u){return u})):n!=null&&(Wh(n)&&(n=mT(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(LS,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(wS(t))for(var l=0;l<t.length;l++)r=t[l],o=s+qh(r,l),i+=hi(r,e,a,o,n);else if(l=hT(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+qh(r,l++),i+=hi(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return hi(vT(t),e,a,r,n);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return i}function wc(t,e,a){if(t==null)return t;var r=[],n=0;return hi(t,r,"","",function(o){return e.call(a,o,n++)}),r}function yT(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(a){(t._status===0||t._status===-1)&&(t._status=1,t._result=a)},function(a){(t._status===0||t._status===-1)&&(t._status=2,t._result=a)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var IS=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},xT={map:wc,forEach:function(t,e,a){wc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return wc(t,function(){e++}),e},toArray:function(t){return wc(t,function(e){return e})||[]},only:function(t){if(!Wh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};oe.Activity=pT;oe.Children=xT;oe.Component=mi;oe.Fragment=oT;oe.Profiler=sT;oe.PureComponent=$h;oe.StrictMode=iT;oe.Suspense=dT;oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Be;oe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Be.H.useMemoCache(t)}};oe.cache=function(t){return function(){return t.apply(null,arguments)}};oe.cacheSignal=function(){return null};oe.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=ES({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!MS.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(r[o]=e[o]);var o=arguments.length-2;if(o===1)r.children=a;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];r.children=i}return Gh(t.type,n,r)};oe.createContext=function(t){return t={$$typeof:uT,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:lT,_context:t},t};oe.createElement=function(t,e,a){var r,n={},o=null;if(e!=null)for(r in e.key!==void 0&&(o=""+e.key),e)MS.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=e[r]);var i=arguments.length-2;if(i===1)n.children=a;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];n.children=s}if(t&&t.defaultProps)for(r in i=t.defaultProps,i)n[r]===void 0&&(n[r]=i[r]);return Gh(t,o,n)};oe.createRef=function(){return{current:null}};oe.forwardRef=function(t){return{$$typeof:cT,render:t}};oe.isValidElement=Wh;oe.lazy=function(t){return{$$typeof:AS,_payload:{_status:-1,_result:t},_init:yT}};oe.memo=function(t,e){return{$$typeof:fT,type:t,compare:e===void 0?null:e}};oe.startTransition=function(t){var e=Be.T,a={};Be.T=a;try{var r=t(),n=Be.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(zh,IS)}catch(o){IS(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Be.T=e}};oe.unstable_useCacheRefresh=function(){return Be.H.useCacheRefresh()};oe.use=function(t){return Be.H.use(t)};oe.useActionState=function(t,e,a){return Be.H.useActionState(t,e,a)};oe.useCallback=function(t,e){return Be.H.useCallback(t,e)};oe.useContext=function(t){return Be.H.useContext(t)};oe.useDebugValue=function(){};oe.useDeferredValue=function(t,e){return Be.H.useDeferredValue(t,e)};oe.useEffect=function(t,e){return Be.H.useEffect(t,e)};oe.useEffectEvent=function(t){return Be.H.useEffectEvent(t)};oe.useId=function(){return Be.H.useId()};oe.useImperativeHandle=function(t,e,a){return Be.H.useImperativeHandle(t,e,a)};oe.useInsertionEffect=function(t,e){return Be.H.useInsertionEffect(t,e)};oe.useLayoutEffect=function(t,e){return Be.H.useLayoutEffect(t,e)};oe.useMemo=function(t,e){return Be.H.useMemo(t,e)};oe.useOptimistic=function(t,e){return Be.H.useOptimistic(t,e)};oe.useReducer=function(t,e,a){return Be.H.useReducer(t,e,a)};oe.useRef=function(t){return Be.H.useRef(t)};oe.useState=function(t){return Be.H.useState(t)};oe.useSyncExternalStore=function(t,e,a){return Be.H.useSyncExternalStore(t,e,a)};oe.useTransition=function(){return Be.H.useTransition()};oe.version="19.2.4"});var We=tr((vH,OS)=>{"use strict";OS.exports=DS()});var FS=tr(Ot=>{"use strict";var bT=We();function BS(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function hn(){}var Dt={d:{f:hn,r:function(){throw Error(BS(522))},D:hn,C:hn,L:hn,m:hn,X:hn,S:hn,M:hn},p:0,findDOMNode:null},ST=Symbol.for("react.portal");function CT(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ST,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var nl=bT.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Lc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Ot.createPortal=function(t,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(BS(299));return CT(t,e,null,a)};Ot.flushSync=function(t){var e=nl.T,a=Dt.p;try{if(nl.T=null,Dt.p=2,t)return t()}finally{nl.T=e,Dt.p=a,Dt.d.f()}};Ot.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Dt.d.C(t,e))};Ot.prefetchDNS=function(t){typeof t=="string"&&Dt.d.D(t)};Ot.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=Lc(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Dt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Dt.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ot.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=Lc(e.as,e.crossOrigin);Dt.d.M(t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Dt.d.M(t)};Ot.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=Lc(a,e.crossOrigin);Dt.d.L(t,a,{crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Ot.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=Lc(e.as,e.crossOrigin);Dt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Dt.d.m(t)};Ot.requestFormReset=function(t){Dt.d.r(t)};Ot.unstable_batchedUpdates=function(t,e){return t(e)};Ot.useFormState=function(t,e,a){return nl.H.useFormState(t,e,a)};Ot.useFormStatus=function(){return nl.H.useHostTransitionStatus()};Ot.version="19.2.4"});var ol=tr((xH,PS)=>{"use strict";function NS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(NS)}catch(t){console.error(t)}}NS(),PS.exports=FS()});var ZS=tr(Ue=>{"use strict";function Kh(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<Ic(n,e))t[r]=e,t[a]=n,a=r;else break e}}function rr(t){return t.length===0?null:t[0]}function kc(t){if(t.length===0)return null;var e=t[0],a=t.pop();if(a!==e){t[0]=a;e:for(var r=0,n=t.length,o=n>>>1;r<o;){var i=2*(r+1)-1,s=t[i],l=i+1,u=t[l];if(0>Ic(s,a))l<n&&0>Ic(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>Ic(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function Ic(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}Ue.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(HS=performance,Ue.unstable_now=function(){return HS.now()}):(Zh=Date,US=Zh.now(),Ue.unstable_now=function(){return Zh.now()-US});var HS,Zh,US,Sr=[],mn=[],_T=1,xa=null,kt=3,Qh=!1,il=!1,sl=!1,Jh=!1,VS=typeof setTimeout=="function"?setTimeout:null,$S=typeof clearTimeout=="function"?clearTimeout:null,qS=typeof setImmediate<"u"?setImmediate:null;function Ac(t){for(var e=rr(mn);e!==null;){if(e.callback===null)kc(mn);else if(e.startTime<=t)kc(mn),e.sortIndex=e.expirationTime,Kh(Sr,e);else break;e=rr(mn)}}function em(t){if(sl=!1,Ac(t),!il)if(rr(Sr)!==null)il=!0,vi||(vi=!0,gi());else{var e=rr(mn);e!==null&&tm(em,e.startTime-t)}}var vi=!1,ll=-1,jS=5,GS=-1;function WS(){return Jh?!0:!(Ue.unstable_now()-GS<jS)}function Xh(){if(Jh=!1,vi){var t=Ue.unstable_now();GS=t;var e=!0;try{e:{il=!1,sl&&(sl=!1,$S(ll),ll=-1),Qh=!0;var a=kt;try{t:{for(Ac(t),xa=rr(Sr);xa!==null&&!(xa.expirationTime>t&&WS());){var r=xa.callback;if(typeof r=="function"){xa.callback=null,kt=xa.priorityLevel;var n=r(xa.expirationTime<=t);if(t=Ue.unstable_now(),typeof n=="function"){xa.callback=n,Ac(t),e=!0;break t}xa===rr(Sr)&&kc(Sr),Ac(t)}else kc(Sr);xa=rr(Sr)}if(xa!==null)e=!0;else{var o=rr(mn);o!==null&&tm(em,o.startTime-t),e=!1}}break e}finally{xa=null,kt=a,Qh=!1}e=void 0}}finally{e?gi():vi=!1}}}var gi;typeof qS=="function"?gi=function(){qS(Xh)}:typeof MessageChannel<"u"?(Yh=new MessageChannel,zS=Yh.port2,Yh.port1.onmessage=Xh,gi=function(){zS.postMessage(null)}):gi=function(){VS(Xh,0)};var Yh,zS;function tm(t,e){ll=VS(function(){t(Ue.unstable_now())},e)}Ue.unstable_IdlePriority=5;Ue.unstable_ImmediatePriority=1;Ue.unstable_LowPriority=4;Ue.unstable_NormalPriority=3;Ue.unstable_Profiling=null;Ue.unstable_UserBlockingPriority=2;Ue.unstable_cancelCallback=function(t){t.callback=null};Ue.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):jS=0<t?Math.floor(1e3/t):5};Ue.unstable_getCurrentPriorityLevel=function(){return kt};Ue.unstable_next=function(t){switch(kt){case 1:case 2:case 3:var e=3;break;default:e=kt}var a=kt;kt=e;try{return t()}finally{kt=a}};Ue.unstable_requestPaint=function(){Jh=!0};Ue.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=kt;kt=t;try{return e()}finally{kt=a}};Ue.unstable_scheduleCallback=function(t,e,a){var r=Ue.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,t){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,t={id:_T++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,Kh(mn,t),rr(Sr)===null&&t===rr(mn)&&(sl?($S(ll),ll=-1):sl=!0,tm(em,a-r))):(t.sortIndex=n,Kh(Sr,t),il||Qh||(il=!0,vi||(vi=!0,gi()))),t};Ue.unstable_shouldYield=WS;Ue.unstable_wrapCallback=function(t){var e=kt;return function(){var a=kt;kt=e;try{return t.apply(this,arguments)}finally{kt=a}}}});var YS=tr((SH,XS)=>{"use strict";XS.exports=ZS()});var lL=tr(Jd=>{"use strict";var it=YS(),CC=We(),wT=ol();function R(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function _C(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Zl(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function wC(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function LC(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function KS(t){if(Zl(t)!==t)throw Error(R(188))}function LT(t){var e=t.alternate;if(!e){if(e=Zl(t),e===null)throw Error(R(188));return e!==t?null:t}for(var a=t,r=e;;){var n=a.return;if(n===null)break;var o=n.alternate;if(o===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===a)return KS(n),t;if(o===r)return KS(n),e;o=o.sibling}throw Error(R(188))}if(a.return!==r.return)a=n,r=o;else{for(var i=!1,s=n.child;s;){if(s===a){i=!0,a=n,r=o;break}if(s===r){i=!0,r=n,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,r=n;break}if(s===r){i=!0,r=o,a=n;break}s=s.sibling}if(!i)throw Error(R(189))}}if(a.alternate!==r)throw Error(R(190))}if(a.tag!==3)throw Error(R(188));return a.stateNode.current===a?t:e}function IC(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=IC(t),e!==null)return e;t=t.sibling}return null}var Pe=Object.assign,IT=Symbol.for("react.element"),Ec=Symbol.for("react.transitional.element"),gl=Symbol.for("react.portal"),_i=Symbol.for("react.fragment"),AC=Symbol.for("react.strict_mode"),Bm=Symbol.for("react.profiler"),kC=Symbol.for("react.consumer"),Er=Symbol.for("react.context"),Tg=Symbol.for("react.forward_ref"),Fm=Symbol.for("react.suspense"),Nm=Symbol.for("react.suspense_list"),Rg=Symbol.for("react.memo"),gn=Symbol.for("react.lazy"),Pm=Symbol.for("react.activity"),AT=Symbol.for("react.memo_cache_sentinel"),QS=Symbol.iterator;function ul(t){return t===null||typeof t!="object"?null:(t=QS&&t[QS]||t["@@iterator"],typeof t=="function"?t:null)}var kT=Symbol.for("react.client.reference");function Hm(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===kT?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _i:return"Fragment";case Bm:return"Profiler";case AC:return"StrictMode";case Fm:return"Suspense";case Nm:return"SuspenseList";case Pm:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case gl:return"Portal";case Er:return t.displayName||"Context";case kC:return(t._context.displayName||"Context")+".Consumer";case Tg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Rg:return e=t.displayName||null,e!==null?e:Hm(t.type)||"Memo";case gn:e=t._payload,t=t._init;try{return Hm(t(e))}catch{}}return null}var vl=Array.isArray,ee=CC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=wT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xo={pending:!1,data:null,method:null,action:null},Um=[],wi=-1;function lr(t){return{current:t}}function ht(t){0>wi||(t.current=Um[wi],Um[wi]=null,wi--)}function Re(t,e){wi++,Um[wi]=t.current,t.current=e}var sr=lr(null),Ol=lr(null),An=lr(null),ld=lr(null);function ud(t,e){switch(Re(An,e),Re(Ol,t),Re(sr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?oC(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=oC(e),t=Zw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(sr),Re(sr,t)}function zi(){ht(sr),ht(Ol),ht(An)}function qm(t){t.memoizedState!==null&&Re(ld,t);var e=sr.current,a=Zw(e,t.type);e!==a&&(Re(Ol,t),Re(sr,a))}function cd(t){Ol.current===t&&(ht(sr),ht(Ol)),ld.current===t&&(ht(ld),jl._currentValue=xo)}var am,JS;function mo(t){if(am===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);am=e&&e[1]||"",JS=-1<a.stack.indexOf(`
1
+ var SyntrologieSDK=(()=>{var lR=Object.create;var hl=Object.defineProperty;var uR=Object.getOwnPropertyDescriptor;var cR=Object.getOwnPropertyNames;var dR=Object.getPrototypeOf,fR=Object.prototype.hasOwnProperty;var cS=t=>{throw TypeError(t)};var pR=(t,e,a)=>e in t?hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var rn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dS=(t,e)=>{for(var a in e)hl(t,a,{get:e[a],enumerable:!0})},fS=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cR(e))!fR.call(t,r)&&r!==a&&hl(t,r,{get:()=>e[r],enumerable:!(n=uR(e,r))||n.enumerable});return t};var Y=(t,e,a)=>(a=t!=null?lR(dR(t)):{},fS(e||!t||!t.__esModule?hl(a,"default",{value:t,enumerable:!0}):a,t)),hR=t=>fS(hl({},"__esModule",{value:!0}),t);var B=(t,e,a)=>pR(t,typeof e!="symbol"?e+"":e,a),pS=(t,e,a)=>e.has(t)||cS("Cannot "+a);var ge=(t,e,a)=>(pS(t,e,"read from private field"),a?a.call(t):e.get(t)),xr=(t,e,a)=>e.has(t)?cS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),on=(t,e,a,n)=>(pS(t,e,"write to private field"),n?n.call(t,a):e.set(t,a),a);var wS=rn(oe=>{"use strict";var bm=Symbol.for("react.transitional.element"),mR=Symbol.for("react.portal"),gR=Symbol.for("react.fragment"),vR=Symbol.for("react.strict_mode"),yR=Symbol.for("react.profiler"),xR=Symbol.for("react.consumer"),bR=Symbol.for("react.context"),SR=Symbol.for("react.forward_ref"),CR=Symbol.for("react.suspense"),_R=Symbol.for("react.memo"),yS=Symbol.for("react.lazy"),wR=Symbol.for("react.activity"),hS=Symbol.iterator;function LR(t){return t===null||typeof t!="object"?null:(t=hS&&t[hS]||t["@@iterator"],typeof t=="function"?t:null)}var xS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bS=Object.assign,SS={};function Li(t,e,a){this.props=t,this.context=e,this.refs=SS,this.updater=a||xS}Li.prototype.isReactComponent={};Li.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Li.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function CS(){}CS.prototype=Li.prototype;function Sm(t,e,a){this.props=t,this.context=e,this.refs=SS,this.updater=a||xS}var Cm=Sm.prototype=new CS;Cm.constructor=Sm;bS(Cm,Li.prototype);Cm.isPureReactComponent=!0;var mS=Array.isArray;function xm(){}var Ne={H:null,A:null,T:null,S:null},_S=Object.prototype.hasOwnProperty;function _m(t,e,a){var n=a.ref;return{$$typeof:bm,type:t,key:e,ref:n!==void 0?n:null,props:a}}function kR(t,e){return _m(t.type,e,t.props)}function wm(t){return typeof t=="object"&&t!==null&&t.$$typeof===bm}function IR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var gS=/\/+/g;function ym(t,e){return typeof t=="object"&&t!==null&&t.key!=null?IR(""+t.key):e.toString(36)}function AR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(xm,xm):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function wi(t,e,a,n,r){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case bm:case mR:i=!0;break;case yS:return i=t._init,wi(i(t._payload),e,a,n,r)}}if(i)return r=r(t),i=n===""?"."+ym(t,0):n,mS(r)?(a="",i!=null&&(a=i.replace(gS,"$&/")+"/"),wi(r,e,a,"",function(u){return u})):r!=null&&(wm(r)&&(r=kR(r,a+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(gS,"$&/")+"/")+i)),e.push(r)),1;i=0;var s=n===""?".":n+":";if(mS(t))for(var l=0;l<t.length;l++)n=t[l],o=s+ym(n,l),i+=wi(n,e,a,o,r);else if(l=LR(t),typeof l=="function")for(t=l.call(t),l=0;!(n=t.next()).done;)n=n.value,o=s+ym(n,l++),i+=wi(n,e,a,o,r);else if(o==="object"){if(typeof t.then=="function")return wi(AR(t),e,a,n,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return i}function Zc(t,e,a){if(t==null)return t;var n=[],r=0;return wi(t,n,"","",function(o){return e.call(a,o,r++)}),n}function ER(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(a){(t._status===0||t._status===-1)&&(t._status=1,t._result=a)},function(a){(t._status===0||t._status===-1)&&(t._status=2,t._result=a)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var vS=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},TR={map:Zc,forEach:function(t,e,a){Zc(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return Zc(t,function(){e++}),e},toArray:function(t){return Zc(t,function(e){return e})||[]},only:function(t){if(!wm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};oe.Activity=wR;oe.Children=TR;oe.Component=Li;oe.Fragment=gR;oe.Profiler=yR;oe.PureComponent=Sm;oe.StrictMode=vR;oe.Suspense=CR;oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ne;oe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Ne.H.useMemoCache(t)}};oe.cache=function(t){return function(){return t.apply(null,arguments)}};oe.cacheSignal=function(){return null};oe.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var n=bS({},t.props),r=t.key;if(e!=null)for(o in e.key!==void 0&&(r=""+e.key),e)!_S.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(n[o]=e[o]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];n.children=i}return _m(t.type,r,n)};oe.createContext=function(t){return t={$$typeof:bR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:xR,_context:t},t};oe.createElement=function(t,e,a){var n,r={},o=null;if(e!=null)for(n in e.key!==void 0&&(o=""+e.key),e)_S.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=e[n]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];r.children=s}if(t&&t.defaultProps)for(n in i=t.defaultProps,i)r[n]===void 0&&(r[n]=i[n]);return _m(t,o,r)};oe.createRef=function(){return{current:null}};oe.forwardRef=function(t){return{$$typeof:SR,render:t}};oe.isValidElement=wm;oe.lazy=function(t){return{$$typeof:yS,_payload:{_status:-1,_result:t},_init:ER}};oe.memo=function(t,e){return{$$typeof:_R,type:t,compare:e===void 0?null:e}};oe.startTransition=function(t){var e=Ne.T,a={};Ne.T=a;try{var n=t(),r=Ne.S;r!==null&&r(a,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(xm,vS)}catch(o){vS(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Ne.T=e}};oe.unstable_useCacheRefresh=function(){return Ne.H.useCacheRefresh()};oe.use=function(t){return Ne.H.use(t)};oe.useActionState=function(t,e,a){return Ne.H.useActionState(t,e,a)};oe.useCallback=function(t,e){return Ne.H.useCallback(t,e)};oe.useContext=function(t){return Ne.H.useContext(t)};oe.useDebugValue=function(){};oe.useDeferredValue=function(t,e){return Ne.H.useDeferredValue(t,e)};oe.useEffect=function(t,e){return Ne.H.useEffect(t,e)};oe.useEffectEvent=function(t){return Ne.H.useEffectEvent(t)};oe.useId=function(){return Ne.H.useId()};oe.useImperativeHandle=function(t,e,a){return Ne.H.useImperativeHandle(t,e,a)};oe.useInsertionEffect=function(t,e){return Ne.H.useInsertionEffect(t,e)};oe.useLayoutEffect=function(t,e){return Ne.H.useLayoutEffect(t,e)};oe.useMemo=function(t,e){return Ne.H.useMemo(t,e)};oe.useOptimistic=function(t,e){return Ne.H.useOptimistic(t,e)};oe.useReducer=function(t,e,a){return Ne.H.useReducer(t,e,a)};oe.useRef=function(t){return Ne.H.useRef(t)};oe.useState=function(t){return Ne.H.useState(t)};oe.useSyncExternalStore=function(t,e,a){return Ne.H.useSyncExternalStore(t,e,a)};oe.useTransition=function(){return Ne.H.useTransition()};oe.version="19.2.4"});var Ye=rn((wH,LS)=>{"use strict";LS.exports=wS()});var IS=rn(Pt=>{"use strict";var RR=Ye();function kS(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function br(){}var Bt={d:{f:br,r:function(){throw Error(kS(522))},D:br,C:br,L:br,m:br,X:br,S:br,M:br},p:0,findDOMNode:null},MR=Symbol.for("react.portal");function DR(t,e,a){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:MR,key:n==null?null:""+n,children:t,containerInfo:e,implementation:a}}var ml=RR.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Wc(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Pt.createPortal=function(t,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(kS(299));return DR(t,e,null,a)};Pt.flushSync=function(t){var e=ml.T,a=Bt.p;try{if(ml.T=null,Bt.p=2,t)return t()}finally{ml.T=e,Bt.p=a,Bt.d.f()}};Pt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Bt.d.C(t,e))};Pt.prefetchDNS=function(t){typeof t=="string"&&Bt.d.D(t)};Pt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,n=Wc(a,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Bt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:o}):a==="script"&&Bt.d.X(t,{crossOrigin:n,integrity:r,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Pt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=Wc(e.as,e.crossOrigin);Bt.d.M(t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Bt.d.M(t)};Pt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,n=Wc(a,e.crossOrigin);Bt.d.L(t,a,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Pt.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=Wc(e.as,e.crossOrigin);Bt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Bt.d.m(t)};Pt.requestFormReset=function(t){Bt.d.r(t)};Pt.unstable_batchedUpdates=function(t,e){return t(e)};Pt.useFormState=function(t,e,a){return ml.H.useFormState(t,e,a)};Pt.useFormStatus=function(){return ml.H.useHostTransitionStatus()};Pt.version="19.2.4"});var gl=rn((kH,ES)=>{"use strict";function AS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AS)}catch(t){console.error(t)}}AS(),ES.exports=IS()});var HS=rn($e=>{"use strict";function Am(t,e){var a=t.length;t.push(e);e:for(;0<a;){var n=a-1>>>1,r=t[n];if(0<Xc(r,e))t[n]=e,t[a]=r,a=n;else break e}}function sn(t){return t.length===0?null:t[0]}function Kc(t){if(t.length===0)return null;var e=t[0],a=t.pop();if(a!==e){t[0]=a;e:for(var n=0,r=t.length,o=r>>>1;n<o;){var i=2*(n+1)-1,s=t[i],l=i+1,u=t[l];if(0>Xc(s,a))l<r&&0>Xc(u,s)?(t[n]=u,t[l]=a,n=l):(t[n]=s,t[i]=a,n=i);else if(l<r&&0>Xc(u,a))t[n]=u,t[l]=a,n=l;else break e}}return e}function Xc(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}$e.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(TS=performance,$e.unstable_now=function(){return TS.now()}):(Lm=Date,RS=Lm.now(),$e.unstable_now=function(){return Lm.now()-RS});var TS,Lm,RS,kn=[],Sr=[],OR=1,_a=null,Rt=3,Em=!1,vl=!1,yl=!1,Tm=!1,OS=typeof setTimeout=="function"?setTimeout:null,BS=typeof clearTimeout=="function"?clearTimeout:null,MS=typeof setImmediate<"u"?setImmediate:null;function Yc(t){for(var e=sn(Sr);e!==null;){if(e.callback===null)Kc(Sr);else if(e.startTime<=t)Kc(Sr),e.sortIndex=e.expirationTime,Am(kn,e);else break;e=sn(Sr)}}function Rm(t){if(yl=!1,Yc(t),!vl)if(sn(kn)!==null)vl=!0,Ii||(Ii=!0,ki());else{var e=sn(Sr);e!==null&&Mm(Rm,e.startTime-t)}}var Ii=!1,xl=-1,PS=5,FS=-1;function NS(){return Tm?!0:!($e.unstable_now()-FS<PS)}function km(){if(Tm=!1,Ii){var t=$e.unstable_now();FS=t;var e=!0;try{e:{vl=!1,yl&&(yl=!1,BS(xl),xl=-1),Em=!0;var a=Rt;try{t:{for(Yc(t),_a=sn(kn);_a!==null&&!(_a.expirationTime>t&&NS());){var n=_a.callback;if(typeof n=="function"){_a.callback=null,Rt=_a.priorityLevel;var r=n(_a.expirationTime<=t);if(t=$e.unstable_now(),typeof r=="function"){_a.callback=r,Yc(t),e=!0;break t}_a===sn(kn)&&Kc(kn),Yc(t)}else Kc(kn);_a=sn(kn)}if(_a!==null)e=!0;else{var o=sn(Sr);o!==null&&Mm(Rm,o.startTime-t),e=!1}}break e}finally{_a=null,Rt=a,Em=!1}e=void 0}}finally{e?ki():Ii=!1}}}var ki;typeof MS=="function"?ki=function(){MS(km)}:typeof MessageChannel<"u"?(Im=new MessageChannel,DS=Im.port2,Im.port1.onmessage=km,ki=function(){DS.postMessage(null)}):ki=function(){OS(km,0)};var Im,DS;function Mm(t,e){xl=OS(function(){t($e.unstable_now())},e)}$e.unstable_IdlePriority=5;$e.unstable_ImmediatePriority=1;$e.unstable_LowPriority=4;$e.unstable_NormalPriority=3;$e.unstable_Profiling=null;$e.unstable_UserBlockingPriority=2;$e.unstable_cancelCallback=function(t){t.callback=null};$e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):PS=0<t?Math.floor(1e3/t):5};$e.unstable_getCurrentPriorityLevel=function(){return Rt};$e.unstable_next=function(t){switch(Rt){case 1:case 2:case 3:var e=3;break;default:e=Rt}var a=Rt;Rt=e;try{return t()}finally{Rt=a}};$e.unstable_requestPaint=function(){Tm=!0};$e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=Rt;Rt=t;try{return e()}finally{Rt=a}};$e.unstable_scheduleCallback=function(t,e,a){var n=$e.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?n+a:n):a=n,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=a+r,t={id:OR++,callback:e,priorityLevel:t,startTime:a,expirationTime:r,sortIndex:-1},a>n?(t.sortIndex=a,Am(Sr,t),sn(kn)===null&&t===sn(Sr)&&(yl?(BS(xl),xl=-1):yl=!0,Mm(Rm,a-n))):(t.sortIndex=r,Am(kn,t),vl||Em||(vl=!0,Ii||(Ii=!0,ki()))),t};$e.unstable_shouldYield=NS;$e.unstable_wrapCallback=function(t){var e=Rt;return function(){var a=Rt;Rt=e;try{return t.apply(this,arguments)}finally{Rt=a}}}});var zS=rn((AH,US)=>{"use strict";US.exports=HS()});var JL=rn(_f=>{"use strict";var ct=zS(),p_=Ye(),BR=gl();function R(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h_(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ou(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function m_(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function g_(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function qS(t){if(ou(t)!==t)throw Error(R(188))}function PR(t){var e=t.alternate;if(!e){if(e=ou(t),e===null)throw Error(R(188));return e!==t?null:t}for(var a=t,n=e;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return qS(r),t;if(o===n)return qS(r),e;o=o.sibling}throw Error(R(188))}if(a.return!==n.return)a=r,n=o;else{for(var i=!1,s=r.child;s;){if(s===a){i=!0,a=r,n=o;break}if(s===n){i=!0,n=r,a=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===a){i=!0,a=o,n=r;break}if(s===n){i=!0,n=o,a=r;break}s=s.sibling}if(!i)throw Error(R(189))}}if(a.alternate!==n)throw Error(R(190))}if(a.tag!==3)throw Error(R(188));return a.stateNode.current===a?t:e}function v_(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=v_(t),e!==null)return e;t=t.sibling}return null}var ze=Object.assign,FR=Symbol.for("react.element"),Qc=Symbol.for("react.transitional.element"),Il=Symbol.for("react.portal"),Di=Symbol.for("react.fragment"),y_=Symbol.for("react.strict_mode"),fg=Symbol.for("react.profiler"),x_=Symbol.for("react.consumer"),On=Symbol.for("react.context"),sv=Symbol.for("react.forward_ref"),pg=Symbol.for("react.suspense"),hg=Symbol.for("react.suspense_list"),lv=Symbol.for("react.memo"),Cr=Symbol.for("react.lazy"),mg=Symbol.for("react.activity"),NR=Symbol.for("react.memo_cache_sentinel"),$S=Symbol.iterator;function bl(t){return t===null||typeof t!="object"?null:(t=$S&&t[$S]||t["@@iterator"],typeof t=="function"?t:null)}var HR=Symbol.for("react.client.reference");function gg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===HR?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Di:return"Fragment";case fg:return"Profiler";case y_:return"StrictMode";case pg:return"Suspense";case hg:return"SuspenseList";case mg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Il:return"Portal";case On:return t.displayName||"Context";case x_:return(t._context.displayName||"Context")+".Consumer";case sv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lv:return e=t.displayName||null,e!==null?e:gg(t.type)||"Memo";case Cr:e=t._payload,t=t._init;try{return gg(t(e))}catch{}}return null}var Al=Array.isArray,ee=p_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be=BR.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Io={pending:!1,data:null,method:null,action:null},vg=[],Oi=-1;function fn(t){return{current:t}}function vt(t){0>Oi||(t.current=vg[Oi],vg[Oi]=null,Oi--)}function Be(t,e){Oi++,vg[Oi]=t.current,t.current=e}var dn=fn(null),jl=fn(null),Dr=fn(null),Rd=fn(null);function Md(t,e){switch(Be(Dr,e),Be(jl,t),Be(dn,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?YC(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=YC(e),t=HL(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}vt(dn),Be(dn,t)}function Qi(){vt(dn),vt(jl),vt(Dr)}function yg(t){t.memoizedState!==null&&Be(Rd,t);var e=dn.current,a=HL(e,t.type);e!==a&&(Be(jl,t),Be(dn,a))}function Dd(t){jl.current===t&&(vt(dn),vt(jl)),Rd.current===t&&(vt(Rd),au._currentValue=Io)}var Dm,VS;function _o(t){if(Dm===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);Dm=e&&e[1]||"",VS=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+am+t+JS}var rm=!1;function nm(t,e){if(!t||rm)return"";rm=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(g){var h=g}Reflect.construct(t,[],d)}else{try{d.call()}catch(g){h=g}t.call(d.prototype)}}else{try{throw Error()}catch(g){h=g}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(g){if(g&&h&&typeof g.stack=="string")return[g.stack,h.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
3
+ `+Dm+t+VS}var Om=!1;function Bm(t,e){if(!t||Om)return"";Om=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(h){var f=h}Reflect.construct(t,[],d)}else{try{d.call()}catch(h){f=h}t.call(d.prototype)}}else{try{throw Error()}catch(h){f=h}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(h){if(h&&f&&typeof h.stack=="string")return[h.stack,f.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=n.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
4
4
  `),u=s.split(`
5
- `);for(n=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;if(r===l.length||n===u.length)for(r=l.length-1,n=u.length-1;1<=r&&0<=n&&l[r]!==u[n];)n--;for(;1<=r&&0<=n;r--,n--)if(l[r]!==u[n]){if(r!==1||n!==1)do if(r--,n--,0>n||l[r]!==u[n]){var c=`
6
- `+l[r].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=r&&0<=n);break}}}finally{rm=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?mo(a):""}function ET(t,e){switch(t.tag){case 26:case 27:case 5:return mo(t.type);case 16:return mo("Lazy");case 13:return t.child!==e&&e!==null?mo("Suspense Fallback"):mo("Suspense");case 19:return mo("SuspenseList");case 0:case 15:return nm(t.type,!1);case 11:return nm(t.type.render,!1);case 1:return nm(t.type,!0);case 31:return mo("Activity");default:return""}}function e0(t){try{var e="",a=null;do e+=ET(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
7
- Error generating stack: `+r.message+`
8
- `+r.stack}}var zm=Object.prototype.hasOwnProperty,Mg=it.unstable_scheduleCallback,om=it.unstable_cancelCallback,TT=it.unstable_shouldYield,RT=it.unstable_requestPaint,ia=it.unstable_now,MT=it.unstable_getCurrentPriorityLevel,EC=it.unstable_ImmediatePriority,TC=it.unstable_UserBlockingPriority,dd=it.unstable_NormalPriority,DT=it.unstable_LowPriority,RC=it.unstable_IdlePriority,OT=it.log,BT=it.unstable_setDisableYieldValue,Xl=null,sa=null;function Cn(t){if(typeof OT=="function"&&BT(t),sa&&typeof sa.setStrictMode=="function")try{sa.setStrictMode(Xl,t)}catch{}}var la=Math.clz32?Math.clz32:PT,FT=Math.log,NT=Math.LN2;function PT(t){return t>>>=0,t===0?32:31-(FT(t)/NT|0)|0}var Tc=256,Rc=262144,Mc=4194304;function go(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Nd(t,e,a){var r=t.pendingLanes;if(r===0)return 0;var n=0,o=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~o,r!==0?n=go(r):(i&=s,i!==0?n=go(i):a||(a=s&~t,a!==0&&(n=go(a))))):(s=r&~o,s!==0?n=go(s):i!==0?n=go(i):a||(a=r&~t,a!==0&&(n=go(a)))),n===0?0:e!==0&&e!==n&&(e&o)===0&&(o=n&-n,a=e&-e,o>=a||o===32&&(a&4194048)!==0)?e:n}function Yl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function HT(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function MC(){var t=Mc;return Mc<<=1,(Mc&62914560)===0&&(Mc=4194304),t}function im(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Kl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function UT(t,e,a,r,n,o){var i=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(a=i&~a;0<a;){var c=31-la(a),d=1<<c;s[c]=0,l[c]=-1;var h=u[c];if(h!==null)for(u[c]=null,c=0;c<h.length;c++){var g=h[c];g!==null&&(g.lane&=-536870913)}a&=~d}r!==0&&DC(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function DC(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-la(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function OC(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-la(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function BC(t,e){var a=e&-e;return a=(a&42)!==0?1:Dg(a),(a&(t.suspendedLanes|e))!==0?0:a}function Dg(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Og(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function FC(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:oL(t.type))}function t0(t,e){var a=xe.p;try{return xe.p=t,e()}finally{xe.p=a}}var Un=Math.random().toString(36).slice(2),yt="__reactFiber$"+Un,Wt="__reactProps$"+Un,Ji="__reactContainer$"+Un,Vm="__reactEvents$"+Un,qT="__reactListeners$"+Un,zT="__reactHandles$"+Un,a0="__reactResources$"+Un,Ql="__reactMarker$"+Un;function Bg(t){delete t[yt],delete t[Wt],delete t[Vm],delete t[qT],delete t[zT]}function Li(t){var e=t[yt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[Ji]||a[yt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=cC(t);t!==null;){if(a=t[yt])return a;t=cC(t)}return e}t=a,a=t.parentNode}return null}function es(t){if(t=t[yt]||t[Ji]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function yl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(R(33))}function Bi(t){var e=t[a0];return e||(e=t[a0]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function pt(t){t[Ql]=!0}var NC=new Set,PC={};function Eo(t,e){Vi(t,e),Vi(t+"Capture",e)}function Vi(t,e){for(PC[t]=e,t=0;t<e.length;t++)NC.add(e[t])}var VT=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),r0={},n0={};function $T(t){return zm.call(n0,t)?!0:zm.call(r0,t)?!1:VT.test(t)?n0[t]=!0:(r0[t]=!0,!1)}function Wc(t,e,a){if($T(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var r=e.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function Dc(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function Cr(t,e,a,r){if(r===null)t.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+r)}}function Sa(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function HC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jT(t,e,a){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function $m(t){if(!t._valueTracker){var e=HC(t)?"checked":"value";t._valueTracker=jT(t,e,""+t[e])}}function UC(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=HC(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function fd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var GT=/[\n"\\]/g;function wa(t){return t.replace(GT,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function jm(t,e,a,r,n,o,i,s){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),e!=null?i==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Sa(e)):t.value!==""+Sa(e)&&(t.value=""+Sa(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?Gm(t,i,Sa(e)):a!=null?Gm(t,i,Sa(a)):r!=null&&t.removeAttribute("value"),n==null&&o!=null&&(t.defaultChecked=!!o),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Sa(s):t.removeAttribute("name")}function qC(t,e,a,r,n,o,i,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){$m(t);return}a=a!=null?""+Sa(a):"",e=e!=null?""+Sa(e):a,s||e===t.value||(t.value=e),t.defaultValue=e}r=r??n,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=s?t.checked:!!r,t.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),$m(t)}function Gm(t,e,a){e==="number"&&fd(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Fi(t,e,a,r){if(t=t.options,e){e={};for(var n=0;n<a.length;n++)e["$"+a[n]]=!0;for(a=0;a<t.length;a++)n=e.hasOwnProperty("$"+t[a].value),t[a].selected!==n&&(t[a].selected=n),n&&r&&(t[a].defaultSelected=!0)}else{for(a=""+Sa(a),e=null,n=0;n<t.length;n++){if(t[n].value===a){t[n].selected=!0,r&&(t[n].defaultSelected=!0);return}e!==null||t[n].disabled||(e=t[n])}e!==null&&(e.selected=!0)}}function zC(t,e,a){if(e!=null&&(e=""+Sa(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Sa(a):""}function VC(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(R(92));if(vl(r)){if(1<r.length)throw Error(R(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Sa(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),$m(t)}function $i(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var WT=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function o0(t,e,a){var r=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,a):typeof a!="number"||a===0||WT.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function $C(t,e,a){if(e!=null&&typeof e!="object")throw Error(R(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var n in e)r=e[n],e.hasOwnProperty(n)&&a[n]!==r&&o0(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&o0(t,o,e[o])}function Fg(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ZT=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),XT=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zc(t){return XT.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Tr(){}var Wm=null;function Ng(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ii=null,Ni=null;function i0(t){var e=es(t);if(e&&(t=e.stateNode)){var a=t[Wt]||null;e:switch(t=e.stateNode,e.type){case"input":if(jm(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[Wt]||null;if(!n)throw Error(R(90));jm(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(e=0;e<a.length;e++)r=a[e],r.form===t.form&&UC(r)}break e;case"textarea":zC(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Fi(t,!!a.multiple,e,!1)}}}var sm=!1;function jC(t,e,a){if(sm)return t(e,a);sm=!0;try{var r=t(e);return r}finally{if(sm=!1,(Ii!==null||Ni!==null)&&(Xd(),Ii&&(e=Ii,t=Ni,Ni=Ii=null,i0(e),t)))for(e=0;e<t.length;e++)i0(t[e])}}function Bl(t,e){var a=t.stateNode;if(a===null)return null;var r=a[Wt]||null;if(r===null)return null;a=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(R(231,e,typeof a));return a}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zm=!1;if(Br)try{yi={},Object.defineProperty(yi,"passive",{get:function(){Zm=!0}}),window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{Zm=!1}var yi,_n=null,Pg=null,Xc=null;function GC(){if(Xc)return Xc;var t,e=Pg,a=e.length,r,n="value"in _n?_n.value:_n.textContent,o=n.length;for(t=0;t<a&&e[t]===n[t];t++);var i=a-t;for(r=1;r<=i&&e[a-r]===n[o-r];r++);return Xc=n.slice(t,1<r?1-r:void 0)}function Yc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Oc(){return!0}function s0(){return!1}function Zt(t){function e(a,r,n,o,i){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(a=t[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Oc:s0,this.isPropagationStopped=s0,this}return Pe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),e}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pd=Zt(To),Jl=Pe({},To,{view:0,detail:0}),YT=Zt(Jl),lm,um,cl,Hd=Pe({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==cl&&(cl&&t.type==="mousemove"?(lm=t.screenX-cl.screenX,um=t.screenY-cl.screenY):um=lm=0,cl=t),lm)},movementY:function(t){return"movementY"in t?t.movementY:um}}),l0=Zt(Hd),KT=Pe({},Hd,{dataTransfer:0}),QT=Zt(KT),JT=Pe({},Jl,{relatedTarget:0}),cm=Zt(JT),eR=Pe({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),tR=Zt(eR),aR=Pe({},To,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),rR=Zt(aR),nR=Pe({},To,{data:0}),u0=Zt(nR),oR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},sR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=sR[t])?!!e[t]:!1}function Hg(){return lR}var uR=Pe({},Jl,{key:function(t){if(t.key){var e=oR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Yc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?iR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hg,charCode:function(t){return t.type==="keypress"?Yc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Yc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),cR=Zt(uR),dR=Pe({},Hd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),c0=Zt(dR),fR=Pe({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hg}),pR=Zt(fR),hR=Pe({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),mR=Zt(hR),gR=Pe({},Hd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),vR=Zt(gR),yR=Pe({},To,{newState:0,oldState:0}),xR=Zt(yR),bR=[9,13,27,32],Ug=Br&&"CompositionEvent"in window,Sl=null;Br&&"documentMode"in document&&(Sl=document.documentMode);var SR=Br&&"TextEvent"in window&&!Sl,WC=Br&&(!Ug||Sl&&8<Sl&&11>=Sl),d0=" ",f0=!1;function ZC(t,e){switch(t){case"keyup":return bR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ai=!1;function CR(t,e){switch(t){case"compositionend":return XC(e);case"keypress":return e.which!==32?null:(f0=!0,d0);case"textInput":return t=e.data,t===d0&&f0?null:t;default:return null}}function _R(t,e){if(Ai)return t==="compositionend"||!Ug&&ZC(t,e)?(t=GC(),Xc=Pg=_n=null,Ai=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return WC&&e.locale!=="ko"?null:e.data;default:return null}}var wR={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function p0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!wR[t.type]:e==="textarea"}function YC(t,e,a,r){Ii?Ni?Ni.push(r):Ni=[r]:Ii=r,e=Td(e,"onChange"),0<e.length&&(a=new Pd("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var Cl=null,Fl=null;function LR(t){jw(t,0)}function Ud(t){var e=yl(t);if(UC(e))return t}function h0(t,e){if(t==="change")return e}var KC=!1;Br&&(Br?(Fc="oninput"in document,Fc||(dm=document.createElement("div"),dm.setAttribute("oninput","return;"),Fc=typeof dm.oninput=="function"),Bc=Fc):Bc=!1,KC=Bc&&(!document.documentMode||9<document.documentMode));var Bc,Fc,dm;function m0(){Cl&&(Cl.detachEvent("onpropertychange",QC),Fl=Cl=null)}function QC(t){if(t.propertyName==="value"&&Ud(Fl)){var e=[];YC(e,Fl,t,Ng(t)),jC(LR,e)}}function IR(t,e,a){t==="focusin"?(m0(),Cl=e,Fl=a,Cl.attachEvent("onpropertychange",QC)):t==="focusout"&&m0()}function AR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ud(Fl)}function kR(t,e){if(t==="click")return Ud(e)}function ER(t,e){if(t==="input"||t==="change")return Ud(e)}function TR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ca=typeof Object.is=="function"?Object.is:TR;function Nl(t,e){if(ca(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),r=Object.keys(e);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!zm.call(e,n)||!ca(t[n],e[n]))return!1}return!0}function g0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function v0(t,e){var a=g0(t);t=0;for(var r;a;){if(a.nodeType===3){if(r=t+a.textContent.length,t<=e&&r>=e)return{node:a,offset:e-t};t=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=g0(a)}}function JC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?JC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function e_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=fd(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=fd(t.document)}return e}function qg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var RR=Br&&"documentMode"in document&&11>=document.documentMode,ki=null,Xm=null,_l=null,Ym=!1;function y0(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ym||ki==null||ki!==fd(r)||(r=ki,"selectionStart"in r&&qg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_l&&Nl(_l,r)||(_l=r,r=Td(Xm,"onSelect"),0<r.length&&(e=new Pd("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=ki)))}function ho(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var Ei={animationend:ho("Animation","AnimationEnd"),animationiteration:ho("Animation","AnimationIteration"),animationstart:ho("Animation","AnimationStart"),transitionrun:ho("Transition","TransitionRun"),transitionstart:ho("Transition","TransitionStart"),transitioncancel:ho("Transition","TransitionCancel"),transitionend:ho("Transition","TransitionEnd")},fm={},t_={};Br&&(t_=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function Ro(t){if(fm[t])return fm[t];if(!Ei[t])return t;var e=Ei[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in t_)return fm[t]=e[a];return t}var a_=Ro("animationend"),r_=Ro("animationiteration"),n_=Ro("animationstart"),MR=Ro("transitionrun"),DR=Ro("transitionstart"),OR=Ro("transitioncancel"),o_=Ro("transitionend"),i_=new Map,Km="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Km.push("scrollEnd");function za(t,e){i_.set(t,e),Eo(e,[t])}var pd=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ba=[],Ti=0,zg=0;function qd(){for(var t=Ti,e=zg=Ti=0;e<t;){var a=ba[e];ba[e++]=null;var r=ba[e];ba[e++]=null;var n=ba[e];ba[e++]=null;var o=ba[e];if(ba[e++]=null,r!==null&&n!==null){var i=r.pending;i===null?n.next=n:(n.next=i.next,i.next=n),r.pending=n}o!==0&&s_(a,n,o)}}function zd(t,e,a,r){ba[Ti++]=t,ba[Ti++]=e,ba[Ti++]=a,ba[Ti++]=r,zg|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Vg(t,e,a,r){return zd(t,e,a,r),hd(t)}function Mo(t,e){return zd(t,null,null,e),hd(t)}function s_(t,e,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var n=!1,o=t.return;o!==null;)o.childLanes|=a,r=o.alternate,r!==null&&(r.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(n=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,n&&e!==null&&(n=31-la(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function hd(t){if(50<Ml)throw Ml=0,yg=null,Error(R(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ri={};function BR(t,e,a,r){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(t,e,a,r){return new BR(t,e,a,r)}function $g(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Mr(t,e){var a=t.alternate;return a===null?(a=na(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function l_(t,e){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Kc(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")$g(t)&&(i=1);else if(typeof t=="string")i=PM(t,a,sr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Pm:return t=na(31,a,e,n),t.elementType=Pm,t.lanes=o,t;case _i:return bo(a.children,n,o,e);case AC:i=8,n|=24;break;case Bm:return t=na(12,a,e,n|2),t.elementType=Bm,t.lanes=o,t;case Fm:return t=na(13,a,e,n),t.elementType=Fm,t.lanes=o,t;case Nm:return t=na(19,a,e,n),t.elementType=Nm,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Er:i=10;break e;case kC:i=9;break e;case Tg:i=11;break e;case Rg:i=14;break e;case gn:i=16,r=null;break e}i=29,a=Error(R(130,t===null?"null":typeof t,"")),r=null}return e=na(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function bo(t,e,a,r){return t=na(7,t,r,e),t.lanes=a,t}function pm(t,e,a){return t=na(6,t,null,e),t.lanes=a,t}function u_(t){var e=na(18,null,null,0);return e.stateNode=t,e}function hm(t,e,a){return e=na(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var x0=new WeakMap;function La(t,e){if(typeof t=="object"&&t!==null){var a=x0.get(t);return a!==void 0?a:(e={value:t,source:e,stack:e0(e)},x0.set(t,e),e)}return{value:t,source:e,stack:e0(e)}}var Mi=[],Di=0,md=null,Pl=0,Ca=[],_a=0,Fn=null,nr=1,or="";function Ar(t,e){Mi[Di++]=Pl,Mi[Di++]=md,md=t,Pl=e}function c_(t,e,a){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Fn,Fn=t;var r=nr;t=or;var n=32-la(r)-1;r&=~(1<<n),a+=1;var o=32-la(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,nr=1<<32-la(e)+n|a<<n|r,or=o+t}else nr=1<<o|a<<n|r,or=t}function jg(t){t.return!==null&&(Ar(t,1),c_(t,1,0))}function Gg(t){for(;t===md;)md=Mi[--Di],Mi[Di]=null,Pl=Mi[--Di],Mi[Di]=null;for(;t===Fn;)Fn=Ca[--_a],Ca[_a]=null,or=Ca[--_a],Ca[_a]=null,nr=Ca[--_a],Ca[_a]=null}function d_(t,e){Ca[_a++]=nr,Ca[_a++]=or,Ca[_a++]=Fn,nr=e.id,or=e.overflow,Fn=t}var xt=null,Ne=null,he=!1,kn=null,Ia=!1,Qm=Error(R(519));function Nn(t){var e=Error(R(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(La(e,t)),Qm}function b0(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[yt]=t,e[Wt]=r,a){case"dialog":ue("cancel",e),ue("close",e);break;case"iframe":case"object":case"embed":ue("load",e);break;case"video":case"audio":for(a=0;a<Vl.length;a++)ue(Vl[a],e);break;case"source":ue("error",e);break;case"img":case"image":case"link":ue("error",e),ue("load",e);break;case"details":ue("toggle",e);break;case"input":ue("invalid",e),qC(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ue("invalid",e);break;case"textarea":ue("invalid",e),VC(e,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||r.suppressHydrationWarning===!0||Ww(e.textContent,a)?(r.popover!=null&&(ue("beforetoggle",e),ue("toggle",e)),r.onScroll!=null&&ue("scroll",e),r.onScrollEnd!=null&&ue("scrollend",e),r.onClick!=null&&(e.onclick=Tr),e=!0):e=!1,e||Nn(t,!0)}function S0(t){for(xt=t.return;xt;)switch(xt.tag){case 5:case 31:case 13:Ia=!1;return;case 27:case 3:Ia=!0;return;default:xt=xt.return}}function xi(t){if(t!==xt)return!1;if(!he)return S0(t),he=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||_g(t.type,t.memoizedProps)),a=!a),a&&Ne&&Nn(t),S0(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));Ne=uC(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));Ne=uC(t)}else e===27?(e=Ne,qn(t.type)?(t=Ag,Ag=null,Ne=t):Ne=e):Ne=xt?ka(t.stateNode.nextSibling):null;return!0}function wo(){Ne=xt=null,he=!1}function mm(){var t=kn;return t!==null&&(jt===null?jt=t:jt.push.apply(jt,t),kn=null),t}function Hl(t){kn===null?kn=[t]:kn.push(t)}var Jm=lr(null),Do=null,Rr=null;function yn(t,e,a){Re(Jm,e._currentValue),e._currentValue=a}function Dr(t){t._currentValue=Jm.current,ht(Jm)}function eg(t,e,a){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===a)break;t=t.return}}function tg(t,e,a,r){var n=t.child;for(n!==null&&(n.return=t);n!==null;){var o=n.dependencies;if(o!==null){var i=n.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=n;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),eg(o.return,a,t),r||(i=null);break e}o=s.next}}else if(n.tag===18){if(i=n.return,i===null)throw Error(R(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),eg(i,a,t),i=null}else i=n.child;if(i!==null)i.return=n;else for(i=n;i!==null;){if(i===t){i=null;break}if(n=i.sibling,n!==null){n.return=i.return,i=n;break}i=i.return}n=i}}function ts(t,e,a,r){t=null;for(var n=e,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var i=n.alternate;if(i===null)throw Error(R(387));if(i=i.memoizedProps,i!==null){var s=n.type;ca(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===ld.current){if(i=n.alternate,i===null)throw Error(R(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(jl):t=[jl])}n=n.return}t!==null&&tg(e,t,a,r),e.flags|=262144}function gd(t){for(t=t.firstContext;t!==null;){if(!ca(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Lo(t){Do=t,Rr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bt(t){return f_(Do,t)}function Nc(t,e){return Do===null&&Lo(t),f_(t,e)}function f_(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Rr===null){if(t===null)throw Error(R(308));Rr=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Rr=Rr.next=e;return a}var FR=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},NR=it.unstable_scheduleCallback,PR=it.unstable_NormalPriority,at={$$typeof:Er,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wg(){return{controller:new FR,data:new Map,refCount:0}}function eu(t){t.refCount--,t.refCount===0&&NR(PR,function(){t.controller.abort()})}var wl=null,ag=0,ji=0,Pi=null;function HR(t,e){if(wl===null){var a=wl=[];ag=0,ji=yv(),Pi={status:"pending",value:void 0,then:function(r){a.push(r)}}}return ag++,e.then(C0,C0),e}function C0(){if(--ag===0&&wl!==null){Pi!==null&&(Pi.status="fulfilled");var t=wl;wl=null,ji=0,Pi=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function UR(t,e){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return t.then(function(){r.status="fulfilled",r.value=e;for(var n=0;n<a.length;n++)(0,a[n])(e)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var _0=ee.S;ee.S=function(t,e){Iw=ia(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&HR(t,e),_0!==null&&_0(t,e)};var So=lr(null);function Zg(){var t=So.current;return t!==null?t:Ae.pooledCache}function Qc(t,e){e===null?Re(So,So.current):Re(So,e.pool)}function p_(){var t=Zg();return t===null?null:{parent:at._currentValue,pool:t}}var as=Error(R(460)),Xg=Error(R(474)),Vd=Error(R(542)),vd={then:function(){}};function w0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function h_(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(Tr,Tr),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,I0(t),t;default:if(typeof e.status=="string")e.then(Tr,Tr);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(R(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var n=e;n.status="fulfilled",n.value=r}},function(r){if(e.status==="pending"){var n=e;n.status="rejected",n.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,I0(t),t}throw Co=e,as}}function vo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Co=a,as):a}}var Co=null;function L0(){if(Co===null)throw Error(R(459));var t=Co;return Co=null,t}function I0(t){if(t===as||t===Vd)throw Error(R(483))}var Hi=null,Ul=0;function Pc(t){var e=Ul;return Ul+=1,Hi===null&&(Hi=[]),h_(Hi,t,e)}function dl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Hc(t,e){throw e.$$typeof===IT?Error(R(525)):(t=Object.prototype.toString.call(e),Error(R(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function m_(t){function e(f,m){if(t){var v=f.deletions;v===null?(f.deletions=[m],f.flags|=16):v.push(m)}}function a(f,m){if(!t)return null;for(;m!==null;)e(f,m),m=m.sibling;return null}function r(f){for(var m=new Map;f!==null;)f.key!==null?m.set(f.key,f):m.set(f.index,f),f=f.sibling;return m}function n(f,m){return f=Mr(f,m),f.index=0,f.sibling=null,f}function o(f,m,v){return f.index=v,t?(v=f.alternate,v!==null?(v=v.index,v<m?(f.flags|=67108866,m):v):(f.flags|=67108866,m)):(f.flags|=1048576,m)}function i(f){return t&&f.alternate===null&&(f.flags|=67108866),f}function s(f,m,v,y){return m===null||m.tag!==6?(m=pm(v,f.mode,y),m.return=f,m):(m=n(m,v),m.return=f,m)}function l(f,m,v,y){var _=v.type;return _===_i?c(f,m,v.props.children,y,v.key):m!==null&&(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===gn&&vo(_)===m.type)?(m=n(m,v.props),dl(m,v),m.return=f,m):(m=Kc(v.type,v.key,v.props,null,f.mode,y),dl(m,v),m.return=f,m)}function u(f,m,v,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=hm(v,f.mode,y),m.return=f,m):(m=n(m,v.children||[]),m.return=f,m)}function c(f,m,v,y,_){return m===null||m.tag!==7?(m=bo(v,f.mode,y,_),m.return=f,m):(m=n(m,v),m.return=f,m)}function d(f,m,v){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=pm(""+m,f.mode,v),m.return=f,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ec:return v=Kc(m.type,m.key,m.props,null,f.mode,v),dl(v,m),v.return=f,v;case gl:return m=hm(m,f.mode,v),m.return=f,m;case gn:return m=vo(m),d(f,m,v)}if(vl(m)||ul(m))return m=bo(m,f.mode,v,null),m.return=f,m;if(typeof m.then=="function")return d(f,Pc(m),v);if(m.$$typeof===Er)return d(f,Nc(f,m),v);Hc(f,m)}return null}function h(f,m,v,y){var _=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(f,m,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ec:return v.key===_?l(f,m,v,y):null;case gl:return v.key===_?u(f,m,v,y):null;case gn:return v=vo(v),h(f,m,v,y)}if(vl(v)||ul(v))return _!==null?null:c(f,m,v,y,null);if(typeof v.then=="function")return h(f,m,Pc(v),y);if(v.$$typeof===Er)return h(f,m,Nc(f,v),y);Hc(f,v)}return null}function g(f,m,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return f=f.get(v)||null,s(m,f,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ec:return f=f.get(y.key===null?v:y.key)||null,l(m,f,y,_);case gl:return f=f.get(y.key===null?v:y.key)||null,u(m,f,y,_);case gn:return y=vo(y),g(f,m,v,y,_)}if(vl(y)||ul(y))return f=f.get(v)||null,c(m,f,y,_,null);if(typeof y.then=="function")return g(f,m,v,Pc(y),_);if(y.$$typeof===Er)return g(f,m,v,Nc(m,y),_);Hc(m,y)}return null}function S(f,m,v,y){for(var _=null,L=null,C=m,k=m=0,w=null;C!==null&&k<v.length;k++){C.index>k?(w=C,C=null):w=C.sibling;var I=h(f,C,v[k],y);if(I===null){C===null&&(C=w);break}t&&C&&I.alternate===null&&e(f,C),m=o(I,m,k),L===null?_=I:L.sibling=I,L=I,C=w}if(k===v.length)return a(f,C),he&&Ar(f,k),_;if(C===null){for(;k<v.length;k++)C=d(f,v[k],y),C!==null&&(m=o(C,m,k),L===null?_=C:L.sibling=C,L=C);return he&&Ar(f,k),_}for(C=r(C);k<v.length;k++)w=g(C,f,k,v[k],y),w!==null&&(t&&w.alternate!==null&&C.delete(w.key===null?k:w.key),m=o(w,m,k),L===null?_=w:L.sibling=w,L=w);return t&&C.forEach(function(T){return e(f,T)}),he&&Ar(f,k),_}function b(f,m,v,y){if(v==null)throw Error(R(151));for(var _=null,L=null,C=m,k=m=0,w=null,I=v.next();C!==null&&!I.done;k++,I=v.next()){C.index>k?(w=C,C=null):w=C.sibling;var T=h(f,C,I.value,y);if(T===null){C===null&&(C=w);break}t&&C&&T.alternate===null&&e(f,C),m=o(T,m,k),L===null?_=T:L.sibling=T,L=T,C=w}if(I.done)return a(f,C),he&&Ar(f,k),_;if(C===null){for(;!I.done;k++,I=v.next())I=d(f,I.value,y),I!==null&&(m=o(I,m,k),L===null?_=I:L.sibling=I,L=I);return he&&Ar(f,k),_}for(C=r(C);!I.done;k++,I=v.next())I=g(C,f,k,I.value,y),I!==null&&(t&&I.alternate!==null&&C.delete(I.key===null?k:I.key),m=o(I,m,k),L===null?_=I:L.sibling=I,L=I);return t&&C.forEach(function(D){return e(f,D)}),he&&Ar(f,k),_}function x(f,m,v,y){if(typeof v=="object"&&v!==null&&v.type===_i&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ec:e:{for(var _=v.key;m!==null;){if(m.key===_){if(_=v.type,_===_i){if(m.tag===7){a(f,m.sibling),y=n(m,v.props.children),y.return=f,f=y;break e}}else if(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===gn&&vo(_)===m.type){a(f,m.sibling),y=n(m,v.props),dl(y,v),y.return=f,f=y;break e}a(f,m);break}else e(f,m);m=m.sibling}v.type===_i?(y=bo(v.props.children,f.mode,y,v.key),y.return=f,f=y):(y=Kc(v.type,v.key,v.props,null,f.mode,y),dl(y,v),y.return=f,f=y)}return i(f);case gl:e:{for(_=v.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){a(f,m.sibling),y=n(m,v.children||[]),y.return=f,f=y;break e}else{a(f,m);break}else e(f,m);m=m.sibling}y=hm(v,f.mode,y),y.return=f,f=y}return i(f);case gn:return v=vo(v),x(f,m,v,y)}if(vl(v))return S(f,m,v,y);if(ul(v)){if(_=ul(v),typeof _!="function")throw Error(R(150));return v=_.call(v),b(f,m,v,y)}if(typeof v.then=="function")return x(f,m,Pc(v),y);if(v.$$typeof===Er)return x(f,m,Nc(f,v),y);Hc(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,m!==null&&m.tag===6?(a(f,m.sibling),y=n(m,v),y.return=f,f=y):(a(f,m),y=pm(v,f.mode,y),y.return=f,f=y),i(f)):a(f,m)}return function(f,m,v,y){try{Ul=0;var _=x(f,m,v,y);return Hi=null,_}catch(C){if(C===as||C===Vd)throw C;var L=na(29,C,null,f.mode);return L.lanes=y,L.return=f,L}}}var Io=m_(!0),g_=m_(!1),vn=!1;function Yg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rg(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function En(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Tn(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(ye&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=hd(t),s_(t,null,a),e}return zd(t,r,e,a),hd(t)}function Ll(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,OC(t,a)}}function gm(t,e){var a=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?n=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?n=o=e:o=o.next=e}else n=o=e;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var ng=!1;function Il(){if(ng){var t=Pi;if(t!==null)throw t}}function Al(t,e,a,r){ng=!1;var n=t.updateQueue;vn=!1;var o=n.firstBaseUpdate,i=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=n.baseState;i=0,c=u=l=null,s=o;do{var h=s.lane&-536870913,g=h!==s.lane;if(g?(pe&h)===h:(r&h)===h){h!==0&&h===ji&&(ng=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,b=s;h=e;var x=a;switch(b.tag){case 1:if(S=b.payload,typeof S=="function"){d=S.call(x,d,h);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,h=typeof S=="function"?S.call(x,d,h):S,h==null)break e;d=Pe({},d,h);break e;case 2:vn=!0}}h=s.callback,h!==null&&(t.flags|=64,g&&(t.flags|=8192),g=n.callbacks,g===null?n.callbacks=[h]:g.push(h))}else g={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=g,l=d):c=c.next=g,i|=h;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;g=s,s=g.next,g.next=null,n.lastBaseUpdate=g,n.shared.pending=null}}while(!0);c===null&&(l=d),n.baseState=l,n.firstBaseUpdate=u,n.lastBaseUpdate=c,o===null&&(n.shared.lanes=0),Hn|=i,t.lanes=i,t.memoizedState=d}}function v_(t,e){if(typeof t!="function")throw Error(R(191,t));t.call(e)}function y_(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)v_(a[t],e)}var Gi=lr(null),yd=lr(0);function A0(t,e){t=Hr,Re(yd,t),Re(Gi,e),Hr=t|e.baseLanes}function og(){Re(yd,Hr),Re(Gi,Gi.current)}function Kg(){Hr=yd.current,ht(Gi),ht(yd)}var da=lr(null),Aa=null;function xn(t){var e=t.alternate;Re(Ke,Ke.current&1),Re(da,t),Aa===null&&(e===null||Gi.current!==null||e.memoizedState!==null)&&(Aa=t)}function ig(t){Re(Ke,Ke.current),Re(da,t),Aa===null&&(Aa=t)}function x_(t){t.tag===22?(Re(Ke,Ke.current),Re(da,t),Aa===null&&(Aa=t)):bn(t)}function bn(){Re(Ke,Ke.current),Re(da,da.current)}function ra(t){ht(da),Aa===t&&(Aa=null),ht(Ke)}var Ke=lr(0);function xd(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lg(a)||Ig(a)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Fr=0,ie=null,Le=null,et=null,bd=!1,Ui=!1,Ao=!1,Sd=0,ql=0,qi=null,qR=0;function Ze(){throw Error(R(321))}function Qg(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!ca(t[a],e[a]))return!1;return!0}function Jg(t,e,a,r,n,o){return Fr=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ee.H=t===null||t.memoizedState===null?Y_:cv,Ao=!1,o=a(r,n),Ao=!1,Ui&&(o=S_(e,a,r,n)),b_(t),o}function b_(t){ee.H=zl;var e=Le!==null&&Le.next!==null;if(Fr=0,et=Le=ie=null,bd=!1,ql=0,qi=null,e)throw Error(R(300));t===null||rt||(t=t.dependencies,t!==null&&gd(t)&&(rt=!0))}function S_(t,e,a,r){ie=t;var n=0;do{if(Ui&&(qi=null),ql=0,Ui=!1,25<=n)throw Error(R(301));if(n+=1,et=Le=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ee.H=K_,o=e(a,r)}while(Ui);return o}function zR(){var t=ee.H,e=t.useState()[0];return e=typeof e.then=="function"?tu(e):e,t=t.useState()[0],(Le!==null?Le.memoizedState:null)!==t&&(ie.flags|=1024),e}function ev(){var t=Sd!==0;return Sd=0,t}function tv(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function av(t){if(bd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}bd=!1}Fr=0,et=Le=ie=null,Ui=!1,ql=Sd=0,qi=null}function Bt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?ie.memoizedState=et=t:et=et.next=t,et}function Qe(){if(Le===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=Le.next;var e=et===null?ie.memoizedState:et.next;if(e!==null)et=e,Le=t;else{if(t===null)throw ie.alternate===null?Error(R(467)):Error(R(310));Le=t,t={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},et===null?ie.memoizedState=et=t:et=et.next=t}return et}function $d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tu(t){var e=ql;return ql+=1,qi===null&&(qi=[]),t=h_(qi,t,e),e=ie,(et===null?e.memoizedState:et.next)===null&&(e=e.alternate,ee.H=e===null||e.memoizedState===null?Y_:cv),t}function jd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return tu(t);if(t.$$typeof===Er)return bt(t)}throw Error(R(438,String(t)))}function rv(t){var e=null,a=ie.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var r=ie.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(n){return n.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=$d(),ie.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),r=0;r<t;r++)a[r]=AT;return e.index++,a}function Nr(t,e){return typeof e=="function"?e(t):e}function Jc(t){var e=Qe();return nv(e,Le,t)}function nv(t,e,a){var r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=a;var n=t.baseQueue,o=r.pending;if(o!==null){if(n!==null){var i=n.next;n.next=o.next,o.next=i}e.baseQueue=n=o,r.pending=null}if(o=t.baseState,n===null)t.memoizedState=o;else{e=n.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(pe&d)===d:(Fr&d)===d){var h=u.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===ji&&(c=!0);else if((Fr&h)===h){u=u.next,h===ji&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,ie.lanes|=h,Hn|=h;d=u.action,Ao&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else h={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=h,i=o):l=l.next=h,ie.lanes|=d,Hn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!ca(o,t.memoizedState)&&(rt=!0,c&&(a=Pi,a!==null)))throw a;t.memoizedState=o,t.baseState=i,t.baseQueue=l,r.lastRenderedState=o}return n===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function vm(t){var e=Qe(),a=e.queue;if(a===null)throw Error(R(311));a.lastRenderedReducer=t;var r=a.dispatch,n=a.pending,o=e.memoizedState;if(n!==null){a.pending=null;var i=n=n.next;do o=t(o,i.action),i=i.next;while(i!==n);ca(o,e.memoizedState)||(rt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function C_(t,e,a){var r=ie,n=Qe(),o=he;if(o){if(a===void 0)throw Error(R(407));a=a()}else a=e();var i=!ca((Le||n).memoizedState,a);if(i&&(n.memoizedState=a,rt=!0),n=n.queue,ov(L_.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,Wi(9,{destroy:void 0},w_.bind(null,r,n,a,e),null),Ae===null)throw Error(R(349));o||(Fr&127)!==0||__(r,e,a)}return a}function __(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=$d(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function w_(t,e,a,r){e.value=a,e.getSnapshot=r,I_(e)&&A_(t)}function L_(t,e,a){return a(function(){I_(e)&&A_(t)})}function I_(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!ca(t,a)}catch{return!0}}function A_(t){var e=Mo(t,2);e!==null&&Gt(e,t,2)}function sg(t){var e=Bt();if(typeof t=="function"){var a=t;if(t=a(),Ao){Cn(!0);try{a()}finally{Cn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:t},e}function k_(t,e,a,r){return t.baseState=a,nv(t,Le,typeof r=="function"?r:Nr)}function VR(t,e,a,r,n){if(Wd(t))throw Error(R(485));if(t=e.action,t!==null){var o={payload:n,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ee.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,E_(e,o)):(o.next=a.next,e.pending=a.next=o)}}function E_(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=ee.T,i={};ee.T=i;try{var s=a(n,r),l=ee.S;l!==null&&l(i,s),k0(t,e,s)}catch(u){lg(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ee.T=o}}else try{o=a(n,r),k0(t,e,o)}catch(u){lg(t,e,u)}}function k0(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){E0(t,e,r)},function(r){return lg(t,e,r)}):E0(t,e,a)}function E0(t,e,a){e.status="fulfilled",e.value=a,T_(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,E_(t,a)))}function lg(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,T_(e),e=e.next;while(e!==r)}t.action=null}function T_(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function R_(t,e){return e}function T0(t,e){if(he){var a=Ae.formState;if(a!==null){e:{var r=ie;if(he){if(Ne){t:{for(var n=Ne,o=Ia;n.nodeType!==8;){if(!o){n=null;break t}if(n=ka(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Ne=ka(n.nextSibling),r=n.data==="F!";break e}}Nn(r)}r=!1}r&&(e=a[0])}}return a=Bt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:R_,lastRenderedState:e},a.queue=r,a=W_.bind(null,ie,r),r.dispatch=a,r=sg(!1),o=uv.bind(null,ie,!1,r.queue),r=Bt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=VR.bind(null,ie,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function R0(t){var e=Qe();return M_(e,Le,t)}function M_(t,e,a){if(e=nv(t,e,R_)[0],t=Jc(Nr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=tu(e)}catch(i){throw i===as?Vd:i}else r=e;e=Qe();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,Wi(9,{destroy:void 0},$R.bind(null,n,a),null)),[r,o,t]}function $R(t,e){t.action=e}function M0(t){var e=Qe(),a=Le;if(a!==null)return M_(e,a,t);Qe(),e=e.memoizedState,a=Qe();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function Wi(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=ie.updateQueue,e===null&&(e=$d(),ie.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(r=a.next,a.next=t,t.next=r,e.lastEffect=t),t}function D_(){return Qe().memoizedState}function ed(t,e,a,r){var n=Bt();ie.flags|=t,n.memoizedState=Wi(1|e,{destroy:void 0},a,r===void 0?null:r)}function Gd(t,e,a,r){var n=Qe();r=r===void 0?null:r;var o=n.memoizedState.inst;Le!==null&&r!==null&&Qg(r,Le.memoizedState.deps)?n.memoizedState=Wi(e,o,a,r):(ie.flags|=t,n.memoizedState=Wi(1|e,o,a,r))}function D0(t,e){ed(8390656,8,t,e)}function ov(t,e){Gd(2048,8,t,e)}function jR(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=$d(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function O_(t){var e=Qe().memoizedState;return jR({ref:e,nextImpl:t}),function(){if((ye&2)!==0)throw Error(R(440));return e.impl.apply(void 0,arguments)}}function B_(t,e){return Gd(4,2,t,e)}function F_(t,e){return Gd(4,4,t,e)}function N_(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function P_(t,e,a){a=a!=null?a.concat([t]):null,Gd(4,4,N_.bind(null,e,t),a)}function iv(){}function H_(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&Qg(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function U_(t,e){var a=Qe();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&Qg(e,r[1]))return r[0];if(r=t(),Ao){Cn(!0);try{t()}finally{Cn(!1)}}return a.memoizedState=[r,e],r}function sv(t,e,a){return a===void 0||(Fr&1073741824)!==0&&(pe&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=kw(),ie.lanes|=t,Hn|=t,a)}function q_(t,e,a,r){return ca(a,e)?a:Gi.current!==null?(t=sv(t,a,r),ca(t,e)||(rt=!0),t):(Fr&42)===0||(Fr&1073741824)!==0&&(pe&261930)===0?(rt=!0,t.memoizedState=a):(t=kw(),ie.lanes|=t,Hn|=t,e)}function z_(t,e,a,r,n){var o=xe.p;xe.p=o!==0&&8>o?o:8;var i=ee.T,s={};ee.T=s,uv(t,!1,e,a);try{var l=n(),u=ee.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=UR(l,r);kl(t,e,c,ua(t))}else kl(t,e,r,ua(t))}catch(d){kl(t,e,{then:function(){},status:"rejected",reason:d},ua())}finally{xe.p=o,i!==null&&s.types!==null&&(i.types=s.types),ee.T=i}}function GR(){}function ug(t,e,a,r){if(t.tag!==5)throw Error(R(476));var n=V_(t).queue;z_(t,n,e,xo,a===null?GR:function(){return $_(t),a(r)})}function V_(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:xo,baseState:xo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:xo},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function $_(t){var e=V_(t);e.next===null&&(e=t.alternate.memoizedState),kl(t,e.next.queue,{},ua())}function lv(){return bt(jl)}function j_(){return Qe().memoizedState}function G_(){return Qe().memoizedState}function WR(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ua();t=En(a);var r=Tn(e,t,a);r!==null&&(Gt(r,e,a),Ll(r,e,a)),e={cache:Wg()},t.payload=e;return}e=e.return}}function ZR(t,e,a){var r=ua();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Wd(t)?Z_(e,a):(a=Vg(t,e,a,r),a!==null&&(Gt(a,t,r),X_(a,e,r)))}function W_(t,e,a){var r=ua();kl(t,e,a,r)}function kl(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Wd(t))Z_(e,n);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var i=e.lastRenderedState,s=o(i,a);if(n.hasEagerState=!0,n.eagerState=s,ca(s,i))return zd(t,e,n,0),Ae===null&&qd(),!1}catch{}if(a=Vg(t,e,n,r),a!==null)return Gt(a,t,r),X_(a,e,r),!0}return!1}function uv(t,e,a,r){if(r={lane:2,revertLane:yv(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Wd(t)){if(e)throw Error(R(479))}else e=Vg(t,a,r,2),e!==null&&Gt(e,t,2)}function Wd(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function Z_(t,e){Ui=bd=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function X_(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,OC(t,a)}}var zl={readContext:bt,use:jd,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};zl.useEffectEvent=Ze;var Y_={readContext:bt,use:jd,useCallback:function(t,e){return Bt().memoizedState=[t,e===void 0?null:e],t},useContext:bt,useEffect:D0,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,ed(4194308,4,N_.bind(null,e,t),a)},useLayoutEffect:function(t,e){return ed(4194308,4,t,e)},useInsertionEffect:function(t,e){ed(4,2,t,e)},useMemo:function(t,e){var a=Bt();e=e===void 0?null:e;var r=t();if(Ao){Cn(!0);try{t()}finally{Cn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=Bt();if(a!==void 0){var n=a(e);if(Ao){Cn(!0);try{a(e)}finally{Cn(!1)}}}else n=e;return r.memoizedState=r.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},r.queue=t,t=t.dispatch=ZR.bind(null,ie,t),[r.memoizedState,t]},useRef:function(t){var e=Bt();return t={current:t},e.memoizedState=t},useState:function(t){t=sg(t);var e=t.queue,a=W_.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:iv,useDeferredValue:function(t,e){var a=Bt();return sv(a,t,e)},useTransition:function(){var t=sg(!1);return t=z_.bind(null,ie,t.queue,!0,!1),Bt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=ie,n=Bt();if(he){if(a===void 0)throw Error(R(407));a=a()}else{if(a=e(),Ae===null)throw Error(R(349));(pe&127)!==0||__(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,D0(L_.bind(null,r,o,t),[t]),r.flags|=2048,Wi(9,{destroy:void 0},w_.bind(null,r,o,a,e),null),a},useId:function(){var t=Bt(),e=Ae.identifierPrefix;if(he){var a=or,r=nr;a=(r&~(1<<32-la(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=Sd++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=qR++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:lv,useFormState:T0,useActionState:T0,useOptimistic:function(t){var e=Bt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=uv.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:rv,useCacheRefresh:function(){return Bt().memoizedState=WR.bind(null,ie)},useEffectEvent:function(t){var e=Bt(),a={impl:t};return e.memoizedState=a,function(){if((ye&2)!==0)throw Error(R(440));return a.impl.apply(void 0,arguments)}}},cv={readContext:bt,use:jd,useCallback:H_,useContext:bt,useEffect:ov,useImperativeHandle:P_,useInsertionEffect:B_,useLayoutEffect:F_,useMemo:U_,useReducer:Jc,useRef:D_,useState:function(){return Jc(Nr)},useDebugValue:iv,useDeferredValue:function(t,e){var a=Qe();return q_(a,Le.memoizedState,t,e)},useTransition:function(){var t=Jc(Nr)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:tu(t),e]},useSyncExternalStore:C_,useId:j_,useHostTransitionStatus:lv,useFormState:R0,useActionState:R0,useOptimistic:function(t,e){var a=Qe();return k_(a,Le,t,e)},useMemoCache:rv,useCacheRefresh:G_};cv.useEffectEvent=O_;var K_={readContext:bt,use:jd,useCallback:H_,useContext:bt,useEffect:ov,useImperativeHandle:P_,useInsertionEffect:B_,useLayoutEffect:F_,useMemo:U_,useReducer:vm,useRef:D_,useState:function(){return vm(Nr)},useDebugValue:iv,useDeferredValue:function(t,e){var a=Qe();return Le===null?sv(a,t,e):q_(a,Le.memoizedState,t,e)},useTransition:function(){var t=vm(Nr)[0],e=Qe().memoizedState;return[typeof t=="boolean"?t:tu(t),e]},useSyncExternalStore:C_,useId:j_,useHostTransitionStatus:lv,useFormState:M0,useActionState:M0,useOptimistic:function(t,e){var a=Qe();return Le!==null?k_(a,Le,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:rv,useCacheRefresh:G_};K_.useEffectEvent=O_;function ym(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Pe({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var cg={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=ua(),n=En(r);n.payload=e,a!=null&&(n.callback=a),e=Tn(t,n,r),e!==null&&(Gt(e,t,r),Ll(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=ua(),n=En(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=Tn(t,n,r),e!==null&&(Gt(e,t,r),Ll(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=ua(),r=En(a);r.tag=2,e!=null&&(r.callback=e),e=Tn(t,r,a),e!==null&&(Gt(e,t,a),Ll(e,t,a))}};function O0(t,e,a,r,n,o,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,i):e.prototype&&e.prototype.isPureReactComponent?!Nl(a,r)||!Nl(n,o):!0}function B0(t,e,a,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,r),e.state!==t&&cg.enqueueReplaceState(e,e.state,null)}function ko(t,e){var a=e;if("ref"in e){a={};for(var r in e)r!=="ref"&&(a[r]=e[r])}if(t=t.defaultProps){a===e&&(a=Pe({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function Q_(t){pd(t)}function J_(t){console.error(t)}function ew(t){pd(t)}function Cd(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function F0(t,e,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function dg(t,e,a){return a=En(a),a.tag=3,a.payload={element:null},a.callback=function(){Cd(t,e)},a}function tw(t){return t=En(t),t.tag=3,t}function aw(t,e,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var o=r.value;t.payload=function(){return n(o)},t.callback=function(){F0(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){F0(e,a,r),typeof n!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function XR(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&ts(e,a,n,!0),a=da.current,a!==null){switch(a.tag){case 31:case 13:return Aa===null?Ad():a.alternate===null&&Xe===0&&(Xe=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===vd?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),Em(t,r,n)),!1;case 22:return a.flags|=65536,r===vd?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([r]):a.add(r)),Em(t,r,n)),!1}throw Error(R(435,a.tag))}return Em(t,r,n),Ad(),!1}if(he)return e=da.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==Qm&&(t=Error(R(422),{cause:r}),Hl(La(t,a)))):(r!==Qm&&(e=Error(R(423),{cause:r}),Hl(La(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=La(r,a),n=dg(t.stateNode,r,n),gm(t,n),Xe!==4&&(Xe=2)),!1;var o=Error(R(520),{cause:r});if(o=La(o,a),Rl===null?Rl=[o]:Rl.push(o),Xe!==4&&(Xe=2),e===null)return!0;r=La(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=dg(a.stateNode,r,t),gm(a,t),!1;case 1:if(e=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Rn===null||!Rn.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=tw(n),aw(n,t,a,r),gm(a,n),!1}a=a.return}while(a!==null);return!1}var dv=Error(R(461)),rt=!1;function vt(t,e,a,r){e.child=t===null?g_(e,null,a,r):Io(e,t.child,a,r)}function N0(t,e,a,r,n){a=a.render;var o=e.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return Lo(e),r=Jg(t,e,a,i,o,n),s=ev(),t!==null&&!rt?(tv(t,e,n),Pr(t,e,n)):(he&&s&&jg(e),e.flags|=1,vt(t,e,r,n),e.child)}function P0(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!$g(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,rw(t,e,o,r,n)):(t=Kc(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!fv(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Nl,a(i,r)&&t.ref===e.ref)return Pr(t,e,n)}return e.flags|=1,t=Mr(o,r),t.ref=e.ref,t.return=e,e.child=t}function rw(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(Nl(o,r)&&t.ref===e.ref)if(rt=!1,e.pendingProps=r=o,fv(t,n))(t.flags&131072)!==0&&(rt=!0);else return e.lanes=t.lanes,Pr(t,e,n)}return fg(t,e,a,r,n)}function nw(t,e,a,r){var n=r.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,t!==null){for(r=e.child=t.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~o}else r=0,e.child=null;return H0(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qc(e,o!==null?o.cachePool:null),o!==null?A0(e,o):og(),x_(e);else return r=e.lanes=536870912,H0(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Qc(e,o.cachePool),A0(e,o),bn(e),e.memoizedState=null):(t!==null&&Qc(e,null),og(),bn(e));return vt(t,e,n,a),e.child}function xl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function H0(t,e,a,r,n){var o=Zg();return o=o===null?null:{parent:at._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Qc(e,null),og(),x_(e),t!==null&&ts(t,e,r,!0),e.childLanes=n,null}function td(t,e){return e=_d({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function U0(t,e,a){return Io(e,t.child,null,a),t=td(e,e.pendingProps),t.flags|=2,ra(e),e.memoizedState=null,t}function YR(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(he){if(r.mode==="hidden")return t=td(e,r),e.lanes=536870912,xl(null,t);if(ig(e),(t=Ne)?(t=Yw(t,Ia),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Fn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=u_(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw Nn(e);return e.lanes=536870912,null}return td(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(ig(e),n)if(e.flags&256)e.flags&=-257,e=U0(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(R(558));else if(rt||ts(t,e,a,!1),n=(a&t.childLanes)!==0,rt||n){if(r=Ae,r!==null&&(i=BC(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Mo(t,i),Gt(r,t,i),dv;Ad(),e=U0(t,e,a)}else t=o.treeContext,Ne=ka(i.nextSibling),xt=e,he=!0,kn=null,Ia=!1,t!==null&&d_(e,t),e=td(e,r),e.flags|=4096;return e}return t=Mr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ad(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(R(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function fg(t,e,a,r,n){return Lo(e),a=Jg(t,e,a,r,void 0,n),r=ev(),t!==null&&!rt?(tv(t,e,n),Pr(t,e,n)):(he&&r&&jg(e),e.flags|=1,vt(t,e,a,n),e.child)}function q0(t,e,a,r,n,o){return Lo(e),e.updateQueue=null,a=S_(e,r,a,n),b_(t),r=ev(),t!==null&&!rt?(tv(t,e,o),Pr(t,e,o)):(he&&r&&jg(e),e.flags|=1,vt(t,e,a,o),e.child)}function z0(t,e,a,r,n){if(Lo(e),e.stateNode===null){var o=Ri,i=a.contextType;typeof i=="object"&&i!==null&&(o=bt(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=cg,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},Yg(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?bt(i):Ri,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(ym(e,a,i,r),o.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&cg.enqueueReplaceState(o,o.state,null),Al(e,r,o,n),Il(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=ko(a,s);o.props=l;var u=o.context,c=a.contextType;i=Ri,typeof c=="object"&&c!==null&&(i=bt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&B0(e,o,r,i),vn=!1;var h=e.memoizedState;o.state=h,Al(e,r,o,n),Il(),u=e.memoizedState,s||h!==u||vn?(typeof d=="function"&&(ym(e,a,d,r),u=e.memoizedState),(l=vn||O0(e,a,l,r,h,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),o.props=r,o.state=u,o.context=i,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,rg(t,e),i=e.memoizedProps,c=ko(a,i),o.props=c,d=e.pendingProps,h=o.context,u=a.contextType,l=Ri,typeof u=="object"&&u!==null&&(l=bt(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||h!==l)&&B0(e,o,r,l),vn=!1,h=e.memoizedState,o.state=h,Al(e,r,o,n),Il();var g=e.memoizedState;i!==d||h!==g||vn||t!==null&&t.dependencies!==null&&gd(t.dependencies)?(typeof s=="function"&&(ym(e,a,s,r),g=e.memoizedState),(c=vn||O0(e,a,c,r,h,g,l)||t!==null&&t.dependencies!==null&&gd(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return o=r,ad(t,e),r=(e.flags&128)!==0,o||r?(o=e.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&r?(e.child=Io(e,t.child,null,n),e.child=Io(e,null,a,n)):vt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Pr(t,e,n),t}function V0(t,e,a,r){return wo(),e.flags|=256,vt(t,e,a,r),e.child}var xm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bm(t){return{baseLanes:t,cachePool:p_()}}function Sm(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=oa),t}function ow(t,e,a){var r=e.pendingProps,n=!1,o=(e.flags&128)!==0,i;if((i=o)||(i=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(n?xn(e):bn(e),(t=Ne)?(t=Yw(t,Ia),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Fn!==null?{id:nr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=u_(t),a.return=e,e.child=a,xt=e,Ne=null)):t=null,t===null)throw Nn(e);return Ig(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(bn(e),n=e.mode,s=_d({mode:"hidden",children:s},n),r=bo(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=bm(a),r.childLanes=Sm(t,i,a),e.memoizedState=xm,xl(null,r)):(xn(e),pg(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(xn(e),e.flags&=-257,e=Cm(t,e,a)):e.memoizedState!==null?(bn(e),e.child=t.child,e.flags|=128,e=null):(bn(e),s=r.fallback,n=e.mode,r=_d({mode:"visible",children:r.children},n),s=bo(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Io(e,t.child,null,a),r=e.child,r.memoizedState=bm(a),r.childLanes=Sm(t,i,a),e.memoizedState=xm,e=xl(null,r));else if(xn(e),Ig(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(R(419)),r.stack="",r.digest=i,Hl({value:r,source:null,stack:null}),e=Cm(t,e,a)}else if(rt||ts(t,e,a,!1),i=(a&t.childLanes)!==0,rt||i){if(i=Ae,i!==null&&(r=BC(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Mo(t,r),Gt(i,t,r),dv;Lg(s)||Ad(),e=Cm(t,e,a)}else Lg(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ne=ka(s.nextSibling),xt=e,he=!0,kn=null,Ia=!1,t!==null&&d_(e,t),e=pg(e,r.children),e.flags|=4096);return e}return n?(bn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=Mr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Mr(u,s):(s=bo(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,xl(null,r),r=e.child,s=t.child.memoizedState,s===null?s=bm(a):(n=s.cachePool,n!==null?(l=at._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=p_(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=Sm(t,i,a),e.memoizedState=xm,xl(t.child,r)):(xn(e),a=t.child,t=a.sibling,a=Mr(a,{mode:"visible",children:r.children}),a.return=e,a.sibling=null,t!==null&&(i=e.deletions,i===null?(e.deletions=[t],e.flags|=16):i.push(t)),e.child=a,e.memoizedState=null,a)}function pg(t,e){return e=_d({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function _d(t,e){return t=na(22,t,null,e),t.lanes=0,t}function Cm(t,e,a){return Io(e,t.child,null,a),t=pg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function $0(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),eg(t.return,e,a)}function _m(t,e,a,r,n,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=a,i.tailMode=n,i.treeForkCount=o)}function iw(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=Ke.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Re(Ke,i),vt(t,e,r,a),r=he?Pl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$0(t,a,e);else if(t.tag===19)$0(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(n){case"forwards":for(a=e.child,n=null;a!==null;)t=a.alternate,t!==null&&xd(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),_m(e,!1,n,a,o,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&xd(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}_m(e,!0,a,null,o,r);break;case"together":_m(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Pr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Hn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(ts(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(R(153));if(e.child!==null){for(t=e.child,a=Mr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Mr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function fv(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&gd(t)))}function KR(t,e,a){switch(e.tag){case 3:ud(e,e.stateNode.containerInfo),yn(e,at,t.memoizedState.cache),wo();break;case 27:case 5:qm(e);break;case 4:ud(e,e.stateNode.containerInfo);break;case 10:yn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,ig(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(xn(e),e.flags|=128,null):(a&e.child.childLanes)!==0?ow(t,e,a):(xn(e),t=Pr(t,e,a),t!==null?t.sibling:null);xn(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(ts(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return iw(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Re(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,nw(t,e,a,e.pendingProps);case 24:yn(e,at,t.memoizedState.cache)}return Pr(t,e,a)}function sw(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)rt=!0;else{if(!fv(t,a)&&(e.flags&128)===0)return rt=!1,KR(t,e,a);rt=(t.flags&131072)!==0}else rt=!1,he&&(e.flags&1048576)!==0&&c_(e,Pl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=vo(e.elementType),e.type=t,typeof t=="function")$g(t)?(r=ko(t,r),e.tag=1,e=z0(null,e,t,r,a)):(e.tag=0,e=fg(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===Tg){e.tag=11,e=N0(null,e,t,r,a);break e}else if(n===Rg){e.tag=14,e=P0(null,e,t,r,a);break e}}throw e=Hm(t)||t,Error(R(306,e,""))}}return e;case 0:return fg(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=ko(r,e.pendingProps),z0(t,e,r,n,a);case 3:e:{if(ud(e,e.stateNode.containerInfo),t===null)throw Error(R(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,rg(t,e),Al(e,r,null,a);var i=e.memoizedState;if(r=i.cache,yn(e,at,r),r!==o.cache&&tg(e,[at],a,!0),Il(),r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=V0(t,e,r,a);break e}else if(r!==n){n=La(Error(R(424)),e),Hl(n),e=V0(t,e,r,a);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ne=ka(t.firstChild),xt=e,he=!0,kn=null,Ia=!0,a=g_(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(wo(),r===n){e=Pr(t,e,a);break e}vt(t,e,r,a)}e=e.child}return e;case 26:return ad(t,e),t===null?(a=fC(e.type,null,e.pendingProps,null))?e.memoizedState=a:he||(a=e.type,t=e.pendingProps,r=Rd(An.current).createElement(a),r[yt]=e,r[Wt]=t,St(r,a,t),pt(r),e.stateNode=r):e.memoizedState=fC(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return qm(e),t===null&&he&&(r=e.stateNode=Kw(e.type,e.pendingProps,An.current),xt=e,Ia=!0,n=Ne,qn(e.type)?(Ag=n,Ne=ka(r.firstChild)):Ne=n),vt(t,e,e.pendingProps.children,a),ad(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((n=r=Ne)&&(r=LM(r,e.type,e.pendingProps,Ia),r!==null?(e.stateNode=r,xt=e,Ne=ka(r.firstChild),Ia=!1,n=!0):n=!1),n||Nn(e)),qm(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,_g(n,o)?r=null:i!==null&&_g(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=Jg(t,e,zR,null,null,a),jl._currentValue=n),ad(t,e),vt(t,e,r,a),e.child;case 6:return t===null&&he&&((t=a=Ne)&&(a=IM(a,e.pendingProps,Ia),a!==null?(e.stateNode=a,xt=e,Ne=null,t=!0):t=!1),t||Nn(e)),null;case 13:return ow(t,e,a);case 4:return ud(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Io(e,null,r,a):vt(t,e,r,a),e.child;case 11:return N0(t,e,e.type,e.pendingProps,a);case 7:return vt(t,e,e.pendingProps,a),e.child;case 8:return vt(t,e,e.pendingProps.children,a),e.child;case 12:return vt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,yn(e,e.type,r.value),vt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,Lo(e),n=bt(n),r=r(n),e.flags|=1,vt(t,e,r,a),e.child;case 14:return P0(t,e,e.type,e.pendingProps,a);case 15:return rw(t,e,e.type,e.pendingProps,a);case 19:return iw(t,e,a);case 31:return YR(t,e,a);case 22:return nw(t,e,a,e.pendingProps);case 24:return Lo(e),r=bt(at),t===null?(n=Zg(),n===null&&(n=Ae,o=Wg(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},Yg(e),yn(e,at,n)):((t.lanes&a)!==0&&(rg(t,e),Al(e,null,null,a),Il()),n=t.memoizedState,o=e.memoizedState,n.parent!==r?(n={parent:r,cache:r},e.memoizedState=n,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=n),yn(e,at,r)):(r=o.cache,yn(e,at,r),r!==n.cache&&tg(e,[at],a,!0))),vt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(R(156,e.tag))}function _r(t){t.flags|=4}function wm(t,e,a,r,n){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(n&335544128)===n)if(t.stateNode.complete)t.flags|=8192;else if(Rw())t.flags|=8192;else throw Co=vd,Xg}else t.flags&=-16777217}function j0(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!eL(e))if(Rw())t.flags|=8192;else throw Co=vd,Xg}function Uc(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?MC():536870912,t.lanes|=e,Zi|=e)}function fl(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Fe(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(e)for(var n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=r,t.childLanes=a,e}function QR(t,e,a){var r=e.pendingProps;switch(Gg(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(e),null;case 1:return Fe(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Dr(at),zi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(xi(e)?_r(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,mm())),Fe(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(_r(e),o!==null?(Fe(e),j0(e,o)):(Fe(e),wm(e,n,null,r,a))):o?o!==t.memoizedState?(_r(e),Fe(e),j0(e,o)):(Fe(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&_r(e),Fe(e),wm(e,n,t,r,a)),null;case 27:if(cd(e),a=An.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&_r(e);else{if(!r){if(e.stateNode===null)throw Error(R(166));return Fe(e),null}t=sr.current,xi(e)?b0(e,t):(t=Kw(n,r,a),e.stateNode=t,_r(e))}return Fe(e),null;case 5:if(cd(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&_r(e);else{if(!r){if(e.stateNode===null)throw Error(R(166));return Fe(e),null}if(o=sr.current,xi(e))b0(e,o);else{var i=Rd(An.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?i.createElement(n,{is:r.is}):i.createElement(n)}}o[yt]=e,o[Wt]=r;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=o;e:switch(St(o,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&_r(e)}}return Fe(e),wm(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&_r(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(R(166));if(t=An.current,xi(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=xt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[yt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Ww(t.nodeValue,a)),t||Nn(e,!0)}else t=Rd(t).createTextNode(r),t[yt]=e,e.stateNode=t}return Fe(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=xi(e),a!==null){if(t===null){if(!r)throw Error(R(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(557));t[yt]=e}else wo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),t=!1}else a=mm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(ra(e),e):(ra(e),null);if((e.flags&128)!==0)throw Error(R(558))}return Fe(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=xi(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(R(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(R(317));n[yt]=e}else wo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),n=!1}else n=mm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(ra(e),e):(ra(e),null)}return ra(e),(e.flags&128)!==0?(e.lanes=a,e):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(r=e.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==n&&(r.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),Uc(e,e.updateQueue),Fe(e),null);case 4:return zi(),t===null&&xv(e.stateNode.containerInfo),Fe(e),null;case 10:return Dr(e.type),Fe(e),null;case 19:if(ht(Ke),r=e.memoizedState,r===null)return Fe(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)fl(r,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=xd(t),o!==null){for(e.flags|=128,fl(r,!1),t=o.updateQueue,e.updateQueue=t,Uc(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)l_(a,t),a=a.sibling;return Re(Ke,Ke.current&1|2),he&&Ar(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&ia()>Ld&&(e.flags|=128,n=!0,fl(r,!1),e.lanes=4194304)}else{if(!n)if(t=xd(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,Uc(e,t),fl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!he)return Fe(e),null}else 2*ia()-r.renderingStartTime>Ld&&a!==536870912&&(e.flags|=128,n=!0,fl(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=ia(),t.sibling=null,a=Ke.current,Re(Ke,n?a&1|2:a&1),he&&Ar(e,r.treeForkCount),t):(Fe(e),null);case 22:case 23:return ra(e),Kg(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(a&536870912)!==0&&(e.flags&128)===0&&(Fe(e),e.subtreeFlags&6&&(e.flags|=8192)):Fe(e),a=e.updateQueue,a!==null&&Uc(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==a&&(e.flags|=2048),t!==null&&ht(So),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Dr(at),Fe(e),null;case 25:return null;case 30:return null}throw Error(R(156,e.tag))}function JR(t,e){switch(Gg(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Dr(at),zi(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return cd(e),null;case 31:if(e.memoizedState!==null){if(ra(e),e.alternate===null)throw Error(R(340));wo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ra(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(R(340));wo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(Ke),null;case 4:return zi(),null;case 10:return Dr(e.type),null;case 22:case 23:return ra(e),Kg(),t!==null&&ht(So),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Dr(at),null;case 25:return null;default:return null}}function lw(t,e){switch(Gg(e),e.tag){case 3:Dr(at),zi();break;case 26:case 27:case 5:cd(e);break;case 4:zi();break;case 31:e.memoizedState!==null&&ra(e);break;case 13:ra(e);break;case 19:ht(Ke);break;case 10:Dr(e.type);break;case 22:case 23:ra(e),Kg(),t!==null&&ht(So);break;case 24:Dr(at)}}function au(t,e){try{var a=e.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&t)===t){r=void 0;var o=a.create,i=a.inst;r=o(),i.destroy=r}a=a.next}while(a!==n)}}catch(s){Ce(e,e.return,s)}}function Pn(t,e,a){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var o=n.next;r=o;do{if((r.tag&t)===t){var i=r.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,n=e;var l=a,u=s;try{u()}catch(c){Ce(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){Ce(e,e.return,c)}}function uw(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{y_(e,a)}catch(r){Ce(t,t.return,r)}}}function cw(t,e,a){a.props=ko(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){Ce(t,e,r)}}function El(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof a=="function"?t.refCleanup=a(r):a.current=r}}catch(n){Ce(t,e,n)}}function ir(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Ce(t,e,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Ce(t,e,n)}else a.current=null}function dw(t){var e=t.type,a=t.memoizedProps,r=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){Ce(t,t.return,n)}}function Lm(t,e,a){try{var r=t.stateNode;xM(r,t.type,a,e),r[Wt]=e}catch(n){Ce(t,t.return,n)}}function fw(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qn(t.type)||t.tag===4}function Im(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fw(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qn(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function hg(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=Tr));else if(r!==4&&(r===27&&qn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(hg(t,e,a),t=t.sibling;t!==null;)hg(t,e,a),t=t.sibling}function wd(t,e,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(r!==4&&(r===27&&qn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(wd(t,e,a),t=t.sibling;t!==null;)wd(t,e,a),t=t.sibling}function pw(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);St(e,r,a),e[yt]=t,e[Wt]=a}catch(o){Ce(t,t.return,o)}}var kr=!1,tt=!1,Am=!1,G0=typeof WeakSet=="function"?WeakSet:Set,ft=null;function eM(t,e){if(t=t.containerInfo,Sg=Bd,t=e_(t),qg(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var n=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,s=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var g;d!==a||n!==0&&d.nodeType!==3||(s=i+n),d!==o||r!==0&&d.nodeType!==3||(l=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===t)break t;if(h===a&&++u===n&&(s=i),h===o&&++c===r&&(l=i),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Cg={focusedElem:t,selectionRange:a},Bd=!1,ft=e;ft!==null;)if(e=ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ft=t;else for(;ft!==null;){switch(e=ft,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)n=t[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,n=o.memoizedProps,o=o.memoizedState,r=a.stateNode;try{var S=ko(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(b){Ce(a,a.return,b)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)wg(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":wg(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(R(163))}if(t=e.sibling,t!==null){t.return=e.return,ft=t;break}ft=e.return}}function hw(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Lr(t,a),r&4&&au(5,a);break;case 1:if(Lr(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){Ce(a,a.return,i)}else{var n=ko(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){Ce(a,a.return,i)}}r&64&&uw(a),r&512&&El(a,a.return);break;case 3:if(Lr(t,a),r&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{y_(t,e)}catch(i){Ce(a,a.return,i)}}break;case 27:e===null&&r&4&&pw(a);case 26:case 5:Lr(t,a),e===null&&r&4&&dw(a),r&512&&El(a,a.return);break;case 12:Lr(t,a);break;case 31:Lr(t,a),r&4&&vw(t,a);break;case 13:Lr(t,a),r&4&&yw(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=uM.bind(null,a),AM(t,a))));break;case 22:if(r=a.memoizedState!==null||kr,!r){e=e!==null&&e.memoizedState!==null||tt,n=kr;var o=tt;kr=r,(tt=e)&&!o?Ir(t,a,(a.subtreeFlags&8772)!==0):Lr(t,a),kr=n,tt=o}break;case 30:break;default:Lr(t,a)}}function mw(t){var e=t.alternate;e!==null&&(t.alternate=null,mw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Bg(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var qe=null,$t=!1;function wr(t,e,a){for(a=a.child;a!==null;)gw(t,e,a),a=a.sibling}function gw(t,e,a){if(sa&&typeof sa.onCommitFiberUnmount=="function")try{sa.onCommitFiberUnmount(Xl,a)}catch{}switch(a.tag){case 26:tt||ir(a,e),wr(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:tt||ir(a,e);var r=qe,n=$t;qn(a.type)&&(qe=a.stateNode,$t=!1),wr(t,e,a),Dl(a.stateNode),qe=r,$t=n;break;case 5:tt||ir(a,e);case 6:if(r=qe,n=$t,qe=null,wr(t,e,a),qe=r,$t=n,qe!==null)if($t)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(a.stateNode)}catch(o){Ce(a,e,o)}else try{qe.removeChild(a.stateNode)}catch(o){Ce(a,e,o)}break;case 18:qe!==null&&($t?(t=qe,sC(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Qi(t)):sC(qe,a.stateNode));break;case 4:r=qe,n=$t,qe=a.stateNode.containerInfo,$t=!0,wr(t,e,a),qe=r,$t=n;break;case 0:case 11:case 14:case 15:Pn(2,a,e),tt||Pn(4,a,e),wr(t,e,a);break;case 1:tt||(ir(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&cw(a,e,r)),wr(t,e,a);break;case 21:wr(t,e,a);break;case 22:tt=(r=tt)||a.memoizedState!==null,wr(t,e,a),tt=r;break;default:wr(t,e,a)}}function vw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Qi(t)}catch(a){Ce(e,e.return,a)}}}function yw(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Qi(t)}catch(a){Ce(e,e.return,a)}}function tM(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new G0),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new G0),e;default:throw Error(R(435,t.tag))}}function qc(t,e){var a=tM(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=cM.bind(null,t,r);r.then(n,n)}})}function zt(t,e){var a=e.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],o=t,i=e,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(qn(s.type)){qe=s.stateNode,$t=!1;break e}break;case 5:qe=s.stateNode,$t=!1;break e;case 3:case 4:qe=s.stateNode.containerInfo,$t=!0;break e}s=s.return}if(qe===null)throw Error(R(160));gw(o,i,n),qe=null,$t=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)xw(e,t),e=e.sibling}var qa=null;function xw(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zt(e,t),Vt(t),r&4&&(Pn(3,t,t.return),au(3,t),Pn(5,t,t.return));break;case 1:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&64&&kr&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var n=qa;if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),r&4){var o=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":o=n.getElementsByTagName("title")[0],(!o||o[Ql]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),St(o,r,a),o[yt]=t,pt(o),r=o;break e;case"link":var i=hC("link","href",n).get(r+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;case"meta":if(i=hC("meta","content",n).get(r+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(s,1);break t}}o=n.createElement(r),St(o,r,a),n.head.appendChild(o);break;default:throw Error(R(468,r))}o[yt]=t,pt(o),r=o}t.stateNode=r}else mC(n,t.type,t.stateNode);else t.stateNode=pC(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?mC(n,t.type,t.stateNode):pC(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&Lm(t,t.memoizedProps,a.memoizedProps)}break;case 27:zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),a!==null&&r&4&&Lm(t,t.memoizedProps,a.memoizedProps);break;case 5:if(zt(e,t),Vt(t),r&512&&(tt||a===null||ir(a,a.return)),t.flags&32){n=t.stateNode;try{$i(n,"")}catch(S){Ce(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,Lm(t,n,a!==null?a.memoizedProps:n)),r&1024&&(Am=!0);break;case 6:if(zt(e,t),Vt(t),r&4){if(t.stateNode===null)throw Error(R(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){Ce(t,t.return,S)}}break;case 3:if(od=null,n=qa,qa=Md(e.containerInfo),zt(e,t),qa=n,Vt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Qi(e.containerInfo)}catch(S){Ce(t,t.return,S)}Am&&(Am=!1,bw(t));break;case 4:r=qa,qa=Md(t.stateNode.containerInfo),zt(e,t),Vt(t),qa=r;break;case 12:zt(e,t),Vt(t);break;case 31:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,qc(t,r)));break;case 13:zt(e,t),Vt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zd=ia()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,qc(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=kr,c=tt;if(kr=u||n,tt=c||l,zt(e,t),tt=c,kr=u,Vt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||kr||tt||yo(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){l=a=e;try{if(o=l.stateNode,n)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,h=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(S){Ce(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){Ce(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var g=l.stateNode;n?lC(g,!0):lC(l.stateNode,!1)}catch(S){Ce(l,l.return,S)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,qc(t,a))));break;case 19:zt(e,t),Vt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,qc(t,r)));break;case 30:break;case 21:break;default:zt(e,t),Vt(t)}}function Vt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(fw(r)){a=r;break}r=r.return}if(a==null)throw Error(R(160));switch(a.tag){case 27:var n=a.stateNode,o=Im(t);wd(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&($i(i,""),a.flags&=-33);var s=Im(t);wd(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=Im(t);hg(t,u,l);break;default:throw Error(R(161))}}catch(c){Ce(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function bw(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;bw(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Lr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)hw(t,e.alternate,e),e=e.sibling}function yo(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Pn(4,e,e.return),yo(e);break;case 1:ir(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&cw(e,e.return,a),yo(e);break;case 27:Dl(e.stateNode);case 26:case 5:ir(e,e.return),yo(e);break;case 22:e.memoizedState===null&&yo(e);break;case 30:yo(e);break;default:yo(e)}t=t.sibling}}function Ir(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,n=t,o=e,i=o.flags;switch(o.tag){case 0:case 11:case 15:Ir(n,o,a),au(4,o);break;case 1:if(Ir(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){Ce(r,r.return,u)}if(r=o,n=r.updateQueue,n!==null){var s=r.stateNode;try{var l=n.shared.hiddenCallbacks;if(l!==null)for(n.shared.hiddenCallbacks=null,n=0;n<l.length;n++)v_(l[n],s)}catch(u){Ce(r,r.return,u)}}a&&i&64&&uw(o),El(o,o.return);break;case 27:pw(o);case 26:case 5:Ir(n,o,a),a&&r===null&&i&4&&dw(o),El(o,o.return);break;case 12:Ir(n,o,a);break;case 31:Ir(n,o,a),a&&i&4&&vw(n,o);break;case 13:Ir(n,o,a),a&&i&4&&yw(n,o);break;case 22:o.memoizedState===null&&Ir(n,o,a),El(o,o.return);break;case 30:break;default:Ir(n,o,a)}e=e.sibling}}function pv(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&eu(a))}function hv(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&eu(t))}function Ua(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sw(t,e,a,r),e=e.sibling}function Sw(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Ua(t,e,a,r),n&2048&&au(9,e);break;case 1:Ua(t,e,a,r);break;case 3:Ua(t,e,a,r),n&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&eu(t)));break;case 12:if(n&2048){Ua(t,e,a,r),t=e.stateNode;try{var o=e.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){Ce(e,e.return,l)}}else Ua(t,e,a,r);break;case 31:Ua(t,e,a,r);break;case 13:Ua(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Ua(t,e,a,r):Tl(t,e):o._visibility&2?Ua(t,e,a,r):(o._visibility|=2,Si(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&pv(i,e);break;case 24:Ua(t,e,a,r),n&2048&&hv(e.alternate,e);break;default:Ua(t,e,a,r)}}function Si(t,e,a,r,n){for(n=n&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,i=e,s=a,l=r,u=i.flags;switch(i.tag){case 0:case 11:case 15:Si(o,i,s,l,n),au(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Si(o,i,s,l,n):Tl(o,i):(c._visibility|=2,Si(o,i,s,l,n)),n&&u&2048&&pv(i.alternate,i);break;case 24:Si(o,i,s,l,n),n&&u&2048&&hv(i.alternate,i);break;default:Si(o,i,s,l,n)}e=e.sibling}}function Tl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,r=e,n=r.flags;switch(r.tag){case 22:Tl(a,r),n&2048&&pv(r.alternate,r);break;case 24:Tl(a,r),n&2048&&hv(r.alternate,r);break;default:Tl(a,r)}e=e.sibling}}var bl=8192;function bi(t,e,a){if(t.subtreeFlags&bl)for(t=t.child;t!==null;)Cw(t,e,a),t=t.sibling}function Cw(t,e,a){switch(t.tag){case 26:bi(t,e,a),t.flags&bl&&t.memoizedState!==null&&HM(a,qa,t.memoizedState,t.memoizedProps);break;case 5:bi(t,e,a);break;case 3:case 4:var r=qa;qa=Md(t.stateNode.containerInfo),bi(t,e,a),qa=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=bl,bl=16777216,bi(t,e,a),bl=r):bi(t,e,a));break;default:bi(t,e,a)}}function _w(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function pl(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,Lw(r,t)}_w(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ww(t),t=t.sibling}function ww(t){switch(t.tag){case 0:case 11:case 15:pl(t),t.flags&2048&&Pn(9,t,t.return);break;case 3:pl(t);break;case 12:pl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,rd(t)):pl(t);break;default:pl(t)}}function rd(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var r=e[a];ft=r,Lw(r,t)}_w(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Pn(8,e,e.return),rd(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,rd(e));break;default:rd(e)}t=t.sibling}}function Lw(t,e){for(;ft!==null;){var a=ft;switch(a.tag){case 0:case 11:case 15:Pn(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:eu(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,ft=r;else e:for(a=t;ft!==null;){r=ft;var n=r.sibling,o=r.return;if(mw(r),r===a){ft=null;break e}if(n!==null){n.return=o,ft=n;break e}ft=o}}}var aM={getCacheForType:function(t){var e=bt(at),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return bt(at).controller.signal}},rM=typeof WeakMap=="function"?WeakMap:Map,ye=0,Ae=null,ce=null,pe=0,Se=0,aa=null,wn=!1,rs=!1,mv=!1,Hr=0,Xe=0,Hn=0,_o=0,gv=0,oa=0,Zi=0,Rl=null,jt=null,mg=!1,Zd=0,Iw=0,Ld=1/0,Id=null,Rn=null,ot=0,Mn=null,Xi=null,Or=0,gg=0,vg=null,Aw=null,Ml=0,yg=null;function ua(){return(ye&2)!==0&&pe!==0?pe&-pe:ee.T!==null?yv():FC()}function kw(){if(oa===0)if((pe&536870912)===0||he){var t=Rc;Rc<<=1,(Rc&3932160)===0&&(Rc=262144),oa=t}else oa=536870912;return t=da.current,t!==null&&(t.flags|=32),oa}function Gt(t,e,a){(t===Ae&&(Se===2||Se===9)||t.cancelPendingCommit!==null)&&(Yi(t,0),Ln(t,pe,oa,!1)),Kl(t,a),((ye&2)===0||t!==Ae)&&(t===Ae&&((ye&2)===0&&(_o|=a),Xe===4&&Ln(t,pe,oa,!1)),ur(t))}function Ew(t,e,a){if((ye&6)!==0)throw Error(R(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Yl(t,e),n=r?iM(t,e):km(t,e,!0),o=r;do{if(n===0){rs&&!r&&Ln(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!nM(a)){n=km(t,e,!1),o=!1;continue}if(n===2){if(o=e,t.errorRecoveryDisabledLanes&o)var i=0;else i=t.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){e=i;e:{var s=t;n=Rl;var l=s.current.memoizedState.isDehydrated;if(l&&(Yi(s,i).flags|=256),i=km(s,i,!1),i!==2){if(mv&&!l){s.errorRecoveryDisabledLanes|=o,_o|=o,n=4;break e}o=jt,jt=n,o!==null&&(jt===null?jt=o:jt.push.apply(jt,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){Yi(t,0),Ln(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(R(345));case 4:if((e&4194048)!==e)break;case 6:Ln(r,e,oa,!wn);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(R(329))}if((e&62914560)===e&&(n=Zd+300-ia(),10<n)){if(Ln(r,e,oa,!wn),Nd(r,0,!0)!==0)break e;Or=e,r.timeoutHandle=Xw(W0.bind(null,r,a,jt,Id,mg,e,oa,_o,Zi,wn,o,"Throttled",-0,0),n);break e}W0(r,a,jt,Id,mg,e,oa,_o,Zi,wn,o,null,-0,0)}}break}while(!0);ur(t)}function W0(t,e,a,r,n,o,i,s,l,u,c,d,h,g){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},Cw(e,o,d);var S=(o&62914560)===o?Zd-ia():(o&4194048)===o?Iw-ia():0;if(S=UM(d,S),S!==null){Or=o,t.cancelPendingCommit=S(X0.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,h,g)),Ln(t,o,i,!u);return}}X0(t,e,o,a,r,n,i,s,l)}function nM(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],o=n.getSnapshot;n=n.value;try{if(!ca(o(),n))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ln(t,e,a,r){e&=~gv,e&=~_o,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-la(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&DC(t,a,e)}function Xd(){return(ye&6)===0?(ru(0,!1),!1):!0}function vv(){if(ce!==null){if(Se===0)var t=ce.return;else t=ce,Rr=Do=null,av(t),Hi=null,Ul=0,t=ce;for(;t!==null;)lw(t.alternate,t),t=t.return;ce=null}}function Yi(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,CM(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Or=0,vv(),Ae=t,ce=a=Mr(t.current,null),pe=e,Se=0,aa=null,wn=!1,rs=Yl(t,e),mv=!1,Zi=oa=gv=_o=Hn=Xe=0,jt=Rl=null,mg=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var n=31-la(r),o=1<<n;e|=t[n],r&=~o}return Hr=e,qd(),a}function Tw(t,e){ie=null,ee.H=zl,e===as||e===Vd?(e=L0(),Se=3):e===Xg?(e=L0(),Se=4):Se=e===dv?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,aa=e,ce===null&&(Xe=1,Cd(t,La(e,t.current)))}function Rw(){var t=da.current;return t===null?!0:(pe&4194048)===pe?Aa===null:(pe&62914560)===pe||(pe&536870912)!==0?t===Aa:!1}function Mw(){var t=ee.H;return ee.H=zl,t===null?zl:t}function Dw(){var t=ee.A;return ee.A=aM,t}function Ad(){Xe=4,wn||(pe&4194048)!==pe&&da.current!==null||(rs=!0),(Hn&134217727)===0&&(_o&134217727)===0||Ae===null||Ln(Ae,pe,oa,!1)}function km(t,e,a){var r=ye;ye|=2;var n=Mw(),o=Dw();(Ae!==t||pe!==e)&&(Id=null,Yi(t,e)),e=!1;var i=Xe;e:do try{if(Se!==0&&ce!==null){var s=ce,l=aa;switch(Se){case 8:vv(),i=6;break e;case 3:case 2:case 9:case 6:da.current===null&&(e=!0);var u=Se;if(Se=0,aa=null,Oi(t,s,l,u),a&&rs){i=0;break e}break;default:u=Se,Se=0,aa=null,Oi(t,s,l,u)}}oM(),i=Xe;break}catch(c){Tw(t,c)}while(!0);return e&&t.shellSuspendCounter++,Rr=Do=null,ye=r,ee.H=n,ee.A=o,ce===null&&(Ae=null,pe=0,qd()),i}function oM(){for(;ce!==null;)Ow(ce)}function iM(t,e){var a=ye;ye|=2;var r=Mw(),n=Dw();Ae!==t||pe!==e?(Id=null,Ld=ia()+500,Yi(t,e)):rs=Yl(t,e);e:do try{if(Se!==0&&ce!==null){e=ce;var o=aa;t:switch(Se){case 1:Se=0,aa=null,Oi(t,e,o,1);break;case 2:case 9:if(w0(o)){Se=0,aa=null,Z0(e);break}e=function(){Se!==2&&Se!==9||Ae!==t||(Se=7),ur(t)},o.then(e,e);break e;case 3:Se=7;break e;case 4:Se=5;break e;case 7:w0(o)?(Se=0,aa=null,Z0(e)):(Se=0,aa=null,Oi(t,e,o,7));break;case 5:var i=null;switch(ce.tag){case 26:i=ce.memoizedState;case 5:case 27:var s=ce;if(i?eL(i):s.stateNode.complete){Se=0,aa=null;var l=s.sibling;if(l!==null)ce=l;else{var u=s.return;u!==null?(ce=u,Yd(u)):ce=null}break t}}Se=0,aa=null,Oi(t,e,o,5);break;case 6:Se=0,aa=null,Oi(t,e,o,6);break;case 8:vv(),Xe=6;break e;default:throw Error(R(462))}}sM();break}catch(c){Tw(t,c)}while(!0);return Rr=Do=null,ee.H=r,ee.A=n,ye=a,ce!==null?0:(Ae=null,pe=0,qd(),Xe)}function sM(){for(;ce!==null&&!TT();)Ow(ce)}function Ow(t){var e=sw(t.alternate,t,Hr);t.memoizedProps=t.pendingProps,e===null?Yd(t):ce=e}function Z0(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=q0(a,e,e.pendingProps,e.type,void 0,pe);break;case 11:e=q0(a,e,e.pendingProps,e.type.render,e.ref,pe);break;case 5:av(e);default:lw(a,e),e=ce=l_(e,Hr),e=sw(a,e,Hr)}t.memoizedProps=t.pendingProps,e===null?Yd(t):ce=e}function Oi(t,e,a,r){Rr=Do=null,av(e),Hi=null,Ul=0;var n=e.return;try{if(XR(t,n,e,a,pe)){Xe=1,Cd(t,La(a,t.current)),ce=null;return}}catch(o){if(n!==null)throw ce=n,o;Xe=1,Cd(t,La(a,t.current)),ce=null;return}e.flags&32768?(he||r===1?t=!0:rs||(pe&536870912)!==0?t=!1:(wn=t=!0,(r===2||r===9||r===3||r===6)&&(r=da.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bw(e,t)):Yd(e)}function Yd(t){var e=t;do{if((e.flags&32768)!==0){Bw(e,wn);return}t=e.return;var a=QR(e.alternate,e,Hr);if(a!==null){ce=a;return}if(e=e.sibling,e!==null){ce=e;return}ce=e=t}while(e!==null);Xe===0&&(Xe=5)}function Bw(t,e){do{var a=JR(t.alternate,t);if(a!==null){a.flags&=32767,ce=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){ce=t;return}ce=t=a}while(t!==null);Xe=6,ce=null}function X0(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Kd();while(ot!==0);if((ye&6)!==0)throw Error(R(327));if(e!==null){if(e===t.current)throw Error(R(177));if(o=e.lanes|e.childLanes,o|=zg,UT(t,a,o,i,s,l),t===Ae&&(ce=Ae=null,pe=0),Xi=e,Mn=t,Or=a,gg=o,vg=n,Aw=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,dM(dd,function(){return Uw(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=ee.T,ee.T=null,n=xe.p,xe.p=2,i=ye,ye|=4;try{eM(t,e,a)}finally{ye=i,xe.p=n,ee.T=r}}ot=1,Fw(),Nw(),Pw()}}function Fw(){if(ot===1){ot=0;var t=Mn,e=Xi,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=ee.T,ee.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{xw(e,t);var o=Cg,i=e_(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&JC(s.ownerDocument.documentElement,s)){if(l!==null&&qg(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var g=h.getSelection(),S=s.textContent.length,b=Math.min(l.start,S),x=l.end===void 0?b:Math.min(l.end,S);!g.extend&&b>x&&(i=x,x=b,b=i);var f=v0(s,b),m=v0(s,x);if(f&&m&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==m.node||g.focusOffset!==m.offset)){var v=d.createRange();v.setStart(f.node,f.offset),g.removeAllRanges(),b>x?(g.addRange(v),g.extend(m.node,m.offset)):(v.setEnd(m.node,m.offset),g.addRange(v))}}}}for(d=[],g=s;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var y=d[s];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}Bd=!!Sg,Cg=Sg=null}finally{ye=n,xe.p=r,ee.T=a}}t.current=e,ot=2}}function Nw(){if(ot===2){ot=0;var t=Mn,e=Xi,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=ee.T,ee.T=null;var r=xe.p;xe.p=2;var n=ye;ye|=4;try{hw(t,e.alternate,e)}finally{ye=n,xe.p=r,ee.T=a}}ot=3}}function Pw(){if(ot===4||ot===3){ot=0,RT();var t=Mn,e=Xi,a=Or,r=Aw;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ot=5:(ot=0,Xi=Mn=null,Hw(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(Rn=null),Og(a),e=e.stateNode,sa&&typeof sa.onCommitFiberRoot=="function")try{sa.onCommitFiberRoot(Xl,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=ee.T,n=xe.p,xe.p=2,ee.T=null;try{for(var o=t.onRecoverableError,i=0;i<r.length;i++){var s=r[i];o(s.value,{componentStack:s.stack})}}finally{ee.T=e,xe.p=n}}(Or&3)!==0&&Kd(),ur(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===yg?Ml++:(Ml=0,yg=t):Ml=0,ru(0,!1)}}function Hw(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,eu(e)))}function Kd(){return Fw(),Nw(),Pw(),Uw()}function Uw(){if(ot!==5)return!1;var t=Mn,e=gg;gg=0;var a=Og(Or),r=ee.T,n=xe.p;try{xe.p=32>a?32:a,ee.T=null,a=vg,vg=null;var o=Mn,i=Or;if(ot=0,Xi=Mn=null,Or=0,(ye&6)!==0)throw Error(R(331));var s=ye;if(ye|=4,ww(o.current),Sw(o,o.current,i,a),ye=s,ru(0,!1),sa&&typeof sa.onPostCommitFiberRoot=="function")try{sa.onPostCommitFiberRoot(Xl,o)}catch{}return!0}finally{xe.p=n,ee.T=r,Hw(t,e)}}function Y0(t,e,a){e=La(a,e),e=dg(t.stateNode,e,2),t=Tn(t,e,2),t!==null&&(Kl(t,2),ur(t))}function Ce(t,e,a){if(t.tag===3)Y0(t,t,a);else for(;e!==null;){if(e.tag===3){Y0(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){t=La(a,t),a=tw(2),r=Tn(e,a,2),r!==null&&(aw(a,r,e,t),Kl(r,2),ur(r));break}}e=e.return}}function Em(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new rM;var n=new Set;r.set(e,n)}else n=r.get(e),n===void 0&&(n=new Set,r.set(e,n));n.has(a)||(mv=!0,n.add(a),t=lM.bind(null,t,e,a),e.then(t,t))}function lM(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ae===t&&(pe&a)===a&&(Xe===4||Xe===3&&(pe&62914560)===pe&&300>ia()-Zd?(ye&2)===0&&Yi(t,0):gv|=a,Zi===pe&&(Zi=0)),ur(t)}function qw(t,e){e===0&&(e=MC()),t=Mo(t,e),t!==null&&(Kl(t,e),ur(t))}function uM(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),qw(t,a)}function cM(t,e){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,n=t.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(R(314))}r!==null&&r.delete(e),qw(t,a)}function dM(t,e){return Mg(t,e)}var kd=null,Ci=null,xg=!1,Ed=!1,Tm=!1,In=0;function ur(t){t!==Ci&&t.next===null&&(Ci===null?kd=Ci=t:Ci=Ci.next=t),Ed=!0,xg||(xg=!0,pM())}function ru(t,e){if(!Tm&&Ed){Tm=!0;do for(var a=!1,r=kd;r!==null;){if(!e)if(t!==0){var n=r.pendingLanes;if(n===0)var o=0;else{var i=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-la(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,K0(r,o))}else o=pe,o=Nd(r,r===Ae?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Yl(r,o)||(a=!0,K0(r,o));r=r.next}while(a);Tm=!1}}function fM(){zw()}function zw(){Ed=xg=!1;var t=0;In!==0&&SM()&&(t=In);for(var e=ia(),a=null,r=kd;r!==null;){var n=r.next,o=Vw(r,e);o===0?(r.next=null,a===null?kd=n:a.next=n,n===null&&(Ci=a)):(a=r,(t!==0||(o&3)!==0)&&(Ed=!0)),r=n}ot!==0&&ot!==5||ru(t,!1),In!==0&&(In=0)}function Vw(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-la(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=HT(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Ae,a=pe,a=Nd(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(Se===2||Se===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&om(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Yl(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&om(r),Og(a)){case 2:case 8:a=TC;break;case 32:a=dd;break;case 268435456:a=RC;break;default:a=dd}return r=$w.bind(null,t),a=Mg(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&om(r),t.callbackPriority=2,t.callbackNode=null,2}function $w(t,e){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Kd()&&t.callbackNode!==a)return null;var r=pe;return r=Nd(t,t===Ae?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(Ew(t,r,e),Vw(t,ia()),t.callbackNode!=null&&t.callbackNode===a?$w.bind(null,t):null)}function K0(t,e){if(Kd())return null;Ew(t,e,!0)}function pM(){_M(function(){(ye&6)!==0?Mg(EC,fM):zw()})}function yv(){if(In===0){var t=ji;t===0&&(t=Tc,Tc<<=1,(Tc&261888)===0&&(Tc=256)),In=t}return In}function Q0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Zc(""+t)}function J0(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function hM(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=Q0((n[Wt]||null).action),i=r.submitter;i&&(e=(e=i[Wt]||null)?Q0(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new Pd("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(In!==0){var l=i?J0(n,i):new FormData(n);ug(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?J0(n,i):new FormData(n),ug(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(zc=0;zc<Km.length;zc++)Vc=Km[zc],eC=Vc.toLowerCase(),tC=Vc[0].toUpperCase()+Vc.slice(1),za(eC,"on"+tC);var Vc,eC,tC,zc;za(a_,"onAnimationEnd");za(r_,"onAnimationIteration");za(n_,"onAnimationStart");za("dblclick","onDoubleClick");za("focusin","onFocus");za("focusout","onBlur");za(MR,"onTransitionRun");za(DR,"onTransitionStart");za(OR,"onTransitionCancel");za(o_,"onTransitionEnd");Vi("onMouseEnter",["mouseout","mouseover"]);Vi("onMouseLeave",["mouseout","mouseover"]);Vi("onPointerEnter",["pointerout","pointerover"]);Vi("onPointerLeave",["pointerout","pointerover"]);Eo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Eo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Eo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Eo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Eo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vl));function jw(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var r=t[a],n=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){pd(c)}n.currentTarget=null,o=l}else for(i=0;i<r.length;i++){if(s=r[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&n.isPropagationStopped())break e;o=s,n.currentTarget=u;try{o(n)}catch(c){pd(c)}n.currentTarget=null,o=l}}}}function ue(t,e){var a=e[Vm];a===void 0&&(a=e[Vm]=new Set);var r=t+"__bubble";a.has(r)||(Gw(e,t,2,!1),a.add(r))}function Rm(t,e,a){var r=0;e&&(r|=4),Gw(a,t,r,e)}var $c="_reactListening"+Math.random().toString(36).slice(2);function xv(t){if(!t[$c]){t[$c]=!0,NC.forEach(function(a){a!=="selectionchange"&&(mM.has(a)||Rm(a,!1,t),Rm(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[$c]||(e[$c]=!0,Rm("selectionchange",!1,e))}}function Gw(t,e,a,r){switch(oL(e)){case 2:var n=VM;break;case 8:n=$M;break;default:n=_v}a=n.bind(null,e,a,t),n=void 0,!Zm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),r?n!==void 0?t.addEventListener(e,a,{capture:!0,passive:n}):t.addEventListener(e,a,!0):n!==void 0?t.addEventListener(e,a,{passive:n}):t.addEventListener(e,a,!1)}function Mm(t,e,a,r,n){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var s=r.stateNode.containerInfo;if(s===n)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===n)return;i=i.return}for(;s!==null;){if(i=Li(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){r=o=i;continue e}s=s.parentNode}}r=r.return}jC(function(){var u=o,c=Ng(a),d=[];e:{var h=i_.get(t);if(h!==void 0){var g=Pd,S=t;switch(t){case"keypress":if(Yc(a)===0)break e;case"keydown":case"keyup":g=cR;break;case"focusin":S="focus",g=cm;break;case"focusout":S="blur",g=cm;break;case"beforeblur":case"afterblur":g=cm;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=l0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=QT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=pR;break;case a_:case r_:case n_:g=tR;break;case o_:g=mR;break;case"scroll":case"scrollend":g=YT;break;case"wheel":g=vR;break;case"copy":case"cut":case"paste":g=rR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=c0;break;case"toggle":case"beforetoggle":g=xR}var b=(e&4)!==0,x=!b&&(t==="scroll"||t==="scrollend"),f=b?h!==null?h+"Capture":null:h;b=[];for(var m=u,v;m!==null;){var y=m;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||f===null||(y=Bl(m,f),y!=null&&b.push($l(m,y,v))),x)break;m=m.return}0<b.length&&(h=new g(h,S,null,a,c),d.push({event:h,listeners:b}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&a!==Wm&&(S=a.relatedTarget||a.fromElement)&&(Li(S)||S[Ji]))break e;if((g||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,g?(S=a.relatedTarget||a.toElement,g=u,S=S?Li(S):null,S!==null&&(x=Zl(S),b=S.tag,S!==x||b!==5&&b!==27&&b!==6)&&(S=null)):(g=null,S=u),g!==S)){if(b=l0,y="onMouseLeave",f="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(b=c0,y="onPointerLeave",f="onPointerEnter",m="pointer"),x=g==null?h:yl(g),v=S==null?h:yl(S),h=new b(y,m+"leave",g,a,c),h.target=x,h.relatedTarget=v,y=null,Li(c)===u&&(b=new b(f,m+"enter",S,a,c),b.target=v,b.relatedTarget=x,y=b),x=y,g&&S)t:{for(b=gM,f=g,m=S,v=0,y=f;y;y=b(y))v++;y=0;for(var _=m;_;_=b(_))y++;for(;0<v-y;)f=b(f),v--;for(;0<y-v;)m=b(m),y--;for(;v--;){if(f===m||m!==null&&f===m.alternate){b=f;break t}f=b(f),m=b(m)}b=null}else b=null;g!==null&&aC(d,h,g,b,!1),S!==null&&x!==null&&aC(d,x,S,b,!0)}}e:{if(h=u?yl(u):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var L=h0;else if(p0(h))if(KC)L=ER;else{L=AR;var C=IR}else g=h.nodeName,!g||g.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&Fg(u.elementType)&&(L=h0):L=kR;if(L&&(L=L(t,u))){YC(d,L,a,c);break e}C&&C(t,h,u),t==="focusout"&&u&&h.type==="number"&&u.memoizedProps.value!=null&&Gm(h,"number",h.value)}switch(C=u?yl(u):window,t){case"focusin":(p0(C)||C.contentEditable==="true")&&(ki=C,Xm=u,_l=null);break;case"focusout":_l=Xm=ki=null;break;case"mousedown":Ym=!0;break;case"contextmenu":case"mouseup":case"dragend":Ym=!1,y0(d,a,c);break;case"selectionchange":if(RR)break;case"keydown":case"keyup":y0(d,a,c)}var k;if(Ug)e:{switch(t){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Ai?ZC(t,a)&&(w="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(w="onCompositionStart");w&&(WC&&a.locale!=="ko"&&(Ai||w!=="onCompositionStart"?w==="onCompositionEnd"&&Ai&&(k=GC()):(_n=c,Pg="value"in _n?_n.value:_n.textContent,Ai=!0)),C=Td(u,w),0<C.length&&(w=new u0(w,t,null,a,c),d.push({event:w,listeners:C}),k?w.data=k:(k=XC(a),k!==null&&(w.data=k)))),(k=SR?CR(t,a):_R(t,a))&&(w=Td(u,"onBeforeInput"),0<w.length&&(C=new u0("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:w}),C.data=k)),hM(d,t,u,a,c)}jw(d,e)})}function $l(t,e,a){return{instance:t,listener:e,currentTarget:a}}function Td(t,e){for(var a=e+"Capture",r=[];t!==null;){var n=t,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=Bl(t,a),n!=null&&r.unshift($l(t,n,o)),n=Bl(t,e),n!=null&&r.push($l(t,n,o))),t.tag===3)return r;t=t.return}return[]}function gM(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function aC(t,e,a,r,n){for(var o=e._reactName,i=[];a!==null&&a!==r;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||u===null||(l=u,n?(u=Bl(a,o),u!=null&&i.unshift($l(a,u,l))):n||(u=Bl(a,o),u!=null&&i.push($l(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var vM=/\r\n?/g,yM=/\u0000|\uFFFD/g;function rC(t){return(typeof t=="string"?t:""+t).replace(vM,`
9
- `).replace(yM,"")}function Ww(t,e){return e=rC(e),rC(t)===e}function we(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||$i(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&$i(t,""+r);break;case"className":Dc(t,"class",r);break;case"tabIndex":Dc(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Dc(t,a,r);break;case"style":$C(t,r,o);break;case"data":if(e!=="object"){Dc(t,"data",r);break}case"src":case"href":if(r===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Zc(""+r),t.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(a==="formAction"?(e!=="input"&&we(t,e,"name",n.name,n,null),we(t,e,"formEncType",n.formEncType,n,null),we(t,e,"formMethod",n.formMethod,n,null),we(t,e,"formTarget",n.formTarget,n,null)):(we(t,e,"encType",n.encType,n,null),we(t,e,"method",n.method,n,null),we(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Zc(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=Tr);break;case"onScroll":r!=null&&ue("scroll",t);break;case"onScrollEnd":r!=null&&ue("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(R(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(R(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}a=Zc(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""+r):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":ue("beforetoggle",t),ue("toggle",t),Wc(t,"popover",r);break;case"xlinkActuate":Cr(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Cr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Cr(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Cr(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Cr(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Cr(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Cr(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Cr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Cr(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Wc(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ZT.get(a)||a,Wc(t,a,r))}}function bg(t,e,a,r,n,o){switch(a){case"style":$C(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(R(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(R(60));t.innerHTML=a}}break;case"children":typeof r=="string"?$i(t,r):(typeof r=="number"||typeof r=="bigint")&&$i(t,""+r);break;case"onScroll":r!=null&&ue("scroll",t);break;case"onScrollEnd":r!=null&&ue("scrollend",t);break;case"onClick":r!=null&&(t.onclick=Tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!PC.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),e=a.slice(2,n?a.length-7:void 0),o=t[Wt]||null,o=o!=null?o[a]:null,typeof o=="function"&&t.removeEventListener(e,o,n),typeof r=="function")){typeof o!="function"&&o!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,r,n);break e}a in t?t[a]=r:r===!0?t.setAttribute(a,""):Wc(t,a,r)}}}function St(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ue("error",t),ue("load",t);var r=!1,n=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(R(137,e));default:we(t,e,o,i,a,null)}}n&&we(t,e,"srcSet",a.srcSet,a,null),r&&we(t,e,"src",a.src,a,null);return;case"input":ue("invalid",t);var s=o=i=n=null,l=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var c=a[r];if(c!=null)switch(r){case"name":n=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(R(137,e));break;default:we(t,e,r,c,a,null)}}qC(t,o,s,l,u,i,n,!1);return;case"select":ue("invalid",t),r=i=o=null;for(n in a)if(a.hasOwnProperty(n)&&(s=a[n],s!=null))switch(n){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:we(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Fi(t,!!r,e,!1):a!=null&&Fi(t,!!r,a,!0);return;case"textarea":ue("invalid",t),o=n=r=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":n=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(R(91));break;default:we(t,e,i,s,a,null)}VC(t,r,n,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null)&&(l==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":we(t,e,l,r,a,null));return;case"dialog":ue("beforetoggle",t),ue("toggle",t),ue("cancel",t),ue("close",t);break;case"iframe":case"object":ue("load",t);break;case"video":case"audio":for(r=0;r<Vl.length;r++)ue(Vl[r],t);break;case"image":ue("error",t),ue("load",t);break;case"details":ue("toggle",t);break;case"embed":case"source":case"link":ue("error",t),ue("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(R(137,e));default:we(t,e,u,r,a,null)}return;default:if(Fg(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&bg(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&we(t,e,s,r,a,null))}function xM(t,e,a,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,i=null,s=null,l=null,u=null,c=null;for(g in a){var d=a[g];if(a.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(g)||we(t,e,g,null,r,d)}}for(var h in r){var g=r[h];if(d=a[h],r.hasOwnProperty(h)&&(g!=null||d!=null))switch(h){case"type":o=g;break;case"name":n=g;break;case"checked":u=g;break;case"defaultChecked":c=g;break;case"value":i=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(R(137,e));break;default:g!==d&&we(t,e,h,g,r,d)}}jm(t,i,s,l,u,c,o,n);return;case"select":g=i=s=h=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":g=l;default:r.hasOwnProperty(o)||we(t,e,o,null,r,l)}for(n in r)if(o=r[n],l=a[n],r.hasOwnProperty(n)&&(o!=null||l!=null))switch(n){case"value":h=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&we(t,e,n,o,r,l)}e=s,a=i,r=g,h!=null?Fi(t,!!a,h,!1):!!r!=!!a&&(e!=null?Fi(t,!!a,e,!0):Fi(t,!!a,a?[]:"",!1));return;case"textarea":g=h=null;for(s in a)if(n=a[s],a.hasOwnProperty(s)&&n!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:we(t,e,s,null,r,n)}for(i in r)if(n=r[i],o=a[i],r.hasOwnProperty(i)&&(n!=null||o!=null))switch(i){case"value":h=n;break;case"defaultValue":g=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(R(91));break;default:n!==o&&we(t,e,i,n,r,o)}zC(t,h,g);return;case"option":for(var S in a)h=a[S],a.hasOwnProperty(S)&&h!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:we(t,e,S,null,r,h));for(l in r)h=r[l],g=a[l],r.hasOwnProperty(l)&&h!==g&&(h!=null||g!=null)&&(l==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,l,h,r,g));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in a)h=a[b],a.hasOwnProperty(b)&&h!=null&&!r.hasOwnProperty(b)&&we(t,e,b,null,r,h);for(u in r)if(h=r[u],g=a[u],r.hasOwnProperty(u)&&h!==g&&(h!=null||g!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(R(137,e));break;default:we(t,e,u,h,r,g)}return;default:if(Fg(e)){for(var x in a)h=a[x],a.hasOwnProperty(x)&&h!==void 0&&!r.hasOwnProperty(x)&&bg(t,e,x,void 0,r,h);for(c in r)h=r[c],g=a[c],!r.hasOwnProperty(c)||h===g||h===void 0&&g===void 0||bg(t,e,c,h,r,g);return}}for(var f in a)h=a[f],a.hasOwnProperty(f)&&h!=null&&!r.hasOwnProperty(f)&&we(t,e,f,null,r,h);for(d in r)h=r[d],g=a[d],!r.hasOwnProperty(d)||h===g||h==null&&g==null||we(t,e,d,h,r,g)}function nC(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bM(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],o=n.transferSize,i=n.initiatorType,s=n.duration;if(o&&s&&nC(i)){for(i=0,s=n.responseEnd,r+=1;r<a.length;r++){var l=a[r],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&nC(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--r,e+=8*(o+i)/(n.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Sg=null,Cg=null;function Rd(t){return t.nodeType===9?t:t.ownerDocument}function oC(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zw(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function _g(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Dm=null;function SM(){var t=window.event;return t&&t.type==="popstate"?t===Dm?!1:(Dm=t,!0):(Dm=null,!1)}var Xw=typeof setTimeout=="function"?setTimeout:void 0,CM=typeof clearTimeout=="function"?clearTimeout:void 0,iC=typeof Promise=="function"?Promise:void 0,_M=typeof queueMicrotask=="function"?queueMicrotask:typeof iC<"u"?function(t){return iC.resolve(null).then(t).catch(wM)}:Xw;function wM(t){setTimeout(function(){throw t})}function qn(t){return t==="head"}function sC(t,e){var a=e,r=0;do{var n=a.nextSibling;if(t.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){t.removeChild(n),Qi(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Dl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Dl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[Ql]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&Dl(t.ownerDocument.body);a=n}while(a);Qi(e)}function lC(t,e){var a=t;t=0;do{var r=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=r}while(a)}function wg(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":wg(a),Bg(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function LM(t,e,a,r){for(;t.nodeType===1;){var n=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[Ql])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==n.rel||t.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||t.getAttribute("title")!==(n.title==null?null:n.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(n.src==null?null:n.src)||t.getAttribute("type")!==(n.type==null?null:n.type)||t.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=n.name==null?null:""+n.name;if(n.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=ka(t.nextSibling),t===null)break}return null}function IM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ka(t.nextSibling),t===null))return null;return t}function Yw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=ka(t.nextSibling),t===null))return null;return t}function Lg(t){return t.data==="$?"||t.data==="$~"}function Ig(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function AM(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var r=function(){e(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function ka(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Ag=null;function uC(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return ka(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function cC(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function Kw(t,e,a){switch(e=Rd(a),t){case"html":if(t=e.documentElement,!t)throw Error(R(452));return t;case"head":if(t=e.head,!t)throw Error(R(453));return t;case"body":if(t=e.body,!t)throw Error(R(454));return t;default:throw Error(R(451))}}function Dl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Bg(t)}var Ea=new Map,dC=new Set;function Md(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ur=xe.d;xe.d={f:kM,r:EM,D:TM,C:RM,L:MM,m:DM,X:BM,S:OM,M:FM};function kM(){var t=Ur.f(),e=Xd();return t||e}function EM(t){var e=es(t);e!==null&&e.tag===5&&e.type==="form"?$_(e):Ur.r(t)}var ns=typeof document>"u"?null:document;function Qw(t,e,a){var r=ns;if(r&&typeof e=="string"&&e){var n=wa(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),dC.has(n)||(dC.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function TM(t){Ur.D(t),Qw("dns-prefetch",t,null)}function RM(t,e){Ur.C(t,e),Qw("preconnect",t,e)}function MM(t,e,a){Ur.L(t,e,a);var r=ns;if(r&&t&&e){var n='link[rel="preload"][as="'+wa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+wa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+wa(a.imageSizes)+'"]')):n+='[href="'+wa(t)+'"]';var o=n;switch(e){case"style":o=Ki(t);break;case"script":o=os(t)}Ea.has(o)||(t=Pe({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ea.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(nu(o))||e==="script"&&r.querySelector(ou(o))||(e=r.createElement("link"),St(e,"link",t),pt(e),r.head.appendChild(e)))}}function DM(t,e){Ur.m(t,e);var a=ns;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+wa(r)+'"][href="'+wa(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=os(t)}if(!Ea.has(o)&&(t=Pe({rel:"modulepreload",href:t},e),Ea.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ou(o)))return}r=a.createElement("link"),St(r,"link",t),pt(r),a.head.appendChild(r)}}}function OM(t,e,a){Ur.S(t,e,a);var r=ns;if(r&&t){var n=Bi(r).hoistableStyles,o=Ki(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(nu(o)))s.loading=5;else{t=Pe({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ea.get(o))&&bv(t,a);var l=i=r.createElement("link");pt(l),St(l,"link",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,nd(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function BM(t,e){Ur.X(t,e);var a=ns;if(a&&t){var r=Bi(a).hoistableScripts,n=os(t),o=r.get(n);o||(o=a.querySelector(ou(n)),o||(t=Pe({src:t,async:!0},e),(e=Ea.get(n))&&Sv(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function FM(t,e){Ur.M(t,e);var a=ns;if(a&&t){var r=Bi(a).hoistableScripts,n=os(t),o=r.get(n);o||(o=a.querySelector(ou(n)),o||(t=Pe({src:t,async:!0,type:"module"},e),(e=Ea.get(n))&&Sv(t,e),o=a.createElement("script"),pt(o),St(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function fC(t,e,a,r){var n=(n=An.current)?Md(n):null;if(!n)throw Error(R(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Ki(a.href),a=Bi(n).hoistableStyles,r=a.get(e),r||(r={type:"style",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Ki(a.href);var o=Bi(n).hoistableStyles,i=o.get(t);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,i),(o=n.querySelector(nu(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Ea.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ea.set(t,a),o||NM(n,t,a,i.state))),e&&r===null)throw Error(R(528,""));return i}if(e&&r!==null)throw Error(R(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=os(a),a=Bi(n).hoistableScripts,r=a.get(e),r||(r={type:"script",instance:null,count:0,state:null},a.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(R(444,t))}}function Ki(t){return'href="'+wa(t)+'"'}function nu(t){return'link[rel="stylesheet"]['+t+"]"}function Jw(t){return Pe({},t,{"data-precedence":t.precedence,precedence:null})}function NM(t,e,a,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),St(e,"link",a),pt(e),t.head.appendChild(e))}function os(t){return'[src="'+wa(t)+'"]'}function ou(t){return"script[async]"+t}function pC(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+wa(a.href)+'"]');if(r)return e.instance=r,pt(r),r;var n=Pe({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),pt(r),St(r,"style",n),nd(r,a.precedence,t),e.instance=r;case"stylesheet":n=Ki(a.href);var o=t.querySelector(nu(n));if(o)return e.state.loading|=4,e.instance=o,pt(o),o;r=Jw(a),(n=Ea.get(n))&&bv(r,n),o=(t.ownerDocument||t).createElement("link"),pt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),e.state.loading|=4,nd(o,a.precedence,t),e.instance=o;case"script":return o=os(a.src),(n=t.querySelector(ou(o)))?(e.instance=n,pt(n),n):(r=a,(n=Ea.get(o))&&(r=Pe({},a),Sv(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),pt(n),St(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(R(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,nd(r,a.precedence,t));return e.instance}function nd(t,e,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,o=n,i=0;i<r.length;i++){var s=r[i];if(s.dataset.precedence===e)o=s;else if(o!==n)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function bv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Sv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var od=null;function hC(t,e,a){if(od===null){var r=new Map,n=od=new Map;n.set(a,r)}else n=od,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(t))return r;for(r.set(t,null),a=a.getElementsByTagName(t),n=0;n<a.length;n++){var o=a[n];if(!(o[Ql]||o[yt]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=r.get(i);s?s.push(o):r.set(i,[o])}}return r}function mC(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function PM(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function eL(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function HM(t,e,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Ki(r.href),o=e.querySelector(nu(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Dd.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,pt(o);return}o=e.ownerDocument||e,r=Jw(r),(n=Ea.get(n))&&bv(r,n),o=o.createElement("link"),pt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),St(o,"link",r),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Dd.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Om=0;function UM(t,e){return t.stylesheets&&t.count===0&&id(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&id(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&Om===0&&(Om=62500*bM());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&id(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>Om?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function Dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)id(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Od=null;function id(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Od=new Map,e.forEach(qM,t),Od=null,Dd.call(t))}function qM(t,e){if(!(e.state.loading&4)){var a=Od.get(t);if(a)var r=a.get(null);else{a=new Map,Od.set(t,a);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<n.length;o++){var i=n[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),r=i)}r&&a.set(null,r)}n=e.instance,i=n.getAttribute("data-precedence"),o=a.get(i)||r,o===r&&a.set(null,n),a.set(i,n),this.count++,r=Dd.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),o?o.parentNode.insertBefore(n,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(n,t.firstChild)),e.state.loading|=4}}var jl={$$typeof:Er,Provider:null,Consumer:null,_currentValue:xo,_currentValue2:xo,_threadCount:0};function zM(t,e,a,r,n,o,i,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=im(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=im(0),this.hiddenUpdates=im(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function tL(t,e,a,r,n,o,i,s,l,u,c,d){return t=new zM(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=na(3,null,null,e),t.current=o,o.stateNode=t,e=Wg(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},Yg(o),t}function aL(t){return t?(t=Ri,t):Ri}function rL(t,e,a,r,n,o){n=aL(n),r.context===null?r.context=n:r.pendingContext=n,r=En(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=Tn(t,r,e),a!==null&&(Gt(a,t,e),Ll(a,t,e))}function gC(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function Cv(t,e){gC(t,e),(t=t.alternate)&&gC(t,e)}function nL(t){if(t.tag===13||t.tag===31){var e=Mo(t,67108864);e!==null&&Gt(e,t,67108864),Cv(t,67108864)}}function vC(t){if(t.tag===13||t.tag===31){var e=ua();e=Dg(e);var a=Mo(t,e);a!==null&&Gt(a,t,e),Cv(t,e)}}var Bd=!0;function VM(t,e,a,r){var n=ee.T;ee.T=null;var o=xe.p;try{xe.p=2,_v(t,e,a,r)}finally{xe.p=o,ee.T=n}}function $M(t,e,a,r){var n=ee.T;ee.T=null;var o=xe.p;try{xe.p=8,_v(t,e,a,r)}finally{xe.p=o,ee.T=n}}function _v(t,e,a,r){if(Bd){var n=kg(r);if(n===null)Mm(t,e,r,Fd,a),yC(t,r);else if(GM(n,t,e,a,r))r.stopPropagation();else if(yC(t,r),e&4&&-1<jM.indexOf(t)){for(;n!==null;){var o=es(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=go(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-la(i);s.entanglements[1]|=l,i&=~l}ur(o),(ye&6)===0&&(Ld=ia()+500,ru(0,!1))}}break;case 31:case 13:s=Mo(o,2),s!==null&&Gt(s,o,2),Xd(),Cv(o,2)}if(o=kg(r),o===null&&Mm(t,e,r,Fd,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else Mm(t,e,r,null,a)}}function kg(t){return t=Ng(t),wv(t)}var Fd=null;function wv(t){if(Fd=null,t=Li(t),t!==null){var e=Zl(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=wC(e),t!==null)return t;t=null}else if(a===31){if(t=LC(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Fd=t,null}function oL(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(MT()){case EC:return 2;case TC:return 8;case dd:case DT:return 32;case RC:return 268435456;default:return 32}default:return 32}}var Eg=!1,Dn=null,On=null,Bn=null,Gl=new Map,Wl=new Map,Sn=[],jM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yC(t,e){switch(t){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Bn=null;break;case"pointerover":case"pointerout":Gl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wl.delete(e.pointerId)}}function hl(t,e,a,r,n,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:a,eventSystemFlags:r,nativeEvent:o,targetContainers:[n]},e!==null&&(e=es(e),e!==null&&nL(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function GM(t,e,a,r,n){switch(e){case"focusin":return Dn=hl(Dn,t,e,a,r,n),!0;case"dragenter":return On=hl(On,t,e,a,r,n),!0;case"mouseover":return Bn=hl(Bn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return Gl.set(o,hl(Gl.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,Wl.set(o,hl(Wl.get(o)||null,t,e,a,r,n)),!0}return!1}function iL(t){var e=Li(t.target);if(e!==null){var a=Zl(e);if(a!==null){if(e=a.tag,e===13){if(e=wC(a),e!==null){t.blockedOn=e,t0(t.priority,function(){vC(a)});return}}else if(e===31){if(e=LC(a),e!==null){t.blockedOn=e,t0(t.priority,function(){vC(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function sd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=kg(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);Wm=r,a.target.dispatchEvent(r),Wm=null}else return e=es(a),e!==null&&nL(e),t.blockedOn=a,!1;e.shift()}return!0}function xC(t,e,a){sd(t)&&a.delete(e)}function WM(){Eg=!1,Dn!==null&&sd(Dn)&&(Dn=null),On!==null&&sd(On)&&(On=null),Bn!==null&&sd(Bn)&&(Bn=null),Gl.forEach(xC),Wl.forEach(xC)}function jc(t,e){t.blockedOn===e&&(t.blockedOn=null,Eg||(Eg=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,WM)))}var Gc=null;function bC(t){Gc!==t&&(Gc=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){Gc===t&&(Gc=null);for(var e=0;e<t.length;e+=3){var a=t[e],r=t[e+1],n=t[e+2];if(typeof r!="function"){if(wv(r||a)===null)continue;break}var o=es(a);o!==null&&(t.splice(e,3),e-=3,ug(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function Qi(t){function e(l){return jc(l,t)}Dn!==null&&jc(Dn,t),On!==null&&jc(On,t),Bn!==null&&jc(Bn,t),Gl.forEach(e),Wl.forEach(e);for(var a=0;a<Sn.length;a++){var r=Sn[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<Sn.length&&(a=Sn[0],a.blockedOn===null);)iL(a),a.blockedOn===null&&Sn.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],o=a[r+1],i=n[Wt]||null;if(typeof o=="function")i||bC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[Wt]||null)s=i.formAction;else if(wv(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),bC(a)}}}function sL(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return n=i})},focusReset:"manual",scroll:"manual"})}function e(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,n=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),n!==null&&(n(),n=null)}}}function Lv(t){this._internalRoot=t}Qd.prototype.render=Lv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(R(409));var a=e.current,r=ua();rL(a,r,t,e,null,null)};Qd.prototype.unmount=Lv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;rL(t.current,2,null,t,null,null),Xd(),e[Ji]=null}};function Qd(t){this._internalRoot=t}Qd.prototype.unstable_scheduleHydration=function(t){if(t){var e=FC();t={blockedOn:null,target:t,priority:e};for(var a=0;a<Sn.length&&e!==0&&e<Sn[a].priority;a++);Sn.splice(a,0,t),a===0&&iL(t)}};var SC=CC.version;if(SC!=="19.2.4")throw Error(R(527,SC,"19.2.4"));xe.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(R(188)):(t=Object.keys(t).join(","),Error(R(268,t)));return t=LT(e),t=t!==null?IC(t):null,t=t===null?null:t.stateNode,t};var ZM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ml=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ml.isDisabled&&ml.supportsFiber))try{Xl=ml.inject(ZM),sa=ml}catch{}var ml;Jd.createRoot=function(t,e){if(!_C(t))throw Error(R(299));var a=!1,r="",n=Q_,o=J_,i=ew;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(n=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=tL(t,1,!1,null,null,a,r,null,n,o,i,sL),t[Ji]=e.current,xv(t),new Lv(e)};Jd.hydrateRoot=function(t,e,a){if(!_C(t))throw Error(R(299));var r=!1,n="",o=Q_,i=J_,s=ew,l=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),e=tL(t,1,!0,e,a??null,r,n,l,o,i,s,sL),e.context=aL(null),a=e.current,r=ua(),r=Dg(r),n=En(r),n.callback=null,Tn(a,n,r),a=r,e.current.lanes=a,Kl(e,a),ur(e),t[Ji]=e.current,xv(t),new Qd(e)};Jd.version="19.2.4"});var Oo=tr((_H,cL)=>{"use strict";function uL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uL)}catch(t){console.error(t)}}uL(),cL.exports=lL()});var iI=tr(xf=>{"use strict";var V2=Symbol.for("react.transitional.element"),$2=Symbol.for("react.fragment");function oI(t,e,a){var r=null;if(a!==void 0&&(r=""+a),e.key!==void 0&&(r=""+e.key),"key"in e){a={};for(var n in e)n!=="key"&&(a[n]=e[n])}else a=e;return e=a.ref,{$$typeof:V2,type:t,key:r,ref:e!==void 0?e:null,props:a}}xf.Fragment=$2;xf.jsx=oI;xf.jsxs=oI});var Me=tr((U4,sI)=>{"use strict";sI.exports=iI()});var hH={};bS(hH,{ANIMATION_KEYFRAMES:()=>al,ActivationConfigZ:()=>pc,AddClassZ:()=>Db,AnchorIdZ:()=>ya,AnchorStateZ:()=>LE,AnchorVisibleConditionZ:()=>lh,AppRegistry:()=>hu,AugmentationZ:()=>IE,BadgePositionZ:()=>Cb,BadgeZ:()=>Hb,BoundingBoxZ:()=>wE,CanvasEvents:()=>hs,CanvasRecipeZ:()=>xp,ConditionZ:()=>un,ContextManager:()=>hc,CooldownActiveConditionZ:()=>hh,CounterDefZ:()=>Gs,CtaButtonZ:()=>yh,DEFAULT_COOLDOWN:()=>Pf,DEFAULT_TTL:()=>Nf,DecisionStrategyZ:()=>Qs,DismissedConditionZ:()=>ph,EVENT_SCHEMA_VERSION:()=>$o,EventBus:()=>vc,EventCountConditionZ:()=>gh,EventFilterZ:()=>RE,EventOccurredConditionZ:()=>uh,EventSourceZ:()=>rS,ExecutorRegistry:()=>dc,ExternalStrategyZ:()=>Ks,FrequencyEntryZ:()=>HE,FrequencyLimitConditionZ:()=>mh,HighlightStepZ:()=>dA,HighlightStyleZ:()=>Sb,HighlightZ:()=>Nb,InsertHtmlZ:()=>Fb,InsertPositionZ:()=>Ib,MAX_VISIBLE_TOASTS:()=>Ff,MatchOpZ:()=>js,ModalContentZ:()=>Lb,ModalZ:()=>qb,ModelStrategyZ:()=>Ys,MountWidgetZ:()=>$b,NavigateZ:()=>Vb,NavigationMonitor:()=>el,NormalizedEventZ:()=>TE,NotificationToastStack:()=>Bf,PageContextZ:()=>bE,PageHistoryEntryZ:()=>SE,PageUrlConditionZ:()=>ih,ParallelZ:()=>Wb,PlacementZ:()=>_b,PulseZ:()=>Pb,RUNTIME_SDK_BUILD:()=>hS,RUNTIME_VERSION:()=>uS,RemoveClassZ:()=>Ob,RouteConditionZ:()=>sh,RouteFilterZ:()=>xb,RuleStrategyZ:()=>Zs,RuleZ:()=>Ws,RuntimeContextZ:()=>AE,RuntimeProvider:()=>Vf,SDK_SCHEMA_VERSION:()=>jr,SDK_VERSION:()=>Ef,STATIC_SLOT_STYLES:()=>sS,ScoreStrategyZ:()=>Xs,ScrollBehaviorZ:()=>Tb,ScrollLogicalPositionZ:()=>vh,ScrollToZ:()=>zb,SelectorZ:()=>My,SequenceZ:()=>Gb,SessionContextZ:()=>CE,SessionMetricConditionZ:()=>fh,SessionMetricTracker:()=>Du,SetAttrZ:()=>Mb,SetStyleZ:()=>Bb,SetTextZ:()=>Rb,ShadowCanvasOverlay:()=>iy,ShadowRootProvider:()=>Zv,SmartCanvasApp:()=>ly,SmartCanvasController:()=>Df,SmartCanvasElement:()=>Wf,SmartCanvasPortal:()=>OF,StandardEvents:()=>be,StateEqualsConditionZ:()=>ch,StateStore:()=>bc,StoredValueZ:()=>PE,Syntro:()=>pS,TileCard:()=>ms,TileWheel:()=>gO,TooltipContentZ:()=>wb,TooltipStepZ:()=>cA,TooltipTriggerZ:()=>Ab,TooltipZ:()=>Ub,TourStepForSchemaZ:()=>Eb,TourZ:()=>Zb,TriggerWhenZ:()=>fc,ViewportConditionZ:()=>dh,ViewportContextZ:()=>_E,WaitZ:()=>jb,WidgetConfigZ:()=>kb,WidgetRegistry:()=>Cc,appRegistry:()=>cs,applyStaticSlotStyles:()=>Lh,cleanupAppContext:()=>Cf,contentRuntime:()=>ef,coreActionStepSchemas:()=>yE,createActionEngine:()=>oh,createAnchorResolver:()=>xh,createAppContext:()=>Sf,createAppLoader:()=>wf,createCanvasConfigFetcher:()=>zo,createContextManager:()=>bh,createDecisionEngine:()=>Sh,createEventAccumulator:()=>Ch,createEventBus:()=>Js,createGrowthBookClient:()=>fp,createNoopClient:()=>Sp,createOverlayRecipeFetcher:()=>DF,createPostHogClient:()=>ah,createPostHogNormalizer:()=>_h,createSessionMetricTracker:()=>pp,createSmartCanvas:()=>Zf,createSmartCanvasController:()=>Wv,createSmartCanvasRuntime:()=>Oh,createStateStore:()=>wh,createSurfaceContainer:()=>Th,createSurfaces:()=>Mh,decisionSchemas:()=>OP,decodeToken:()=>_c,encodeToken:()=>Bh,evaluate:()=>Qb,evaluateCondition:()=>Yb,evaluateRule:()=>Kb,evaluateRuleStrategy:()=>mc,evaluateScoreStrategy:()=>gc,evaluateSync:()=>Jb,executorRegistry:()=>br,getAntiFlickerSnippet:()=>OI,getAppIdFromActionKind:()=>Uv,getAppIdFromWidgetId:()=>_f,getExecutor:()=>mE,getSlotAnchorId:()=>Sc,getSlotType:()=>tl,getSlotZIndex:()=>Rh,hasExecutor:()=>rh,interpolateTemplate:()=>xu,isCoreActionKind:()=>Hv,matchEvent:()=>Hf,needsMigration:()=>bO,normalizePostHogEvent:()=>tS,overlaysRuntime:()=>bf,parseVersion:()=>vs,playEnterAnimation:()=>kh,playExitAnimation:()=>Eh,registerConfigPredicates:()=>yu,registerSmartCanvasElement:()=>cy,resolveConfigUri:()=>Tf,setupAdjacentPositioning:()=>Ih,setupInlinePositioning:()=>Ah,shouldNormalizeEvent:()=>aS,useDecision:()=>QI,useNotifications:()=>Uf,useNotifyWatcher:()=>zf,usePageContext:()=>$f,useRuntime:()=>dr,useRuntimeContext:()=>bu,useRuntimeEvents:()=>YI,useRuntimeState:()=>KI,useSessionContext:()=>ZI,useShadowCanvasConfig:()=>sy,useShadowRoot:()=>Vo,useViewportContext:()=>XI,validateAction:()=>ln,validateActions:()=>nh,validateActivationConfig:()=>DP,validateCondition:()=>RP,validateConfig:()=>vO,validateEventFilter:()=>YP,validateFrequencyEntry:()=>tH,validateNormalizedEvent:()=>XP,validateRecipe:()=>MF,validateRuntimeContext:()=>GP,validateStoredValue:()=>eH,validateStrategy:()=>MP,widgetRegistry:()=>Dh});var XE=K(We(),1),Fh=K(ol(),1),pH=K(Oo(),1);function dL(t,e,a,r){let n=r?.maxRetries??3,o=r?.debounceMs??50,i=t.parentElement??e.parentElement;if(!i)return()=>{};let s=0,l=null,u=!1,c=new MutationObserver(d=>{if(!u){for(let h of d)for(let g of h.removedNodes)if(g===t){if(s>=n){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){s++;try{a()}catch{c.disconnect(),u=!0}}},o);return}}});return c.observe(i,{childList:!0,subtree:!0}),()=>{u=!0,c.disconnect(),l&&clearTimeout(l)}}var XM=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Iv(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!XM.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),g=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||g)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var fL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=Iv(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),g=(a.parentElement??a).querySelector(`[${n}="${d}"]`);g&&g.remove()}let i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),o&&i.setAttribute(n,o),i.innerHTML=r;let s=null;switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":s=a.innerHTML,a.replaceWith(i);break}let l=null;if(t.deepLink){let{tileId:d,itemId:h}=t.deepLink;l=()=>{let g=window.SynOS?.handle;g&&(g.open(),g.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:h}))},i.style.cursor="pointer",i.addEventListener("click",l)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let c=dL(i,a,()=>{switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":break}});return{cleanup:()=>{if(l&&i.removeEventListener("click",l),c(),t.position==="replace"&&s!==null){let d=document.createElement(a.tagName);d.innerHTML=s,Array.from(a.attributes).forEach(h=>{d.setAttribute(h.name,h.value)}),i.replaceWith(d)}else i.remove()},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=Iv(d.html))}}},pL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.textContent=r},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},hL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.attr.toLowerCase();if(r.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(r==="href"||r==="src"||r==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=a.getAttribute(t.attr),i=a.hasAttribute(t.attr);return a.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{i&&o!==null?a.setAttribute(t.attr,o):a.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&a.setAttribute(t.attr,s.value)}}},mL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||a.classList.remove(t.className)}}},gL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=a.classList.contains(t.className);return a.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&a.classList.add(t.className)}}},vL=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=new Map;for(let n of Object.keys(t.styles)){let o=a.style.getPropertyValue(n);r.set(n,o)}for(let[n,o]of Object.entries(t.styles))a.style.setProperty(n,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[n,o]of r)o?a.style.setProperty(n,o):a.style.removeProperty(n)},updateFn:n=>{if("styles"in n&&typeof n.styles=="object"&&n.styles)for(let[o,i]of Object.entries(n.styles))a.style.setProperty(o,i)}}},Av=[{kind:"content:insertHtml",executor:fL},{kind:"content:setText",executor:pL},{kind:"content:setAttr",executor:hL},{kind:"content:addClass",executor:mL},{kind:"content:removeClass",executor:gL},{kind:"content:setStyle",executor:vL}],ef={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Av};var YM={light:50,medium:100,heavy:200},KM=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],yL={init(t,e,a){let r=YM[a.intensity],n=a.colors.length>0?a.colors:KM,o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:n[Math.floor(Math.random()*n.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let r=!1;for(let n of t)n.vy+=.15,n.vx*=.99,n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.y>0&&n.opacity>0&&n.y>500&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation),a.shape==="circle"?(t.beginPath(),t.arc(0,0,a.size/2,0,Math.PI*2),t.fill()):t.fillRect(-a.size/2,-a.size/2,a.size,a.size*.6),t.restore())}};var QM={light:20,medium:40,heavy:80},JM="\u{1F389}",xL={init(t,e,a){let r=QM[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:JM,o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:n,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let i of o)i.data&&(i.data.originX=i.x);return o},update(t,e,a){let r=!1;for(let n of t){n.y+=n.vy;let o=n.data?.wobblePhase??0,i=n.data?.wobbleAmp??1,s=n.data?.originX??n.x;n.x=s+Math.sin(a*.003+o)*i*20,n.y>600&&(n.opacity-=.02,n.opacity<0&&(n.opacity=0)),n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e)a.opacity<.01||!a.emoji||(t.save(),t.globalAlpha=a.opacity,t.font=`${a.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.emoji,a.x,a.y),t.restore())}};var e2={light:20,medium:40,heavy:80},t2={light:3,medium:4,heavy:5},bL={init(t,e,a){let r=e2[a.intensity],n=t2[a.intensity],o=a.colors.length>0?a.colors:["#ff4444","#44ff44","#4444ff"],i=[];for(let s=0;s<n;s++){let l=Math.random()*t*.8+t*.1,u=Math.random()*e*.6,c=o[Math.floor(Math.random()*o.length)];for(let d=0;d<r;d++){let h=Math.PI*2*d/r+(Math.random()-.5)*.3,g=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(h)*g,vy:Math.sin(h)*g,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:c,opacity:1,shape:"circle",data:{centerX:l,centerY:u}})}}return i},update(t,e,a){let r=!1;for(let n of t)n.vx*=.97,n.vy*=.97,n.vy+=.03,n.x+=n.vx,n.y+=n.vy,n.opacity-=.008,n.opacity<0&&(n.opacity=0),n.opacity>.01&&(r=!0);return r},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.shadowBlur=12,t.shadowColor=a.color,t.beginPath(),t.arc(a.x,a.y,a.size,0,Math.PI*2),t.fill(),t.restore())}};var a2={light:30,medium:60,heavy:120},SL={init(t,e,a){let r=a2[a.intensity],n=a.colors.length>0?a.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let i=0;i<r;i++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:n[Math.floor(Math.random()*n.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,a){let r=!1;for(let n of t){n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.data&&(n.data.baseOpacity=(n.data.baseOpacity??1)-.001,n.data.baseOpacity<0&&(n.data.baseOpacity=0));let o=n.data?.phase??0,i=n.data?.baseOpacity??1;if(i<=.01)n.opacity=0;else{let s=Math.sin(a*.005+o)*.4+.6;n.opacity=i*s}n.opacity>.01&&(r=!0)}return r},render(t,e){for(let a of e){if(a.opacity<.01)continue;t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation);let r=a.size;t.beginPath(),t.moveTo(0,-r),t.lineTo(r*.3,-r*.3),t.lineTo(r,0),t.lineTo(r*.3,r*.3),t.lineTo(0,r),t.lineTo(-r*.3,r*.3),t.lineTo(-r,0),t.lineTo(-r*.3,-r*.3),t.closePath(),t.fill(),t.restore()}}};var tf=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,a,r){this.container=e,this.effect=a,this.duration=r.duration;let n=document.createElement("canvas");n.setAttribute("data-syntro-celebrate",""),Object.assign(n.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;n.width=i*o,n.height=s*o,n.style.width=`${i}px`,n.style.height=`${s}px`;let l=n.getContext("2d");l&&(l.scale(o,o),this.canvas=n,this.ctx=l,e.appendChild(n),this.particles=a.init(i,s,r),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let a=e-this.startTime,r=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let n=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,n,o),!this.effect.update(this.particles,r,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var r2=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function n2(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function o2(t){try{let e=getComputedStyle(t),a=e.getPropertyValue("--sc-color-primary")?.trim(),r=e.getPropertyValue("--sc-color-primary-hover")?.trim();if(a?.startsWith("#")&&a.length>=7)return n2(a,r||a)}catch{}return null}var CL=new Map([["confetti",yL],["fireworks",bL],["sparkles",SL],["emoji-rain",xL]]),_L=async(t,e)=>{let a=CL.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...CL.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??o2(e.overlayRoot)??r2,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new tf;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var Ev="syntro_active_tour",af=new Map;function i2(t){try{let e=localStorage.getItem(Ev);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function kv(t){try{localStorage.setItem(Ev,JSON.stringify(t))}catch{}}function s2(){try{localStorage.removeItem(Ev)}catch{}}function iu(){return window.location.pathname}function l2(t){if(!t.route)return!0;let e=iu();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Tv=async(t,e)=>{let{tourId:a,steps:r,startStep:n,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${a}" has no steps`);if(af.has(a))return{cleanup:async()=>{let v=af.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=i2(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},kv(i));let l=r.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=n||r[0].id;l=r.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=r[l].id,kv(i)}let u=r[l];if(!l2(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:iu()}),{cleanup:()=>{}};let c=!1,d=null,h=null,g=null,S=async()=>{h&&(h(),h=null),d?.isApplied()&&(await d.revert(),d=null)},b=async v=>{if(c)return;if(await S(),v==="end"){s2(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let y=r.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,kv(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==iu()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:v,targetRoute:y.route});return}await x(y)},x=async v=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:v.id,stepIndex:r.findIndex(y=>y.id===v.id),totalSteps:r.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:a,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",L=>{let C=L?.actionId;if(C&&v.onAction){let k=v.onAction[C];k&&b(k)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",L=>{let C=L?.actionId;if(C&&v.onAction){let k=v.onAction[C];k&&b(k)}}),_=h;h=()=>{_(),y()}}}};g=(()=>{let v=iu(),y=()=>{let C=iu();C!==v&&(v=C,e.publishEvent("tour.route_changed",{tourId:a,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let _=history.pushState.bind(history),L=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{L(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=L}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await x(u);let m=async()=>{c=!0,af.delete(a),await S(),g&&g(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return af.set(a,{cleanup:m}),{cleanup:m}};var Va={white:"#ffffff",black:"#000000"},ne={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},A={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},ke={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},Ct={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},ze={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},fa={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},su={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Ft={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},lu={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var pa={primary:A[10],secondary:A[9],tertiary:A[8]},qH={primary:A[2],secondary:A[0]},Rv={primary:A[4],secondary:A[3]},rf={primary:{text:Va.white,icon:Va.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:A[10],textHover:Va.white,icon:A[10],iconHover:Va.white,border:A[4],background:A[2]},link:{text:Va.white,icon:Va.white,hover:ne[5]},error:{text:ze[5],hover:ze[6]},success:{text:ke[5],hover:ke[6]}},zH={slateGrey:{content:A[10],pillOutline:A[10],borderPrimary:A[5],borderSecondary:A[5],background:A[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:ze[8],pillOutline:ze[4],borderPrimary:ze[2],borderSecondary:ze[2],background:ze[0]},yellow:{content:Ct[8],pillOutline:Ct[4],borderPrimary:Ct[2],borderSecondary:Ct[2],background:Ct[0]},green:{content:ke[8],pillOutline:ke[4],borderPrimary:ke[2],borderSecondary:ke[2],background:ke[0]},purple:{content:Ft[8],pillOutline:Ft[4],borderPrimary:Ft[2],borderSecondary:Ft[2],background:Ft[0]},blue:{content:fa[8],pillOutline:fa[4],borderPrimary:fa[2],borderSecondary:fa[2],background:fa[0]},orange:{content:su[8],pillOutline:su[4],borderPrimary:su[2],borderSecondary:su[2],background:su[0]},pink:{content:lu[8],pillOutline:lu[4],borderPrimary:lu[2],borderSecondary:lu[2],background:lu[0]}},VH={green:{content:ke[8],border:ke[2],background:ke[0]},yellow:{content:Ct[8],border:Ct[2],background:Ct[0]},red:{content:ze[8],border:ze[2],background:ze[0]}},$H={green:{content:ke[1],background:ke[9]},yellow:{content:Ct[1],background:Ct[9]},red:{content:ze[1],background:ze[9]}},jH={content:A[10],border:A[4],background:"#1c2124"},GH={backgroundDefault:A[2],backgroundHover:A[1],selected:A[3]},WH={background:A[2],icon:A[10],borderDefault:A[4],borderSelected:ne[3],textLabel:A[9],textPlaceholder:A[8],textHint:A[8]},ZH={backgroundDefault:A[2],backgroundDisabled:A[0],textLabel:A[9],textPlaceholder:A[8],textHint:A[8],textError:ze[5],iconDefault:A[9],iconPlaceholder:A[10],iconError:ze[5],borderDefault:A[4],borderSelected:ne[3],borderError:ze[5]},XH={handleDefault:Va.white,handleDisabled:A[10],off:{backgroundDefault:A[4],backgroundHover:A[5],backgroundDisabled:A[4]},on:{backgroundDefault:ke[3],backgroundHover:ke[2],backgroundDisabled:A[4]}},YH={off:{backgroundDefault:"#00000000",backgroundHover:A[5],backgroundDisabled:A[2],border:A[6]},on:{backgroundDefault:ke[0],backgroundHover:ke[1],backgroundDisabled:A[2],border:ke[3]}},KH={content:A[10],background:A[4]},QH={background:A[4],active:ke[3]},JH={background:A[1],content:A[9],border:A[4]},e4={backgroundDefault:A[1],backgroundHover:A[3],backgroundActive:A[4],border:A[4],contentPrimary:A[10],contentSecondary:A[9],contentTertiary:A[8]},t4={background:A[1],content:A[9],border:A[4]},a4={activeBackground:A[3],activeContent:ne[5],inactiveContent:A[9],border:A[4]},r4={header:{textDefault:A[9],textHover:A[8],backgroundDefault:A[1]},border:A[4],cell:{textPrimary:A[10],textSecondary:A[9],backgroundDefault:A[2],backgroundHover:A[1]}},n4={textPrimaryDefault:A[10],textPrimaryHover:A[10],textSecondaryDefault:A[8],textSecondaryHover:A[9],iconPrimary:A[10],iconSecondary:A[8]},o4={background:ke[1],active:ke[5]},i4={textDefault:A[10],textSelected:Va.white,textDisabled:A[7],backgroundDefault:A[2],backgroundMiddle:A[3],backgroundSelected:ne[3],border:A[4]},s4=A[9];var wL=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function LL(t,e,a){let r=a?.paddingPx??12,n=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${fa[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=c.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let S=s||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:S?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let b=document.createElement("div");b.className="syntro-spotlight-ring",Object.assign(b.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||h||fa[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(b);let x=[];if(!wL)for(let w=0;w<4;w++){let I=document.createElement("div");I.style.position="fixed",I.style.background="inherit",x.push(I),g.appendChild(I)}let f=w=>{g.style.clipPath=w,g.style.webkitClipPath=w},m=()=>{if(!t.isConnected){k.destroy();return}let w=t.getBoundingClientRect(),I=Math.max(0,w.left-r),T=Math.max(0,w.top-r),D=Math.min(window.innerWidth,w.width+r*2),M=Math.min(window.innerHeight,w.height+r*2);if(Object.assign(b.style,{left:`${I}px`,top:`${T}px`,width:`${D}px`,height:`${M}px`}),wL){let B=window.innerWidth,F=window.innerHeight,H=Math.min(n,D/2,M/2),V=`M 0 0 L ${B} 0 L ${B} ${F} L 0 ${F} Z`,N=`M ${I+H} ${T} A ${H} ${H} 0 0 0 ${I} ${T+H} L ${I} ${T+M-H} A ${H} ${H} 0 0 0 ${I+H} ${T+M} L ${I+D-H} ${T+M} A ${H} ${H} 0 0 0 ${I+D} ${T+M-H} L ${I+D} ${T+H} A ${H} ${H} 0 0 0 ${I+D-H} ${T} L ${I+H} ${T} Z`;f(`path('${V} ${N}')`)}else{let[B,F,H,V]=x;Object.assign(B.style,{left:"0px",top:"0px",width:"100vw",height:`${T}px`}),Object.assign(H.style,{left:"0px",top:`${T+M}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(T+M))}px`}),Object.assign(V.style,{left:"0px",top:`${T}px`,width:`${I}px`,height:`${M}px`}),Object.assign(F.style,{left:`${I+D}px`,top:`${T}px`,width:`${Math.max(0,window.innerWidth-(I+D))}px`,height:`${M}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(m));v.observe(t);let y=()=>requestAnimationFrame(m),_=()=>requestAnimationFrame(m);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let L=w=>{w.key==="Escape"&&u&&k.destroy()};u&&window.addEventListener("keydown",L);let C=w=>{s?(w.preventDefault(),w.stopPropagation()):l&&k.destroy()};g.addEventListener("click",C);let k={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",L),g.removeEventListener("click",C),g.style.pointerEvents="none",g.style.opacity="0",setTimeout(()=>{g.remove(),b.remove()},220)}};return m(),k}var u2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ha(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;n.nextNode();){let i=n.currentNode,s=i.tagName.toLowerCase();if(!u2.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),h=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||h)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var Bo={bg:"var(--sc-overlay-background, #ffffff)",title:"var(--sc-overlay-title-color, var(--sc-overlay-text-color, #111827))",text:"var(--sc-overlay-text-color, #4b5563)",accent:"var(--sc-color-primary, #4f46e5)",radius:"var(--sc-border-radius, 12px)"},Mv=async(t,e)=>{let{content:a,size:r="md",blocking:n=!1,scrim:o,dismiss:i,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
5
+ `);for(r=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(n===l.length||r===u.length)for(n=l.length-1,r=u.length-1;1<=n&&0<=r&&l[n]!==u[r];)r--;for(;1<=n&&0<=r;n--,r--)if(l[n]!==u[r]){if(n!==1||r!==1)do if(n--,r--,0>r||l[n]!==u[r]){var c=`
6
+ `+l[n].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=n&&0<=r);break}}}finally{Om=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?_o(a):""}function UR(t,e){switch(t.tag){case 26:case 27:case 5:return _o(t.type);case 16:return _o("Lazy");case 13:return t.child!==e&&e!==null?_o("Suspense Fallback"):_o("Suspense");case 19:return _o("SuspenseList");case 0:case 15:return Bm(t.type,!1);case 11:return Bm(t.type.render,!1);case 1:return Bm(t.type,!0);case 31:return _o("Activity");default:return""}}function jS(t){try{var e="",a=null;do e+=UR(t,a),a=t,t=t.return;while(t);return e}catch(n){return`
7
+ Error generating stack: `+n.message+`
8
+ `+n.stack}}var xg=Object.prototype.hasOwnProperty,uv=ct.unstable_scheduleCallback,Pm=ct.unstable_cancelCallback,zR=ct.unstable_shouldYield,qR=ct.unstable_requestPaint,ua=ct.unstable_now,$R=ct.unstable_getCurrentPriorityLevel,b_=ct.unstable_ImmediatePriority,S_=ct.unstable_UserBlockingPriority,Od=ct.unstable_NormalPriority,VR=ct.unstable_LowPriority,C_=ct.unstable_IdlePriority,jR=ct.log,GR=ct.unstable_setDisableYieldValue,iu=null,ca=null;function Ar(t){if(typeof jR=="function"&&GR(t),ca&&typeof ca.setStrictMode=="function")try{ca.setStrictMode(iu,t)}catch{}}var da=Math.clz32?Math.clz32:XR,ZR=Math.log,WR=Math.LN2;function XR(t){return t>>>=0,t===0?32:31-(ZR(t)/WR|0)|0}var Jc=256,ed=262144,td=4194304;function wo(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function sf(t,e,a){var n=t.pendingLanes;if(n===0)return 0;var r=0,o=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var s=n&134217727;return s!==0?(n=s&~o,n!==0?r=wo(n):(i&=s,i!==0?r=wo(i):a||(a=s&~t,a!==0&&(r=wo(a))))):(s=n&~o,s!==0?r=wo(s):i!==0?r=wo(i):a||(a=n&~t,a!==0&&(r=wo(a)))),r===0?0:e!==0&&e!==r&&(e&o)===0&&(o=r&-r,a=e&-e,o>=a||o===32&&(a&4194048)!==0)?e:r}function su(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function YR(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function __(){var t=td;return td<<=1,(td&62914560)===0&&(td=4194304),t}function Fm(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function lu(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function KR(t,e,a,n,r,o){var i=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(a=i&~a;0<a;){var c=31-da(a),d=1<<c;s[c]=0,l[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var h=f[c];h!==null&&(h.lane&=-536870913)}a&=~d}n!==0&&w_(t,n,0),o!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function w_(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-da(e);t.entangledLanes|=e,t.entanglements[n]=t.entanglements[n]|1073741824|a&261930}function L_(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var n=31-da(a),r=1<<n;r&e|t[n]&e&&(t[n]|=e),a&=~r}}function k_(t,e){var a=e&-e;return a=(a&42)!==0?1:cv(a),(a&(t.suspendedLanes|e))!==0?0:a}function cv(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function dv(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function I_(){var t=be.p;return t!==0?t:(t=window.event,t===void 0?32:YL(t.type))}function GS(t,e){var a=be.p;try{return be.p=t,e()}finally{be.p=a}}var Gr=Math.random().toString(36).slice(2),St="__reactFiber$"+Gr,Yt="__reactProps$"+Gr,us="__reactContainer$"+Gr,bg="__reactEvents$"+Gr,QR="__reactListeners$"+Gr,JR="__reactHandles$"+Gr,ZS="__reactResources$"+Gr,uu="__reactMarker$"+Gr;function fv(t){delete t[St],delete t[Yt],delete t[bg],delete t[QR],delete t[JR]}function Bi(t){var e=t[St];if(e)return e;for(var a=t.parentNode;a;){if(e=a[us]||a[St]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=t_(t);t!==null;){if(a=t[St])return a;t=t_(t)}return e}t=a,a=t.parentNode}return null}function cs(t){if(t=t[St]||t[us]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function El(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(R(33))}function ji(t){var e=t[ZS];return e||(e=t[ZS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function gt(t){t[uu]=!0}var A_=new Set,E_={};function Fo(t,e){Ji(t,e),Ji(t+"Capture",e)}function Ji(t,e){for(E_[t]=e,t=0;t<e.length;t++)A_.add(e[t])}var e2=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),WS={},XS={};function t2(t){return xg.call(XS,t)?!0:xg.call(WS,t)?!1:e2.test(t)?XS[t]=!0:(WS[t]=!0,!1)}function gd(t,e,a){if(t2(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var n=e.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function ad(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function In(t,e,a,n){if(n===null)t.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+n)}}function La(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function T_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function a2(t,e,a){var n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,o.call(this,i)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Sg(t){if(!t._valueTracker){var e=T_(t)?"checked":"value";t._valueTracker=a2(t,e,""+t[e])}}function R_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),n="";return t&&(n=T_(t)?t.checked?"true":"false":t.value),t=n,t!==a?(e.setValue(t),!0):!1}function Bd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var n2=/[\n"\\]/g;function Aa(t){return t.replace(n2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Cg(t,e,a,n,r,o,i,s){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),e!=null?i==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+La(e)):t.value!==""+La(e)&&(t.value=""+La(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?_g(t,i,La(e)):a!=null?_g(t,i,La(a)):n!=null&&t.removeAttribute("value"),r==null&&o!=null&&(t.defaultChecked=!!o),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+La(s):t.removeAttribute("name")}function M_(t,e,a,n,r,o,i,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),e!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||e!=null)){Sg(t);return}a=a!=null?""+La(a):"",e=e!=null?""+La(e):a,s||e===t.value||(t.value=e),t.defaultValue=e}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=s?t.checked:!!n,t.defaultChecked=!!n,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Sg(t)}function _g(t,e,a){e==="number"&&Bd(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Gi(t,e,a,n){if(t=t.options,e){e={};for(var r=0;r<a.length;r++)e["$"+a[r]]=!0;for(a=0;a<t.length;a++)r=e.hasOwnProperty("$"+t[a].value),t[a].selected!==r&&(t[a].selected=r),r&&n&&(t[a].defaultSelected=!0)}else{for(a=""+La(a),e=null,r=0;r<t.length;r++){if(t[r].value===a){t[r].selected=!0,n&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function D_(t,e,a){if(e!=null&&(e=""+La(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+La(a):""}function O_(t,e,a,n){if(e==null){if(n!=null){if(a!=null)throw Error(R(92));if(Al(n)){if(1<n.length)throw Error(R(93));n=n[0]}a=n}a==null&&(a=""),e=a}a=La(e),t.defaultValue=a,n=t.textContent,n===a&&n!==""&&n!==null&&(t.value=n),Sg(t)}function es(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var r2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function YS(t,e,a){var n=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":n?t.setProperty(e,a):typeof a!="number"||a===0||r2.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function B_(t,e,a){if(e!=null&&typeof e!="object")throw Error(R(62));if(t=t.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||e!=null&&e.hasOwnProperty(n)||(n.indexOf("--")===0?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="");for(var r in e)n=e[r],e.hasOwnProperty(r)&&a[r]!==n&&YS(t,r,n)}else for(var o in e)e.hasOwnProperty(o)&&YS(t,o,e[o])}function pv(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var o2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),i2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vd(t){return i2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Bn(){}var wg=null;function hv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Pi=null,Zi=null;function KS(t){var e=cs(t);if(e&&(t=e.stateNode)){var a=t[Yt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Cg(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Aa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var n=a[e];if(n!==t&&n.form===t.form){var r=n[Yt]||null;if(!r)throw Error(R(90));Cg(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<a.length;e++)n=a[e],n.form===t.form&&R_(n)}break e;case"textarea":D_(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Gi(t,!!a.multiple,e,!1)}}}var Nm=!1;function P_(t,e,a){if(Nm)return t(e,a);Nm=!0;try{var n=t(e);return n}finally{if(Nm=!1,(Pi!==null||Zi!==null)&&(xf(),Pi&&(e=Pi,t=Zi,Zi=Pi=null,KS(e),t)))for(e=0;e<t.length;e++)KS(t[e])}}function Gl(t,e){var a=t.stateNode;if(a===null)return null;var n=a[Yt]||null;if(n===null)return null;a=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(R(231,e,typeof a));return a}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lg=!1;if(Un)try{Ai={},Object.defineProperty(Ai,"passive",{get:function(){Lg=!0}}),window.addEventListener("test",Ai,Ai),window.removeEventListener("test",Ai,Ai)}catch{Lg=!1}var Ai,Er=null,mv=null,yd=null;function F_(){if(yd)return yd;var t,e=mv,a=e.length,n,r="value"in Er?Er.value:Er.textContent,o=r.length;for(t=0;t<a&&e[t]===r[t];t++);var i=a-t;for(n=1;n<=i&&e[a-n]===r[o-n];n++);return yd=r.slice(t,1<n?1-n:void 0)}function xd(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function nd(){return!0}function QS(){return!1}function Kt(t){function e(a,n,r,o,i){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(a=t[s],this[s]=a?a(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?nd:QS,this.isPropagationStopped=QS,this}return ze(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=nd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=nd)},persist:function(){},isPersistent:nd}),e}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lf=Kt(No),cu=ze({},No,{view:0,detail:0}),s2=Kt(cu),Hm,Um,Sl,uf=ze({},cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gv,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Sl&&(Sl&&t.type==="mousemove"?(Hm=t.screenX-Sl.screenX,Um=t.screenY-Sl.screenY):Um=Hm=0,Sl=t),Hm)},movementY:function(t){return"movementY"in t?t.movementY:Um}}),JS=Kt(uf),l2=ze({},uf,{dataTransfer:0}),u2=Kt(l2),c2=ze({},cu,{relatedTarget:0}),zm=Kt(c2),d2=ze({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),f2=Kt(d2),p2=ze({},No,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),h2=Kt(p2),m2=ze({},No,{data:0}),eC=Kt(m2),g2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},y2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=y2[t])?!!e[t]:!1}function gv(){return x2}var b2=ze({},cu,{key:function(t){if(t.key){var e=g2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=xd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?v2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gv,charCode:function(t){return t.type==="keypress"?xd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?xd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),S2=Kt(b2),C2=ze({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tC=Kt(C2),_2=ze({},cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gv}),w2=Kt(_2),L2=ze({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),k2=Kt(L2),I2=ze({},uf,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),A2=Kt(I2),E2=ze({},No,{newState:0,oldState:0}),T2=Kt(E2),R2=[9,13,27,32],vv=Un&&"CompositionEvent"in window,Ml=null;Un&&"documentMode"in document&&(Ml=document.documentMode);var M2=Un&&"TextEvent"in window&&!Ml,N_=Un&&(!vv||Ml&&8<Ml&&11>=Ml),aC=" ",nC=!1;function H_(t,e){switch(t){case"keyup":return R2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fi=!1;function D2(t,e){switch(t){case"compositionend":return U_(e);case"keypress":return e.which!==32?null:(nC=!0,aC);case"textInput":return t=e.data,t===aC&&nC?null:t;default:return null}}function O2(t,e){if(Fi)return t==="compositionend"||!vv&&H_(t,e)?(t=F_(),yd=mv=Er=null,Fi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return N_&&e.locale!=="ko"?null:e.data;default:return null}}var B2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rC(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!B2[t.type]:e==="textarea"}function z_(t,e,a,n){Pi?Zi?Zi.push(n):Zi=[n]:Pi=n,e=Jd(e,"onChange"),0<e.length&&(a=new lf("onChange","change",null,a,n),t.push({event:a,listeners:e}))}var Dl=null,Zl=null;function P2(t){PL(t,0)}function cf(t){var e=El(t);if(R_(e))return t}function oC(t,e){if(t==="change")return e}var q_=!1;Un&&(Un?(od="oninput"in document,od||(qm=document.createElement("div"),qm.setAttribute("oninput","return;"),od=typeof qm.oninput=="function"),rd=od):rd=!1,q_=rd&&(!document.documentMode||9<document.documentMode));var rd,od,qm;function iC(){Dl&&(Dl.detachEvent("onpropertychange",$_),Zl=Dl=null)}function $_(t){if(t.propertyName==="value"&&cf(Zl)){var e=[];z_(e,Zl,t,hv(t)),P_(P2,e)}}function F2(t,e,a){t==="focusin"?(iC(),Dl=e,Zl=a,Dl.attachEvent("onpropertychange",$_)):t==="focusout"&&iC()}function N2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return cf(Zl)}function H2(t,e){if(t==="click")return cf(e)}function U2(t,e){if(t==="input"||t==="change")return cf(e)}function z2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pa=typeof Object.is=="function"?Object.is:z2;function Wl(t,e){if(pa(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),n=Object.keys(e);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!xg.call(e,r)||!pa(t[r],e[r]))return!1}return!0}function sC(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lC(t,e){var a=sC(t);t=0;for(var n;a;){if(a.nodeType===3){if(n=t+a.textContent.length,t<=e&&n>=e)return{node:a,offset:e-t};t=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=sC(a)}}function V_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?V_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function j_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Bd(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=Bd(t.document)}return e}function yv(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var q2=Un&&"documentMode"in document&&11>=document.documentMode,Ni=null,kg=null,Ol=null,Ig=!1;function uC(t,e,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ig||Ni==null||Ni!==Bd(n)||(n=Ni,"selectionStart"in n&&yv(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ol&&Wl(Ol,n)||(Ol=n,n=Jd(kg,"onSelect"),0<n.length&&(e=new lf("onSelect","select",null,e,a),t.push({event:e,listeners:n}),e.target=Ni)))}function Co(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var Hi={animationend:Co("Animation","AnimationEnd"),animationiteration:Co("Animation","AnimationIteration"),animationstart:Co("Animation","AnimationStart"),transitionrun:Co("Transition","TransitionRun"),transitionstart:Co("Transition","TransitionStart"),transitioncancel:Co("Transition","TransitionCancel"),transitionend:Co("Transition","TransitionEnd")},$m={},G_={};Un&&(G_=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function Ho(t){if($m[t])return $m[t];if(!Hi[t])return t;var e=Hi[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in G_)return $m[t]=e[a];return t}var Z_=Ho("animationend"),W_=Ho("animationiteration"),X_=Ho("animationstart"),$2=Ho("transitionrun"),V2=Ho("transitionstart"),j2=Ho("transitioncancel"),Y_=Ho("transitionend"),K_=new Map,Ag="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ag.push("scrollEnd");function ja(t,e){K_.set(t,e),Fo(e,[t])}var Pd=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},wa=[],Ui=0,xv=0;function df(){for(var t=Ui,e=xv=Ui=0;e<t;){var a=wa[e];wa[e++]=null;var n=wa[e];wa[e++]=null;var r=wa[e];wa[e++]=null;var o=wa[e];if(wa[e++]=null,n!==null&&r!==null){var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}o!==0&&Q_(a,r,o)}}function ff(t,e,a,n){wa[Ui++]=t,wa[Ui++]=e,wa[Ui++]=a,wa[Ui++]=n,xv|=n,t.lanes|=n,t=t.alternate,t!==null&&(t.lanes|=n)}function bv(t,e,a,n){return ff(t,e,a,n),Fd(t)}function Uo(t,e){return ff(t,null,null,e),Fd(t)}function Q_(t,e,a){t.lanes|=a;var n=t.alternate;n!==null&&(n.lanes|=a);for(var r=!1,o=t.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(t=o.stateNode,t===null||t._visibility&1||(r=!0)),t=o,o=o.return;return t.tag===3?(o=t.stateNode,r&&e!==null&&(r=31-da(a),t=o.hiddenUpdates,n=t[r],n===null?t[r]=[e]:n.push(e),e.lane=a|536870912),o):null}function Fd(t){if(50<$l)throw $l=0,Xg=null,Error(R(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var zi={};function G2(t,e,a,n){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(t,e,a,n){return new G2(t,e,a,n)}function Sv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Fn(t,e){var a=t.alternate;return a===null?(a=sa(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function J_(t,e){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function bd(t,e,a,n,r,o){var i=0;if(n=t,typeof t=="function")Sv(t)&&(i=1);else if(typeof t=="string")i=XM(t,a,dn.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case mg:return t=sa(31,a,e,r),t.elementType=mg,t.lanes=o,t;case Di:return Ao(a.children,r,o,e);case y_:i=8,r|=24;break;case fg:return t=sa(12,a,e,r|2),t.elementType=fg,t.lanes=o,t;case pg:return t=sa(13,a,e,r),t.elementType=pg,t.lanes=o,t;case hg:return t=sa(19,a,e,r),t.elementType=hg,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case On:i=10;break e;case x_:i=9;break e;case sv:i=11;break e;case lv:i=14;break e;case Cr:i=16,n=null;break e}i=29,a=Error(R(130,t===null?"null":typeof t,"")),n=null}return e=sa(i,a,e,r),e.elementType=t,e.type=n,e.lanes=o,e}function Ao(t,e,a,n){return t=sa(7,t,n,e),t.lanes=a,t}function Vm(t,e,a){return t=sa(6,t,null,e),t.lanes=a,t}function ew(t){var e=sa(18,null,null,0);return e.stateNode=t,e}function jm(t,e,a){return e=sa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var cC=new WeakMap;function Ea(t,e){if(typeof t=="object"&&t!==null){var a=cC.get(t);return a!==void 0?a:(e={value:t,source:e,stack:jS(e)},cC.set(t,e),e)}return{value:t,source:e,stack:jS(e)}}var qi=[],$i=0,Nd=null,Xl=0,ka=[],Ia=0,qr=null,ln=1,un="";function Mn(t,e){qi[$i++]=Xl,qi[$i++]=Nd,Nd=t,Xl=e}function tw(t,e,a){ka[Ia++]=ln,ka[Ia++]=un,ka[Ia++]=qr,qr=t;var n=ln;t=un;var r=32-da(n)-1;n&=~(1<<r),a+=1;var o=32-da(e)+r;if(30<o){var i=r-r%5;o=(n&(1<<i)-1).toString(32),n>>=i,r-=i,ln=1<<32-da(e)+r|a<<r|n,un=o+t}else ln=1<<o|a<<r|n,un=t}function Cv(t){t.return!==null&&(Mn(t,1),tw(t,1,0))}function _v(t){for(;t===Nd;)Nd=qi[--$i],qi[$i]=null,Xl=qi[--$i],qi[$i]=null;for(;t===qr;)qr=ka[--Ia],ka[Ia]=null,un=ka[--Ia],ka[Ia]=null,ln=ka[--Ia],ka[Ia]=null}function aw(t,e){ka[Ia++]=ln,ka[Ia++]=un,ka[Ia++]=qr,ln=e.id,un=e.overflow,qr=t}var Ct=null,Ue=null,me=!1,Or=null,Ta=!1,Eg=Error(R(519));function $r(t){var e=Error(R(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yl(Ea(e,t)),Eg}function dC(t){var e=t.stateNode,a=t.type,n=t.memoizedProps;switch(e[St]=t,e[Yt]=n,a){case"dialog":ce("cancel",e),ce("close",e);break;case"iframe":case"object":case"embed":ce("load",e);break;case"video":case"audio":for(a=0;a<eu.length;a++)ce(eu[a],e);break;case"source":ce("error",e);break;case"img":case"image":case"link":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"input":ce("invalid",e),M_(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ce("invalid",e);break;case"textarea":ce("invalid",e),O_(e,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||n.suppressHydrationWarning===!0||NL(e.textContent,a)?(n.popover!=null&&(ce("beforetoggle",e),ce("toggle",e)),n.onScroll!=null&&ce("scroll",e),n.onScrollEnd!=null&&ce("scrollend",e),n.onClick!=null&&(e.onclick=Bn),e=!0):e=!1,e||$r(t,!0)}function fC(t){for(Ct=t.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:Ta=!1;return;case 27:case 3:Ta=!0;return;default:Ct=Ct.return}}function Ei(t){if(t!==Ct)return!1;if(!me)return fC(t),me=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||ev(t.type,t.memoizedProps)),a=!a),a&&Ue&&$r(t),fC(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));Ue=e_(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));Ue=e_(t)}else e===27?(e=Ue,Zr(t.type)?(t=rv,rv=null,Ue=t):Ue=e):Ue=Ct?Ma(t.stateNode.nextSibling):null;return!0}function Mo(){Ue=Ct=null,me=!1}function Gm(){var t=Or;return t!==null&&(Wt===null?Wt=t:Wt.push.apply(Wt,t),Or=null),t}function Yl(t){Or===null?Or=[t]:Or.push(t)}var Tg=fn(null),zo=null,Pn=null;function wr(t,e,a){Be(Tg,e._currentValue),e._currentValue=a}function Nn(t){t._currentValue=Tg.current,vt(Tg)}function Rg(t,e,a){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===a)break;t=t.return}}function Mg(t,e,a,n){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var o=r.dependencies;if(o!==null){var i=r.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=r;for(var l=0;l<e.length;l++)if(s.context===e[l]){o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),Rg(o.return,a,t),n||(i=null);break e}o=s.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(R(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Rg(i,a,t),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===t){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function ds(t,e,a,n){t=null;for(var r=e,o=!1;r!==null;){if(!o){if((r.flags&524288)!==0)o=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(R(387));if(i=i.memoizedProps,i!==null){var s=r.type;pa(r.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(r===Rd.current){if(i=r.alternate,i===null)throw Error(R(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(au):t=[au])}r=r.return}t!==null&&Mg(e,t,a,n),e.flags|=262144}function Hd(t){for(t=t.firstContext;t!==null;){if(!pa(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Do(t){zo=t,Pn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function _t(t){return nw(zo,t)}function id(t,e){return zo===null&&Do(t),nw(t,e)}function nw(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Pn===null){if(t===null)throw Error(R(308));Pn=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Pn=Pn.next=e;return a}var Z2=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,n){t.push(n)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},W2=ct.unstable_scheduleCallback,X2=ct.unstable_NormalPriority,ot={$$typeof:On,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wv(){return{controller:new Z2,data:new Map,refCount:0}}function du(t){t.refCount--,t.refCount===0&&W2(X2,function(){t.controller.abort()})}var Bl=null,Dg=0,ts=0,Wi=null;function Y2(t,e){if(Bl===null){var a=Bl=[];Dg=0,ts=Xv(),Wi={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Dg++,e.then(pC,pC),e}function pC(){if(--Dg===0&&Bl!==null){Wi!==null&&(Wi.status="fulfilled");var t=Bl;Bl=null,ts=0,Wi=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function K2(t,e){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return t.then(function(){n.status="fulfilled",n.value=e;for(var r=0;r<a.length;r++)(0,a[r])(e)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var hC=ee.S;ee.S=function(t,e){vL=ua(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&Y2(t,e),hC!==null&&hC(t,e)};var Eo=fn(null);function Lv(){var t=Eo.current;return t!==null?t:Re.pooledCache}function Sd(t,e){e===null?Be(Eo,Eo.current):Be(Eo,e.pool)}function rw(){var t=Lv();return t===null?null:{parent:ot._currentValue,pool:t}}var fs=Error(R(460)),kv=Error(R(474)),pf=Error(R(542)),Ud={then:function(){}};function mC(t){return t=t.status,t==="fulfilled"||t==="rejected"}function ow(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(Bn,Bn),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,vC(t),t;default:if(typeof e.status=="string")e.then(Bn,Bn);else{if(t=Re,t!==null&&100<t.shellSuspendCounter)throw Error(R(482));t=e,t.status="pending",t.then(function(n){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=n}},function(n){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=n}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,vC(t),t}throw To=e,fs}}function Lo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(To=a,fs):a}}var To=null;function gC(){if(To===null)throw Error(R(459));var t=To;return To=null,t}function vC(t){if(t===fs||t===pf)throw Error(R(483))}var Xi=null,Kl=0;function sd(t){var e=Kl;return Kl+=1,Xi===null&&(Xi=[]),ow(Xi,t,e)}function Cl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function ld(t,e){throw e.$$typeof===FR?Error(R(525)):(t=Object.prototype.toString.call(e),Error(R(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function iw(t){function e(m,g){if(t){var v=m.deletions;v===null?(m.deletions=[g],m.flags|=16):v.push(g)}}function a(m,g){if(!t)return null;for(;g!==null;)e(m,g),g=g.sibling;return null}function n(m){for(var g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function r(m,g){return m=Fn(m,g),m.index=0,m.sibling=null,m}function o(m,g,v){return m.index=v,t?(v=m.alternate,v!==null?(v=v.index,v<g?(m.flags|=67108866,g):v):(m.flags|=67108866,g)):(m.flags|=1048576,g)}function i(m){return t&&m.alternate===null&&(m.flags|=67108866),m}function s(m,g,v,y){return g===null||g.tag!==6?(g=Vm(v,m.mode,y),g.return=m,g):(g=r(g,v),g.return=m,g)}function l(m,g,v,y){var _=v.type;return _===Di?c(m,g,v.props.children,y,v.key):g!==null&&(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Cr&&Lo(_)===g.type)?(g=r(g,v.props),Cl(g,v),g.return=m,g):(g=bd(v.type,v.key,v.props,null,m.mode,y),Cl(g,v),g.return=m,g)}function u(m,g,v,y){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=jm(v,m.mode,y),g.return=m,g):(g=r(g,v.children||[]),g.return=m,g)}function c(m,g,v,y,_){return g===null||g.tag!==7?(g=Ao(v,m.mode,y,_),g.return=m,g):(g=r(g,v),g.return=m,g)}function d(m,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Vm(""+g,m.mode,v),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Qc:return v=bd(g.type,g.key,g.props,null,m.mode,v),Cl(v,g),v.return=m,v;case Il:return g=jm(g,m.mode,v),g.return=m,g;case Cr:return g=Lo(g),d(m,g,v)}if(Al(g)||bl(g))return g=Ao(g,m.mode,v,null),g.return=m,g;if(typeof g.then=="function")return d(m,sd(g),v);if(g.$$typeof===On)return d(m,id(m,g),v);ld(m,g)}return null}function f(m,g,v,y){var _=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return _!==null?null:s(m,g,""+v,y);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Qc:return v.key===_?l(m,g,v,y):null;case Il:return v.key===_?u(m,g,v,y):null;case Cr:return v=Lo(v),f(m,g,v,y)}if(Al(v)||bl(v))return _!==null?null:c(m,g,v,y,null);if(typeof v.then=="function")return f(m,g,sd(v),y);if(v.$$typeof===On)return f(m,g,id(m,v),y);ld(m,v)}return null}function h(m,g,v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return m=m.get(v)||null,s(g,m,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Qc:return m=m.get(y.key===null?v:y.key)||null,l(g,m,y,_);case Il:return m=m.get(y.key===null?v:y.key)||null,u(g,m,y,_);case Cr:return y=Lo(y),h(m,g,v,y,_)}if(Al(y)||bl(y))return m=m.get(v)||null,c(g,m,y,_,null);if(typeof y.then=="function")return h(m,g,v,sd(y),_);if(y.$$typeof===On)return h(m,g,v,id(g,y),_);ld(g,y)}return null}function S(m,g,v,y){for(var _=null,L=null,C=g,I=g=0,w=null;C!==null&&I<v.length;I++){C.index>I?(w=C,C=null):w=C.sibling;var k=f(m,C,v[I],y);if(k===null){C===null&&(C=w);break}t&&C&&k.alternate===null&&e(m,C),g=o(k,g,I),L===null?_=k:L.sibling=k,L=k,C=w}if(I===v.length)return a(m,C),me&&Mn(m,I),_;if(C===null){for(;I<v.length;I++)C=d(m,v[I],y),C!==null&&(g=o(C,g,I),L===null?_=C:L.sibling=C,L=C);return me&&Mn(m,I),_}for(C=n(C);I<v.length;I++)w=h(C,m,I,v[I],y),w!==null&&(t&&w.alternate!==null&&C.delete(w.key===null?I:w.key),g=o(w,g,I),L===null?_=w:L.sibling=w,L=w);return t&&C.forEach(function(T){return e(m,T)}),me&&Mn(m,I),_}function x(m,g,v,y){if(v==null)throw Error(R(151));for(var _=null,L=null,C=g,I=g=0,w=null,k=v.next();C!==null&&!k.done;I++,k=v.next()){C.index>I?(w=C,C=null):w=C.sibling;var T=f(m,C,k.value,y);if(T===null){C===null&&(C=w);break}t&&C&&T.alternate===null&&e(m,C),g=o(T,g,I),L===null?_=T:L.sibling=T,L=T,C=w}if(k.done)return a(m,C),me&&Mn(m,I),_;if(C===null){for(;!k.done;I++,k=v.next())k=d(m,k.value,y),k!==null&&(g=o(k,g,I),L===null?_=k:L.sibling=k,L=k);return me&&Mn(m,I),_}for(C=n(C);!k.done;I++,k=v.next())k=h(C,m,I,k.value,y),k!==null&&(t&&k.alternate!==null&&C.delete(k.key===null?I:k.key),g=o(k,g,I),L===null?_=k:L.sibling=k,L=k);return t&&C.forEach(function(D){return e(m,D)}),me&&Mn(m,I),_}function b(m,g,v,y){if(typeof v=="object"&&v!==null&&v.type===Di&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Qc:e:{for(var _=v.key;g!==null;){if(g.key===_){if(_=v.type,_===Di){if(g.tag===7){a(m,g.sibling),y=r(g,v.props.children),y.return=m,m=y;break e}}else if(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Cr&&Lo(_)===g.type){a(m,g.sibling),y=r(g,v.props),Cl(y,v),y.return=m,m=y;break e}a(m,g);break}else e(m,g);g=g.sibling}v.type===Di?(y=Ao(v.props.children,m.mode,y,v.key),y.return=m,m=y):(y=bd(v.type,v.key,v.props,null,m.mode,y),Cl(y,v),y.return=m,m=y)}return i(m);case Il:e:{for(_=v.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){a(m,g.sibling),y=r(g,v.children||[]),y.return=m,m=y;break e}else{a(m,g);break}else e(m,g);g=g.sibling}y=jm(v,m.mode,y),y.return=m,m=y}return i(m);case Cr:return v=Lo(v),b(m,g,v,y)}if(Al(v))return S(m,g,v,y);if(bl(v)){if(_=bl(v),typeof _!="function")throw Error(R(150));return v=_.call(v),x(m,g,v,y)}if(typeof v.then=="function")return b(m,g,sd(v),y);if(v.$$typeof===On)return b(m,g,id(m,v),y);ld(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(a(m,g.sibling),y=r(g,v),y.return=m,m=y):(a(m,g),y=Vm(v,m.mode,y),y.return=m,m=y),i(m)):a(m,g)}return function(m,g,v,y){try{Kl=0;var _=b(m,g,v,y);return Xi=null,_}catch(C){if(C===fs||C===pf)throw C;var L=sa(29,C,null,m.mode);return L.lanes=y,L.return=m,L}}}var Oo=iw(!0),sw=iw(!1),_r=!1;function Iv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Og(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Br(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(t,e,a){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(xe&2)!==0){var r=n.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),n.pending=e,e=Fd(t),Q_(t,null,a),e}return ff(t,n,e,a),Fd(t)}function Pl(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,a|=n,e.lanes=a,L_(t,a)}}function Zm(t,e){var a=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var i={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=i:o=o.next=i,a=a.next}while(a!==null);o===null?r=o=e:o=o.next=e}else r=o=e;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:n.shared,callbacks:n.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var Bg=!1;function Fl(){if(Bg){var t=Wi;if(t!==null)throw t}}function Nl(t,e,a,n){Bg=!1;var r=t.updateQueue;_r=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,s=r.shared.pending;if(s!==null){r.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;i=0,c=u=l=null,s=o;do{var f=s.lane&-536870913,h=f!==s.lane;if(h?(he&f)===f:(n&f)===f){f!==0&&f===ts&&(Bg=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=t,x=s;f=e;var b=a;switch(x.tag){case 1:if(S=x.payload,typeof S=="function"){d=S.call(b,d,f);break e}d=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=x.payload,f=typeof S=="function"?S.call(b,d,f):S,f==null)break e;d=ze({},d,f);break e;case 2:_r=!0}}f=s.callback,f!==null&&(t.flags|=64,h&&(t.flags|=8192),h=r.callbacks,h===null?r.callbacks=[f]:h.push(f))}else h={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,i|=f;if(s=s.next,s===null){if(s=r.shared.pending,s===null)break;h=s,s=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);c===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=c,o===null&&(r.shared.lanes=0),jr|=i,t.lanes=i,t.memoizedState=d}}function lw(t,e){if(typeof t!="function")throw Error(R(191,t));t.call(e)}function uw(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)lw(a[t],e)}var as=fn(null),zd=fn(0);function yC(t,e){t=Vn,Be(zd,t),Be(as,e),Vn=t|e.baseLanes}function Pg(){Be(zd,Vn),Be(as,as.current)}function Av(){Vn=zd.current,vt(as),vt(zd)}var ha=fn(null),Ra=null;function Lr(t){var e=t.alternate;Be(et,et.current&1),Be(ha,t),Ra===null&&(e===null||as.current!==null||e.memoizedState!==null)&&(Ra=t)}function Fg(t){Be(et,et.current),Be(ha,t),Ra===null&&(Ra=t)}function cw(t){t.tag===22?(Be(et,et.current),Be(ha,t),Ra===null&&(Ra=t)):kr(t)}function kr(){Be(et,et.current),Be(ha,ha.current)}function ia(t){vt(ha),Ra===t&&(Ra=null),vt(et)}var et=fn(0);function qd(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||av(a)||nv(a)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var zn=0,ie=null,Ie=null,nt=null,$d=!1,Yi=!1,Bo=!1,Vd=0,Ql=0,Ki=null,Q2=0;function Ke(){throw Error(R(321))}function Ev(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!pa(t[a],e[a]))return!1;return!0}function Tv(t,e,a,n,r,o){return zn=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ee.H=t===null||t.memoizedState===null?zw:zv,Bo=!1,o=a(n,r),Bo=!1,Yi&&(o=fw(e,a,n,r)),dw(t),o}function dw(t){ee.H=Jl;var e=Ie!==null&&Ie.next!==null;if(zn=0,nt=Ie=ie=null,$d=!1,Ql=0,Ki=null,e)throw Error(R(300));t===null||it||(t=t.dependencies,t!==null&&Hd(t)&&(it=!0))}function fw(t,e,a,n){ie=t;var r=0;do{if(Yi&&(Ki=null),Ql=0,Yi=!1,25<=r)throw Error(R(301));if(r+=1,nt=Ie=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ee.H=qw,o=e(a,n)}while(Yi);return o}function J2(){var t=ee.H,e=t.useState()[0];return e=typeof e.then=="function"?fu(e):e,t=t.useState()[0],(Ie!==null?Ie.memoizedState:null)!==t&&(ie.flags|=1024),e}function Rv(){var t=Vd!==0;return Vd=0,t}function Mv(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Dv(t){if($d){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}$d=!1}zn=0,nt=Ie=ie=null,Yi=!1,Ql=Vd=0,Ki=null}function Ft(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?ie.memoizedState=nt=t:nt=nt.next=t,nt}function tt(){if(Ie===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=Ie.next;var e=nt===null?ie.memoizedState:nt.next;if(e!==null)nt=e,Ie=t;else{if(t===null)throw ie.alternate===null?Error(R(467)):Error(R(310));Ie=t,t={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},nt===null?ie.memoizedState=nt=t:nt=nt.next=t}return nt}function hf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fu(t){var e=Ql;return Ql+=1,Ki===null&&(Ki=[]),t=ow(Ki,t,e),e=ie,(nt===null?e.memoizedState:nt.next)===null&&(e=e.alternate,ee.H=e===null||e.memoizedState===null?zw:zv),t}function mf(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return fu(t);if(t.$$typeof===On)return _t(t)}throw Error(R(438,String(t)))}function Ov(t){var e=null,a=ie.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var n=ie.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(e={data:n.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=hf(),ie.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),n=0;n<t;n++)a[n]=NR;return e.index++,a}function qn(t,e){return typeof e=="function"?e(t):e}function Cd(t){var e=tt();return Bv(e,Ie,t)}function Bv(t,e,a){var n=t.queue;if(n===null)throw Error(R(311));n.lastRenderedReducer=a;var r=t.baseQueue,o=n.pending;if(o!==null){if(r!==null){var i=r.next;r.next=o.next,o.next=i}e.baseQueue=r=o,n.pending=null}if(o=t.baseState,r===null)t.memoizedState=o;else{e=r.next;var s=i=null,l=null,u=e,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(he&d)===d:(zn&d)===d){var f=u.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===ts&&(c=!0);else if((zn&f)===f){u=u.next,f===ts&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,ie.lanes|=f,jr|=f;d=u.action,Bo&&a(o,d),o=u.hasEagerState?u.eagerState:a(o,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=f,i=o):l=l.next=f,ie.lanes|=d,jr|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!pa(o,t.memoizedState)&&(it=!0,c&&(a=Wi,a!==null)))throw a;t.memoizedState=o,t.baseState=i,t.baseQueue=l,n.lastRenderedState=o}return r===null&&(n.lanes=0),[t.memoizedState,n.dispatch]}function Wm(t){var e=tt(),a=e.queue;if(a===null)throw Error(R(311));a.lastRenderedReducer=t;var n=a.dispatch,r=a.pending,o=e.memoizedState;if(r!==null){a.pending=null;var i=r=r.next;do o=t(o,i.action),i=i.next;while(i!==r);pa(o,e.memoizedState)||(it=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,n]}function pw(t,e,a){var n=ie,r=tt(),o=me;if(o){if(a===void 0)throw Error(R(407));a=a()}else a=e();var i=!pa((Ie||r).memoizedState,a);if(i&&(r.memoizedState=a,it=!0),r=r.queue,Pv(gw.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,ns(9,{destroy:void 0},mw.bind(null,n,r,a,e),null),Re===null)throw Error(R(349));o||(zn&127)!==0||hw(n,e,a)}return a}function hw(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=hf(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function mw(t,e,a,n){e.value=a,e.getSnapshot=n,vw(e)&&yw(t)}function gw(t,e,a){return a(function(){vw(e)&&yw(t)})}function vw(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!pa(t,a)}catch{return!0}}function yw(t){var e=Uo(t,2);e!==null&&Xt(e,t,2)}function Ng(t){var e=Ft();if(typeof t=="function"){var a=t;if(t=a(),Bo){Ar(!0);try{a()}finally{Ar(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:t},e}function xw(t,e,a,n){return t.baseState=a,Bv(t,Ie,typeof n=="function"?n:qn)}function eM(t,e,a,n,r){if(vf(t))throw Error(R(485));if(t=e.action,t!==null){var o={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};ee.T!==null?a(!0):o.isTransition=!1,n(o),a=e.pending,a===null?(o.next=e.pending=o,bw(e,o)):(o.next=a.next,e.pending=a.next=o)}}function bw(t,e){var a=e.action,n=e.payload,r=t.state;if(e.isTransition){var o=ee.T,i={};ee.T=i;try{var s=a(r,n),l=ee.S;l!==null&&l(i,s),xC(t,e,s)}catch(u){Hg(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),ee.T=o}}else try{o=a(r,n),xC(t,e,o)}catch(u){Hg(t,e,u)}}function xC(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){bC(t,e,n)},function(n){return Hg(t,e,n)}):bC(t,e,a)}function bC(t,e,a){e.status="fulfilled",e.value=a,Sw(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,bw(t,a)))}function Hg(t,e,a){var n=t.pending;if(t.pending=null,n!==null){n=n.next;do e.status="rejected",e.reason=a,Sw(e),e=e.next;while(e!==n)}t.action=null}function Sw(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function Cw(t,e){return e}function SC(t,e){if(me){var a=Re.formState;if(a!==null){e:{var n=ie;if(me){if(Ue){t:{for(var r=Ue,o=Ta;r.nodeType!==8;){if(!o){r=null;break t}if(r=Ma(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){Ue=Ma(r.nextSibling),n=r.data==="F!";break e}}$r(n)}n=!1}n&&(e=a[0])}}return a=Ft(),a.memoizedState=a.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cw,lastRenderedState:e},a.queue=n,a=Nw.bind(null,ie,n),n.dispatch=a,n=Ng(!1),o=Uv.bind(null,ie,!1,n.queue),n=Ft(),r={state:e,dispatch:null,action:t,pending:null},n.queue=r,a=eM.bind(null,ie,r,o,a),r.dispatch=a,n.memoizedState=t,[e,a,!1]}function CC(t){var e=tt();return _w(e,Ie,t)}function _w(t,e,a){if(e=Bv(t,e,Cw)[0],t=Cd(qn)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var n=fu(e)}catch(i){throw i===fs?pf:i}else n=e;e=tt();var r=e.queue,o=r.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,ns(9,{destroy:void 0},tM.bind(null,r,a),null)),[n,o,t]}function tM(t,e){t.action=e}function _C(t){var e=tt(),a=Ie;if(a!==null)return _w(e,a,t);tt(),e=e.memoizedState,a=tt();var n=a.queue.dispatch;return a.memoizedState=t,[e,n,!1]}function ns(t,e,a,n){return t={tag:t,create:a,deps:n,inst:e,next:null},e=ie.updateQueue,e===null&&(e=hf(),ie.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(n=a.next,a.next=t,t.next=n,e.lastEffect=t),t}function ww(){return tt().memoizedState}function _d(t,e,a,n){var r=Ft();ie.flags|=t,r.memoizedState=ns(1|e,{destroy:void 0},a,n===void 0?null:n)}function gf(t,e,a,n){var r=tt();n=n===void 0?null:n;var o=r.memoizedState.inst;Ie!==null&&n!==null&&Ev(n,Ie.memoizedState.deps)?r.memoizedState=ns(e,o,a,n):(ie.flags|=t,r.memoizedState=ns(1|e,o,a,n))}function wC(t,e){_d(8390656,8,t,e)}function Pv(t,e){gf(2048,8,t,e)}function aM(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=hf(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function Lw(t){var e=tt().memoizedState;return aM({ref:e,nextImpl:t}),function(){if((xe&2)!==0)throw Error(R(440));return e.impl.apply(void 0,arguments)}}function kw(t,e){return gf(4,2,t,e)}function Iw(t,e){return gf(4,4,t,e)}function Aw(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Ew(t,e,a){a=a!=null?a.concat([t]):null,gf(4,4,Aw.bind(null,e,t),a)}function Fv(){}function Tw(t,e){var a=tt();e=e===void 0?null:e;var n=a.memoizedState;return e!==null&&Ev(e,n[1])?n[0]:(a.memoizedState=[t,e],t)}function Rw(t,e){var a=tt();e=e===void 0?null:e;var n=a.memoizedState;if(e!==null&&Ev(e,n[1]))return n[0];if(n=t(),Bo){Ar(!0);try{t()}finally{Ar(!1)}}return a.memoizedState=[n,e],n}function Nv(t,e,a){return a===void 0||(zn&1073741824)!==0&&(he&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=xL(),ie.lanes|=t,jr|=t,a)}function Mw(t,e,a,n){return pa(a,e)?a:as.current!==null?(t=Nv(t,a,n),pa(t,e)||(it=!0),t):(zn&42)===0||(zn&1073741824)!==0&&(he&261930)===0?(it=!0,t.memoizedState=a):(t=xL(),ie.lanes|=t,jr|=t,e)}function Dw(t,e,a,n,r){var o=be.p;be.p=o!==0&&8>o?o:8;var i=ee.T,s={};ee.T=s,Uv(t,!1,e,a);try{var l=r(),u=ee.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=K2(l,n);Hl(t,e,c,fa(t))}else Hl(t,e,n,fa(t))}catch(d){Hl(t,e,{then:function(){},status:"rejected",reason:d},fa())}finally{be.p=o,i!==null&&s.types!==null&&(i.types=s.types),ee.T=i}}function nM(){}function Ug(t,e,a,n){if(t.tag!==5)throw Error(R(476));var r=Ow(t).queue;Dw(t,r,e,Io,a===null?nM:function(){return Bw(t),a(n)})}function Ow(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Io,baseState:Io,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:Io},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Bw(t){var e=Ow(t);e.next===null&&(e=t.alternate.memoizedState),Hl(t,e.next.queue,{},fa())}function Hv(){return _t(au)}function Pw(){return tt().memoizedState}function Fw(){return tt().memoizedState}function rM(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=fa();t=Br(a);var n=Pr(e,t,a);n!==null&&(Xt(n,e,a),Pl(n,e,a)),e={cache:wv()},t.payload=e;return}e=e.return}}function oM(t,e,a){var n=fa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vf(t)?Hw(e,a):(a=bv(t,e,a,n),a!==null&&(Xt(a,t,n),Uw(a,e,n)))}function Nw(t,e,a){var n=fa();Hl(t,e,a,n)}function Hl(t,e,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(vf(t))Hw(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var i=e.lastRenderedState,s=o(i,a);if(r.hasEagerState=!0,r.eagerState=s,pa(s,i))return ff(t,e,r,0),Re===null&&df(),!1}catch{}if(a=bv(t,e,r,n),a!==null)return Xt(a,t,n),Uw(a,e,n),!0}return!1}function Uv(t,e,a,n){if(n={lane:2,revertLane:Xv(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vf(t)){if(e)throw Error(R(479))}else e=bv(t,a,n,2),e!==null&&Xt(e,t,2)}function vf(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function Hw(t,e){Yi=$d=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function Uw(t,e,a){if((a&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,a|=n,e.lanes=a,L_(t,a)}}var Jl={readContext:_t,use:mf,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke};Jl.useEffectEvent=Ke;var zw={readContext:_t,use:mf,useCallback:function(t,e){return Ft().memoizedState=[t,e===void 0?null:e],t},useContext:_t,useEffect:wC,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,_d(4194308,4,Aw.bind(null,e,t),a)},useLayoutEffect:function(t,e){return _d(4194308,4,t,e)},useInsertionEffect:function(t,e){_d(4,2,t,e)},useMemo:function(t,e){var a=Ft();e=e===void 0?null:e;var n=t();if(Bo){Ar(!0);try{t()}finally{Ar(!1)}}return a.memoizedState=[n,e],n},useReducer:function(t,e,a){var n=Ft();if(a!==void 0){var r=a(e);if(Bo){Ar(!0);try{a(e)}finally{Ar(!1)}}}else r=e;return n.memoizedState=n.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},n.queue=t,t=t.dispatch=oM.bind(null,ie,t),[n.memoizedState,t]},useRef:function(t){var e=Ft();return t={current:t},e.memoizedState=t},useState:function(t){t=Ng(t);var e=t.queue,a=Nw.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Fv,useDeferredValue:function(t,e){var a=Ft();return Nv(a,t,e)},useTransition:function(){var t=Ng(!1);return t=Dw.bind(null,ie,t.queue,!0,!1),Ft().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var n=ie,r=Ft();if(me){if(a===void 0)throw Error(R(407));a=a()}else{if(a=e(),Re===null)throw Error(R(349));(he&127)!==0||hw(n,e,a)}r.memoizedState=a;var o={value:a,getSnapshot:e};return r.queue=o,wC(gw.bind(null,n,o,t),[t]),n.flags|=2048,ns(9,{destroy:void 0},mw.bind(null,n,o,a,e),null),a},useId:function(){var t=Ft(),e=Re.identifierPrefix;if(me){var a=un,n=ln;a=(n&~(1<<32-da(n)-1)).toString(32)+a,e="_"+e+"R_"+a,a=Vd++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=Q2++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Hv,useFormState:SC,useActionState:SC,useOptimistic:function(t){var e=Ft();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=Uv.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:Ov,useCacheRefresh:function(){return Ft().memoizedState=rM.bind(null,ie)},useEffectEvent:function(t){var e=Ft(),a={impl:t};return e.memoizedState=a,function(){if((xe&2)!==0)throw Error(R(440));return a.impl.apply(void 0,arguments)}}},zv={readContext:_t,use:mf,useCallback:Tw,useContext:_t,useEffect:Pv,useImperativeHandle:Ew,useInsertionEffect:kw,useLayoutEffect:Iw,useMemo:Rw,useReducer:Cd,useRef:ww,useState:function(){return Cd(qn)},useDebugValue:Fv,useDeferredValue:function(t,e){var a=tt();return Mw(a,Ie.memoizedState,t,e)},useTransition:function(){var t=Cd(qn)[0],e=tt().memoizedState;return[typeof t=="boolean"?t:fu(t),e]},useSyncExternalStore:pw,useId:Pw,useHostTransitionStatus:Hv,useFormState:CC,useActionState:CC,useOptimistic:function(t,e){var a=tt();return xw(a,Ie,t,e)},useMemoCache:Ov,useCacheRefresh:Fw};zv.useEffectEvent=Lw;var qw={readContext:_t,use:mf,useCallback:Tw,useContext:_t,useEffect:Pv,useImperativeHandle:Ew,useInsertionEffect:kw,useLayoutEffect:Iw,useMemo:Rw,useReducer:Wm,useRef:ww,useState:function(){return Wm(qn)},useDebugValue:Fv,useDeferredValue:function(t,e){var a=tt();return Ie===null?Nv(a,t,e):Mw(a,Ie.memoizedState,t,e)},useTransition:function(){var t=Wm(qn)[0],e=tt().memoizedState;return[typeof t=="boolean"?t:fu(t),e]},useSyncExternalStore:pw,useId:Pw,useHostTransitionStatus:Hv,useFormState:_C,useActionState:_C,useOptimistic:function(t,e){var a=tt();return Ie!==null?xw(a,Ie,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Ov,useCacheRefresh:Fw};qw.useEffectEvent=Lw;function Xm(t,e,a,n){e=t.memoizedState,a=a(n,e),a=a==null?e:ze({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var zg={enqueueSetState:function(t,e,a){t=t._reactInternals;var n=fa(),r=Br(n);r.payload=e,a!=null&&(r.callback=a),e=Pr(t,r,n),e!==null&&(Xt(e,t,n),Pl(e,t,n))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var n=fa(),r=Br(n);r.tag=1,r.payload=e,a!=null&&(r.callback=a),e=Pr(t,r,n),e!==null&&(Xt(e,t,n),Pl(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=fa(),n=Br(a);n.tag=2,e!=null&&(n.callback=e),e=Pr(t,n,a),e!==null&&(Xt(e,t,a),Pl(e,t,a))}};function LC(t,e,a,n,r,o,i){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,o,i):e.prototype&&e.prototype.isPureReactComponent?!Wl(a,n)||!Wl(r,o):!0}function kC(t,e,a,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,n),e.state!==t&&zg.enqueueReplaceState(e,e.state,null)}function Po(t,e){var a=e;if("ref"in e){a={};for(var n in e)n!=="ref"&&(a[n]=e[n])}if(t=t.defaultProps){a===e&&(a=ze({},a));for(var r in t)a[r]===void 0&&(a[r]=t[r])}return a}function $w(t){Pd(t)}function Vw(t){console.error(t)}function jw(t){Pd(t)}function jd(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(n){setTimeout(function(){throw n})}}function IC(t,e,a){try{var n=t.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function qg(t,e,a){return a=Br(a),a.tag=3,a.payload={element:null},a.callback=function(){jd(t,e)},a}function Gw(t){return t=Br(t),t.tag=3,t}function Zw(t,e,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=n.value;t.payload=function(){return r(o)},t.callback=function(){IC(e,a,n)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){IC(e,a,n),typeof r!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var s=n.stack;this.componentDidCatch(n.value,{componentStack:s!==null?s:""})})}function iM(t,e,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(e=a.alternate,e!==null&&ds(e,a,r,!0),a=ha.current,a!==null){switch(a.tag){case 31:case 13:return Ra===null?Yd():a.alternate===null&&Qe===0&&(Qe=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===Ud?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([n]):e.add(n),ig(t,n,r)),!1;case 22:return a.flags|=65536,n===Ud?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([n]):a.add(n)),ig(t,n,r)),!1}throw Error(R(435,a.tag))}return ig(t,n,r),Yd(),!1}if(me)return e=ha.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,n!==Eg&&(t=Error(R(422),{cause:n}),Yl(Ea(t,a)))):(n!==Eg&&(e=Error(R(423),{cause:n}),Yl(Ea(e,a))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,n=Ea(n,a),r=qg(t.stateNode,n,r),Zm(t,r),Qe!==4&&(Qe=2)),!1;var o=Error(R(520),{cause:n});if(o=Ea(o,a),ql===null?ql=[o]:ql.push(o),Qe!==4&&(Qe=2),e===null)return!0;n=Ea(n,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=r&-r,a.lanes|=t,t=qg(a.stateNode,n,t),Zm(a,t),!1;case 1:if(e=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Fr===null||!Fr.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=Gw(r),Zw(r,t,a,n),Zm(a,r),!1}a=a.return}while(a!==null);return!1}var qv=Error(R(461)),it=!1;function bt(t,e,a,n){e.child=t===null?sw(e,null,a,n):Oo(e,t.child,a,n)}function AC(t,e,a,n,r){a=a.render;var o=e.ref;if("ref"in n){var i={};for(var s in n)s!=="ref"&&(i[s]=n[s])}else i=n;return Do(e),n=Tv(t,e,a,i,o,r),s=Rv(),t!==null&&!it?(Mv(t,e,r),$n(t,e,r)):(me&&s&&Cv(e),e.flags|=1,bt(t,e,n,r),e.child)}function EC(t,e,a,n,r){if(t===null){var o=a.type;return typeof o=="function"&&!Sv(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,Ww(t,e,o,n,r)):(t=bd(a.type,null,n,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!$v(t,r)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:Wl,a(i,n)&&t.ref===e.ref)return $n(t,e,r)}return e.flags|=1,t=Fn(o,n),t.ref=e.ref,t.return=e,e.child=t}function Ww(t,e,a,n,r){if(t!==null){var o=t.memoizedProps;if(Wl(o,n)&&t.ref===e.ref)if(it=!1,e.pendingProps=n=o,$v(t,r))(t.flags&131072)!==0&&(it=!0);else return e.lanes=t.lanes,$n(t,e,r)}return $g(t,e,a,n,r)}function Xw(t,e,a,n){var r=n.children,o=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((e.flags&128)!==0){if(o=o!==null?o.baseLanes|a:a,t!==null){for(n=e.child=t.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~o}else n=0,e.child=null;return TC(t,e,o,a,n)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Sd(e,o!==null?o.cachePool:null),o!==null?yC(e,o):Pg(),cw(e);else return n=e.lanes=536870912,TC(t,e,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Sd(e,o.cachePool),yC(e,o),kr(e),e.memoizedState=null):(t!==null&&Sd(e,null),Pg(),kr(e));return bt(t,e,r,a),e.child}function Tl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function TC(t,e,a,n,r){var o=Lv();return o=o===null?null:{parent:ot._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Sd(e,null),Pg(),cw(e),t!==null&&ds(t,e,n,!0),e.childLanes=r,null}function wd(t,e){return e=Gd({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function RC(t,e,a){return Oo(e,t.child,null,a),t=wd(e,e.pendingProps),t.flags|=2,ia(e),e.memoizedState=null,t}function sM(t,e,a){var n=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(me){if(n.mode==="hidden")return t=wd(e,n),e.lanes=536870912,Tl(null,t);if(Fg(e),(t=Ue)?(t=zL(t,Ta),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:qr!==null?{id:ln,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=ew(t),a.return=e,e.child=a,Ct=e,Ue=null)):t=null,t===null)throw $r(e);return e.lanes=536870912,null}return wd(e,n)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(Fg(e),r)if(e.flags&256)e.flags&=-257,e=RC(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(R(558));else if(it||ds(t,e,a,!1),r=(a&t.childLanes)!==0,it||r){if(n=Re,n!==null&&(i=k_(n,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Uo(t,i),Xt(n,t,i),qv;Yd(),e=RC(t,e,a)}else t=o.treeContext,Ue=Ma(i.nextSibling),Ct=e,me=!0,Or=null,Ta=!1,t!==null&&aw(e,t),e=wd(e,n),e.flags|=4096;return e}return t=Fn(t.child,{mode:n.mode,children:n.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Ld(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(R(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function $g(t,e,a,n,r){return Do(e),a=Tv(t,e,a,n,void 0,r),n=Rv(),t!==null&&!it?(Mv(t,e,r),$n(t,e,r)):(me&&n&&Cv(e),e.flags|=1,bt(t,e,a,r),e.child)}function MC(t,e,a,n,r,o){return Do(e),e.updateQueue=null,a=fw(e,n,a,r),dw(t),n=Rv(),t!==null&&!it?(Mv(t,e,o),$n(t,e,o)):(me&&n&&Cv(e),e.flags|=1,bt(t,e,a,o),e.child)}function DC(t,e,a,n,r){if(Do(e),e.stateNode===null){var o=zi,i=a.contextType;typeof i=="object"&&i!==null&&(o=_t(i)),o=new a(n,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=zg,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=n,o.state=e.memoizedState,o.refs={},Iv(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?_t(i):zi,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(Xm(e,a,i,n),o.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&zg.enqueueReplaceState(o,o.state,null),Nl(e,n,o,r),Fl(),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!0}else if(t===null){o=e.stateNode;var s=e.memoizedProps,l=Po(a,s);o.props=l;var u=o.context,c=a.contextType;i=zi,typeof c=="object"&&c!==null&&(i=_t(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&kC(e,o,n,i),_r=!1;var f=e.memoizedState;o.state=f,Nl(e,n,o,r),Fl(),u=e.memoizedState,s||f!==u||_r?(typeof d=="function"&&(Xm(e,a,d,n),u=e.memoizedState),(l=_r||LC(e,a,l,n,f,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=u),o.props=n,o.state=u,o.context=i,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,Og(t,e),i=e.memoizedProps,c=Po(a,i),o.props=c,d=e.pendingProps,f=o.context,u=a.contextType,l=zi,typeof u=="object"&&u!==null&&(l=_t(u)),s=a.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==d||f!==l)&&kC(e,o,n,l),_r=!1,f=e.memoizedState,o.state=f,Nl(e,n,o,r),Fl();var h=e.memoizedState;i!==d||f!==h||_r||t!==null&&t.dependencies!==null&&Hd(t.dependencies)?(typeof s=="function"&&(Xm(e,a,s,n),h=e.memoizedState),(c=_r||LC(e,a,c,n,f,h,l)||t!==null&&t.dependencies!==null&&Hd(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,h,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=h),o.props=n,o.state=h,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return o=n,Ld(t,e),n=(e.flags&128)!==0,o||n?(o=e.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),e.flags|=1,t!==null&&n?(e.child=Oo(e,t.child,null,r),e.child=Oo(e,null,a,r)):bt(t,e,a,r),e.memoizedState=o.state,t=e.child):t=$n(t,e,r),t}function OC(t,e,a,n){return Mo(),e.flags|=256,bt(t,e,a,n),e.child}var Ym={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Km(t){return{baseLanes:t,cachePool:rw()}}function Qm(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=la),t}function Yw(t,e,a){var n=e.pendingProps,r=!1,o=(e.flags&128)!==0,i;if((i=o)||(i=t!==null&&t.memoizedState===null?!1:(et.current&2)!==0),i&&(r=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(me){if(r?Lr(e):kr(e),(t=Ue)?(t=zL(t,Ta),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:qr!==null?{id:ln,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=ew(t),a.return=e,e.child=a,Ct=e,Ue=null)):t=null,t===null)throw $r(e);return nv(t)?e.lanes=32:e.lanes=536870912,null}var s=n.children;return n=n.fallback,r?(kr(e),r=e.mode,s=Gd({mode:"hidden",children:s},r),n=Ao(n,r,a,null),s.return=e,n.return=e,s.sibling=n,e.child=s,n=e.child,n.memoizedState=Km(a),n.childLanes=Qm(t,i,a),e.memoizedState=Ym,Tl(null,n)):(Lr(e),Vg(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(Lr(e),e.flags&=-257,e=Jm(t,e,a)):e.memoizedState!==null?(kr(e),e.child=t.child,e.flags|=128,e=null):(kr(e),s=n.fallback,r=e.mode,n=Gd({mode:"visible",children:n.children},r),s=Ao(s,r,a,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,Oo(e,t.child,null,a),n=e.child,n.memoizedState=Km(a),n.childLanes=Qm(t,i,a),e.memoizedState=Ym,e=Tl(null,n));else if(Lr(e),nv(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,n=Error(R(419)),n.stack="",n.digest=i,Yl({value:n,source:null,stack:null}),e=Jm(t,e,a)}else if(it||ds(t,e,a,!1),i=(a&t.childLanes)!==0,it||i){if(i=Re,i!==null&&(n=k_(i,a),n!==0&&n!==l.retryLane))throw l.retryLane=n,Uo(t,n),Xt(i,t,n),qv;av(s)||Yd(),e=Jm(t,e,a)}else av(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ue=Ma(s.nextSibling),Ct=e,me=!0,Or=null,Ta=!1,t!==null&&aw(e,t),e=Vg(e,n.children),e.flags|=4096);return e}return r?(kr(e),s=n.fallback,r=e.mode,l=t.child,u=l.sibling,n=Fn(l,{mode:"hidden",children:n.children}),n.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=Fn(u,s):(s=Ao(s,r,a,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,Tl(null,n),n=e.child,s=t.child.memoizedState,s===null?s=Km(a):(r=s.cachePool,r!==null?(l=ot._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=rw(),s={baseLanes:s.baseLanes|a,cachePool:r}),n.memoizedState=s,n.childLanes=Qm(t,i,a),e.memoizedState=Ym,Tl(t.child,n)):(Lr(e),a=t.child,t=a.sibling,a=Fn(a,{mode:"visible",children:n.children}),a.return=e,a.sibling=null,t!==null&&(i=e.deletions,i===null?(e.deletions=[t],e.flags|=16):i.push(t)),e.child=a,e.memoizedState=null,a)}function Vg(t,e){return e=Gd({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Gd(t,e){return t=sa(22,t,null,e),t.lanes=0,t}function Jm(t,e,a){return Oo(e,t.child,null,a),t=Vg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function BC(t,e,a){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Rg(t.return,e,a)}function eg(t,e,a,n,r,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=a,i.tailMode=r,i.treeForkCount=o)}function Kw(t,e,a){var n=e.pendingProps,r=n.revealOrder,o=n.tail;n=n.children;var i=et.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Be(et,i),bt(t,e,n,a),n=me?Xl:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&BC(t,a,e);else if(t.tag===19)BC(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(a=e.child,r=null;a!==null;)t=a.alternate,t!==null&&qd(t)===null&&(r=a),a=a.sibling;a=r,a===null?(r=e.child,e.child=null):(r=a.sibling,a.sibling=null),eg(e,!1,r,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&qd(t)===null){e.child=r;break}t=r.sibling,r.sibling=a,a=r,r=t}eg(e,!0,a,null,o,n);break;case"together":eg(e,!1,null,null,void 0,n);break;default:e.memoizedState=null}return e.child}function $n(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),jr|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(ds(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(R(153));if(e.child!==null){for(t=e.child,a=Fn(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=Fn(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function $v(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Hd(t)))}function lM(t,e,a){switch(e.tag){case 3:Md(e,e.stateNode.containerInfo),wr(e,ot,t.memoizedState.cache),Mo();break;case 27:case 5:yg(e);break;case 4:Md(e,e.stateNode.containerInfo);break;case 10:wr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Fg(e),null;break;case 13:var n=e.memoizedState;if(n!==null)return n.dehydrated!==null?(Lr(e),e.flags|=128,null):(a&e.child.childLanes)!==0?Yw(t,e,a):(Lr(e),t=$n(t,e,a),t!==null?t.sibling:null);Lr(e);break;case 19:var r=(t.flags&128)!==0;if(n=(a&e.childLanes)!==0,n||(ds(t,e,a,!1),n=(a&e.childLanes)!==0),r){if(n)return Kw(t,e,a);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Be(et,et.current),n)break;return null;case 22:return e.lanes=0,Xw(t,e,a,e.pendingProps);case 24:wr(e,ot,t.memoizedState.cache)}return $n(t,e,a)}function Qw(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)it=!0;else{if(!$v(t,a)&&(e.flags&128)===0)return it=!1,lM(t,e,a);it=(t.flags&131072)!==0}else it=!1,me&&(e.flags&1048576)!==0&&tw(e,Xl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var n=e.pendingProps;if(t=Lo(e.elementType),e.type=t,typeof t=="function")Sv(t)?(n=Po(t,n),e.tag=1,e=DC(null,e,t,n,a)):(e.tag=0,e=$g(null,e,t,n,a));else{if(t!=null){var r=t.$$typeof;if(r===sv){e.tag=11,e=AC(null,e,t,n,a);break e}else if(r===lv){e.tag=14,e=EC(null,e,t,n,a);break e}}throw e=gg(t)||t,Error(R(306,e,""))}}return e;case 0:return $g(t,e,e.type,e.pendingProps,a);case 1:return n=e.type,r=Po(n,e.pendingProps),DC(t,e,n,r,a);case 3:e:{if(Md(e,e.stateNode.containerInfo),t===null)throw Error(R(387));n=e.pendingProps;var o=e.memoizedState;r=o.element,Og(t,e),Nl(e,n,null,a);var i=e.memoizedState;if(n=i.cache,wr(e,ot,n),n!==o.cache&&Mg(e,[ot],a,!0),Fl(),n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){e=OC(t,e,n,a);break e}else if(n!==r){r=Ea(Error(R(424)),e),Yl(r),e=OC(t,e,n,a);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ue=Ma(t.firstChild),Ct=e,me=!0,Or=null,Ta=!0,a=sw(e,null,n,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Mo(),n===r){e=$n(t,e,a);break e}bt(t,e,n,a)}e=e.child}return e;case 26:return Ld(t,e),t===null?(a=n_(e.type,null,e.pendingProps,null))?e.memoizedState=a:me||(a=e.type,t=e.pendingProps,n=ef(Dr.current).createElement(a),n[St]=e,n[Yt]=t,wt(n,a,t),gt(n),e.stateNode=n):e.memoizedState=n_(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return yg(e),t===null&&me&&(n=e.stateNode=qL(e.type,e.pendingProps,Dr.current),Ct=e,Ta=!0,r=Ue,Zr(e.type)?(rv=r,Ue=Ma(n.firstChild)):Ue=r),bt(t,e,e.pendingProps.children,a),Ld(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&me&&((r=n=Ue)&&(n=PM(n,e.type,e.pendingProps,Ta),n!==null?(e.stateNode=n,Ct=e,Ue=Ma(n.firstChild),Ta=!1,r=!0):r=!1),r||$r(e)),yg(e),r=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,n=o.children,ev(r,o)?n=null:i!==null&&ev(r,i)&&(e.flags|=32),e.memoizedState!==null&&(r=Tv(t,e,J2,null,null,a),au._currentValue=r),Ld(t,e),bt(t,e,n,a),e.child;case 6:return t===null&&me&&((t=a=Ue)&&(a=FM(a,e.pendingProps,Ta),a!==null?(e.stateNode=a,Ct=e,Ue=null,t=!0):t=!1),t||$r(e)),null;case 13:return Yw(t,e,a);case 4:return Md(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Oo(e,null,n,a):bt(t,e,n,a),e.child;case 11:return AC(t,e,e.type,e.pendingProps,a);case 7:return bt(t,e,e.pendingProps,a),e.child;case 8:return bt(t,e,e.pendingProps.children,a),e.child;case 12:return bt(t,e,e.pendingProps.children,a),e.child;case 10:return n=e.pendingProps,wr(e,e.type,n.value),bt(t,e,n.children,a),e.child;case 9:return r=e.type._context,n=e.pendingProps.children,Do(e),r=_t(r),n=n(r),e.flags|=1,bt(t,e,n,a),e.child;case 14:return EC(t,e,e.type,e.pendingProps,a);case 15:return Ww(t,e,e.type,e.pendingProps,a);case 19:return Kw(t,e,a);case 31:return sM(t,e,a);case 22:return Xw(t,e,a,e.pendingProps);case 24:return Do(e),n=_t(ot),t===null?(r=Lv(),r===null&&(r=Re,o=wv(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),e.memoizedState={parent:n,cache:r},Iv(e),wr(e,ot,r)):((t.lanes&a)!==0&&(Og(t,e),Nl(e,null,null,a),Fl()),r=t.memoizedState,o=e.memoizedState,r.parent!==n?(r={parent:n,cache:n},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),wr(e,ot,n)):(n=o.cache,wr(e,ot,n),n!==r.cache&&Mg(e,[ot],a,!0))),bt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(R(156,e.tag))}function An(t){t.flags|=4}function tg(t,e,a,n,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(CL())t.flags|=8192;else throw To=Ud,kv}else t.flags&=-16777217}function PC(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!jL(e))if(CL())t.flags|=8192;else throw To=Ud,kv}function ud(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?__():536870912,t.lanes|=e,rs|=e)}function _l(t,e){if(!me)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function He(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,n=0;if(e)for(var r=t.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=n,t.childLanes=a,e}function uM(t,e,a){var n=e.pendingProps;switch(_v(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(e),null;case 1:return He(e),null;case 3:return a=e.stateNode,n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Nn(ot),Qi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Ei(e)?An(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Gm())),He(e),null;case 26:var r=e.type,o=e.memoizedState;return t===null?(An(e),o!==null?(He(e),PC(e,o)):(He(e),tg(e,r,null,n,a))):o?o!==t.memoizedState?(An(e),He(e),PC(e,o)):(He(e),e.flags&=-16777217):(t=t.memoizedProps,t!==n&&An(e),He(e),tg(e,r,t,n,a)),null;case 27:if(Dd(e),a=Dr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&An(e);else{if(!n){if(e.stateNode===null)throw Error(R(166));return He(e),null}t=dn.current,Ei(e)?dC(e,t):(t=qL(r,n,a),e.stateNode=t,An(e))}return He(e),null;case 5:if(Dd(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&An(e);else{if(!n){if(e.stateNode===null)throw Error(R(166));return He(e),null}if(o=dn.current,Ei(e))dC(e,o);else{var i=ef(Dr.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?i.createElement(r,{is:n.is}):i.createElement(r)}}o[St]=e,o[Yt]=n;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=o;e:switch(wt(o,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&An(e)}}return He(e),tg(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&An(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(R(166));if(t=Dr.current,Ei(e)){if(t=e.stateNode,a=e.memoizedProps,n=null,r=Ct,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}t[St]=e,t=!!(t.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||NL(t.nodeValue,a)),t||$r(e,!0)}else t=ef(t).createTextNode(n),t[St]=e,e.stateNode=t}return He(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(n=Ei(e),a!==null){if(t===null){if(!n)throw Error(R(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(557));t[St]=e}else Mo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;He(e),t=!1}else a=Gm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(ia(e),e):(ia(e),null);if((e.flags&128)!==0)throw Error(R(558))}return He(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Ei(e),n!==null&&n.dehydrated!==null){if(t===null){if(!r)throw Error(R(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(317));r[St]=e}else Mo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;He(e),r=!1}else r=Gm(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(ia(e),e):(ia(e),null)}return ia(e),(e.flags&128)!==0?(e.lanes=a,e):(a=n!==null,t=t!==null&&t.memoizedState!==null,a&&(n=e.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),ud(e,e.updateQueue),He(e),null);case 4:return Qi(),t===null&&Yv(e.stateNode.containerInfo),He(e),null;case 10:return Nn(e.type),He(e),null;case 19:if(vt(et),n=e.memoizedState,n===null)return He(e),null;if(r=(e.flags&128)!==0,o=n.rendering,o===null)if(r)_l(n,!1);else{if(Qe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=qd(t),o!==null){for(e.flags|=128,_l(n,!1),t=o.updateQueue,e.updateQueue=t,ud(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)J_(a,t),a=a.sibling;return Be(et,et.current&1|2),me&&Mn(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&ua()>Wd&&(e.flags|=128,r=!0,_l(n,!1),e.lanes=4194304)}else{if(!r)if(t=qd(o),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,ud(e,t),_l(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!me)return He(e),null}else 2*ua()-n.renderingStartTime>Wd&&a!==536870912&&(e.flags|=128,r=!0,_l(n,!1),e.lanes=4194304);n.isBackwards?(o.sibling=e.child,e.child=o):(t=n.last,t!==null?t.sibling=o:e.child=o,n.last=o)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=ua(),t.sibling=null,a=et.current,Be(et,r?a&1|2:a&1),me&&Mn(e,n.treeForkCount),t):(He(e),null);case 22:case 23:return ia(e),Av(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(a&536870912)!==0&&(e.flags&128)===0&&(He(e),e.subtreeFlags&6&&(e.flags|=8192)):He(e),a=e.updateQueue,a!==null&&ud(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==a&&(e.flags|=2048),t!==null&&vt(Eo),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Nn(ot),He(e),null;case 25:return null;case 30:return null}throw Error(R(156,e.tag))}function cM(t,e){switch(_v(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Nn(ot),Qi(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Dd(e),null;case 31:if(e.memoizedState!==null){if(ia(e),e.alternate===null)throw Error(R(340));Mo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(ia(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(R(340));Mo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return vt(et),null;case 4:return Qi(),null;case 10:return Nn(e.type),null;case 22:case 23:return ia(e),Av(),t!==null&&vt(Eo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Nn(ot),null;case 25:return null;default:return null}}function Jw(t,e){switch(_v(e),e.tag){case 3:Nn(ot),Qi();break;case 26:case 27:case 5:Dd(e);break;case 4:Qi();break;case 31:e.memoizedState!==null&&ia(e);break;case 13:ia(e);break;case 19:vt(et);break;case 10:Nn(e.type);break;case 22:case 23:ia(e),Av(),t!==null&&vt(Eo);break;case 24:Nn(ot)}}function pu(t,e){try{var a=e.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&t)===t){n=void 0;var o=a.create,i=a.inst;n=o(),i.destroy=n}a=a.next}while(a!==r)}}catch(s){we(e,e.return,s)}}function Vr(t,e,a){try{var n=e.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&t)===t){var i=n.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,r=e;var l=a,u=s;try{u()}catch(c){we(r,l,c)}}}n=n.next}while(n!==o)}}catch(c){we(e,e.return,c)}}function eL(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{uw(e,a)}catch(n){we(t,t.return,n)}}}function tL(t,e,a){a.props=Po(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(n){we(t,e,n)}}function Ul(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof a=="function"?t.refCleanup=a(n):a.current=n}}catch(r){we(t,e,r)}}function cn(t,e){var a=t.ref,n=t.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){we(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){we(t,e,r)}else a.current=null}function aL(t){var e=t.type,a=t.memoizedProps,n=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){we(t,t.return,r)}}function ag(t,e,a){try{var n=t.stateNode;TM(n,t.type,a,e),n[Yt]=e}catch(r){we(t,t.return,r)}}function nL(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Zr(t.type)||t.tag===4}function ng(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||nL(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Zr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function jg(t,e,a){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=Bn));else if(n!==4&&(n===27&&Zr(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(jg(t,e,a),t=t.sibling;t!==null;)jg(t,e,a),t=t.sibling}function Zd(t,e,a){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(n!==4&&(n===27&&Zr(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Zd(t,e,a),t=t.sibling;t!==null;)Zd(t,e,a),t=t.sibling}function rL(t){var e=t.stateNode,a=t.memoizedProps;try{for(var n=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);wt(e,n,a),e[St]=t,e[Yt]=a}catch(o){we(t,t.return,o)}}var Dn=!1,rt=!1,rg=!1,FC=typeof WeakSet=="function"?WeakSet:Set,mt=null;function dM(t,e){if(t=t.containerInfo,Qg=rf,t=j_(t),yv(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var i=0,s=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==a||r!==0&&d.nodeType!==3||(s=i+r),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===a&&++u===r&&(s=i),f===o&&++c===n&&(l=i),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Jg={focusedElem:t,selectionRange:a},rf=!1,mt=e;mt!==null;)if(e=mt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,mt=t;else for(;mt!==null;){switch(e=mt,o=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)r=t[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&o!==null){t=void 0,a=e,r=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var S=Po(a.type,r);t=n.getSnapshotBeforeUpdate(S,o),n.__reactInternalSnapshotBeforeUpdate=t}catch(x){we(a,a.return,x)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)tv(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":tv(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(R(163))}if(t=e.sibling,t!==null){t.return=e.return,mt=t;break}mt=e.return}}function oL(t,e,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Tn(t,a),n&4&&pu(5,a);break;case 1:if(Tn(t,a),n&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){we(a,a.return,i)}else{var r=Po(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){we(a,a.return,i)}}n&64&&eL(a),n&512&&Ul(a,a.return);break;case 3:if(Tn(t,a),n&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{uw(t,e)}catch(i){we(a,a.return,i)}}break;case 27:e===null&&n&4&&rL(a);case 26:case 5:Tn(t,a),e===null&&n&4&&aL(a),n&512&&Ul(a,a.return);break;case 12:Tn(t,a);break;case 31:Tn(t,a),n&4&&lL(t,a);break;case 13:Tn(t,a),n&4&&uL(t,a),n&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=bM.bind(null,a),NM(t,a))));break;case 22:if(n=a.memoizedState!==null||Dn,!n){e=e!==null&&e.memoizedState!==null||rt,r=Dn;var o=rt;Dn=n,(rt=e)&&!o?Rn(t,a,(a.subtreeFlags&8772)!==0):Tn(t,a),Dn=r,rt=o}break;case 30:break;default:Tn(t,a)}}function iL(t){var e=t.alternate;e!==null&&(t.alternate=null,iL(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&fv(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ve=null,Zt=!1;function En(t,e,a){for(a=a.child;a!==null;)sL(t,e,a),a=a.sibling}function sL(t,e,a){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(iu,a)}catch{}switch(a.tag){case 26:rt||cn(a,e),En(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:rt||cn(a,e);var n=Ve,r=Zt;Zr(a.type)&&(Ve=a.stateNode,Zt=!1),En(t,e,a),Vl(a.stateNode),Ve=n,Zt=r;break;case 5:rt||cn(a,e);case 6:if(n=Ve,r=Zt,Ve=null,En(t,e,a),Ve=n,Zt=r,Ve!==null)if(Zt)try{(Ve.nodeType===9?Ve.body:Ve.nodeName==="HTML"?Ve.ownerDocument.body:Ve).removeChild(a.stateNode)}catch(o){we(a,e,o)}else try{Ve.removeChild(a.stateNode)}catch(o){we(a,e,o)}break;case 18:Ve!==null&&(Zt?(t=Ve,QC(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ls(t)):QC(Ve,a.stateNode));break;case 4:n=Ve,r=Zt,Ve=a.stateNode.containerInfo,Zt=!0,En(t,e,a),Ve=n,Zt=r;break;case 0:case 11:case 14:case 15:Vr(2,a,e),rt||Vr(4,a,e),En(t,e,a);break;case 1:rt||(cn(a,e),n=a.stateNode,typeof n.componentWillUnmount=="function"&&tL(a,e,n)),En(t,e,a);break;case 21:En(t,e,a);break;case 22:rt=(n=rt)||a.memoizedState!==null,En(t,e,a),rt=n;break;default:En(t,e,a)}}function lL(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ls(t)}catch(a){we(e,e.return,a)}}}function uL(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ls(t)}catch(a){we(e,e.return,a)}}function fM(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new FC),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new FC),e;default:throw Error(R(435,t.tag))}}function cd(t,e){var a=fM(t);e.forEach(function(n){if(!a.has(n)){a.add(n);var r=SM.bind(null,t,n);n.then(r,r)}})}function jt(t,e){var a=e.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],o=t,i=e,s=i;e:for(;s!==null;){switch(s.tag){case 27:if(Zr(s.type)){Ve=s.stateNode,Zt=!1;break e}break;case 5:Ve=s.stateNode,Zt=!1;break e;case 3:case 4:Ve=s.stateNode.containerInfo,Zt=!0;break e}s=s.return}if(Ve===null)throw Error(R(160));sL(o,i,r),Ve=null,Zt=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)cL(e,t),e=e.sibling}var Va=null;function cL(t,e){var a=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:jt(e,t),Gt(t),n&4&&(Vr(3,t,t.return),pu(3,t),Vr(5,t,t.return));break;case 1:jt(e,t),Gt(t),n&512&&(rt||a===null||cn(a,a.return)),n&64&&Dn&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=Va;if(jt(e,t),Gt(t),n&512&&(rt||a===null||cn(a,a.return)),n&4){var o=a!==null?a.memoizedState:null;if(n=t.memoizedState,a===null)if(n===null)if(t.stateNode===null){e:{n=t.type,a=t.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":o=r.getElementsByTagName("title")[0],(!o||o[uu]||o[St]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(n),r.head.insertBefore(o,r.querySelector("head > title"))),wt(o,n,a),o[St]=t,gt(o),n=o;break e;case"link":var i=o_("link","href",r).get(n+(a.href||""));if(i){for(var s=0;s<i.length;s++)if(o=i[s],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){i.splice(s,1);break t}}o=r.createElement(n),wt(o,n,a),r.head.appendChild(o);break;case"meta":if(i=o_("meta","content",r).get(n+(a.content||""))){for(s=0;s<i.length;s++)if(o=i[s],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){i.splice(s,1);break t}}o=r.createElement(n),wt(o,n,a),r.head.appendChild(o);break;default:throw Error(R(468,n))}o[St]=t,gt(o),n=o}t.stateNode=n}else i_(r,t.type,t.stateNode);else t.stateNode=r_(r,n,t.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?i_(r,t.type,t.stateNode):r_(r,n,t.memoizedProps)):n===null&&t.stateNode!==null&&ag(t,t.memoizedProps,a.memoizedProps)}break;case 27:jt(e,t),Gt(t),n&512&&(rt||a===null||cn(a,a.return)),a!==null&&n&4&&ag(t,t.memoizedProps,a.memoizedProps);break;case 5:if(jt(e,t),Gt(t),n&512&&(rt||a===null||cn(a,a.return)),t.flags&32){r=t.stateNode;try{es(r,"")}catch(S){we(t,t.return,S)}}n&4&&t.stateNode!=null&&(r=t.memoizedProps,ag(t,r,a!==null?a.memoizedProps:r)),n&1024&&(rg=!0);break;case 6:if(jt(e,t),Gt(t),n&4){if(t.stateNode===null)throw Error(R(162));n=t.memoizedProps,a=t.stateNode;try{a.nodeValue=n}catch(S){we(t,t.return,S)}}break;case 3:if(Ad=null,r=Va,Va=tf(e.containerInfo),jt(e,t),Va=r,Gt(t),n&4&&a!==null&&a.memoizedState.isDehydrated)try{ls(e.containerInfo)}catch(S){we(t,t.return,S)}rg&&(rg=!1,dL(t));break;case 4:n=Va,Va=tf(t.stateNode.containerInfo),jt(e,t),Gt(t),Va=n;break;case 12:jt(e,t),Gt(t);break;case 31:jt(e,t),Gt(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,cd(t,n)));break;case 13:jt(e,t),Gt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(yf=ua()),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,cd(t,n)));break;case 22:r=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Dn,c=rt;if(Dn=u||r,rt=c||l,jt(e,t),rt=c,Dn=u,Gt(t),n&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(a===null||l||Dn||rt||ko(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){l=a=e;try{if(o=l.stateNode,r)i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(S){we(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(S){we(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var h=l.stateNode;r?JC(h,!0):JC(l.stateNode,!1)}catch(S){we(l,l.return,S)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}n&4&&(n=t.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,cd(t,a))));break;case 19:jt(e,t),Gt(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,cd(t,n)));break;case 30:break;case 21:break;default:jt(e,t),Gt(t)}}function Gt(t){var e=t.flags;if(e&2){try{for(var a,n=t.return;n!==null;){if(nL(n)){a=n;break}n=n.return}if(a==null)throw Error(R(160));switch(a.tag){case 27:var r=a.stateNode,o=ng(t);Zd(t,o,r);break;case 5:var i=a.stateNode;a.flags&32&&(es(i,""),a.flags&=-33);var s=ng(t);Zd(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=ng(t);jg(t,u,l);break;default:throw Error(R(161))}}catch(c){we(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function dL(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;dL(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Tn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)oL(t,e.alternate,e),e=e.sibling}function ko(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Vr(4,e,e.return),ko(e);break;case 1:cn(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&tL(e,e.return,a),ko(e);break;case 27:Vl(e.stateNode);case 26:case 5:cn(e,e.return),ko(e);break;case 22:e.memoizedState===null&&ko(e);break;case 30:ko(e);break;default:ko(e)}t=t.sibling}}function Rn(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var n=e.alternate,r=t,o=e,i=o.flags;switch(o.tag){case 0:case 11:case 15:Rn(r,o,a),pu(4,o);break;case 1:if(Rn(r,o,a),n=o,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){we(n,n.return,u)}if(n=o,r=n.updateQueue,r!==null){var s=n.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)lw(l[r],s)}catch(u){we(n,n.return,u)}}a&&i&64&&eL(o),Ul(o,o.return);break;case 27:rL(o);case 26:case 5:Rn(r,o,a),a&&n===null&&i&4&&aL(o),Ul(o,o.return);break;case 12:Rn(r,o,a);break;case 31:Rn(r,o,a),a&&i&4&&lL(r,o);break;case 13:Rn(r,o,a),a&&i&4&&uL(r,o);break;case 22:o.memoizedState===null&&Rn(r,o,a),Ul(o,o.return);break;case 30:break;default:Rn(r,o,a)}e=e.sibling}}function Vv(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&du(a))}function jv(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&du(t))}function $a(t,e,a,n){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)fL(t,e,a,n),e=e.sibling}function fL(t,e,a,n){var r=e.flags;switch(e.tag){case 0:case 11:case 15:$a(t,e,a,n),r&2048&&pu(9,e);break;case 1:$a(t,e,a,n);break;case 3:$a(t,e,a,n),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&du(t)));break;case 12:if(r&2048){$a(t,e,a,n),t=e.stateNode;try{var o=e.memoizedProps,i=o.id,s=o.onPostCommit;typeof s=="function"&&s(i,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){we(e,e.return,l)}}else $a(t,e,a,n);break;case 31:$a(t,e,a,n);break;case 13:$a(t,e,a,n);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?$a(t,e,a,n):zl(t,e):o._visibility&2?$a(t,e,a,n):(o._visibility|=2,Ri(t,e,a,n,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Vv(i,e);break;case 24:$a(t,e,a,n),r&2048&&jv(e.alternate,e);break;default:$a(t,e,a,n)}}function Ri(t,e,a,n,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var o=t,i=e,s=a,l=n,u=i.flags;switch(i.tag){case 0:case 11:case 15:Ri(o,i,s,l,r),pu(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Ri(o,i,s,l,r):zl(o,i):(c._visibility|=2,Ri(o,i,s,l,r)),r&&u&2048&&Vv(i.alternate,i);break;case 24:Ri(o,i,s,l,r),r&&u&2048&&jv(i.alternate,i);break;default:Ri(o,i,s,l,r)}e=e.sibling}}function zl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,n=e,r=n.flags;switch(n.tag){case 22:zl(a,n),r&2048&&Vv(n.alternate,n);break;case 24:zl(a,n),r&2048&&jv(n.alternate,n);break;default:zl(a,n)}e=e.sibling}}var Rl=8192;function Ti(t,e,a){if(t.subtreeFlags&Rl)for(t=t.child;t!==null;)pL(t,e,a),t=t.sibling}function pL(t,e,a){switch(t.tag){case 26:Ti(t,e,a),t.flags&Rl&&t.memoizedState!==null&&YM(a,Va,t.memoizedState,t.memoizedProps);break;case 5:Ti(t,e,a);break;case 3:case 4:var n=Va;Va=tf(t.stateNode.containerInfo),Ti(t,e,a),Va=n;break;case 22:t.memoizedState===null&&(n=t.alternate,n!==null&&n.memoizedState!==null?(n=Rl,Rl=16777216,Ti(t,e,a),Rl=n):Ti(t,e,a));break;default:Ti(t,e,a)}}function hL(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function wl(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var n=e[a];mt=n,gL(n,t)}hL(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mL(t),t=t.sibling}function mL(t){switch(t.tag){case 0:case 11:case 15:wl(t),t.flags&2048&&Vr(9,t,t.return);break;case 3:wl(t);break;case 12:wl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,kd(t)):wl(t);break;default:wl(t)}}function kd(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var n=e[a];mt=n,gL(n,t)}hL(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Vr(8,e,e.return),kd(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,kd(e));break;default:kd(e)}t=t.sibling}}function gL(t,e){for(;mt!==null;){var a=mt;switch(a.tag){case 0:case 11:case 15:Vr(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:du(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,mt=n;else e:for(a=t;mt!==null;){n=mt;var r=n.sibling,o=n.return;if(iL(n),n===a){mt=null;break e}if(r!==null){r.return=o,mt=r;break e}mt=o}}}var pM={getCacheForType:function(t){var e=_t(ot),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return _t(ot).controller.signal}},hM=typeof WeakMap=="function"?WeakMap:Map,xe=0,Re=null,de=null,he=0,_e=0,oa=null,Tr=!1,ps=!1,Gv=!1,Vn=0,Qe=0,jr=0,Ro=0,Zv=0,la=0,rs=0,ql=null,Wt=null,Gg=!1,yf=0,vL=0,Wd=1/0,Xd=null,Fr=null,ut=0,Nr=null,os=null,Hn=0,Zg=0,Wg=null,yL=null,$l=0,Xg=null;function fa(){return(xe&2)!==0&&he!==0?he&-he:ee.T!==null?Xv():I_()}function xL(){if(la===0)if((he&536870912)===0||me){var t=ed;ed<<=1,(ed&3932160)===0&&(ed=262144),la=t}else la=536870912;return t=ha.current,t!==null&&(t.flags|=32),la}function Xt(t,e,a){(t===Re&&(_e===2||_e===9)||t.cancelPendingCommit!==null)&&(is(t,0),Rr(t,he,la,!1)),lu(t,a),((xe&2)===0||t!==Re)&&(t===Re&&((xe&2)===0&&(Ro|=a),Qe===4&&Rr(t,he,la,!1)),pn(t))}function bL(t,e,a){if((xe&6)!==0)throw Error(R(327));var n=!a&&(e&127)===0&&(e&t.expiredLanes)===0||su(t,e),r=n?vM(t,e):og(t,e,!0),o=n;do{if(r===0){ps&&!n&&Rr(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!mM(a)){r=og(t,e,!1),o=!1;continue}if(r===2){if(o=e,t.errorRecoveryDisabledLanes&o)var i=0;else i=t.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){e=i;e:{var s=t;r=ql;var l=s.current.memoizedState.isDehydrated;if(l&&(is(s,i).flags|=256),i=og(s,i,!1),i!==2){if(Gv&&!l){s.errorRecoveryDisabledLanes|=o,Ro|=o,r=4;break e}o=Wt,Wt=r,o!==null&&(Wt===null?Wt=o:Wt.push.apply(Wt,o))}r=i}if(o=!1,r!==2)continue}}if(r===1){is(t,0),Rr(t,e,0,!0);break}e:{switch(n=t,o=r,o){case 0:case 1:throw Error(R(345));case 4:if((e&4194048)!==e)break;case 6:Rr(n,e,la,!Tr);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(R(329))}if((e&62914560)===e&&(r=yf+300-ua(),10<r)){if(Rr(n,e,la,!Tr),sf(n,0,!0)!==0)break e;Hn=e,n.timeoutHandle=UL(NC.bind(null,n,a,Wt,Xd,Gg,e,la,Ro,rs,Tr,o,"Throttled",-0,0),r);break e}NC(n,a,Wt,Xd,Gg,e,la,Ro,rs,Tr,o,null,-0,0)}}break}while(!0);pn(t)}function NC(t,e,a,n,r,o,i,s,l,u,c,d,f,h){if(t.timeoutHandle=-1,d=e.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bn},pL(e,o,d);var S=(o&62914560)===o?yf-ua():(o&4194048)===o?vL-ua():0;if(S=KM(d,S),S!==null){Hn=o,t.cancelPendingCommit=S(UC.bind(null,t,e,o,a,n,r,i,s,l,c,d,null,f,h)),Rr(t,o,i,!u);return}}UC(t,e,o,a,n,r,i,s,l)}function mM(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],o=r.getSnapshot;r=r.value;try{if(!pa(o(),r))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Rr(t,e,a,n){e&=~Zv,e&=~Ro,t.suspendedLanes|=e,t.pingedLanes&=~e,n&&(t.warmLanes|=e),n=t.expirationTimes;for(var r=e;0<r;){var o=31-da(r),i=1<<o;n[o]=-1,r&=~i}a!==0&&w_(t,a,e)}function xf(){return(xe&6)===0?(hu(0,!1),!1):!0}function Wv(){if(de!==null){if(_e===0)var t=de.return;else t=de,Pn=zo=null,Dv(t),Xi=null,Kl=0,t=de;for(;t!==null;)Jw(t.alternate,t),t=t.return;de=null}}function is(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,DM(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Hn=0,Wv(),Re=t,de=a=Fn(t.current,null),he=e,_e=0,oa=null,Tr=!1,ps=su(t,e),Gv=!1,rs=la=Zv=Ro=jr=Qe=0,Wt=ql=null,Gg=!1,(e&8)!==0&&(e|=e&32);var n=t.entangledLanes;if(n!==0)for(t=t.entanglements,n&=e;0<n;){var r=31-da(n),o=1<<r;e|=t[r],n&=~o}return Vn=e,df(),a}function SL(t,e){ie=null,ee.H=Jl,e===fs||e===pf?(e=gC(),_e=3):e===kv?(e=gC(),_e=4):_e=e===qv?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,oa=e,de===null&&(Qe=1,jd(t,Ea(e,t.current)))}function CL(){var t=ha.current;return t===null?!0:(he&4194048)===he?Ra===null:(he&62914560)===he||(he&536870912)!==0?t===Ra:!1}function _L(){var t=ee.H;return ee.H=Jl,t===null?Jl:t}function wL(){var t=ee.A;return ee.A=pM,t}function Yd(){Qe=4,Tr||(he&4194048)!==he&&ha.current!==null||(ps=!0),(jr&134217727)===0&&(Ro&134217727)===0||Re===null||Rr(Re,he,la,!1)}function og(t,e,a){var n=xe;xe|=2;var r=_L(),o=wL();(Re!==t||he!==e)&&(Xd=null,is(t,e)),e=!1;var i=Qe;e:do try{if(_e!==0&&de!==null){var s=de,l=oa;switch(_e){case 8:Wv(),i=6;break e;case 3:case 2:case 9:case 6:ha.current===null&&(e=!0);var u=_e;if(_e=0,oa=null,Vi(t,s,l,u),a&&ps){i=0;break e}break;default:u=_e,_e=0,oa=null,Vi(t,s,l,u)}}gM(),i=Qe;break}catch(c){SL(t,c)}while(!0);return e&&t.shellSuspendCounter++,Pn=zo=null,xe=n,ee.H=r,ee.A=o,de===null&&(Re=null,he=0,df()),i}function gM(){for(;de!==null;)LL(de)}function vM(t,e){var a=xe;xe|=2;var n=_L(),r=wL();Re!==t||he!==e?(Xd=null,Wd=ua()+500,is(t,e)):ps=su(t,e);e:do try{if(_e!==0&&de!==null){e=de;var o=oa;t:switch(_e){case 1:_e=0,oa=null,Vi(t,e,o,1);break;case 2:case 9:if(mC(o)){_e=0,oa=null,HC(e);break}e=function(){_e!==2&&_e!==9||Re!==t||(_e=7),pn(t)},o.then(e,e);break e;case 3:_e=7;break e;case 4:_e=5;break e;case 7:mC(o)?(_e=0,oa=null,HC(e)):(_e=0,oa=null,Vi(t,e,o,7));break;case 5:var i=null;switch(de.tag){case 26:i=de.memoizedState;case 5:case 27:var s=de;if(i?jL(i):s.stateNode.complete){_e=0,oa=null;var l=s.sibling;if(l!==null)de=l;else{var u=s.return;u!==null?(de=u,bf(u)):de=null}break t}}_e=0,oa=null,Vi(t,e,o,5);break;case 6:_e=0,oa=null,Vi(t,e,o,6);break;case 8:Wv(),Qe=6;break e;default:throw Error(R(462))}}yM();break}catch(c){SL(t,c)}while(!0);return Pn=zo=null,ee.H=n,ee.A=r,xe=a,de!==null?0:(Re=null,he=0,df(),Qe)}function yM(){for(;de!==null&&!zR();)LL(de)}function LL(t){var e=Qw(t.alternate,t,Vn);t.memoizedProps=t.pendingProps,e===null?bf(t):de=e}function HC(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=MC(a,e,e.pendingProps,e.type,void 0,he);break;case 11:e=MC(a,e,e.pendingProps,e.type.render,e.ref,he);break;case 5:Dv(e);default:Jw(a,e),e=de=J_(e,Vn),e=Qw(a,e,Vn)}t.memoizedProps=t.pendingProps,e===null?bf(t):de=e}function Vi(t,e,a,n){Pn=zo=null,Dv(e),Xi=null,Kl=0;var r=e.return;try{if(iM(t,r,e,a,he)){Qe=1,jd(t,Ea(a,t.current)),de=null;return}}catch(o){if(r!==null)throw de=r,o;Qe=1,jd(t,Ea(a,t.current)),de=null;return}e.flags&32768?(me||n===1?t=!0:ps||(he&536870912)!==0?t=!1:(Tr=t=!0,(n===2||n===9||n===3||n===6)&&(n=ha.current,n!==null&&n.tag===13&&(n.flags|=16384))),kL(e,t)):bf(e)}function bf(t){var e=t;do{if((e.flags&32768)!==0){kL(e,Tr);return}t=e.return;var a=uM(e.alternate,e,Vn);if(a!==null){de=a;return}if(e=e.sibling,e!==null){de=e;return}de=e=t}while(e!==null);Qe===0&&(Qe=5)}function kL(t,e){do{var a=cM(t.alternate,t);if(a!==null){a.flags&=32767,de=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){de=t;return}de=t=a}while(t!==null);Qe=6,de=null}function UC(t,e,a,n,r,o,i,s,l){t.cancelPendingCommit=null;do Sf();while(ut!==0);if((xe&6)!==0)throw Error(R(327));if(e!==null){if(e===t.current)throw Error(R(177));if(o=e.lanes|e.childLanes,o|=xv,KR(t,a,o,i,s,l),t===Re&&(de=Re=null,he=0),os=e,Nr=t,Hn=a,Zg=o,Wg=r,yL=n,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,CM(Od,function(){return RL(),null})):(t.callbackNode=null,t.callbackPriority=0),n=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||n){n=ee.T,ee.T=null,r=be.p,be.p=2,i=xe,xe|=4;try{dM(t,e,a)}finally{xe=i,be.p=r,ee.T=n}}ut=1,IL(),AL(),EL()}}function IL(){if(ut===1){ut=0;var t=Nr,e=os,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=ee.T,ee.T=null;var n=be.p;be.p=2;var r=xe;xe|=4;try{cL(e,t);var o=Jg,i=j_(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&V_(s.ownerDocument.documentElement,s)){if(l!==null&&yv(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var h=f.getSelection(),S=s.textContent.length,x=Math.min(l.start,S),b=l.end===void 0?x:Math.min(l.end,S);!h.extend&&x>b&&(i=b,b=x,x=i);var m=lC(s,x),g=lC(s,b);if(m&&g&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==g.node||h.focusOffset!==g.offset)){var v=d.createRange();v.setStart(m.node,m.offset),h.removeAllRanges(),x>b?(h.addRange(v),h.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),h.addRange(v))}}}}for(d=[],h=s;h=h.parentNode;)h.nodeType===1&&d.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var y=d[s];y.element.scrollLeft=y.left,y.element.scrollTop=y.top}}rf=!!Qg,Jg=Qg=null}finally{xe=r,be.p=n,ee.T=a}}t.current=e,ut=2}}function AL(){if(ut===2){ut=0;var t=Nr,e=os,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=ee.T,ee.T=null;var n=be.p;be.p=2;var r=xe;xe|=4;try{oL(t,e.alternate,e)}finally{xe=r,be.p=n,ee.T=a}}ut=3}}function EL(){if(ut===4||ut===3){ut=0,qR();var t=Nr,e=os,a=Hn,n=yL;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ut=5:(ut=0,os=Nr=null,TL(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Fr=null),dv(a),e=e.stateNode,ca&&typeof ca.onCommitFiberRoot=="function")try{ca.onCommitFiberRoot(iu,e,void 0,(e.current.flags&128)===128)}catch{}if(n!==null){e=ee.T,r=be.p,be.p=2,ee.T=null;try{for(var o=t.onRecoverableError,i=0;i<n.length;i++){var s=n[i];o(s.value,{componentStack:s.stack})}}finally{ee.T=e,be.p=r}}(Hn&3)!==0&&Sf(),pn(t),r=t.pendingLanes,(a&261930)!==0&&(r&42)!==0?t===Xg?$l++:($l=0,Xg=t):$l=0,hu(0,!1)}}function TL(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,du(e)))}function Sf(){return IL(),AL(),EL(),RL()}function RL(){if(ut!==5)return!1;var t=Nr,e=Zg;Zg=0;var a=dv(Hn),n=ee.T,r=be.p;try{be.p=32>a?32:a,ee.T=null,a=Wg,Wg=null;var o=Nr,i=Hn;if(ut=0,os=Nr=null,Hn=0,(xe&6)!==0)throw Error(R(331));var s=xe;if(xe|=4,mL(o.current),fL(o,o.current,i,a),xe=s,hu(0,!1),ca&&typeof ca.onPostCommitFiberRoot=="function")try{ca.onPostCommitFiberRoot(iu,o)}catch{}return!0}finally{be.p=r,ee.T=n,TL(t,e)}}function zC(t,e,a){e=Ea(a,e),e=qg(t.stateNode,e,2),t=Pr(t,e,2),t!==null&&(lu(t,2),pn(t))}function we(t,e,a){if(t.tag===3)zC(t,t,a);else for(;e!==null;){if(e.tag===3){zC(e,t,a);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Fr===null||!Fr.has(n))){t=Ea(a,t),a=Gw(2),n=Pr(e,a,2),n!==null&&(Zw(a,n,e,t),lu(n,2),pn(n));break}}e=e.return}}function ig(t,e,a){var n=t.pingCache;if(n===null){n=t.pingCache=new hM;var r=new Set;n.set(e,r)}else r=n.get(e),r===void 0&&(r=new Set,n.set(e,r));r.has(a)||(Gv=!0,r.add(a),t=xM.bind(null,t,e,a),e.then(t,t))}function xM(t,e,a){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Re===t&&(he&a)===a&&(Qe===4||Qe===3&&(he&62914560)===he&&300>ua()-yf?(xe&2)===0&&is(t,0):Zv|=a,rs===he&&(rs=0)),pn(t)}function ML(t,e){e===0&&(e=__()),t=Uo(t,e),t!==null&&(lu(t,e),pn(t))}function bM(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),ML(t,a)}function SM(t,e){var a=0;switch(t.tag){case 31:case 13:var n=t.stateNode,r=t.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(R(314))}n!==null&&n.delete(e),ML(t,a)}function CM(t,e){return uv(t,e)}var Kd=null,Mi=null,Yg=!1,Qd=!1,sg=!1,Mr=0;function pn(t){t!==Mi&&t.next===null&&(Mi===null?Kd=Mi=t:Mi=Mi.next=t),Qd=!0,Yg||(Yg=!0,wM())}function hu(t,e){if(!sg&&Qd){sg=!0;do for(var a=!1,n=Kd;n!==null;){if(!e)if(t!==0){var r=n.pendingLanes;if(r===0)var o=0;else{var i=n.suspendedLanes,s=n.pingedLanes;o=(1<<31-da(42|t)+1)-1,o&=r&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,qC(n,o))}else o=he,o=sf(n,n===Re?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||su(n,o)||(a=!0,qC(n,o));n=n.next}while(a);sg=!1}}function _M(){DL()}function DL(){Qd=Yg=!1;var t=0;Mr!==0&&MM()&&(t=Mr);for(var e=ua(),a=null,n=Kd;n!==null;){var r=n.next,o=OL(n,e);o===0?(n.next=null,a===null?Kd=r:a.next=r,r===null&&(Mi=a)):(a=n,(t!==0||(o&3)!==0)&&(Qd=!0)),n=r}ut!==0&&ut!==5||hu(t,!1),Mr!==0&&(Mr=0)}function OL(t,e){for(var a=t.suspendedLanes,n=t.pingedLanes,r=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-da(o),s=1<<i,l=r[i];l===-1?((s&a)===0||(s&n)!==0)&&(r[i]=YR(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Re,a=he,a=sf(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n=t.callbackNode,a===0||t===e&&(_e===2||_e===9)||t.cancelPendingCommit!==null)return n!==null&&n!==null&&Pm(n),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||su(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(n!==null&&Pm(n),dv(a)){case 2:case 8:a=S_;break;case 32:a=Od;break;case 268435456:a=C_;break;default:a=Od}return n=BL.bind(null,t),a=uv(a,n),t.callbackPriority=e,t.callbackNode=a,e}return n!==null&&n!==null&&Pm(n),t.callbackPriority=2,t.callbackNode=null,2}function BL(t,e){if(ut!==0&&ut!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Sf()&&t.callbackNode!==a)return null;var n=he;return n=sf(t,t===Re?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n===0?null:(bL(t,n,e),OL(t,ua()),t.callbackNode!=null&&t.callbackNode===a?BL.bind(null,t):null)}function qC(t,e){if(Sf())return null;bL(t,e,!0)}function wM(){OM(function(){(xe&6)!==0?uv(b_,_M):DL()})}function Xv(){if(Mr===0){var t=ts;t===0&&(t=Jc,Jc<<=1,(Jc&261888)===0&&(Jc=256)),Mr=t}return Mr}function $C(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:vd(""+t)}function VC(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function LM(t,e,a,n,r){if(e==="submit"&&a&&a.stateNode===r){var o=$C((r[Yt]||null).action),i=n.submitter;i&&(e=(e=i[Yt]||null)?$C(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new lf("action","action",null,n,r);t.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Mr!==0){var l=i?VC(r,i):new FormData(r);Ug(a,{pending:!0,data:l,method:r.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?VC(r,i):new FormData(r),Ug(a,{pending:!0,data:l,method:r.method,action:o},o,l))},currentTarget:r}]})}}for(dd=0;dd<Ag.length;dd++)fd=Ag[dd],jC=fd.toLowerCase(),GC=fd[0].toUpperCase()+fd.slice(1),ja(jC,"on"+GC);var fd,jC,GC,dd;ja(Z_,"onAnimationEnd");ja(W_,"onAnimationIteration");ja(X_,"onAnimationStart");ja("dblclick","onDoubleClick");ja("focusin","onFocus");ja("focusout","onBlur");ja($2,"onTransitionRun");ja(V2,"onTransitionStart");ja(j2,"onTransitionCancel");ja(Y_,"onTransitionEnd");Ji("onMouseEnter",["mouseout","mouseover"]);Ji("onMouseLeave",["mouseout","mouseover"]);Ji("onPointerEnter",["pointerout","pointerover"]);Ji("onPointerLeave",["pointerout","pointerover"]);Fo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eu));function PL(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var n=t[a],r=n.event;n=n.listeners;e:{var o=void 0;if(e)for(var i=n.length-1;0<=i;i--){var s=n[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){Pd(c)}r.currentTarget=null,o=l}else for(i=0;i<n.length;i++){if(s=n[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=u;try{o(r)}catch(c){Pd(c)}r.currentTarget=null,o=l}}}}function ce(t,e){var a=e[bg];a===void 0&&(a=e[bg]=new Set);var n=t+"__bubble";a.has(n)||(FL(e,t,2,!1),a.add(n))}function lg(t,e,a){var n=0;e&&(n|=4),FL(a,t,n,e)}var pd="_reactListening"+Math.random().toString(36).slice(2);function Yv(t){if(!t[pd]){t[pd]=!0,A_.forEach(function(a){a!=="selectionchange"&&(kM.has(a)||lg(a,!1,t),lg(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[pd]||(e[pd]=!0,lg("selectionchange",!1,e))}}function FL(t,e,a,n){switch(YL(e)){case 2:var r=eD;break;case 8:r=tD;break;default:r=ey}a=r.bind(null,e,a,t),r=void 0,!Lg||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),n?r!==void 0?t.addEventListener(e,a,{capture:!0,passive:r}):t.addEventListener(e,a,!0):r!==void 0?t.addEventListener(e,a,{passive:r}):t.addEventListener(e,a,!1)}function ug(t,e,a,n,r){var o=n;if((e&1)===0&&(e&2)===0&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var s=n.stateNode.containerInfo;if(s===r)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;s!==null;){if(i=Bi(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){n=o=i;continue e}s=s.parentNode}}n=n.return}P_(function(){var u=o,c=hv(a),d=[];e:{var f=K_.get(t);if(f!==void 0){var h=lf,S=t;switch(t){case"keypress":if(xd(a)===0)break e;case"keydown":case"keyup":h=S2;break;case"focusin":S="focus",h=zm;break;case"focusout":S="blur",h=zm;break;case"beforeblur":case"afterblur":h=zm;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=JS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=u2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=w2;break;case Z_:case W_:case X_:h=f2;break;case Y_:h=k2;break;case"scroll":case"scrollend":h=s2;break;case"wheel":h=A2;break;case"copy":case"cut":case"paste":h=h2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=tC;break;case"toggle":case"beforetoggle":h=T2}var x=(e&4)!==0,b=!x&&(t==="scroll"||t==="scrollend"),m=x?f!==null?f+"Capture":null:f;x=[];for(var g=u,v;g!==null;){var y=g;if(v=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||v===null||m===null||(y=Gl(g,m),y!=null&&x.push(tu(g,y,v))),b)break;g=g.return}0<x.length&&(f=new h(f,S,null,a,c),d.push({event:f,listeners:x}))}}if((e&7)===0){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&a!==wg&&(S=a.relatedTarget||a.fromElement)&&(Bi(S)||S[us]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(S=a.relatedTarget||a.toElement,h=u,S=S?Bi(S):null,S!==null&&(b=ou(S),x=S.tag,S!==b||x!==5&&x!==27&&x!==6)&&(S=null)):(h=null,S=u),h!==S)){if(x=JS,y="onMouseLeave",m="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(x=tC,y="onPointerLeave",m="onPointerEnter",g="pointer"),b=h==null?f:El(h),v=S==null?f:El(S),f=new x(y,g+"leave",h,a,c),f.target=b,f.relatedTarget=v,y=null,Bi(c)===u&&(x=new x(m,g+"enter",S,a,c),x.target=v,x.relatedTarget=b,y=x),b=y,h&&S)t:{for(x=IM,m=h,g=S,v=0,y=m;y;y=x(y))v++;y=0;for(var _=g;_;_=x(_))y++;for(;0<v-y;)m=x(m),v--;for(;0<y-v;)g=x(g),y--;for(;v--;){if(m===g||g!==null&&m===g.alternate){x=m;break t}m=x(m),g=x(g)}x=null}else x=null;h!==null&&ZC(d,f,h,x,!1),S!==null&&b!==null&&ZC(d,b,S,x,!0)}}e:{if(f=u?El(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var L=oC;else if(rC(f))if(q_)L=U2;else{L=N2;var C=F2}else h=f.nodeName,!h||h.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&pv(u.elementType)&&(L=oC):L=H2;if(L&&(L=L(t,u))){z_(d,L,a,c);break e}C&&C(t,f,u),t==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&_g(f,"number",f.value)}switch(C=u?El(u):window,t){case"focusin":(rC(C)||C.contentEditable==="true")&&(Ni=C,kg=u,Ol=null);break;case"focusout":Ol=kg=Ni=null;break;case"mousedown":Ig=!0;break;case"contextmenu":case"mouseup":case"dragend":Ig=!1,uC(d,a,c);break;case"selectionchange":if(q2)break;case"keydown":case"keyup":uC(d,a,c)}var I;if(vv)e:{switch(t){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Fi?H_(t,a)&&(w="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(w="onCompositionStart");w&&(N_&&a.locale!=="ko"&&(Fi||w!=="onCompositionStart"?w==="onCompositionEnd"&&Fi&&(I=F_()):(Er=c,mv="value"in Er?Er.value:Er.textContent,Fi=!0)),C=Jd(u,w),0<C.length&&(w=new eC(w,t,null,a,c),d.push({event:w,listeners:C}),I?w.data=I:(I=U_(a),I!==null&&(w.data=I)))),(I=M2?D2(t,a):O2(t,a))&&(w=Jd(u,"onBeforeInput"),0<w.length&&(C=new eC("onBeforeInput","beforeinput",null,a,c),d.push({event:C,listeners:w}),C.data=I)),LM(d,t,u,a,c)}PL(d,e)})}function tu(t,e,a){return{instance:t,listener:e,currentTarget:a}}function Jd(t,e){for(var a=e+"Capture",n=[];t!==null;){var r=t,o=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Gl(t,a),r!=null&&n.unshift(tu(t,r,o)),r=Gl(t,e),r!=null&&n.push(tu(t,r,o))),t.tag===3)return n;t=t.return}return[]}function IM(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ZC(t,e,a,n,r){for(var o=e._reactName,i=[];a!==null&&a!==n;){var s=a,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===n)break;s!==5&&s!==26&&s!==27||u===null||(l=u,r?(u=Gl(a,o),u!=null&&i.unshift(tu(a,u,l))):r||(u=Gl(a,o),u!=null&&i.push(tu(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var AM=/\r\n?/g,EM=/\u0000|\uFFFD/g;function WC(t){return(typeof t=="string"?t:""+t).replace(AM,`
9
+ `).replace(EM,"")}function NL(t,e){return e=WC(e),WC(t)===e}function ke(t,e,a,n,r,o){switch(a){case"children":typeof n=="string"?e==="body"||e==="textarea"&&n===""||es(t,n):(typeof n=="number"||typeof n=="bigint")&&e!=="body"&&es(t,""+n);break;case"className":ad(t,"class",n);break;case"tabIndex":ad(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ad(t,a,n);break;case"style":B_(t,n,o);break;case"data":if(e!=="object"){ad(t,"data",n);break}case"src":case"href":if(n===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(a);break}n=vd(""+n),t.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(a==="formAction"?(e!=="input"&&ke(t,e,"name",r.name,r,null),ke(t,e,"formEncType",r.formEncType,r,null),ke(t,e,"formMethod",r.formMethod,r,null),ke(t,e,"formTarget",r.formTarget,r,null)):(ke(t,e,"encType",r.encType,r,null),ke(t,e,"method",r.method,r,null),ke(t,e,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(a);break}n=vd(""+n),t.setAttribute(a,n);break;case"onClick":n!=null&&(t.onclick=Bn);break;case"onScroll":n!=null&&ce("scroll",t);break;case"onScrollEnd":n!=null&&ce("scrollend",t);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(R(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(R(60));t.innerHTML=a}}break;case"multiple":t.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":t.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){t.removeAttribute("xlink:href");break}a=vd(""+n),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,""+n):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":n===!0?t.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,n):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?t.setAttribute(a,n):t.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?t.removeAttribute(a):t.setAttribute(a,n);break;case"popover":ce("beforetoggle",t),ce("toggle",t),gd(t,"popover",n);break;case"xlinkActuate":In(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":In(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":In(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":In(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":In(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":In(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":In(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":In(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":In(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":gd(t,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=o2.get(a)||a,gd(t,a,n))}}function Kg(t,e,a,n,r,o){switch(a){case"style":B_(t,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(R(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(R(60));t.innerHTML=a}}break;case"children":typeof n=="string"?es(t,n):(typeof n=="number"||typeof n=="bigint")&&es(t,""+n);break;case"onScroll":n!=null&&ce("scroll",t);break;case"onScrollEnd":n!=null&&ce("scrollend",t);break;case"onClick":n!=null&&(t.onclick=Bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!E_.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),e=a.slice(2,r?a.length-7:void 0),o=t[Yt]||null,o=o!=null?o[a]:null,typeof o=="function"&&t.removeEventListener(e,o,r),typeof n=="function")){typeof o!="function"&&o!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,n,r);break e}a in t?t[a]=n:n===!0?t.setAttribute(a,""):gd(t,a,n)}}}function wt(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",t),ce("load",t);var n=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var i=a[o];if(i!=null)switch(o){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(R(137,e));default:ke(t,e,o,i,a,null)}}r&&ke(t,e,"srcSet",a.srcSet,a,null),n&&ke(t,e,"src",a.src,a,null);return;case"input":ce("invalid",t);var s=o=i=r=null,l=null,u=null;for(n in a)if(a.hasOwnProperty(n)){var c=a[n];if(c!=null)switch(n){case"name":r=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(R(137,e));break;default:ke(t,e,n,c,a,null)}}M_(t,o,s,l,u,i,r,!1);return;case"select":ce("invalid",t),n=i=o=null;for(r in a)if(a.hasOwnProperty(r)&&(s=a[r],s!=null))switch(r){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":n=s;default:ke(t,e,r,s,a,null)}e=o,a=i,t.multiple=!!n,e!=null?Gi(t,!!n,e,!1):a!=null&&Gi(t,!!n,a,!0);return;case"textarea":ce("invalid",t),o=r=n=null;for(i in a)if(a.hasOwnProperty(i)&&(s=a[i],s!=null))switch(i){case"value":n=s;break;case"defaultValue":r=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(R(91));break;default:ke(t,e,i,s,a,null)}O_(t,n,r,o);return;case"option":for(l in a)a.hasOwnProperty(l)&&(n=a[l],n!=null)&&(l==="selected"?t.selected=n&&typeof n!="function"&&typeof n!="symbol":ke(t,e,l,n,a,null));return;case"dialog":ce("beforetoggle",t),ce("toggle",t),ce("cancel",t),ce("close",t);break;case"iframe":case"object":ce("load",t);break;case"video":case"audio":for(n=0;n<eu.length;n++)ce(eu[n],t);break;case"image":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"embed":case"source":case"link":ce("error",t),ce("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(n=a[u],n!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(R(137,e));default:ke(t,e,u,n,a,null)}return;default:if(pv(e)){for(c in a)a.hasOwnProperty(c)&&(n=a[c],n!==void 0&&Kg(t,e,c,n,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(n=a[s],n!=null&&ke(t,e,s,n,a,null))}function TM(t,e,a,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,i=null,s=null,l=null,u=null,c=null;for(h in a){var d=a[h];if(a.hasOwnProperty(h)&&d!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=d;default:n.hasOwnProperty(h)||ke(t,e,h,null,n,d)}}for(var f in n){var h=n[f];if(d=a[f],n.hasOwnProperty(f)&&(h!=null||d!=null))switch(f){case"type":o=h;break;case"name":r=h;break;case"checked":u=h;break;case"defaultChecked":c=h;break;case"value":i=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(R(137,e));break;default:h!==d&&ke(t,e,f,h,n,d)}}Cg(t,i,s,l,u,c,o,r);return;case"select":h=i=s=f=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":h=l;default:n.hasOwnProperty(o)||ke(t,e,o,null,n,l)}for(r in n)if(o=n[r],l=a[r],n.hasOwnProperty(r)&&(o!=null||l!=null))switch(r){case"value":f=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&ke(t,e,r,o,n,l)}e=s,a=i,n=h,f!=null?Gi(t,!!a,f,!1):!!n!=!!a&&(e!=null?Gi(t,!!a,e,!0):Gi(t,!!a,a?[]:"",!1));return;case"textarea":h=f=null;for(s in a)if(r=a[s],a.hasOwnProperty(s)&&r!=null&&!n.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:ke(t,e,s,null,n,r)}for(i in n)if(r=n[i],o=a[i],n.hasOwnProperty(i)&&(r!=null||o!=null))switch(i){case"value":f=r;break;case"defaultValue":h=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(R(91));break;default:r!==o&&ke(t,e,i,r,n,o)}D_(t,f,h);return;case"option":for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!=null&&!n.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:ke(t,e,S,null,n,f));for(l in n)f=n[l],h=a[l],n.hasOwnProperty(l)&&f!==h&&(f!=null||h!=null)&&(l==="selected"?t.selected=f&&typeof f!="function"&&typeof f!="symbol":ke(t,e,l,f,n,h));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in a)f=a[x],a.hasOwnProperty(x)&&f!=null&&!n.hasOwnProperty(x)&&ke(t,e,x,null,n,f);for(u in n)if(f=n[u],h=a[u],n.hasOwnProperty(u)&&f!==h&&(f!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(R(137,e));break;default:ke(t,e,u,f,n,h)}return;default:if(pv(e)){for(var b in a)f=a[b],a.hasOwnProperty(b)&&f!==void 0&&!n.hasOwnProperty(b)&&Kg(t,e,b,void 0,n,f);for(c in n)f=n[c],h=a[c],!n.hasOwnProperty(c)||f===h||f===void 0&&h===void 0||Kg(t,e,c,f,n,h);return}}for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&ke(t,e,m,null,n,f);for(d in n)f=n[d],h=a[d],!n.hasOwnProperty(d)||f===h||f==null&&h==null||ke(t,e,d,f,n,h)}function XC(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RM(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],o=r.transferSize,i=r.initiatorType,s=r.duration;if(o&&s&&XC(i)){for(i=0,s=r.responseEnd,n+=1;n<a.length;n++){var l=a[n],u=l.startTime;if(u>s)break;var c=l.transferSize,d=l.initiatorType;c&&XC(d)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--n,e+=8*(o+i)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Qg=null,Jg=null;function ef(t){return t.nodeType===9?t:t.ownerDocument}function YC(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function HL(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function ev(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var cg=null;function MM(){var t=window.event;return t&&t.type==="popstate"?t===cg?!1:(cg=t,!0):(cg=null,!1)}var UL=typeof setTimeout=="function"?setTimeout:void 0,DM=typeof clearTimeout=="function"?clearTimeout:void 0,KC=typeof Promise=="function"?Promise:void 0,OM=typeof queueMicrotask=="function"?queueMicrotask:typeof KC<"u"?function(t){return KC.resolve(null).then(t).catch(BM)}:UL;function BM(t){setTimeout(function(){throw t})}function Zr(t){return t==="head"}function QC(t,e){var a=e,n=0;do{var r=a.nextSibling;if(t.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){t.removeChild(r),ls(e);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Vl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Vl(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[uu]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&Vl(t.ownerDocument.body);a=r}while(a);ls(e)}function JC(t,e){var a=t;t=0;do{var n=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=n}while(a)}function tv(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":tv(a),fv(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function PM(t,e,a,n){for(;t.nodeType===1;){var r=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(n){if(!t[uu])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(o=t.getAttribute("rel"),o==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(o!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(o=t.getAttribute("src"),(o!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===o)return t}else return t;if(t=Ma(t.nextSibling),t===null)break}return null}function FM(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Ma(t.nextSibling),t===null))return null;return t}function zL(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Ma(t.nextSibling),t===null))return null;return t}function av(t){return t.data==="$?"||t.data==="$~"}function nv(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function NM(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var n=function(){e(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),t._reactRetry=n}}function Ma(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var rv=null;function e_(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return Ma(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function t_(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function qL(t,e,a){switch(e=ef(a),t){case"html":if(t=e.documentElement,!t)throw Error(R(452));return t;case"head":if(t=e.head,!t)throw Error(R(453));return t;case"body":if(t=e.body,!t)throw Error(R(454));return t;default:throw Error(R(451))}}function Vl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);fv(t)}var Da=new Map,a_=new Set;function tf(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var jn=be.d;be.d={f:HM,r:UM,D:zM,C:qM,L:$M,m:VM,X:GM,S:jM,M:ZM};function HM(){var t=jn.f(),e=xf();return t||e}function UM(t){var e=cs(t);e!==null&&e.tag===5&&e.type==="form"?Bw(e):jn.r(t)}var hs=typeof document>"u"?null:document;function $L(t,e,a){var n=hs;if(n&&typeof e=="string"&&e){var r=Aa(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),a_.has(r)||(a_.add(r),t={rel:t,crossOrigin:a,href:e},n.querySelector(r)===null&&(e=n.createElement("link"),wt(e,"link",t),gt(e),n.head.appendChild(e)))}}function zM(t){jn.D(t),$L("dns-prefetch",t,null)}function qM(t,e){jn.C(t,e),$L("preconnect",t,e)}function $M(t,e,a){jn.L(t,e,a);var n=hs;if(n&&t&&e){var r='link[rel="preload"][as="'+Aa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Aa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Aa(a.imageSizes)+'"]')):r+='[href="'+Aa(t)+'"]';var o=r;switch(e){case"style":o=ss(t);break;case"script":o=ms(t)}Da.has(o)||(t=ze({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Da.set(o,t),n.querySelector(r)!==null||e==="style"&&n.querySelector(mu(o))||e==="script"&&n.querySelector(gu(o))||(e=n.createElement("link"),wt(e,"link",t),gt(e),n.head.appendChild(e)))}}function VM(t,e){jn.m(t,e);var a=hs;if(a&&t){var n=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Aa(n)+'"][href="'+Aa(t)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ms(t)}if(!Da.has(o)&&(t=ze({rel:"modulepreload",href:t},e),Da.set(o,t),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gu(o)))return}n=a.createElement("link"),wt(n,"link",t),gt(n),a.head.appendChild(n)}}}function jM(t,e,a){jn.S(t,e,a);var n=hs;if(n&&t){var r=ji(n).hoistableStyles,o=ss(t);e=e||"default";var i=r.get(o);if(!i){var s={loading:0,preload:null};if(i=n.querySelector(mu(o)))s.loading=5;else{t=ze({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Da.get(o))&&Kv(t,a);var l=i=n.createElement("link");gt(l),wt(l,"link",t),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Id(i,e,n)}i={type:"stylesheet",instance:i,count:1,state:s},r.set(o,i)}}}function GM(t,e){jn.X(t,e);var a=hs;if(a&&t){var n=ji(a).hoistableScripts,r=ms(t),o=n.get(r);o||(o=a.querySelector(gu(r)),o||(t=ze({src:t,async:!0},e),(e=Da.get(r))&&Qv(t,e),o=a.createElement("script"),gt(o),wt(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function ZM(t,e){jn.M(t,e);var a=hs;if(a&&t){var n=ji(a).hoistableScripts,r=ms(t),o=n.get(r);o||(o=a.querySelector(gu(r)),o||(t=ze({src:t,async:!0,type:"module"},e),(e=Da.get(r))&&Qv(t,e),o=a.createElement("script"),gt(o),wt(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}function n_(t,e,a,n){var r=(r=Dr.current)?tf(r):null;if(!r)throw Error(R(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=ss(a.href),a=ji(r).hoistableStyles,n=a.get(e),n||(n={type:"style",instance:null,count:0,state:null},a.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ss(a.href);var o=ji(r).hoistableStyles,i=o.get(t);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,i),(o=r.querySelector(mu(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Da.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Da.set(t,a),o||WM(r,t,a,i.state))),e&&n===null)throw Error(R(528,""));return i}if(e&&n!==null)throw Error(R(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ms(a),a=ji(r).hoistableScripts,n=a.get(e),n||(n={type:"script",instance:null,count:0,state:null},a.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(R(444,t))}}function ss(t){return'href="'+Aa(t)+'"'}function mu(t){return'link[rel="stylesheet"]['+t+"]"}function VL(t){return ze({},t,{"data-precedence":t.precedence,precedence:null})}function WM(t,e,a,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),wt(e,"link",a),gt(e),t.head.appendChild(e))}function ms(t){return'[src="'+Aa(t)+'"]'}function gu(t){return"script[async]"+t}function r_(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+Aa(a.href)+'"]');if(n)return e.instance=n,gt(n),n;var r=ze({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),gt(n),wt(n,"style",r),Id(n,a.precedence,t),e.instance=n;case"stylesheet":r=ss(a.href);var o=t.querySelector(mu(r));if(o)return e.state.loading|=4,e.instance=o,gt(o),o;n=VL(a),(r=Da.get(r))&&Kv(n,r),o=(t.ownerDocument||t).createElement("link"),gt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),wt(o,"link",n),e.state.loading|=4,Id(o,a.precedence,t),e.instance=o;case"script":return o=ms(a.src),(r=t.querySelector(gu(o)))?(e.instance=r,gt(r),r):(n=a,(r=Da.get(o))&&(n=ze({},a),Qv(n,r)),t=t.ownerDocument||t,r=t.createElement("script"),gt(r),wt(r,"link",n),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(R(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,Id(n,a.precedence,t));return e.instance}function Id(t,e,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,o=r,i=0;i<n.length;i++){var s=n[i];if(s.dataset.precedence===e)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(t,o.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function Kv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Qv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Ad=null;function o_(t,e,a){if(Ad===null){var n=new Map,r=Ad=new Map;r.set(a,n)}else r=Ad,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(t))return n;for(n.set(t,null),a=a.getElementsByTagName(t),r=0;r<a.length;r++){var o=a[r];if(!(o[uu]||o[St]||t==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(e)||"";i=t+i;var s=n.get(i);s?s.push(o):n.set(i,[o])}}return n}function i_(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function XM(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function jL(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function YM(t,e,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=ss(n.href),o=e.querySelector(mu(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=af.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,gt(o);return}o=e.ownerDocument||e,n=VL(n),(r=Da.get(r))&&Kv(n,r),o=o.createElement("link"),gt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),wt(o,"link",n),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=af.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var dg=0;function KM(t,e){return t.stylesheets&&t.count===0&&Ed(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var n=setTimeout(function(){if(t.stylesheets&&Ed(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&dg===0&&(dg=62500*RM());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ed(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>dg?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function af(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ed(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nf=null;function Ed(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nf=new Map,e.forEach(QM,t),nf=null,af.call(t))}function QM(t,e){if(!(e.state.loading&4)){var a=nf.get(t);if(a)var n=a.get(null);else{a=new Map,nf.set(t,a);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var i=r[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),n=i)}n&&a.set(null,n)}r=e.instance,i=r.getAttribute("data-precedence"),o=a.get(i)||n,o===n&&a.set(null,r),a.set(i,r),this.count++,n=af.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),o?o.parentNode.insertBefore(r,o.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var au={$$typeof:On,Provider:null,Consumer:null,_currentValue:Io,_currentValue2:Io,_threadCount:0};function JM(t,e,a,n,r,o,i,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fm(0),this.hiddenUpdates=Fm(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function GL(t,e,a,n,r,o,i,s,l,u,c,d){return t=new JM(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=sa(3,null,null,e),t.current=o,o.stateNode=t,e=wv(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:e},Iv(o),t}function ZL(t){return t?(t=zi,t):zi}function WL(t,e,a,n,r,o){r=ZL(r),n.context===null?n.context=r:n.pendingContext=r,n=Br(e),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Pr(t,n,e),a!==null&&(Xt(a,t,e),Pl(a,t,e))}function s_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function Jv(t,e){s_(t,e),(t=t.alternate)&&s_(t,e)}function XL(t){if(t.tag===13||t.tag===31){var e=Uo(t,67108864);e!==null&&Xt(e,t,67108864),Jv(t,67108864)}}function l_(t){if(t.tag===13||t.tag===31){var e=fa();e=cv(e);var a=Uo(t,e);a!==null&&Xt(a,t,e),Jv(t,e)}}var rf=!0;function eD(t,e,a,n){var r=ee.T;ee.T=null;var o=be.p;try{be.p=2,ey(t,e,a,n)}finally{be.p=o,ee.T=r}}function tD(t,e,a,n){var r=ee.T;ee.T=null;var o=be.p;try{be.p=8,ey(t,e,a,n)}finally{be.p=o,ee.T=r}}function ey(t,e,a,n){if(rf){var r=ov(n);if(r===null)ug(t,e,n,of,a),u_(t,n);else if(nD(r,t,e,a,n))n.stopPropagation();else if(u_(t,n),e&4&&-1<aD.indexOf(t)){for(;r!==null;){var o=cs(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=wo(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-da(i);s.entanglements[1]|=l,i&=~l}pn(o),(xe&6)===0&&(Wd=ua()+500,hu(0,!1))}}break;case 31:case 13:s=Uo(o,2),s!==null&&Xt(s,o,2),xf(),Jv(o,2)}if(o=ov(n),o===null&&ug(t,e,n,of,a),o===r)break;r=o}r!==null&&n.stopPropagation()}else ug(t,e,n,null,a)}}function ov(t){return t=hv(t),ty(t)}var of=null;function ty(t){if(of=null,t=Bi(t),t!==null){var e=ou(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=m_(e),t!==null)return t;t=null}else if(a===31){if(t=g_(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return of=t,null}function YL(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($R()){case b_:return 2;case S_:return 8;case Od:case VR:return 32;case C_:return 268435456;default:return 32}default:return 32}}var iv=!1,Hr=null,Ur=null,zr=null,nu=new Map,ru=new Map,Ir=[],aD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function u_(t,e){switch(t){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":nu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ru.delete(e.pointerId)}}function Ll(t,e,a,n,r,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]},e!==null&&(e=cs(e),e!==null&&XL(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function nD(t,e,a,n,r){switch(e){case"focusin":return Hr=Ll(Hr,t,e,a,n,r),!0;case"dragenter":return Ur=Ll(Ur,t,e,a,n,r),!0;case"mouseover":return zr=Ll(zr,t,e,a,n,r),!0;case"pointerover":var o=r.pointerId;return nu.set(o,Ll(nu.get(o)||null,t,e,a,n,r)),!0;case"gotpointercapture":return o=r.pointerId,ru.set(o,Ll(ru.get(o)||null,t,e,a,n,r)),!0}return!1}function KL(t){var e=Bi(t.target);if(e!==null){var a=ou(e);if(a!==null){if(e=a.tag,e===13){if(e=m_(a),e!==null){t.blockedOn=e,GS(t.priority,function(){l_(a)});return}}else if(e===31){if(e=g_(a),e!==null){t.blockedOn=e,GS(t.priority,function(){l_(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Td(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=ov(t.nativeEvent);if(a===null){a=t.nativeEvent;var n=new a.constructor(a.type,a);wg=n,a.target.dispatchEvent(n),wg=null}else return e=cs(a),e!==null&&XL(e),t.blockedOn=a,!1;e.shift()}return!0}function c_(t,e,a){Td(t)&&a.delete(e)}function rD(){iv=!1,Hr!==null&&Td(Hr)&&(Hr=null),Ur!==null&&Td(Ur)&&(Ur=null),zr!==null&&Td(zr)&&(zr=null),nu.forEach(c_),ru.forEach(c_)}function hd(t,e){t.blockedOn===e&&(t.blockedOn=null,iv||(iv=!0,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,rD)))}var md=null;function d_(t){md!==t&&(md=t,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,function(){md===t&&(md=null);for(var e=0;e<t.length;e+=3){var a=t[e],n=t[e+1],r=t[e+2];if(typeof n!="function"){if(ty(n||a)===null)continue;break}var o=cs(a);o!==null&&(t.splice(e,3),e-=3,Ug(o,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function ls(t){function e(l){return hd(l,t)}Hr!==null&&hd(Hr,t),Ur!==null&&hd(Ur,t),zr!==null&&hd(zr,t),nu.forEach(e),ru.forEach(e);for(var a=0;a<Ir.length;a++){var n=Ir[a];n.blockedOn===t&&(n.blockedOn=null)}for(;0<Ir.length&&(a=Ir[0],a.blockedOn===null);)KL(a),a.blockedOn===null&&Ir.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],o=a[n+1],i=r[Yt]||null;if(typeof o=="function")i||d_(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,i=o[Yt]||null)s=i.formAction;else if(ty(r)!==null)continue}else s=i.action;typeof s=="function"?a[n+1]=s:(a.splice(n,3),n-=3),d_(a)}}}function QL(){function t(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function ay(t){this._internalRoot=t}Cf.prototype.render=ay.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(R(409));var a=e.current,n=fa();WL(a,n,t,e,null,null)};Cf.prototype.unmount=ay.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;WL(t.current,2,null,t,null,null),xf(),e[us]=null}};function Cf(t){this._internalRoot=t}Cf.prototype.unstable_scheduleHydration=function(t){if(t){var e=I_();t={blockedOn:null,target:t,priority:e};for(var a=0;a<Ir.length&&e!==0&&e<Ir[a].priority;a++);Ir.splice(a,0,t),a===0&&KL(t)}};var f_=p_.version;if(f_!=="19.2.4")throw Error(R(527,f_,"19.2.4"));be.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(R(188)):(t=Object.keys(t).join(","),Error(R(268,t)));return t=PR(e),t=t!==null?v_(t):null,t=t===null?null:t.stateNode,t};var oD={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(kl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!kl.isDisabled&&kl.supportsFiber))try{iu=kl.inject(oD),ca=kl}catch{}var kl;_f.createRoot=function(t,e){if(!h_(t))throw Error(R(299));var a=!1,n="",r=$w,o=Vw,i=jw;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(o=e.onCaughtError),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=GL(t,1,!1,null,null,a,n,null,r,o,i,QL),t[us]=e.current,Yv(t),new ay(e)};_f.hydrateRoot=function(t,e,a){if(!h_(t))throw Error(R(299));var n=!1,r="",o=$w,i=Vw,s=jw,l=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(s=a.onRecoverableError),a.formState!==void 0&&(l=a.formState)),e=GL(t,1,!0,e,a??null,n,r,l,o,i,s,QL),e.context=ZL(null),a=e.current,n=fa(),n=cv(n),r=Br(n),r.callback=null,Pr(a,r,n),a=n,e.current.lanes=a,lu(e,a),pn(e),t[us]=e.current,Yv(t),new Cf(e)};_f.version="19.2.4"});var qo=rn((TH,t1)=>{"use strict";function e1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e1)}catch(t){console.error(t)}}e1(),t1.exports=JL()});var K1=rn(qf=>{"use strict";var eO=Symbol.for("react.transitional.element"),tO=Symbol.for("react.fragment");function Y1(t,e,a){var n=null;if(a!==void 0&&(n=""+a),e.key!==void 0&&(n=""+e.key),"key"in e){a={};for(var r in e)r!=="key"&&(a[r]=e[r])}else a=e;return e=a.ref,{$$typeof:eO,type:t,key:n,ref:e!==void 0?e:null,props:a}}qf.Fragment=tO;qf.jsx=Y1;qf.jsxs=Y1});var Ae=rn((ZU,Q1)=>{"use strict";Q1.exports=K1()});var SH={};dS(SH,{ANIMATION_KEYFRAMES:()=>pl,ActivationConfigZ:()=>Pc,AddClassZ:()=>w0,AnchorIdZ:()=>Ca,AnchorStateZ:()=>BT,AnchorVisibleConditionZ:()=>Hh,AppRegistry:()=>Lu,AugmentationZ:()=>PT,BadgePositionZ:()=>p0,BadgeZ:()=>T0,BoundingBoxZ:()=>OT,CanvasEvents:()=>ws,CanvasRecipeZ:()=>Yp,ConditionZ:()=>mr,ContextManager:()=>Fc,CooldownActiveConditionZ:()=>jh,CounterDefZ:()=>nl,CtaButtonZ:()=>Xh,DEFAULT_COOLDOWN:()=>vp,DEFAULT_TTL:()=>gp,DecisionStrategyZ:()=>ul,DismissedConditionZ:()=>Vh,EVENT_SCHEMA_VERSION:()=>ei,EventBus:()=>Uc,EventCountConditionZ:()=>Zh,EventFilterZ:()=>qT,EventOccurredConditionZ:()=>Uh,EventSourceZ:()=>W0,ExecutorRegistry:()=>Oc,ExternalStrategyZ:()=>ll,FrequencyEntryZ:()=>YT,FrequencyLimitConditionZ:()=>Gh,HighlightStepZ:()=>SA,HighlightStyleZ:()=>f0,HighlightZ:()=>A0,InsertHtmlZ:()=>I0,InsertPositionZ:()=>v0,MAX_VISIBLE_TOASTS:()=>mp,MatchOpZ:()=>al,ModalContentZ:()=>g0,ModalZ:()=>M0,ModelStrategyZ:()=>sl,MountWidgetZ:()=>B0,NavigateZ:()=>O0,NavigationMonitor:()=>dl,NormalizedEventZ:()=>zT,NotificationToastStack:()=>hp,PageContextZ:()=>TT,PageHistoryEntryZ:()=>RT,PageUrlConditionZ:()=>Fh,ParallelZ:()=>N0,PlacementZ:()=>h0,PulseZ:()=>E0,RUNTIME_SDK_BUILD:()=>oS,RUNTIME_VERSION:()=>eS,RemoveClassZ:()=>L0,RouteConditionZ:()=>Nh,RouteFilterZ:()=>c0,RuleStrategyZ:()=>ol,RuleZ:()=>rl,RuntimeContextZ:()=>FT,RuntimeProvider:()=>Cp,SDK_SCHEMA_VERSION:()=>Qn,SDK_VERSION:()=>op,STATIC_SLOT_STYLES:()=>Q0,ScoreStrategyZ:()=>il,ScrollBehaviorZ:()=>S0,ScrollLogicalPositionZ:()=>Wh,ScrollToZ:()=>D0,SelectorZ:()=>_x,SequenceZ:()=>F0,SessionContextZ:()=>MT,SessionMetricConditionZ:()=>$h,SessionMetricTracker:()=>ac,SetAttrZ:()=>_0,SetStyleZ:()=>k0,SetTextZ:()=>C0,ShadowCanvasOverlay:()=>Ky,ShadowRootProvider:()=>Hy,SmartCanvasApp:()=>Jy,SmartCanvasController:()=>up,SmartCanvasElement:()=>wp,SmartCanvasPortal:()=>UN,StandardEvents:()=>Ce,StateEqualsConditionZ:()=>zh,StateStore:()=>$c,StoredValueZ:()=>XT,Syntro:()=>rS,TileCard:()=>ks,TileWheel:()=>CP,TooltipContentZ:()=>m0,TooltipStepZ:()=>bA,TooltipTriggerZ:()=>y0,TooltipZ:()=>R0,TourStepForSchemaZ:()=>b0,TourZ:()=>H0,TriggerWhenZ:()=>Bc,ViewportConditionZ:()=>qh,ViewportContextZ:()=>DT,WaitZ:()=>P0,WidgetConfigZ:()=>x0,WidgetRegistry:()=>jc,appRegistry:()=>bs,applyStaticSlotStyles:()=>am,cleanupAppContext:()=>jf,contentRuntime:()=>wf,coreActionStepSchemas:()=>AT,createActionEngine:()=>Ph,createAnchorResolver:()=>Yh,createAppContext:()=>Vf,createAppLoader:()=>Zf,createCanvasConfigFetcher:()=>Qo,createContextManager:()=>Kh,createDecisionEngine:()=>Qh,createEventAccumulator:()=>Jh,createEventBus:()=>cl,createGrowthBookClient:()=>$p,createNoopClient:()=>Qp,createOverlayRecipeFetcher:()=>HN,createPostHogClient:()=>Dh,createPostHogNormalizer:()=>em,createSessionMetricTracker:()=>Vp,createSmartCanvas:()=>Lp,createSmartCanvasController:()=>Ny,createSmartCanvasRuntime:()=>dm,createStateStore:()=>tm,createSurfaceContainer:()=>sm,createSurfaces:()=>um,decisionSchemas:()=>U3,decodeToken:()=>Gc,encodeToken:()=>fm,evaluate:()=>$0,evaluateCondition:()=>z0,evaluateRule:()=>q0,evaluateRuleStrategy:()=>Nc,evaluateScoreStrategy:()=>Hc,evaluateSync:()=>V0,executorRegistry:()=>Ln,getAntiFlickerSnippet:()=>$k,getAppIdFromActionKind:()=>vy,getAppIdFromWidgetId:()=>Gf,getExecutor:()=>LT,getSlotAnchorId:()=>Vc,getSlotType:()=>fl,getSlotZIndex:()=>lm,hasExecutor:()=>Oh,interpolateTemplate:()=>Wu,isCoreActionKind:()=>gy,matchEvent:()=>yp,needsMigration:()=>kP,normalizePostHogEvent:()=>G0,overlaysRuntime:()=>$f,parseVersion:()=>As,playEnterAnimation:()=>om,playExitAnimation:()=>im,registerConfigPredicates:()=>Du,registerSmartCanvasElement:()=>tx,resolveConfigUri:()=>ip,setupAdjacentPositioning:()=>nm,setupInlinePositioning:()=>rm,shouldNormalizeEvent:()=>Z0,useDecision:()=>fI,useNotifications:()=>xp,useNotifyWatcher:()=>Sp,usePageContext:()=>_p,useRuntime:()=>gn,useRuntimeContext:()=>Xu,useRuntimeEvents:()=>cI,useRuntimeState:()=>dI,useSessionContext:()=>lI,useShadowCanvasConfig:()=>Qy,useShadowRoot:()=>Jo,useViewportContext:()=>uI,validateAction:()=>hr,validateActions:()=>Bh,validateActivationConfig:()=>H3,validateCondition:()=>F3,validateConfig:()=>_P,validateEventFilter:()=>nH,validateFrequencyEntry:()=>lH,validateNormalizedEvent:()=>aH,validateRecipe:()=>NN,validateRuntimeContext:()=>Q3,validateStoredValue:()=>sH,validateStrategy:()=>N3,widgetRegistry:()=>cm});var iR=Y(Ye(),1),pm=Y(gl(),1),bH=Y(qo(),1);function a1(t,e,a,n){let r=n?.maxRetries??3,o=n?.debounceMs??50,i=t.parentElement??e.parentElement;if(!i)return()=>{};let s=0,l=null,u=!1,c=new MutationObserver(d=>{if(!u){for(let f of d)for(let h of f.removedNodes)if(h===t){if(s>=r){c.disconnect(),u=!0;return}l&&clearTimeout(l),l=setTimeout(()=>{if(!u){if(!e.isConnected){c.disconnect(),u=!0;return}s++;try{a()}catch{c.disconnect(),u=!0}}},o);return}}});return c.observe(i,{childList:!0,subtree:!0}),()=>{u=!0,c.disconnect(),l&&clearTimeout(l)}}var iD=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button","svg","path","circle","line","polyline","polygon","rect","g"]);function ny(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let n=a.content,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let i=r.currentNode,s=i.tagName.toLowerCase();if(!iD.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),h=(u==="href"||u==="src"||u==="formaction")&&(c.startsWith("javascript:")||c.startsWith("vbscript:")||c.startsWith("data:text/html"));(d||h)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var n1=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=ny(t.html),r="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),h=(a.parentElement??a).querySelector(`[${r}="${d}"]`);h&&h.remove()}let i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),o&&i.setAttribute(r,o),i.innerHTML=n;let s=null;switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":s=a.innerHTML,a.replaceWith(i);break}let l=null;if(t.deepLink){let{tileId:d,itemId:f}=t.deepLink;l=()=>{let h=window.SynOS?.handle;h&&(h.open(),h.runtime?.events?.publish("notification.deep_link",{tileId:d,itemId:f}))},i.style.cursor="pointer",i.addEventListener("click",l)}e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position});let c=a1(i,a,()=>{switch(t.position){case"before":a.insertAdjacentElement("beforebegin",i);break;case"after":a.insertAdjacentElement("afterend",i);break;case"prepend":a.insertBefore(i,a.firstChild);break;case"append":a.appendChild(i);break;case"replace":break}});return{cleanup:()=>{if(l&&i.removeEventListener("click",l),c(),!!i.isConnected)try{if(t.position==="replace"&&s!==null){let d=document.createElement(a.tagName);d.innerHTML=s,Array.from(a.attributes).forEach(f=>{d.setAttribute(f.name,f.value)}),i.replaceWith(d)}else i.remove()}catch{}},updateFn:d=>{"html"in d&&typeof d.html=="string"&&(i.innerHTML=ny(d.html))}}},r1=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=a.textContent??"";return a.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{a.isConnected&&(a.textContent=n)},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(a.textContent=r.text)}}},o1=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=t.attr.toLowerCase();if(n.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);if(n==="href"||n==="src"||n==="formaction"){let s=t.value.trim().toLowerCase();if(s.startsWith("javascript:")||s.startsWith("vbscript:")||s.startsWith("data:text/html"))throw new Error(`Dangerous URL not allowed in ${t.attr}: ${t.value}`)}let o=a.getAttribute(t.attr),i=a.hasAttribute(t.attr);return a.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a.isConnected&&(i&&o!==null?a.setAttribute(t.attr,o):a.removeAttribute(t.attr))},updateFn:s=>{"value"in s&&typeof s.value=="string"&&a.setAttribute(t.attr,s.value)}}},i1=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=a.classList.contains(t.className);return a.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{a.isConnected&&(n||a.classList.remove(t.className))}}},s1=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=a.classList.contains(t.className);return a.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{a.isConnected&&n&&a.classList.add(t.className)}}},l1=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-content] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=new Map;for(let r of Object.keys(t.styles)){let o=a.style.getPropertyValue(r);n.set(r,o)}for(let[r,o]of Object.entries(t.styles))a.style.setProperty(r,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{if(a.isConnected)for(let[r,o]of n)o?a.style.setProperty(r,o):a.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[o,i]of Object.entries(r.styles))a.style.setProperty(o,i)}}},ry=[{kind:"content:insertHtml",executor:n1},{kind:"content:setText",executor:r1},{kind:"content:setAttr",executor:o1},{kind:"content:addClass",executor:i1},{kind:"content:removeClass",executor:s1},{kind:"content:setStyle",executor:l1}],wf={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:ry};var sD={light:50,medium:100,heavy:200},lD=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],u1={init(t,e,a){let n=sD[a.intensity],r=a.colors.length>0?a.colors:lD,o=[];for(let i=0;i<n;i++)o.push({x:Math.random()*t,y:Math.random()*-e*.3,vx:(Math.random()-.5)*4,vy:Math.random()*2+1,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.2,size:Math.random()*6+4,color:r[Math.floor(Math.random()*r.length)],opacity:1,shape:Math.random()>.5?"rect":"circle"});return o},update(t,e,a){let n=!1;for(let r of t)r.vy+=.15,r.vx*=.99,r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.y>0&&r.opacity>0&&r.y>500&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(n=!0);return n},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation),a.shape==="circle"?(t.beginPath(),t.arc(0,0,a.size/2,0,Math.PI*2),t.fill()):t.fillRect(-a.size/2,-a.size/2,a.size,a.size*.6),t.restore())}};var uD={light:20,medium:40,heavy:80},cD="\u{1F389}",c1={init(t,e,a){let n=uD[a.intensity],r=typeof a.props?.emoji=="string"?a.props.emoji:cD,o=[];for(let i=0;i<n;i++)o.push({x:Math.random()*t,y:Math.random()*-200,vx:0,vy:Math.random()*1.5+1,rotation:0,rotationSpeed:0,size:Math.random()*12+16,color:"#000000",opacity:1,shape:"emoji",emoji:r,data:{wobblePhase:Math.random()*Math.PI*2,wobbleAmp:Math.random()*1.5+.5,originX:0}});for(let i of o)i.data&&(i.data.originX=i.x);return o},update(t,e,a){let n=!1;for(let r of t){r.y+=r.vy;let o=r.data?.wobblePhase??0,i=r.data?.wobbleAmp??1,s=r.data?.originX??r.x;r.x=s+Math.sin(a*.003+o)*i*20,r.y>600&&(r.opacity-=.02,r.opacity<0&&(r.opacity=0)),r.opacity>.01&&(n=!0)}return n},render(t,e){for(let a of e)a.opacity<.01||!a.emoji||(t.save(),t.globalAlpha=a.opacity,t.font=`${a.size}px serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.emoji,a.x,a.y),t.restore())}};var dD={light:20,medium:40,heavy:80},fD={light:3,medium:4,heavy:5},d1={init(t,e,a){let n=dD[a.intensity],r=fD[a.intensity],o=a.colors.length>0?a.colors:["#ff4444","#44ff44","#4444ff"],i=[];for(let s=0;s<r;s++){let l=Math.random()*t*.8+t*.1,u=Math.random()*e*.6,c=o[Math.floor(Math.random()*o.length)];for(let d=0;d<n;d++){let f=Math.PI*2*d/n+(Math.random()-.5)*.3,h=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(f)*h,vy:Math.sin(f)*h,rotation:0,rotationSpeed:0,size:Math.random()*3+2,color:c,opacity:1,shape:"circle",data:{centerX:l,centerY:u}})}}return i},update(t,e,a){let n=!1;for(let r of t)r.vx*=.97,r.vy*=.97,r.vy+=.03,r.x+=r.vx,r.y+=r.vy,r.opacity-=.008,r.opacity<0&&(r.opacity=0),r.opacity>.01&&(n=!0);return n},render(t,e){for(let a of e)a.opacity<.01||(t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.shadowBlur=12,t.shadowColor=a.color,t.beginPath(),t.arc(a.x,a.y,a.size,0,Math.PI*2),t.fill(),t.restore())}};var pD={light:30,medium:60,heavy:120},f1={init(t,e,a){let n=pD[a.intensity],r=a.colors.length>0?a.colors:["#ffd700","#ffffff","#fffacd"],o=[];for(let i=0;i<n;i++)o.push({x:Math.random()*t,y:Math.random()*e,vx:(Math.random()-.5)*.3,vy:-(Math.random()*.5+.2),rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*.1,size:Math.random()*4+2,color:r[Math.floor(Math.random()*r.length)],opacity:Math.random()*.5+.5,shape:"circle",data:{phase:Math.random()*Math.PI*2,baseOpacity:Math.random()*.5+.5}});return o},update(t,e,a){let n=!1;for(let r of t){r.x+=r.vx,r.y+=r.vy,r.rotation+=r.rotationSpeed,r.data&&(r.data.baseOpacity=(r.data.baseOpacity??1)-.001,r.data.baseOpacity<0&&(r.data.baseOpacity=0));let o=r.data?.phase??0,i=r.data?.baseOpacity??1;if(i<=.01)r.opacity=0;else{let s=Math.sin(a*.005+o)*.4+.6;r.opacity=i*s}r.opacity>.01&&(n=!0)}return n},render(t,e){for(let a of e){if(a.opacity<.01)continue;t.save(),t.globalAlpha=a.opacity,t.fillStyle=a.color,t.translate(a.x,a.y),t.rotate(a.rotation);let n=a.size;t.beginPath(),t.moveTo(0,-n),t.lineTo(n*.3,-n*.3),t.lineTo(n,0),t.lineTo(n*.3,n*.3),t.lineTo(0,n),t.lineTo(-n*.3,n*.3),t.lineTo(-n,0),t.lineTo(-n*.3,-n*.3),t.closePath(),t.fill(),t.restore()}}};var Lf=class{constructor(){this.canvas=null,this.ctx=null,this.rafId=null,this.particles=[],this.startTime=0,this.lastFrame=0,this.duration=0,this.effect=null,this.container=null}start(e,a,n){this.container=e,this.effect=a,this.duration=n.duration;let r=document.createElement("canvas");r.setAttribute("data-syntro-celebrate",""),Object.assign(r.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let o=window.devicePixelRatio||1,i=window.innerWidth,s=window.innerHeight;r.width=i*o,r.height=s*o,r.style.width=`${i}px`,r.style.height=`${s}px`;let l=r.getContext("2d");l&&(l.scale(o,o),this.canvas=r,this.ctx=l,e.appendChild(r),this.particles=a.init(i,s,n),this.startTime=performance.now(),this.lastFrame=this.startTime,this.tick=this.tick.bind(this),this.rafId=requestAnimationFrame(this.tick))}stop(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.canvas&&this.container&&(this.canvas.remove(),this.canvas=null),this.ctx=null,this.effect=null,this.container=null,this.particles=[]}tick(e){if(!this.ctx||!this.canvas||!this.effect)return;let a=e-this.startTime,n=e-this.lastFrame;if(this.lastFrame=e,a>=this.duration){this.stop();return}let r=this.canvas.width/(window.devicePixelRatio||1),o=this.canvas.height/(window.devicePixelRatio||1);if(this.ctx.clearRect(0,0,r,o),!this.effect.update(this.particles,n,a)){this.stop();return}this.effect.render(this.ctx,this.particles),this.rafId=requestAnimationFrame(this.tick)}};var hD=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function mD(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function gD(t){try{let e=getComputedStyle(t),a=e.getPropertyValue("--sc-color-primary")?.trim(),n=e.getPropertyValue("--sc-color-primary-hover")?.trim();if(a?.startsWith("#")&&a.length>=7)return mD(a,n||a)}catch{}return null}var p1=new Map([["confetti",u1],["fireworks",d1],["sparkles",f1],["emoji-rain",c1]]),h1=async(t,e)=>{let a=p1.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...p1.keys()].join(", ")}`),{cleanup:()=>{}};let n=t.colors??gD(e.overlayRoot)??hD,r={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:n,props:t.props},o=new Lf;return o.start(e.overlayRoot,a,r),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var iy="syntro_active_tour",kf=new Map;function vD(t){try{let e=localStorage.getItem(iy);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function oy(t){try{localStorage.setItem(iy,JSON.stringify(t))}catch{}}function yD(){try{localStorage.removeItem(iy)}catch{}}function vu(){return window.location.pathname}function xD(t){if(!t.route)return!0;let e=vu();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var sy=async(t,e)=>{let{tourId:a,steps:n,startStep:r,autoStart:o=!0}=t;if(n.length===0)throw new Error(`Tour "${a}" has no steps`);if(kf.has(a))return{cleanup:async()=>{let v=kf.get(a);v&&await v.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=vD(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:r||n[0].id,startedAt:Date.now()},oy(i));let l=n.findIndex(v=>v.id===i.currentStepId);if(l===-1){let v=r||n[0].id;l=n.findIndex(y=>y.id===v),l===-1&&(l=0),i.currentStepId=n[l].id,oy(i)}let u=n[l];if(!xD(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:vu()}),{cleanup:()=>{}};let c=!1,d=null,f=null,h=null,S=async()=>{f&&(f(),f=null),d?.isApplied()&&(await d.revert(),d=null)},x=async v=>{if(c)return;if(await S(),v==="end"){yD(),e.publishEvent("tour.completed",{tourId:a,totalSteps:n.length}),c=!0;return}let y=n.find(_=>_.id===v);if(!y){console.error(`[Tour] Step "${v}" not found`);return}if(i.currentStepId=v,oy(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:v}),y.route&&y.route!==vu()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:v,targetRoute:y.route});return}await b(y)},b=async v=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:v.id,stepIndex:n.findIndex(y=>y.id===v.id),totalSteps:n.length});try{d=await e.applyAction(v.action)}catch(y){console.error(`[Tour] Failed to execute step "${v.id}":`,y),e.publishEvent("tour.step_failed",{tourId:a,stepId:v.id,error:String(y)});return}if(v.onAction&&e.subscribeEvent){f=e.subscribeEvent("action.modal_cta_clicked",L=>{let C=L?.actionId;if(C&&v.onAction){let I=v.onAction[C];I&&x(I)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",L=>{let C=L?.actionId;if(C&&v.onAction){let I=v.onAction[C];I&&x(I)}}),_=f;f=()=>{_(),y()}}}};h=(()=>{let v=vu(),y=()=>{let C=vu();C!==v&&(v=C,e.publishEvent("tour.route_changed",{tourId:a,newRoute:C}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let _=history.pushState.bind(history),L=history.replaceState.bind(history);return history.pushState=(...C)=>{_(...C),queueMicrotask(y)},history.replaceState=(...C)=>{L(...C),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=_,history.replaceState=L}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:n.length,startStepId:i.currentStepId}),await b(u);let g=async()=>{c=!0,kf.delete(a),await S(),h&&h(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return kf.set(a,{cleanup:g}),{cleanup:g}};var Ga={white:"#ffffff",black:"#000000"},re={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},A={0:"#07080a",1:"#0f1318",2:"#0e1114",3:"#1c222a",4:"#2b333f",5:"#394454",6:"#475569",7:"#677384",8:"#87919f",9:"#a8afba",10:"#cbd0d7",11:"#e8eaee",12:"#f6f7f9"},Me={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},Lt={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},je={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},ma={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},yu={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Nt={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},xu={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var ga={primary:A[10],secondary:A[9],tertiary:A[8]},WH={primary:A[2],secondary:A[0]},ly={primary:A[4],secondary:A[3]},If={primary:{text:Ga.white,icon:Ga.white,border:re[3],backgroundDefault:re[3],backgroundHover:re[2]},neutral:{text:A[10],textHover:Ga.white,icon:A[10],iconHover:Ga.white,border:A[4],background:A[2]},link:{text:Ga.white,icon:Ga.white,hover:re[5]},error:{text:je[5],hover:je[6]},success:{text:Me[5],hover:Me[6]}},XH={slateGrey:{content:A[10],pillOutline:A[10],borderPrimary:A[5],borderSecondary:A[5],background:A[3]},brand:{content:re[9],pillOutline:re[9],borderPrimary:re[6],borderSecondary:re[6],background:re[0]},red:{content:je[8],pillOutline:je[4],borderPrimary:je[2],borderSecondary:je[2],background:je[0]},yellow:{content:Lt[8],pillOutline:Lt[4],borderPrimary:Lt[2],borderSecondary:Lt[2],background:Lt[0]},green:{content:Me[8],pillOutline:Me[4],borderPrimary:Me[2],borderSecondary:Me[2],background:Me[0]},purple:{content:Nt[8],pillOutline:Nt[4],borderPrimary:Nt[2],borderSecondary:Nt[2],background:Nt[0]},blue:{content:ma[8],pillOutline:ma[4],borderPrimary:ma[2],borderSecondary:ma[2],background:ma[0]},orange:{content:yu[8],pillOutline:yu[4],borderPrimary:yu[2],borderSecondary:yu[2],background:yu[0]},pink:{content:xu[8],pillOutline:xu[4],borderPrimary:xu[2],borderSecondary:xu[2],background:xu[0]}},YH={green:{content:Me[8],border:Me[2],background:Me[0]},yellow:{content:Lt[8],border:Lt[2],background:Lt[0]},red:{content:je[8],border:je[2],background:je[0]}},KH={green:{content:Me[1],background:Me[9]},yellow:{content:Lt[1],background:Lt[9]},red:{content:je[1],background:je[9]}},QH={content:A[10],border:A[4],background:"#1c2124"},JH={backgroundDefault:A[2],backgroundHover:A[1],selected:A[3]},eU={background:A[2],icon:A[10],borderDefault:A[4],borderSelected:re[3],textLabel:A[9],textPlaceholder:A[8],textHint:A[8]},tU={backgroundDefault:A[2],backgroundDisabled:A[0],textLabel:A[9],textPlaceholder:A[8],textHint:A[8],textError:je[5],iconDefault:A[9],iconPlaceholder:A[10],iconError:je[5],borderDefault:A[4],borderSelected:re[3],borderError:je[5]},aU={handleDefault:Ga.white,handleDisabled:A[10],off:{backgroundDefault:A[4],backgroundHover:A[5],backgroundDisabled:A[4]},on:{backgroundDefault:Me[3],backgroundHover:Me[2],backgroundDisabled:A[4]}},nU={off:{backgroundDefault:"#00000000",backgroundHover:A[5],backgroundDisabled:A[2],border:A[6]},on:{backgroundDefault:Me[0],backgroundHover:Me[1],backgroundDisabled:A[2],border:Me[3]}},rU={content:A[10],background:A[4]},oU={background:A[4],active:Me[3]},iU={background:A[1],content:A[9],border:A[4]},sU={backgroundDefault:A[1],backgroundHover:A[3],backgroundActive:A[4],border:A[4],contentPrimary:A[10],contentSecondary:A[9],contentTertiary:A[8]},lU={background:A[1],content:A[9],border:A[4]},uU={activeBackground:A[3],activeContent:re[5],inactiveContent:A[9],border:A[4]},cU={header:{textDefault:A[9],textHover:A[8],backgroundDefault:A[1]},border:A[4],cell:{textPrimary:A[10],textSecondary:A[9],backgroundDefault:A[2],backgroundHover:A[1]}},dU={textPrimaryDefault:A[10],textPrimaryHover:A[10],textSecondaryDefault:A[8],textSecondaryHover:A[9],iconPrimary:A[10],iconSecondary:A[8]},fU={background:Me[1],active:Me[5]},pU={textDefault:A[10],textSelected:Ga.white,textDisabled:A[7],backgroundDefault:A[2],backgroundMiddle:A[3],backgroundSelected:re[3],border:A[4]},hU=A[9];var m1=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function g1(t,e,a){let n=a?.paddingPx??12,r=a?.radiusPx??12,o=Math.min(Math.max(a?.scrimOpacity??.55,0),1),i=a?.ringColor??`var(--syntro-ring, ${ma[5]})`,s=a?.blocking??!1,l=a?.onClickOutside??!0,u=a?.onEsc??!0,c=getComputedStyle(document.documentElement),d=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),f=c.getPropertyValue("--syntro-ring").trim(),h=document.createElement("div");h.className="syntro-spotlight-scrim";let S=s||l;Object.assign(h.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:S?"auto":"none",background:d||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(h),requestAnimationFrame(()=>h.style.opacity="1");let x=document.createElement("div");x.className="syntro-spotlight-ring",Object.assign(x.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${i||f||ma[5]}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(x);let b=[];if(!m1)for(let w=0;w<4;w++){let k=document.createElement("div");k.style.position="fixed",k.style.background="inherit",b.push(k),h.appendChild(k)}let m=w=>{h.style.clipPath=w,h.style.webkitClipPath=w},g=()=>{if(!t.isConnected){I.destroy();return}let w=t.getBoundingClientRect(),k=w.left-n,T=w.top-n,D=w.width+n*2,M=w.height+n*2;if(Object.assign(x.style,{left:`${k}px`,top:`${T}px`,width:`${D}px`,height:`${M}px`}),m1){let P=window.innerWidth,F=window.innerHeight,U=Math.min(r,D/2,M/2),j=`M 0 0 L ${P} 0 L ${P} ${F} L 0 ${F} Z`,N=`M ${k+U} ${T} A ${U} ${U} 0 0 0 ${k} ${T+U} L ${k} ${T+M-U} A ${U} ${U} 0 0 0 ${k+U} ${T+M} L ${k+D-U} ${T+M} A ${U} ${U} 0 0 0 ${k+D} ${T+M-U} L ${k+D} ${T+U} A ${U} ${U} 0 0 0 ${k+D-U} ${T} L ${k+U} ${T} Z`;m(`path('${j} ${N}')`)}else{let[P,F,U,j]=b;Object.assign(P.style,{left:"0px",top:"0px",width:"100vw",height:`${T}px`}),Object.assign(U.style,{left:"0px",top:`${T+M}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(T+M))}px`}),Object.assign(j.style,{left:"0px",top:`${T}px`,width:`${k}px`,height:`${M}px`}),Object.assign(F.style,{left:`${k+D}px`,top:`${T}px`,width:`${Math.max(0,window.innerWidth-(k+D))}px`,height:`${M}px`})}},v=new ResizeObserver(()=>requestAnimationFrame(g));v.observe(t);let y=()=>requestAnimationFrame(g),_=()=>requestAnimationFrame(g);window.addEventListener("scroll",y,!0),window.addEventListener("resize",_);let L=w=>{w.key==="Escape"&&u&&(a?.onDismiss?.(),I.destroy())};u&&window.addEventListener("keydown",L);let C=w=>{s?(w.preventDefault(),w.stopPropagation()):l&&(a?.onDismiss?.(),I.destroy())};h.addEventListener("click",C);let I={destroy(){v.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",_),u&&window.removeEventListener("keydown",L),h.removeEventListener("click",C),h.style.pointerEvents="none",h.style.opacity="0",setTimeout(()=>{try{h.remove()}catch{}try{x.remove()}catch{}},220)}};return g(),I}var bD=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button","svg","path","circle","line","polyline","polygon","rect","g"]);function va(t){if(typeof window.Sanitizer=="function")try{let s=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(s),l.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let n=a.content,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,null),o=[];for(;r.nextNode();){let i=r.currentNode,s=i.tagName.toLowerCase();if(!bD.has(s)){o.push(i);continue}for(let l of Array.from(i.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),d=u.startsWith("on"),f=(u==="href"||u==="src")&&c.startsWith("javascript:");(d||f)&&i.removeAttribute(l.name)}}for(let i of o){for(;i.firstChild;)i.parentNode?.insertBefore(i.firstChild,i);i.remove()}return a.innerHTML}var $o={bg:"var(--sc-overlay-background, #ffffff)",title:"var(--sc-overlay-title-color, var(--sc-overlay-text-color, #111827))",text:"var(--sc-overlay-text-color, #4b5563)",accent:"var(--sc-color-primary, #4f46e5)",radius:"var(--sc-border-radius, 12px)"},uy=async(t,e)=>{let{content:a,size:n="md",blocking:r=!1,scrim:o,dismiss:i,ctaButtons:s}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
10
10
  position: fixed;
11
11
  inset: 0;
12
12
  background: rgba(0, 0, 0, ${o?.opacity??.6});
13
13
  z-index: 2147483645;
14
14
  opacity: 0;
15
15
  transition: opacity 200ms ease-out;
16
- `,e.overlayRoot.appendChild(l);let u=document.createElement("div");u.className=`syntro-modal syntro-modal-${r}`,u.setAttribute("role","dialog"),u.setAttribute("aria-modal","true");let c={sm:"360px",md:"480px",lg:"640px"};u.style.cssText=`
16
+ `,e.overlayRoot.appendChild(l);let u=document.createElement("div");u.className=`syntro-modal syntro-modal-${n}`,u.setAttribute("role","dialog"),u.setAttribute("aria-modal","true");let c={sm:"360px",md:"480px",lg:"640px"};u.style.cssText=`
17
17
  position: fixed;
18
18
  top: 50%;
19
19
  left: 50%;
20
20
  transform: translate(-50%, -50%) scale(0.95);
21
- max-width: ${c[r]};
21
+ max-width: ${c[n]};
22
22
  width: 90%;
23
- background: ${Bo.bg};
24
- border-radius: ${Bo.radius};
23
+ background: ${$o.bg};
24
+ border-radius: ${$o.radius};
25
25
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
26
26
  z-index: 2147483646;
27
27
  opacity: 0;
28
28
  transition: opacity 200ms ease-out, transform 200ms ease-out;
29
29
  padding: 24px;
30
- `;let d="";if(a.title&&(d+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: ${Bo.title};">${ha(a.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: ${Bo.text}; line-height: 1.5;">${ha(a.body)}</div>`,i?.closeButton!==!1&&(d+=`
30
+ `;let d="";if(a.title&&(d+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: ${$o.title};">${va(a.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: ${$o.text}; line-height: 1.5;">${va(a.body)}</div>`,i?.closeButton!==!1&&(d+=`
31
31
  <button class="syntro-modal-close" data-syntro-action="dismiss" style="
32
32
  position: absolute;
33
33
  top: 16px;
@@ -36,7 +36,7 @@ Error generating stack: `+r.message+`
36
36
  border: none;
37
37
  cursor: pointer;
38
38
  padding: 4px;
39
- color: ${Bo.text};
39
+ color: ${$o.text};
40
40
  opacity: 0.6;
41
41
  " aria-label="Close">
42
42
  <svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
@@ -46,7 +46,7 @@ Error generating stack: `+r.message+`
46
46
  `),s&&s.length>0){d+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let _ of s){let L=_.primary??!1;d+=`
47
47
  <button
48
48
  class="syntro-modal-btn ${L?"syntro-modal-btn-primary":""}"
49
- data-syntro-action="${ha(_.actionId)}"
49
+ data-syntro-action="${va(_.actionId)}"
50
50
  style="
51
51
  padding: 10px 20px;
52
52
  border-radius: 8px;
@@ -54,79 +54,134 @@ Error generating stack: `+r.message+`
54
54
  font-weight: 500;
55
55
  cursor: pointer;
56
56
  transition: background 150ms ease;
57
- ${L?`background: ${Bo.accent}; color: white; border: none;`:`background: transparent; color: ${Bo.accent}; border: 1px solid currentColor; opacity: 0.7;`}
57
+ ${L?`background: ${$o.accent}; color: white; border: none;`:`background: transparent; color: ${$o.accent}; border: 1px solid currentColor; opacity: 0.7;`}
58
58
  "
59
59
  >
60
- ${ha(_.label)}
60
+ ${va(_.label)}
61
61
  </button>
62
- `}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let h=null,g=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(h=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};g.forEach(_=>_.addEventListener("click",S));let b=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",b);let x=()=>{n||y.destroy()};l.addEventListener("click",x);let f=[];n&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),f.push(_))});let m;i?.timeoutMs&&(m=setTimeout(()=>{y.destroy()},i.timeoutMs));let v=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",u.style.opacity="1",u.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:n});let y={destroy(){m&&clearTimeout(m),window.removeEventListener("keydown",b),l.removeEventListener("click",x),g.forEach(_=>_.removeEventListener("click",S)),f.forEach(_=>_.removeAttribute("inert")),u.style.pointerEvents="none",l.style.pointerEvents="none",u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{u.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var kL=["top","right","bottom","left"];var zn=Math.min,qr=Math.max,cu=Math.round,du=Math.floor,$a=t=>({x:t,y:t}),c2={left:"right",right:"left",bottom:"top",top:"bottom"},d2={start:"end",end:"start"};function of(t,e,a){return qr(t,zn(e,a))}function Fo(t,e){return typeof t=="function"?t(e):t}function Vn(t){return t.split("-")[0]}function is(t){return t.split("-")[1]}function Dv(t){return t==="x"?"y":"x"}function sf(t){return t==="y"?"height":"width"}var f2=new Set(["top","bottom"]);function zr(t){return f2.has(Vn(t))?"y":"x"}function lf(t){return Dv(zr(t))}function EL(t,e,a){a===void 0&&(a=!1);let r=is(t),n=lf(t),o=sf(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=uu(i)),[i,uu(i)]}function TL(t){let e=uu(t);return[nf(t),e,nf(e)]}function nf(t){return t.replace(/start|end/g,e=>d2[e])}var IL=["left","right"],AL=["right","left"],p2=["top","bottom"],h2=["bottom","top"];function m2(t,e,a){switch(t){case"top":case"bottom":return a?e?AL:IL:e?IL:AL;case"left":case"right":return e?p2:h2;default:return[]}}function RL(t,e,a,r){let n=is(t),o=m2(Vn(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(nf)))),o}function uu(t){return t.replace(/left|right|bottom|top/g,e=>c2[e])}function g2(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ov(t){return typeof t!="number"?g2(t):{top:t,right:t,bottom:t,left:t}}function No(t){let{x:e,y:a,width:r,height:n}=t;return{width:r,height:n,top:a,left:e,right:e+r,bottom:a+n,x:e,y:a}}function ML(t,e,a){let{reference:r,floating:n}=t,o=zr(e),i=lf(e),s=sf(i),l=Vn(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,h=r[s]/2-n[s]/2,g;switch(l){case"top":g={x:c,y:r.y-n.height};break;case"bottom":g={x:c,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-n.width,y:d};break;default:g={x:r.x,y:r.y}}switch(is(e)){case"start":g[i]-=h*(a&&u?-1:1);break;case"end":g[i]+=h*(a&&u?-1:1);break}return g}async function BL(t,e){var a;e===void 0&&(e={});let{x:r,y:n,platform:o,rects:i,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Fo(e,t),S=Ov(g),x=s[h?d==="floating"?"reference":"floating":d],f=No(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(x)))==null||a?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},_=No(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:v,strategy:l}):m);return{top:(f.top-_.top+S.top)/y.y,bottom:(_.bottom-f.bottom+S.bottom)/y.y,left:(f.left-_.left+S.left)/y.x,right:(_.right-f.right+S.right)/y.x}}var FL=async(t,e,a)=>{let{placement:r="bottom",strategy:n="absolute",middleware:o=[],platform:i}=a,s=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(e)),u=await i.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:d}=ML(u,r,l),h=r,g={},S=0;for(let x=0;x<s.length;x++){var b;let{name:f,fn:m}=s[x],{x:v,y,data:_,reset:L}=await m({x:c,y:d,initialPlacement:r,placement:h,strategy:n,middlewareData:g,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:BL},elements:{reference:t,floating:e}});c=v??c,d=y??d,g={...g,[f]:{...g[f],..._}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(h=L.placement),L.rects&&(u=L.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):L.rects),{x:c,y:d}=ML(u,h,l)),x=-1)}return{x:c,y:d,placement:h,strategy:n,middlewareData:g}},NL=t=>({name:"arrow",options:t,async fn(e){let{x:a,y:r,placement:n,rects:o,platform:i,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=Fo(t,e)||{};if(u==null)return{};let d=Ov(c),h={x:a,y:r},g=lf(n),S=sf(g),b=await i.getDimensions(u),x=g==="y",f=x?"top":"left",m=x?"bottom":"right",v=x?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[g]-h[g]-o.floating[S],_=h[g]-o.reference[g],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=L?L[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(L)))&&(C=s.floating[v]||o.floating[S]);let k=y/2-_/2,w=C/2-b[S]/2-1,I=zn(d[f],w),T=zn(d[m],w),D=I,M=C-b[S]-T,B=C/2-b[S]/2+k,F=of(D,B,M),H=!l.arrow&&is(n)!=null&&B!==F&&o.reference[S]/2-(B<D?I:T)-b[S]/2<0,V=H?B<D?B-D:B-M:0;return{[g]:h[g]+V,data:{[g]:F,centerOffset:B-F-V,...H&&{alignmentOffset:V}},reset:H}}});var PL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,r;let{placement:n,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=Fo(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let f=Vn(n),m=zr(s),v=Vn(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(v||!b?[uu(s)]:TL(s)),L=S!=="none";!h&&L&&_.push(...RL(s,b,S,y));let C=[s,..._],k=await l.detectOverflow(e,x),w=[],I=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&w.push(k[f]),d){let B=EL(n,i,y);w.push(k[B[0]],k[B[1]])}if(I=[...I,{placement:n,overflows:w}],!w.every(B=>B<=0)){var T,D;let B=(((T=o.flip)==null?void 0:T.index)||0)+1,F=C[B];if(F&&(!(d==="alignment"?m!==zr(F):!1)||I.every(N=>zr(N.placement)===m?N.overflows[0]>0:!0)))return{data:{index:B,overflows:I},reset:{placement:F}};let H=(D=I.filter(V=>V.overflows[0]<=0).sort((V,N)=>V.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!H)switch(g){case"bestFit":{var M;let V=(M=I.filter(N=>{if(L){let X=zr(N.placement);return X===m||X==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(X=>X>0).reduce((X,ve)=>X+ve,0)]).sort((N,X)=>N[1]-X[1])[0])==null?void 0:M[0];V&&(H=V);break}case"initialPlacement":H=s;break}if(n!==H)return{reset:{placement:H}}}return{}}}};function DL(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function OL(t){return kL.some(e=>t[e]>=0)}var HL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=Fo(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=DL(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:OL(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=DL(i,a.floating);return{data:{escapedOffsets:s,escaped:OL(s)}}}default:return{}}}}};var v2=new Set(["left","top"]);async function y2(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Vn(a),s=is(a),l=zr(a)==="y",u=v2.has(i)?-1:1,c=o&&l?-1:1,d=Fo(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof S=="number"&&(g=s==="end"?S*-1:S),l?{x:g*c,y:h*u}:{x:h*u,y:g*c}}var UL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,r;let{x:n,y:o,placement:i,middlewareData:s}=e,l=await y2(e,t);return i===((a=s.offset)==null?void 0:a.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:n+l.x,y:o+l.y,data:{...l,placement:i}}}}},qL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:r,placement:n,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:f=>{let{x:m,y:v}=f;return{x:m,y:v}}},...u}=Fo(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),h=zr(Vn(n)),g=Dv(h),S=c[g],b=c[h];if(i){let f=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=S+d[f],y=S-d[m];S=of(v,S,y)}if(s){let f=h==="y"?"top":"left",m=h==="y"?"bottom":"right",v=b+d[f],y=b-d[m];b=of(v,b,y)}let x=l.fn({...e,[g]:S,[h]:b});return{...x,data:{x:x.x-a,y:x.y-r,enabled:{[g]:i,[h]:s}}}}}};function uf(){return typeof window<"u"}function Po(t){return VL(t)?(t.nodeName||"").toLowerCase():"#document"}function Xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ja(t){var e;return(e=(VL(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function VL(t){return uf()?t instanceof Node||t instanceof Xt(t).Node:!1}function Ta(t){return uf()?t instanceof Element||t instanceof Xt(t).Element:!1}function Ga(t){return uf()?t instanceof HTMLElement||t instanceof Xt(t).HTMLElement:!1}function zL(t){return!uf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xt(t).ShadowRoot}var x2=new Set(["inline","contents"]);function ls(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ra(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!x2.has(n)}var b2=new Set(["table","td","th"]);function $L(t){return b2.has(Po(t))}var S2=[":popover-open",":modal"];function fu(t){return S2.some(e=>{try{return t.matches(e)}catch{return!1}})}var C2=["transform","translate","scale","rotate","perspective"],_2=["transform","translate","scale","rotate","perspective","filter"],w2=["paint","layout","strict","content"];function cf(t){let e=df(),a=Ta(t)?Ra(t):t;return C2.some(r=>a[r]?a[r]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||_2.some(r=>(a.willChange||"").includes(r))||w2.some(r=>(a.contain||"").includes(r))}function jL(t){let e=Vr(t);for(;Ga(e)&&!Ho(e);){if(cf(e))return e;if(fu(e))return null;e=Vr(e)}return null}function df(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var L2=new Set(["html","body","#document"]);function Ho(t){return L2.has(Po(t))}function Ra(t){return Xt(t).getComputedStyle(t)}function pu(t){return Ta(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Vr(t){if(Po(t)==="html")return t;let e=t.assignedSlot||t.parentNode||zL(t)&&t.host||ja(t);return zL(e)?e.host:e}function GL(t){let e=Vr(t);return Ho(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ga(e)&&ls(e)?e:GL(e)}function ss(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=GL(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=Xt(n);if(o){let s=ff(i);return e.concat(i,i.visualViewport||[],ls(n)?n:[],s&&a?ss(s):[])}return e.concat(n,ss(n,[],a))}function ff(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function YL(t){let e=Ra(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=Ga(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=cu(a)!==o||cu(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Fv(t){return Ta(t)?t:t.contextElement}function us(t){let e=Fv(t);if(!Ga(e))return $a(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=YL(e),i=(o?cu(a.width):a.width)/r,s=(o?cu(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var I2=$a(0);function KL(t){let e=Xt(t);return!df()||!e.visualViewport?I2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function A2(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Xt(t)?!1:e}function Uo(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Fv(t),i=$a(1);e&&(r?Ta(r)&&(i=us(r)):i=us(t));let s=A2(o,a,r)?KL(o):$a(0),l=(n.left+s.x)/i.x,u=(n.top+s.y)/i.y,c=n.width/i.x,d=n.height/i.y;if(o){let h=Xt(o),g=r&&Ta(r)?Xt(r):r,S=h,b=ff(S);for(;b&&r&&g!==S;){let x=us(b),f=b.getBoundingClientRect(),m=Ra(b),v=f.left+(b.clientLeft+parseFloat(m.paddingLeft))*x.x,y=f.top+(b.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=v,u+=y,S=Xt(b),b=ff(S)}}return No({width:c,height:d,x:l,y:u})}function pf(t,e){let a=pu(t).scrollLeft;return e?e.left+a:Uo(ja(t)).left+a}function QL(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-pf(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function k2(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=ja(r),s=e?fu(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=$a(1),c=$a(0),d=Ga(r);if((d||!d&&!o)&&((Po(r)!=="body"||ls(i))&&(l=pu(r)),Ga(r))){let g=Uo(r);u=us(r),c.x=g.x+r.clientLeft,c.y=g.y+r.clientTop}let h=i&&!d&&!o?QL(i,l):$a(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:a.y*u.y-l.scrollTop*u.y+c.y+h.y}}function E2(t){return Array.from(t.getClientRects())}function T2(t){let e=ja(t),a=pu(t),r=t.ownerDocument.body,n=qr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=qr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+pf(t),s=-a.scrollTop;return Ra(r).direction==="rtl"&&(i+=qr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var WL=25;function R2(t,e){let a=Xt(t),r=ja(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=df();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=pf(r);if(u<=0){let c=r.ownerDocument,d=c.body,h=getComputedStyle(d),g=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-g);S<=WL&&(o-=S)}else u<=WL&&(o+=u);return{width:o,height:i,x:s,y:l}}var M2=new Set(["absolute","fixed"]);function D2(t,e){let a=Uo(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=Ga(t)?us(t):$a(1),i=t.clientWidth*o.x,s=t.clientHeight*o.y,l=n*o.x,u=r*o.y;return{width:i,height:s,x:l,y:u}}function ZL(t,e,a){let r;if(e==="viewport")r=R2(t,a);else if(e==="document")r=T2(ja(t));else if(Ta(e))r=D2(e,a);else{let n=KL(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return No(r)}function JL(t,e){let a=Vr(t);return a===e||!Ta(a)||Ho(a)?!1:Ra(a).position==="fixed"||JL(a,e)}function O2(t,e){let a=e.get(t);if(a)return a;let r=ss(t,[],!1).filter(s=>Ta(s)&&Po(s)!=="body"),n=null,o=Ra(t).position==="fixed",i=o?Vr(t):t;for(;Ta(i)&&!Ho(i);){let s=Ra(i),l=cf(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&M2.has(n.position)||ls(i)&&!l&&JL(t,i))?r=r.filter(c=>c!==i):n=s,i=Vr(i)}return e.set(t,r),r}function B2(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?fu(e)?[]:O2(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=ZL(e,c,n);return u.top=qr(d.top,u.top),u.right=zn(d.right,u.right),u.bottom=zn(d.bottom,u.bottom),u.left=qr(d.left,u.left),u},ZL(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function F2(t){let{width:e,height:a}=YL(t);return{width:e,height:a}}function N2(t,e,a){let r=Ga(e),n=ja(e),o=a==="fixed",i=Uo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=$a(0);function u(){l.x=pf(n)}if(r||!r&&!o)if((Po(e)!=="body"||ls(n))&&(s=pu(e)),r){let g=Uo(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?QL(n,s):$a(0),d=i.left+s.scrollLeft-l.x-c.x,h=i.top+s.scrollTop-l.y-c.y;return{x:d,y:h,width:i.width,height:i.height}}function Bv(t){return Ra(t).position==="static"}function XL(t,e){if(!Ga(t)||Ra(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return ja(t)===a&&(a=a.ownerDocument.body),a}function eI(t,e){let a=Xt(t);if(fu(t))return a;if(!Ga(t)){let n=Vr(t);for(;n&&!Ho(n);){if(Ta(n)&&!Bv(n))return n;n=Vr(n)}return a}let r=XL(t,e);for(;r&&$L(r)&&Bv(r);)r=XL(r,e);return r&&Ho(r)&&Bv(r)&&!cf(r)?a:r||jL(t)||a}var P2=async function(t){let e=this.getOffsetParent||eI,a=this.getDimensions,r=await a(t.floating);return{reference:N2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H2(t){return Ra(t).direction==="rtl"}var U2={convertOffsetParentRelativeRectToViewportRelativeRect:k2,getDocumentElement:ja,getClippingRect:B2,getOffsetParent:eI,getElementRects:P2,getClientRects:E2,getDimensions:F2,getScale:us,isElement:Ta,isRTL:H2};function tI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function q2(t,e){let a=null,r,n=ja(t);function o(){var s;clearTimeout(r),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let u=t.getBoundingClientRect(),{left:c,top:d,width:h,height:g}=u;if(s||e(),!h||!g)return;let S=du(d),b=du(n.clientWidth-(c+h)),x=du(n.clientHeight-(d+g)),f=du(c),v={rootMargin:-S+"px "+-b+"px "+-x+"px "+-f+"px",threshold:qr(0,zn(1,l))||1},y=!0;function _(L){let C=L[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!tI(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:n.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function hf(t,e,a,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Fv(t),c=n||o?[...u?ss(u):[],...ss(e)]:[];c.forEach(f=>{n&&f.addEventListener("scroll",a,{passive:!0}),o&&f.addEventListener("resize",a)});let d=u&&s?q2(u,a):null,h=-1,g=null;i&&(g=new ResizeObserver(f=>{let[m]=f;m&&m.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=g)==null||v.observe(e)})),a()}),u&&!l&&g.observe(u),g.observe(e));let S,b=l?Uo(t):null;l&&x();function x(){let f=Uo(t);b&&!tI(b,f)&&a(),b=f,S=requestAnimationFrame(x)}return a(),()=>{var f;c.forEach(m=>{n&&m.removeEventListener("scroll",a),o&&m.removeEventListener("resize",a)}),d?.(),(f=g)==null||f.disconnect(),g=null,l&&cancelAnimationFrame(S)}}var mf=UL;var gf=qL,vf=PL;var aI=HL,rI=NL;var yf=(t,e,a)=>{let r=new Map,n={platform:U2,...a},o={...n.platform,_c:r};return FL(t,e,{...n,platform:o})};function z2(t){let e=t.getBoundingClientRect(),a=window.innerWidth,r=window.innerHeight;if(!(e.width>a*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),i=Math.max(e.top,0),s=Math.min(e.right,a),l=Math.min(e.bottom,r),u=(o+s)/2,c=(i+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:u,y:c,top:c,left:u,right:u,bottom:c}}}}function nI(t,e,a){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");if(o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=ha(a.html),!a.trigger||a.trigger==="immediate"){let f=document.createElement("button");f.className="syntro-tooltip-close",f.setAttribute("aria-label","Close"),f.textContent="\xD7",Object.assign(f.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),f.addEventListener("mouseenter",()=>{f.style.opacity="1"}),f.addEventListener("mouseleave",()=>{f.style.opacity="0.6"}),f.addEventListener("click",()=>x.destroy()),o.style.position="relative",o.appendChild(f)}let i=o.querySelectorAll("[data-syntro-action]"),s=f=>{let v=f.currentTarget.getAttribute("data-syntro-action");v&&a.onAction&&a.onAction(v)};i.forEach(f=>f.addEventListener("click",s));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[mf(a.offsetPx??8),vf(),gf({padding:8}),aI(),rI({element:l})],c=a.placement&&a.placement!=="auto"?a.placement:"top",d=hf(t,o,async()=>{if(!t.isConnected){x.destroy();return}let f=z2(t),m=await yf(f,o,{placement:c,strategy:"fixed",middleware:u}),{x:v,y,strategy:_,middlewareData:L,placement:C}=m;if(Object.assign(o.style,{left:`${v}px`,top:`${y}px`,position:_}),L.arrow){let{x:k,y:w}=L.arrow,I=C.split("-")[0],T={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:k!=null?`${k}px`:"",top:w!=null?`${w}px`:"",right:"",bottom:"",[T[I]]:"-4px"});let D={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${D[I]||"0deg"})`}}),h=f=>{f.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let g=[];if(a.blocking){Array.from(document.body.children).forEach(m=>{m!==e&&m.getAttribute("inert")===null&&(m.setAttribute("inert",""),g.push(m.id||m.tagName))});let f=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(f.length>0){let m=f[0],v=f[f.length-1],y=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===m&&(v.focus(),_.preventDefault()):document.activeElement===v&&(m.focus(),_.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>m.focus())}}let b=(()=>{if(a.trigger==="hover"){let f=null,m=()=>{f&&(clearTimeout(f),f=null),o.style.visibility="visible",o.style.opacity="1"},v=()=>{f=setTimeout(()=>{o.style.visibility="hidden",o.style.opacity="0",f=null},100)};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",m),t.addEventListener("mouseleave",v),o.addEventListener("mouseenter",m),o.addEventListener("mouseleave",v),t.addEventListener("focus",m),t.addEventListener("blur",v),()=>{f&&clearTimeout(f),t.removeEventListener("mouseenter",m),t.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",m),o.removeEventListener("mouseleave",v),t.removeEventListener("focus",m),t.removeEventListener("blur",v)}}if(a.trigger==="click"){let f=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",f),()=>t.removeEventListener("click",f)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){d(),b(),window.removeEventListener("keydown",h),i.forEach(f=>f.removeEventListener("click",s)),a.blocking&&Array.from(document.body.children).forEach(f=>{f!==e&&f.removeAttribute("inert")}),o.style.pointerEvents="none",o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var Nv=K(Me(),1),je=K(We(),1),cI=K(Oo(),1);var Ve=K(Me(),1);function j2({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,Ve.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ve.jsx)("div",{role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${a}%`}})})}function G2({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,Ve.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":a?"true":void 0,"data-completed":e?"true":void 0,"aria-current":a?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${a?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>n(r,t.id),children:[(0,Ve.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ve.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ve.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ve.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function W2({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,Ve.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ve.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ve.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ve.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ve.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>r(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ve.jsxs)("div",{className:"se-mb-2",children:[(0,Ve.jsx)(j2,{completed:n,total:o}),(0,Ve.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,Ve.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,Ve.jsx)(G2,{step:i,isCompleted:t.completedSteps.includes(i.id),isCurrent:t.currentStepId===i.id,tourId:t.tourId,onStepClick:a},i.id))}),e&&t.meta.description&&(0,Ve.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function lI({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,Ve.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ve.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,Ve.jsx)(W2,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function uI(t,e){let a=document.createElement("div");a.setAttribute("data-testid","workflow-toast"),a.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(a.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let r=document.createElement("div");if(r.className="se-font-semibold",r.style.fontWeight="600",r.textContent=e.title,a.appendChild(r),e.body){let i=document.createElement("div");i.className="se-mt-1 se-text-sm",i.style.marginTop="4px",i.style.fontSize="13px",i.style.color="var(--se-color-text-secondary, #666)",i.textContent=e.body,a.appendChild(i)}t.appendChild(a);let n,o=setTimeout(()=>{a.style.opacity="0",n=setTimeout(()=>{a.remove()},300)},4e3);return()=>{clearTimeout(o),clearTimeout(n),a.remove()}}function Z2(t){let e=new Map;for(let a of t){let r=a.action;if(r.kind==="core:tour"&&r.workflow&&r.tourId){let n=r.workflow,i=(r.steps||[]).map(s=>({id:s.id,title:n.stepTitles?.[s.id]||s.id}));e.set(r.tourId,{meta:n,steps:i})}}return e}function X2({runtime:t}){let[e,a]=(0,je.useState)(0),r=(0,je.useMemo)(()=>{let x=t?.actions?.getActive?.()||[];return Z2(x)},[t,e]),n=(0,je.useRef)(r);n.current=r,(0,je.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(x=>x+1))},[t]);let o=(0,je.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,je.useRef)(new Set),s=(0,je.useRef)([]),l=(0,je.useRef)(null),u=(0,je.useRef)({}),[c,d]=(0,je.useState)([]),h=(0,je.useRef)(!1);if(!h.current&&o){let x=o.get?.("notified")||[];for(let m of x)i.current.add(m);let f=o.get?.("completed")||{};u.current={...f},h.current=!0}(0,je.useEffect)(()=>{if(r.size===0)return;let x=o?.get?.("dismissed")||[],f=o?.get?.("completed")||{};d(m=>{let v=new Set(m.map(_=>_.tourId)),y=[];for(let[_,{meta:L,steps:C}]of r){if(v.has(_))continue;let k="active";x.includes(_)?k="dismissed":f[_]&&(k="completed"),y.push({tourId:_,meta:L,steps:C,currentStepId:null,completedSteps:[],status:k,completedAt:f[_]||void 0})}return y.length>0?[...m,...y]:m});for(let[m,{meta:v}]of r)if(!i.current.has(m)&&v.notification&&l.current&&!x.includes(m)&&!f[m]){i.current.add(m),o?.set?.("notified",[...i.current]);let y=uI(l.current,v.notification);s.current.push(y)}},[r,o]),(0,je.useEffect)(()=>{if(!t?.events?.subscribe)return;let x=t.events.subscribe({patterns:["^tour\\."]},f=>{let m=f.props?.tourId;if(!m)return;let v=n.current;if(!v.has(m)&&f.name==="tour.started"){a(y=>y+1);return}v.has(m)&&d(y=>y.map(L=>{if(L.tourId!==m)return L;switch(f.name){case"tour.started":{let C=f.props?.startStepId||L.steps[0]?.id||null;if(!i.current.has(m)){i.current.add(m),o?.set?.("notified",[...i.current]);let w=v.get(m);if(w?.meta.notification&&l.current){let I=uI(l.current,w.meta.notification);s.current.push(I)}}let k=y.filter(w=>w.status==="active"||w.tourId===m).map(w=>w.tourId);return k.includes(m)||k.push(m),o?.set?.("active",[...new Set(k)]),{...L,status:"active",currentStepId:C,completedSteps:L.status==="active"?L.completedSteps:[]}}case"tour.step_started":{let C=f.props?.stepId;return{...L,currentStepId:C||L.currentStepId}}case"tour.step_changed":{let C=f.props?.previousStepId,k=f.props?.nextStepId,w=C&&!L.completedSteps.includes(C)?[...L.completedSteps,C]:L.completedSteps;return{...L,currentStepId:k||L.currentStepId,completedSteps:w}}case"tour.completed":{let C=Date.now();return u.current[m]=C,o?.set?.("completed",{...u.current}),{...L,status:"completed",currentStepId:null,completedSteps:L.steps.map(k=>k.id),completedAt:C}}case"tour.paused":return L;default:return L}}))});return()=>{x();for(let f of s.current)f();s.current=[]}},[t,o]);let g=(0,je.useCallback)((x,f)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:x,stepId:f})},[t]),S=(0,je.useCallback)(x=>{d(f=>{let m=f.map(y=>y.tourId===x?{...y,status:"dismissed"}:y),v=m.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),m})},[o]),b=(0,je.useMemo)(()=>c.filter(x=>x.status==="active"),[c]);return(0,Nv.jsx)("div",{ref:l,children:(0,Nv.jsx)(lI,{workflows:b,onStepClick:g,onDismiss:S})})}var dI={mount(t,e){let a=e?.runtime||null,r=(0,cI.createRoot)(t);return r.render(je.default.createElement(X2,{runtime:a})),()=>{r.unmount()}}};var fI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};a.getAttribute("data-syntro-highlight")&&e.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring").forEach(s=>s.remove()),a.setAttribute("data-syntro-highlight","true");let n=t.style?.color;if(!n)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(n=i)}catch{}let o=LL(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:n,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight")}}},pI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r=t.duration??4e3;await new Promise(b=>requestAnimationFrame(b));let n=b=>({r:parseInt(b.slice(1,3),16),g:parseInt(b.slice(3,5),16),b:parseInt(b.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let b=getComputedStyle(e.overlayRoot),x=b.getPropertyValue("--sc-color-primary")?.trim(),f=b.getPropertyValue("--sc-color-primary-hover")?.trim();x?.startsWith("#")&&x.length>=7&&(i=n(x)),f?.startsWith("#")&&f.length>=7&&(s=n(f))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let u=document.createElement("style");u.setAttribute("data-syntro-pulse-styles","");let{r:c,g:d,b:h}=i;if(s){let{r:b,g:x,b:f}=s;u.textContent=`
62
+ `}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let f=null,h=u.querySelectorAll("[data-syntro-action]"),S=_=>{let C=_.currentTarget.getAttribute("data-syntro-action");C&&(f=C,e.publishEvent("action.modal_cta_clicked",{actionId:C}),y.destroy())};h.forEach(_=>_.addEventListener("click",S));let x=_=>{_.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",x);let b=()=>{r||y.destroy()};l.addEventListener("click",b);let m=[];r&&Array.from(document.body.children).forEach(_=>{_!==e.overlayRoot&&_.getAttribute("inert")===null&&!_.querySelector("[data-syntro-editor-panel]")&&!_.hasAttribute("data-syntro-editor-panel")&&(_.setAttribute("inert",""),m.push(_))});let g;i?.timeoutMs&&(g=setTimeout(()=>{y.destroy()},i.timeoutMs));let v=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');v.length>0&&requestAnimationFrame(()=>v[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",u.style.opacity="1",u.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:n,blocking:r});let y={destroy(){g&&clearTimeout(g),window.removeEventListener("keydown",x),l.removeEventListener("click",b),h.forEach(_=>_.removeEventListener("click",S)),m.forEach(_=>_.removeAttribute("inert")),u.style.pointerEvents="none",l.style.pointerEvents="none",u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{try{u.remove()}catch{}try{l.remove()}catch{}},200),e.publishEvent("action.modal_dismissed",{actionClicked:f})}};return{cleanup:()=>{y.destroy()}}};var x1=["top","right","bottom","left"];var Wr=Math.min,Gn=Math.max,Su=Math.round,Cu=Math.floor,Za=t=>({x:t,y:t}),SD={left:"right",right:"left",bottom:"top",top:"bottom"},CD={start:"end",end:"start"};function Ef(t,e,a){return Gn(t,Wr(e,a))}function Vo(t,e){return typeof t=="function"?t(e):t}function Xr(t){return t.split("-")[0]}function gs(t){return t.split("-")[1]}function cy(t){return t==="x"?"y":"x"}function Tf(t){return t==="y"?"height":"width"}var _D=new Set(["top","bottom"]);function Zn(t){return _D.has(Xr(t))?"y":"x"}function Rf(t){return cy(Zn(t))}function b1(t,e,a){a===void 0&&(a=!1);let n=gs(t),r=Rf(t),o=Tf(r),i=r==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=bu(i)),[i,bu(i)]}function S1(t){let e=bu(t);return[Af(t),e,Af(e)]}function Af(t){return t.replace(/start|end/g,e=>CD[e])}var v1=["left","right"],y1=["right","left"],wD=["top","bottom"],LD=["bottom","top"];function kD(t,e,a){switch(t){case"top":case"bottom":return a?e?y1:v1:e?v1:y1;case"left":case"right":return e?wD:LD;default:return[]}}function C1(t,e,a,n){let r=gs(t),o=kD(Xr(t),a==="start",n);return r&&(o=o.map(i=>i+"-"+r),e&&(o=o.concat(o.map(Af)))),o}function bu(t){return t.replace(/left|right|bottom|top/g,e=>SD[e])}function ID(t){return{top:0,right:0,bottom:0,left:0,...t}}function dy(t){return typeof t!="number"?ID(t):{top:t,right:t,bottom:t,left:t}}function jo(t){let{x:e,y:a,width:n,height:r}=t;return{width:n,height:r,top:a,left:e,right:e+n,bottom:a+r,x:e,y:a}}function _1(t,e,a){let{reference:n,floating:r}=t,o=Zn(e),i=Rf(e),s=Tf(i),l=Xr(e),u=o==="y",c=n.x+n.width/2-r.width/2,d=n.y+n.height/2-r.height/2,f=n[s]/2-r[s]/2,h;switch(l){case"top":h={x:c,y:n.y-r.height};break;case"bottom":h={x:c,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-r.width,y:d};break;default:h={x:n.x,y:n.y}}switch(gs(e)){case"start":h[i]-=f*(a&&u?-1:1);break;case"end":h[i]+=f*(a&&u?-1:1);break}return h}async function k1(t,e){var a;e===void 0&&(e={});let{x:n,y:r,platform:o,rects:i,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Vo(e,t),S=dy(h),b=s[f?d==="floating"?"reference":"floating":d],m=jo(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(b)))==null||a?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:n,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},_=jo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(m.top-_.top+S.top)/y.y,bottom:(_.bottom-m.bottom+S.bottom)/y.y,left:(m.left-_.left+S.left)/y.x,right:(_.right-m.right+S.right)/y.x}}var I1=async(t,e,a)=>{let{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i}=a,s=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(e)),u=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:d}=_1(u,n,l),f=n,h={},S=0;for(let b=0;b<s.length;b++){var x;let{name:m,fn:g}=s[b],{x:v,y,data:_,reset:L}=await g({x:c,y:d,initialPlacement:n,placement:f,strategy:r,middlewareData:h,rects:u,platform:{...i,detectOverflow:(x=i.detectOverflow)!=null?x:k1},elements:{reference:t,floating:e}});c=v??c,d=y??d,h={...h,[m]:{...h[m],..._}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(u=L.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):L.rects),{x:c,y:d}=_1(u,f,l)),b=-1)}return{x:c,y:d,placement:f,strategy:r,middlewareData:h}},A1=t=>({name:"arrow",options:t,async fn(e){let{x:a,y:n,placement:r,rects:o,platform:i,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=Vo(t,e)||{};if(u==null)return{};let d=dy(c),f={x:a,y:n},h=Rf(r),S=Tf(h),x=await i.getDimensions(u),b=h==="y",m=b?"top":"left",g=b?"bottom":"right",v=b?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[h]-f[h]-o.floating[S],_=f[h]-o.reference[h],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),C=L?L[v]:0;(!C||!await(i.isElement==null?void 0:i.isElement(L)))&&(C=s.floating[v]||o.floating[S]);let I=y/2-_/2,w=C/2-x[S]/2-1,k=Wr(d[m],w),T=Wr(d[g],w),D=k,M=C-x[S]-T,P=C/2-x[S]/2+I,F=Ef(D,P,M),U=!l.arrow&&gs(r)!=null&&P!==F&&o.reference[S]/2-(P<D?k:T)-x[S]/2<0,j=U?P<D?P-D:P-M:0;return{[h]:f[h]+j,data:{[h]:F,centerOffset:P-F-j,...U&&{alignmentOffset:j}},reset:U}}});var E1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,n;let{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...b}=Vo(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let m=Xr(r),g=Zn(s),v=Xr(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=f||(v||!x?[bu(s)]:S1(s)),L=S!=="none";!f&&L&&_.push(...C1(s,x,S,y));let C=[s,..._],I=await l.detectOverflow(e,b),w=[],k=((n=o.flip)==null?void 0:n.overflows)||[];if(c&&w.push(I[m]),d){let P=b1(r,i,y);w.push(I[P[0]],I[P[1]])}if(k=[...k,{placement:r,overflows:w}],!w.every(P=>P<=0)){var T,D;let P=(((T=o.flip)==null?void 0:T.index)||0)+1,F=C[P];if(F&&(!(d==="alignment"?g!==Zn(F):!1)||k.every(N=>Zn(N.placement)===g?N.overflows[0]>0:!0)))return{data:{index:P,overflows:k},reset:{placement:F}};let U=(D=k.filter(j=>j.overflows[0]<=0).sort((j,N)=>j.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(h){case"bestFit":{var M;let j=(M=k.filter(N=>{if(L){let X=Zn(N.placement);return X===g||X==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(X=>X>0).reduce((X,ye)=>X+ye,0)]).sort((N,X)=>N[1]-X[1])[0])==null?void 0:M[0];j&&(U=j);break}case"initialPlacement":U=s;break}if(r!==U)return{reset:{placement:U}}}return{}}}};function w1(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function L1(t){return x1.some(e=>t[e]>=0)}var T1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:n}=e,{strategy:r="referenceHidden",...o}=Vo(t,e);switch(r){case"referenceHidden":{let i=await n.detectOverflow(e,{...o,elementContext:"reference"}),s=w1(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:L1(s)}}}case"escaped":{let i=await n.detectOverflow(e,{...o,altBoundary:!0}),s=w1(i,a.floating);return{data:{escapedOffsets:s,escaped:L1(s)}}}default:return{}}}}};var AD=new Set(["left","top"]);async function ED(t,e){let{placement:a,platform:n,elements:r}=t,o=await(n.isRTL==null?void 0:n.isRTL(r.floating)),i=Xr(a),s=gs(a),l=Zn(a)==="y",u=AD.has(i)?-1:1,c=o&&l?-1:1,d=Vo(e,t),{mainAxis:f,crossAxis:h,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof S=="number"&&(h=s==="end"?S*-1:S),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var R1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,n;let{x:r,y:o,placement:i,middlewareData:s}=e,l=await ED(e,t);return i===((a=s.offset)==null?void 0:a.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:i}}}}},M1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:a,y:n,placement:r,platform:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:m=>{let{x:g,y:v}=m;return{x:g,y:v}}},...u}=Vo(t,e),c={x:a,y:n},d=await o.detectOverflow(e,u),f=Zn(Xr(r)),h=cy(f),S=c[h],x=c[f];if(i){let m=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=S+d[m],y=S-d[g];S=Ef(v,S,y)}if(s){let m=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=x+d[m],y=x-d[g];x=Ef(v,x,y)}let b=l.fn({...e,[h]:S,[f]:x});return{...b,data:{x:b.x-a,y:b.y-n,enabled:{[h]:i,[f]:s}}}}}};function Mf(){return typeof window<"u"}function Go(t){return O1(t)?(t.nodeName||"").toLowerCase():"#document"}function Qt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Wa(t){var e;return(e=(O1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function O1(t){return Mf()?t instanceof Node||t instanceof Qt(t).Node:!1}function Oa(t){return Mf()?t instanceof Element||t instanceof Qt(t).Element:!1}function Xa(t){return Mf()?t instanceof HTMLElement||t instanceof Qt(t).HTMLElement:!1}function D1(t){return!Mf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qt(t).ShadowRoot}var TD=new Set(["inline","contents"]);function ys(t){let{overflow:e,overflowX:a,overflowY:n,display:r}=Ba(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+a)&&!TD.has(r)}var RD=new Set(["table","td","th"]);function B1(t){return RD.has(Go(t))}var MD=[":popover-open",":modal"];function _u(t){return MD.some(e=>{try{return t.matches(e)}catch{return!1}})}var DD=["transform","translate","scale","rotate","perspective"],OD=["transform","translate","scale","rotate","perspective","filter"],BD=["paint","layout","strict","content"];function Df(t){let e=Of(),a=Oa(t)?Ba(t):t;return DD.some(n=>a[n]?a[n]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||OD.some(n=>(a.willChange||"").includes(n))||BD.some(n=>(a.contain||"").includes(n))}function P1(t){let e=Wn(t);for(;Xa(e)&&!Zo(e);){if(Df(e))return e;if(_u(e))return null;e=Wn(e)}return null}function Of(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var PD=new Set(["html","body","#document"]);function Zo(t){return PD.has(Go(t))}function Ba(t){return Qt(t).getComputedStyle(t)}function wu(t){return Oa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Wn(t){if(Go(t)==="html")return t;let e=t.assignedSlot||t.parentNode||D1(t)&&t.host||Wa(t);return D1(e)?e.host:e}function F1(t){let e=Wn(t);return Zo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xa(e)&&ys(e)?e:F1(e)}function vs(t,e,a){var n;e===void 0&&(e=[]),a===void 0&&(a=!0);let r=F1(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Qt(r);if(o){let s=Bf(i);return e.concat(i,i.visualViewport||[],ys(r)?r:[],s&&a?vs(s):[])}return e.concat(r,vs(r,[],a))}function Bf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function z1(t){let e=Ba(t),a=parseFloat(e.width)||0,n=parseFloat(e.height)||0,r=Xa(t),o=r?t.offsetWidth:a,i=r?t.offsetHeight:n,s=Su(a)!==o||Su(n)!==i;return s&&(a=o,n=i),{width:a,height:n,$:s}}function py(t){return Oa(t)?t:t.contextElement}function xs(t){let e=py(t);if(!Xa(e))return Za(1);let a=e.getBoundingClientRect(),{width:n,height:r,$:o}=z1(e),i=(o?Su(a.width):a.width)/n,s=(o?Su(a.height):a.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var FD=Za(0);function q1(t){let e=Qt(t);return!Of()||!e.visualViewport?FD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ND(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Qt(t)?!1:e}function Wo(t,e,a,n){e===void 0&&(e=!1),a===void 0&&(a=!1);let r=t.getBoundingClientRect(),o=py(t),i=Za(1);e&&(n?Oa(n)&&(i=xs(n)):i=xs(t));let s=ND(o,a,n)?q1(o):Za(0),l=(r.left+s.x)/i.x,u=(r.top+s.y)/i.y,c=r.width/i.x,d=r.height/i.y;if(o){let f=Qt(o),h=n&&Oa(n)?Qt(n):n,S=f,x=Bf(S);for(;x&&n&&h!==S;){let b=xs(x),m=x.getBoundingClientRect(),g=Ba(x),v=m.left+(x.clientLeft+parseFloat(g.paddingLeft))*b.x,y=m.top+(x.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=v,u+=y,S=Qt(x),x=Bf(S)}}return jo({width:c,height:d,x:l,y:u})}function Pf(t,e){let a=wu(t).scrollLeft;return e?e.left+a:Wo(Wa(t)).left+a}function $1(t,e){let a=t.getBoundingClientRect(),n=a.left+e.scrollLeft-Pf(t,a),r=a.top+e.scrollTop;return{x:n,y:r}}function HD(t){let{elements:e,rect:a,offsetParent:n,strategy:r}=t,o=r==="fixed",i=Wa(n),s=e?_u(e.floating):!1;if(n===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=Za(1),c=Za(0),d=Xa(n);if((d||!d&&!o)&&((Go(n)!=="body"||ys(i))&&(l=wu(n)),Xa(n))){let h=Wo(n);u=xs(n),c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}let f=i&&!d&&!o?$1(i,l):Za(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:a.y*u.y-l.scrollTop*u.y+c.y+f.y}}function UD(t){return Array.from(t.getClientRects())}function zD(t){let e=Wa(t),a=wu(t),n=t.ownerDocument.body,r=Gn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Gn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-a.scrollLeft+Pf(t),s=-a.scrollTop;return Ba(n).direction==="rtl"&&(i+=Gn(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:s}}var N1=25;function qD(t,e){let a=Qt(t),n=Wa(t),r=a.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(r){o=r.width,i=r.height;let c=Of();(!c||c&&e==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let u=Pf(n);if(u<=0){let c=n.ownerDocument,d=c.body,f=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(n.clientWidth-d.clientWidth-h);S<=N1&&(o-=S)}else u<=N1&&(o+=u);return{width:o,height:i,x:s,y:l}}var $D=new Set(["absolute","fixed"]);function VD(t,e){let a=Wo(t,!0,e==="fixed"),n=a.top+t.clientTop,r=a.left+t.clientLeft,o=Xa(t)?xs(t):Za(1),i=t.clientWidth*o.x,s=t.clientHeight*o.y,l=r*o.x,u=n*o.y;return{width:i,height:s,x:l,y:u}}function H1(t,e,a){let n;if(e==="viewport")n=qD(t,a);else if(e==="document")n=zD(Wa(t));else if(Oa(e))n=VD(e,a);else{let r=q1(t);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return jo(n)}function V1(t,e){let a=Wn(t);return a===e||!Oa(a)||Zo(a)?!1:Ba(a).position==="fixed"||V1(a,e)}function jD(t,e){let a=e.get(t);if(a)return a;let n=vs(t,[],!1).filter(s=>Oa(s)&&Go(s)!=="body"),r=null,o=Ba(t).position==="fixed",i=o?Wn(t):t;for(;Oa(i)&&!Zo(i);){let s=Ba(i),l=Df(i);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&$D.has(r.position)||ys(i)&&!l&&V1(t,i))?n=n.filter(c=>c!==i):r=s,i=Wn(i)}return e.set(t,n),n}function GD(t){let{element:e,boundary:a,rootBoundary:n,strategy:r}=t,i=[...a==="clippingAncestors"?_u(e)?[]:jD(e,this._c):[].concat(a),n],s=i[0],l=i.reduce((u,c)=>{let d=H1(e,c,r);return u.top=Gn(d.top,u.top),u.right=Wr(d.right,u.right),u.bottom=Wr(d.bottom,u.bottom),u.left=Gn(d.left,u.left),u},H1(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ZD(t){let{width:e,height:a}=z1(t);return{width:e,height:a}}function WD(t,e,a){let n=Xa(e),r=Wa(e),o=a==="fixed",i=Wo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Za(0);function u(){l.x=Pf(r)}if(n||!n&&!o)if((Go(e)!=="body"||ys(r))&&(s=wu(e)),n){let h=Wo(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else r&&u();o&&!n&&r&&u();let c=r&&!n&&!o?$1(r,s):Za(0),d=i.left+s.scrollLeft-l.x-c.x,f=i.top+s.scrollTop-l.y-c.y;return{x:d,y:f,width:i.width,height:i.height}}function fy(t){return Ba(t).position==="static"}function U1(t,e){if(!Xa(t)||Ba(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return Wa(t)===a&&(a=a.ownerDocument.body),a}function j1(t,e){let a=Qt(t);if(_u(t))return a;if(!Xa(t)){let r=Wn(t);for(;r&&!Zo(r);){if(Oa(r)&&!fy(r))return r;r=Wn(r)}return a}let n=U1(t,e);for(;n&&B1(n)&&fy(n);)n=U1(n,e);return n&&Zo(n)&&fy(n)&&!Df(n)?a:n||P1(t)||a}var XD=async function(t){let e=this.getOffsetParent||j1,a=this.getDimensions,n=await a(t.floating);return{reference:WD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function YD(t){return Ba(t).direction==="rtl"}var KD={convertOffsetParentRelativeRectToViewportRelativeRect:HD,getDocumentElement:Wa,getClippingRect:GD,getOffsetParent:j1,getElementRects:XD,getClientRects:UD,getDimensions:ZD,getScale:xs,isElement:Oa,isRTL:YD};function G1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function QD(t,e){let a=null,n,r=Wa(t);function o(){var s;clearTimeout(n),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();let u=t.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||e(),!f||!h)return;let S=Cu(d),x=Cu(r.clientWidth-(c+f)),b=Cu(r.clientHeight-(d+h)),m=Cu(c),v={rootMargin:-S+"px "+-x+"px "+-b+"px "+-m+"px",threshold:Gn(0,Wr(1,l))||1},y=!0;function _(L){let C=L[0].intersectionRatio;if(C!==l){if(!y)return i();C?i(!1,C):n=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!G1(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(_,{...v,root:r.ownerDocument})}catch{a=new IntersectionObserver(_,v)}a.observe(t)}return i(!0),o}function Ff(t,e,a,n){n===void 0&&(n={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=py(t),c=r||o?[...u?vs(u):[],...vs(e)]:[];c.forEach(m=>{r&&m.addEventListener("scroll",a,{passive:!0}),o&&m.addEventListener("resize",a)});let d=u&&s?QD(u,a):null,f=-1,h=null;i&&(h=new ResizeObserver(m=>{let[g]=m;g&&g.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),a()}),u&&!l&&h.observe(u),h.observe(e));let S,x=l?Wo(t):null;l&&b();function b(){let m=Wo(t);x&&!G1(x,m)&&a(),x=m,S=requestAnimationFrame(b)}return a(),()=>{var m;c.forEach(g=>{r&&g.removeEventListener("scroll",a),o&&g.removeEventListener("resize",a)}),d?.(),(m=h)==null||m.disconnect(),h=null,l&&cancelAnimationFrame(S)}}var Nf=R1;var Hf=M1,Uf=E1;var Z1=T1,W1=A1;var zf=(t,e,a)=>{let n=new Map,r={platform:KD,...a},o={...r.platform,_c:n};return I1(t,e,{...r,platform:o})};function JD(t){let e=t.getBoundingClientRect(),a=window.innerWidth,n=window.innerHeight;if(!(e.width>a*.8||e.height>n*.8))return t;let o=Math.max(e.left,0),i=Math.max(e.top,0),s=Math.min(e.right,a),l=Math.min(e.bottom,n),u=(o+s)/2,c=(i+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:u,y:c,top:c,left:u,right:u,bottom:c}}}}function X1(t,e,a){if(!a.trigger||a.trigger==="immediate"){let x=t.getBoundingClientRect();x.width>window.innerWidth*.8||x.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}let n=document.createElement("div");if(n.className="syntro-tooltip",n.setAttribute("role","tooltip"),n.innerHTML=va(a.html),!a.trigger||a.trigger==="immediate"){let x=document.createElement("button");x.className="syntro-tooltip-close",x.setAttribute("aria-label","Close"),x.textContent="\xD7",Object.assign(x.style,{position:"absolute",top:"4px",right:"4px",background:"none",border:"none",color:"inherit",fontSize:"16px",lineHeight:"1",cursor:"pointer",opacity:"0.6",padding:"2px 4px"}),x.addEventListener("mouseenter",()=>{x.style.opacity="1"}),x.addEventListener("mouseleave",()=>{x.style.opacity="0.6"}),x.addEventListener("click",()=>S.destroy()),n.style.position="relative",n.appendChild(x)}let r=n.querySelectorAll("[data-syntro-action]"),o=x=>{let m=x.currentTarget.getAttribute("data-syntro-action");m&&a.onAction&&a.onAction(m)};r.forEach(x=>x.addEventListener("click",o));let i=document.createElement("div");i.className="syntro-tooltip-arrow",n.appendChild(i),e.appendChild(n);let s=[Nf(a.offsetPx??8),Uf(),Hf({padding:8}),Z1(),W1({element:i})],l=a.placement&&a.placement!=="auto"?a.placement:"top",u=Ff(t,n,async()=>{if(!t.isConnected){S.destroy();return}let x=JD(t),b=await zf(x,n,{placement:l,strategy:"fixed",middleware:s}),{x:m,y:g,strategy:v,middlewareData:y,placement:_}=b;if(Object.assign(n.style,{left:`${m}px`,top:`${g}px`,position:v}),y.arrow){let{x:L,y:C}=y.arrow,I=_.split("-")[0],w={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(i.style,{left:L!=null?`${L}px`:"",top:C!=null?`${C}px`:"",right:"",bottom:"",[w[I]]:"-4px"});let k={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};i.style.transform=`rotate(${k[I]||"0deg"})`}}),c=x=>{x.key==="Escape"&&S.destroy()};window.addEventListener("keydown",c);let d=[];if(a.blocking){Array.from(document.body.children).forEach(b=>{b!==e&&b.getAttribute("inert")===null&&(b.setAttribute("inert",""),d.push(b.id||b.tagName))});let x=Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(x.length>0){let b=x[0],m=x[x.length-1],g=v=>{v.key==="Tab"&&(v.shiftKey?document.activeElement===b&&(m.focus(),v.preventDefault()):document.activeElement===m&&(b.focus(),v.preventDefault()))};n.addEventListener("keydown",g),requestAnimationFrame(()=>b.focus())}}let h=(()=>{if(a.trigger==="hover"){let x=null,b=()=>{x&&(clearTimeout(x),x=null),n.style.visibility="visible",n.style.opacity="1"},m=()=>{x=setTimeout(()=>{n.style.visibility="hidden",n.style.opacity="0",x=null},100)};return n.style.visibility="hidden",n.style.opacity="0",n.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",b),t.addEventListener("mouseleave",m),n.addEventListener("mouseenter",b),n.addEventListener("mouseleave",m),t.addEventListener("focus",b),t.addEventListener("blur",m),()=>{x&&clearTimeout(x),t.removeEventListener("mouseenter",b),t.removeEventListener("mouseleave",m),n.removeEventListener("mouseenter",b),n.removeEventListener("mouseleave",m),t.removeEventListener("focus",b),t.removeEventListener("blur",m)}}if(a.trigger==="click"){let x=()=>{n.style.visibility==="visible"?S.destroy():(n.style.visibility="visible",n.style.opacity="1")};return n.style.visibility="hidden",n.style.opacity="0",n.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",x),()=>t.removeEventListener("click",x)}return n.style.opacity="0",n.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{n.style.opacity="1"}),()=>{}})(),S={el:n,destroy(){u(),h(),window.removeEventListener("keydown",c),r.forEach(x=>x.removeEventListener("click",o)),a.blocking&&Array.from(document.body.children).forEach(x=>{x!==e&&x.removeAttribute("inert")}),n.style.pointerEvents="none",n.style.opacity="0",setTimeout(()=>{try{n.remove()}catch{}},200)}};return S}var hy=Y(Ae(),1),We=Y(Ye(),1),tk=Y(qo(),1);var Ge=Y(Ae(),1);function aO({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,Ge.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,Ge.jsx)("div",{role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,className:"se-h-full se-rounded-full se-bg-blue-5 se-transition-all se-duration-300",style:{width:`${a}%`}})})}function nO({step:t,isCompleted:e,isCurrent:a,tourId:n,onStepClick:r}){return(0,Ge.jsxs)("button",{type:"button","data-testid":`step-${t.id}`,"data-current":a?"true":void 0,"data-completed":e?"true":void 0,"aria-current":a?"step":void 0,className:`se-flex se-items-center se-gap-2 se-w-full se-py-1.5 se-px-2 se-rounded se-border-none se-bg-transparent se-cursor-pointer se-text-left se-text-xs ${a?"se-font-semibold se-text-slate-grey-10":"se-text-slate-grey-8"}`,onClick:()=>r(n,t.id),children:[(0,Ge.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,Ge.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,Ge.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,Ge.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,Ge.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function rO({workflow:t,expanded:e,onStepClick:a,onDismiss:n}){let r=t.completedSteps.length,o=t.steps.length;return(0,Ge.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,Ge.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,Ge.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,Ge.jsx)("span",{className:"se-flex-1 se-text-[13px] se-font-semibold se-text-slate-grey-10 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.meta.title}),(0,Ge.jsx)("button",{type:"button","data-testid":`dismiss-${t.tourId}`,className:"se-shrink-0 se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-slate-grey-7 se-text-xs se-cursor-pointer se-leading-none",onClick:()=>n(t.tourId),"aria-label":`Dismiss ${t.meta.title}`,children:"\u2715"})]}),(0,Ge.jsxs)("div",{className:"se-mb-2",children:[(0,Ge.jsx)(aO,{completed:r,total:o}),(0,Ge.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[r," of ",o," steps"]})]}),(0,Ge.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,Ge.jsx)(nO,{step:i,isCompleted:t.completedSteps.includes(i.id),isCurrent:t.currentStepId===i.id,tourId:t.tourId,onStepClick:a},i.id))}),e&&t.meta.description&&(0,Ge.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function J1({workflows:t,expanded:e,onStepClick:a,onDismiss:n}){return t.length===0?(0,Ge.jsx)("div",{className:"se-flex se-items-center se-justify-center se-py-6 se-text-xs se-text-slate-grey-7",children:"No active workflows"}):(0,Ge.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(r=>(0,Ge.jsx)(rO,{workflow:r,expanded:e,onStepClick:a,onDismiss:n},r.tourId))})}function ek(t){let e=document.createElement("div");e.setAttribute("data-testid","workflow-toast"),e.className="se-fixed se-bottom-4 se-right-4 se-z-50",Object.assign(e.style,{position:"fixed",bottom:"16px",right:"16px",zIndex:"2147483646",padding:"12px 16px",borderRadius:"8px",backgroundColor:"var(--se-color-bg-surface, #fff)",color:"var(--se-color-text-primary, #1a1a1a)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"320px",fontFamily:"var(--se-font-family, system-ui, sans-serif)",fontSize:"14px",lineHeight:"1.4",transition:"opacity 0.3s ease"});let a=document.createElement("div");if(a.className="se-font-semibold",a.style.fontWeight="600",a.textContent=t.title,e.appendChild(a),t.body){let o=document.createElement("div");o.className="se-mt-1 se-text-sm",o.style.marginTop="4px",o.style.fontSize="13px",o.style.color="var(--se-color-text-secondary, #666)",o.textContent=t.body,e.appendChild(o)}document.body.appendChild(e);let n,r=setTimeout(()=>{e.style.opacity="0",n=setTimeout(()=>{e.remove()},300)},4e3);return()=>{clearTimeout(r),clearTimeout(n),e.remove()}}function oO(t){let e=new Map;for(let a of t){let n=a.action;if(n.kind==="core:tour"&&n.workflow&&n.tourId){let r=n.workflow,i=(n.steps||[]).map(s=>({id:s.id,title:r.stepTitles?.[s.id]||s.id}));e.set(n.tourId,{meta:r,steps:i})}}return e}function iO({runtime:t}){let[e,a]=(0,We.useState)(0),n=(0,We.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return oO(b)},[t,e]),r=(0,We.useRef)(n);r.current=n,(0,We.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(b=>b+1))},[t]);let o=(0,We.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,We.useRef)(new Set),s=(0,We.useRef)([]),l=(0,We.useRef)(null),u=(0,We.useRef)({}),[c,d]=(0,We.useState)([]),f=(0,We.useRef)(!1);if(!f.current&&o){let b=o.get?.("notified")||[];for(let g of b)i.current.add(g);let m=o.get?.("completed")||{};u.current={...m},f.current=!0}(0,We.useEffect)(()=>{if(n.size===0)return;let b=o?.get?.("dismissed")||[],m=o?.get?.("completed")||{};d(g=>{let v=new Set(g.map(_=>_.tourId)),y=[];for(let[_,{meta:L,steps:C}]of n){if(v.has(_))continue;let I="active";b.includes(_)?I="dismissed":m[_]&&(I="completed"),y.push({tourId:_,meta:L,steps:C,currentStepId:null,completedSteps:[],status:I,completedAt:m[_]||void 0})}return y.length>0?[...g,...y]:g});for(let[g,{meta:v}]of n)if(!i.current.has(g)&&v.notification&&!b.includes(g)&&!m[g]){i.current.add(g),o?.set?.("notified",[...i.current]);let y=ek(v.notification);s.current.push(y)}},[n,o]),(0,We.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},m=>{let g=m.props?.tourId;if(!g)return;let v=r.current;if(!v.has(g)&&m.name==="tour.started"){a(y=>y+1);return}v.has(g)&&d(y=>y.map(L=>{if(L.tourId!==g)return L;switch(m.name){case"tour.started":{let C=m.props?.startStepId||L.steps[0]?.id||null;if(!i.current.has(g)){i.current.add(g),o?.set?.("notified",[...i.current]);let w=v.get(g);if(w?.meta.notification){let k=ek(w.meta.notification);s.current.push(k)}}let I=y.filter(w=>w.status==="active"||w.tourId===g).map(w=>w.tourId);return I.includes(g)||I.push(g),o?.set?.("active",[...new Set(I)]),{...L,status:"active",currentStepId:C,completedSteps:L.status==="active"?L.completedSteps:[]}}case"tour.step_started":{let C=m.props?.stepId;return{...L,currentStepId:C||L.currentStepId}}case"tour.step_changed":{let C=m.props?.previousStepId,I=m.props?.nextStepId,w=C&&!L.completedSteps.includes(C)?[...L.completedSteps,C]:L.completedSteps;return{...L,currentStepId:I||L.currentStepId,completedSteps:w}}case"tour.completed":{let C=Date.now();return u.current[g]=C,o?.set?.("completed",{...u.current}),{...L,status:"completed",currentStepId:null,completedSteps:L.steps.map(I=>I.id),completedAt:C}}case"tour.paused":return L;default:return L}}))});return()=>{b();for(let m of s.current)m();s.current=[]}},[t,o]);let h=(0,We.useCallback)((b,m)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:m})},[t]),S=(0,We.useCallback)(b=>{d(m=>{let g=m.map(y=>y.tourId===b?{...y,status:"dismissed"}:y),v=g.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",v),g})},[o]),x=(0,We.useMemo)(()=>c.filter(b=>b.status==="active"),[c]);return(0,hy.jsx)("div",{ref:l,children:(0,hy.jsx)(J1,{workflows:x,onStepClick:h,onDismiss:S})})}var ak={mount(t,e){let a=e?.runtime||null,n=(0,tk.createRoot)(t);return n.render(We.default.createElement(iO,{runtime:a})),()=>{n.unmount()}}};var nk=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};if(a.getAttribute("data-syntro-highlight-dismissed"))return{cleanup:()=>{}};a.getAttribute("data-syntro-highlight")&&e.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring").forEach(s=>s.remove()),a.setAttribute("data-syntro-highlight","true");let r=t.style?.color;if(!r)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(r=i)}catch{}let o=g1(a,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:r,blocking:t.blocking??!1,onClickOutside:t.onClickOutside??!0,onEsc:t.onEsc??!0,onDismiss:()=>{a.setAttribute("data-syntro-highlight-dismissed","true")}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{o.destroy(),a.removeAttribute("data-syntro-highlight"),a.removeAttribute("data-syntro-highlight-dismissed")}}},rk=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n=t.duration??4e3;await new Promise(x=>requestAnimationFrame(x));let r=x=>({r:parseInt(x.slice(1,3),16),g:parseInt(x.slice(3,5),16),b:parseInt(x.slice(5,7),16)}),i={r:79,g:70,b:229},s=null;try{let x=getComputedStyle(e.overlayRoot),b=x.getPropertyValue("--sc-color-primary")?.trim(),m=x.getPropertyValue("--sc-color-primary-hover")?.trim();b?.startsWith("#")&&b.length>=7&&(i=r(b)),m?.startsWith("#")&&m.length>=7&&(s=r(m))}catch{}let l=document.querySelector("[data-syntro-pulse-styles]");l&&l.remove();let u=document.createElement("style");u.setAttribute("data-syntro-pulse-styles","");let{r:c,g:d,b:f}=i;if(s){let{r:x,g:b,b:m}=s;u.textContent=`
63
63
  @keyframes syntro-pulse-anim {
64
64
  0%, 100% {
65
- box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${h}, 0.35);
65
+ box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${f}, 0.35);
66
66
  }
67
67
  25% {
68
- box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${h}, 0);
68
+ box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${f}, 0);
69
69
  }
70
70
  50% {
71
- box-shadow: 0 0 0 0 rgba(${b}, ${x}, ${f}, 0.35);
71
+ box-shadow: 0 0 0 0 rgba(${x}, ${b}, ${m}, 0.35);
72
72
  }
73
73
  75% {
74
- box-shadow: 0 0 0 12px rgba(${b}, ${x}, ${f}, 0);
74
+ box-shadow: 0 0 0 12px rgba(${x}, ${b}, ${m}, 0);
75
75
  }
76
76
  }
77
77
  `}else u.textContent=`
78
78
  @keyframes syntro-pulse-anim {
79
79
  0%, 100% {
80
- box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${h}, 0.35);
80
+ box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${f}, 0.35);
81
81
  }
82
82
  50% {
83
- box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${h}, 0);
83
+ box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${f}, 0);
84
84
  }
85
85
  }
86
- `;document.head.appendChild(u);let g=a.style.animation;a.style.animation="syntro-pulse-anim 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",a.setAttribute("data-syntro-pulse","true");let S=setTimeout(()=>{a.style.animation=g,a.removeAttribute("data-syntro-pulse")},r);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:r}),{cleanup:()=>{clearTimeout(S),a.style.animation=g,a.removeAttribute("data-syntro-pulse")}}},hI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let r="#4f46e5";try{let s=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();s?.startsWith("#")&&s.length>=7&&(r=s)}catch{}let n=document.createElement("div");n.textContent=t.content,n.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(n.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:r,borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let o=t.position??"top-right",i=a.style.position;switch(getComputedStyle(a).position==="static"&&(a.style.position="relative"),a.appendChild(n),o){case"top-left":Object.assign(n.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(n.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(n.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(n.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:o}),{cleanup:()=>{n.remove(),i!==void 0&&(a.style.position=i)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(n.textContent=s.content)}}},mI=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:r}=t,n="";if(r.title&&(n+=`<div class="syntro-tt-title">${ha(r.title)}</div>`),n+=`<div class="syntro-tt-body">${ha(r.body)}</div>`,r.ctaButtons&&r.ctaButtons.length>0){n+='<div class="syntro-tt-actions">';for(let i of r.ctaButtons){let s=i.primary??!1;n+=`
86
+ `;document.head.appendChild(u);let h=a.style.animation;a.style.animation="syntro-pulse-anim 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",a.setAttribute("data-syntro-pulse","true");let S=setTimeout(()=>{a.style.animation=h,a.removeAttribute("data-syntro-pulse")},n);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:n}),{cleanup:()=>{clearTimeout(S),a.isConnected&&(a.style.animation=h,a.removeAttribute("data-syntro-pulse"))}}},ok=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let n="#4f46e5";try{let s=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();s?.startsWith("#")&&s.length>=7&&(n=s)}catch{}let r=document.createElement("div");r.textContent=t.content,r.setAttribute("data-syntro-badge",t.anchorId.selector),Object.assign(r.style,{position:"absolute",padding:"2px 6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",color:"white",background:n,borderRadius:"9999px",pointerEvents:"none",zIndex:"2147483646",whiteSpace:"nowrap"});let o=t.position??"top-right",i=a.style.position;switch(getComputedStyle(a).position==="static"&&(a.style.position="relative"),a.appendChild(r),o){case"top-left":Object.assign(r.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(r.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(r.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(r.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:o}),{cleanup:()=>{try{r.remove()}catch{}a.isConnected&&i!==void 0&&(a.style.position=i)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(r.textContent=s.content)}}},ik=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);if(!a&&e.waitForAnchor&&(a=await e.waitForAnchor(t.anchorId,3e3)),!a)return console.warn(`[adaptive-overlays] Anchor not found after waiting: ${t.anchorId.selector}`),{cleanup:()=>{}};let{content:n}=t,r="";if(n.title&&(r+=`<div class="syntro-tt-title">${va(n.title)}</div>`),r+=`<div class="syntro-tt-body">${va(n.body)}</div>`,n.ctaButtons&&n.ctaButtons.length>0){r+='<div class="syntro-tt-actions">';for(let i of n.ctaButtons){let s=i.primary??!1;r+=`
87
87
  <button
88
88
  class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
89
- data-syntro-action="${ha(i.actionId)}"
89
+ data-syntro-action="${va(i.actionId)}"
90
90
  >
91
- ${ha(i.label)}
91
+ ${va(i.label)}
92
92
  </button>
93
- `}n+="</div>"}else r.cta&&(n+=`<div class="syntro-tt-actions">
93
+ `}r+="</div>"}else n.cta&&(r+=`<div class="syntro-tt-actions">
94
94
  <button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
95
- ${ha(r.cta.label)}
95
+ ${va(n.cta.label)}
96
96
  </button>
97
- </div>`);let o=nI(a,e.overlayRoot,{html:n,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:i=>{if(i==="dismiss"){o.destroy();return}if(i==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let s=r.ctaButtons.find(l=>l.actionId===i);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:i,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},Pv=[{kind:"overlays:highlight",executor:fI},{kind:"overlays:pulse",executor:pI},{kind:"overlays:badge",executor:hI},{kind:"overlays:tooltip",executor:mI},{kind:"overlays:modal",executor:Mv},{kind:"core:tour",executor:Tv},{kind:"overlays:celebrate",executor:_L}],bf={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Pv,widgets:[{id:"adaptive-overlays:workflow-tracker",component:dI,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Sf(t){let{appId:e,runtime:a,isBuiltIn:r=!1}=t,n=`app:${e}:`,o=[],i=[],s=a.state.ns(`app:${e}`);return{appId:e,state:{get:u=>s.get(u),set:(u,c)=>s.set(u,c),remove:u=>s.remove(u)},telemetry:a.telemetry?{emit:(u,c)=>{a.events.publish(u,{...c,_appId:e})},getSessionId:()=>a.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(u,c,d)=>{let h=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(u,c)=>a.surfaces.canMount(u,c)},events:{subscribe:u=>a.events.subscribe(c=>{u(c)}),publish:(u,c)=>{a.events.publish(u,{...c,_appId:e})}},registerAction:u=>{a.executors.register(u.kind,u.executor,u.schema,e,r),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function Cf(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var Y2=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]),K2={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function gI(t){return K2[t]??t}function Hv(t){return Y2.has(t)}function Uv(t){if(Hv(t))return null;let e=t.indexOf(":");return e===-1?null:gI(t.slice(0,e))}function _f(t){let e=t.indexOf(":");return e===-1?null:gI(t.slice(0,e))}function wf(t){let{cdnBase:e,registry:a,timeout:r=1e4,onLoadStart:n,onLoadEnd:o}=t,i=new Map,s=new Set,l=new Map;function u(b){return`${e}/adaptives/${b}/index.js`}async function c(b){if(a.has(b))return{appId:b,success:!0,manifest:a.get(b)?.manifest};if(l.has(b))return l.get(b);if(i.has(b))return i.get(b);let x=(async()=>{n?.(b);try{let f=u(b);if(s.has(f)){let _=a.get(b);if(_)return o?.(b,!0),{appId:b,success:!0,manifest:_.manifest}}let m=new Promise((_,L)=>{setTimeout(()=>L(new Error(`Timeout loading app: ${b}`)),r)}),v=d(f,b);await Promise.race([v,m]),s.add(f);let y=a.get(b);if(!y)throw new Error(`App ${b} did not register after loading`);return o?.(b,!0),{appId:b,success:!0,manifest:y.manifest}}catch(f){let m=f instanceof Error?f.message:String(f);o?.(b,!1,m);let v={appId:b,success:!1,error:m};return l.set(b,v),v}finally{i.delete(b)}})();return i.set(b,x),x}async function d(b,x){if(typeof window<"u"){try{let f=await import(b);f.manifest?a.register(f.manifest):f.default?.manifest?a.register(f.default.manifest):f.default&&a.register(f.default);return}catch{}return new Promise((f,m)=>{let v=document.createElement("script");v.src=b,v.async=!0,v.onload=()=>{a.get(x)?f():m(new Error(`App ${x} did not self-register`))},v.onerror=()=>{m(new Error(`Failed to load app script: ${b}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function h(b){let x=new Set;if(b.apps)for(let f of b.apps)x.add(f);if(b.actions)for(let f of b.actions){let m=Uv(f.kind);if(m&&x.add(m),f.kind==="core:mountWidget"){let v=f.widget?.widgetId;if(v){let y=_f(v);y&&x.add(y)}}}if(b.tiles){for(let f of b.tiles)if(f.widget){let m=_f(f.widget);m&&x.add(m)}}return Array.from(x)}async function g(b){let x=h(b);return x.length===0?[]:await Promise.all(x.map(m=>c(m)))}async function S(b){return Promise.all(b.map(x=>c(x)))}return{loadApp:c,loadAppsForConfig:g,preloadApps:S,getRequiredApps:h,getAppUrl:u}}var hu=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,a]of this.apps)a.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let a={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,a),this.emit({type:"app:registered",appId:e.id,manifest:e}),a}async activate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state==="active"||a.state==="activating"){console.warn(`[AppRegistry] App already ${a.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(a.manifest.dependencies)for(let r of a.manifest.dependencies){let n=this.apps.get(r);if(!n||n.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}a.state="activating";try{let r=a.manifest.metadata?.isBuiltIn===!0,n=Sf({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=a.manifest,i=[];if(o){if(o.actions)for(let s of o.actions)n.registerAction(s);if(o.widgets)for(let s of o.widgets)n.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(u=>{if(s.names.includes(u.name)){let c={appId:e,state:n.state,telemetry:n.telemetry,surfaces:n.surfaces};try{s.handler(u,c)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});i.push(l)}}a.cleanup=async()=>{for(let s of i)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Cf(e,this.runtime)},a.state="active",a.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,n]of this.apps)if(n.state==="active"&&n.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);a.state="deactivating";try{a.cleanup&&(await a.cleanup(),a.cleanup=void 0),a.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw a.state="error",a.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let a=this.apps.get(e);a&&(a.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let a of this.eventListeners)try{a(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},cs=new hu;var Za=K(Me(),1);var qo=K(We(),1),zv=K(Oo(),1);var $r=K(We(),1);var vI=/```json\s*\n([\s\S]*?)```/g;function yI(t){let e=[],a=t,r=[],n;for(vI.lastIndex=0;(n=vI.exec(t))!==null;)r.push({fullMatch:n[0],json:n[1],index:n.index});for(let o=r.length-1;o>=0;o--){let{fullMatch:i,json:s}=r[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),a=a.replace(i,""))}return a=a.replace(/\n{3,}/g,`
97
+ </div>`);let o=X1(a,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:i=>{if(i==="dismiss"){o.destroy();return}if(i==="cta"&&n.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:n.cta.label});else if(n.ctaButtons){let s=n.ctaButtons.find(l=>l.actionId===i);s&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:i,label:s.label})}o.destroy()}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},my=[{kind:"overlays:highlight",executor:nk},{kind:"overlays:pulse",executor:rk},{kind:"overlays:badge",executor:ok},{kind:"overlays:tooltip",executor:ik},{kind:"overlays:modal",executor:uy},{kind:"core:tour",executor:sy},{kind:"overlays:celebrate",executor:h1}],$f={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:my,widgets:[{id:"adaptive-overlays:workflow-tracker",component:ak,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function Vf(t){let{appId:e,runtime:a,isBuiltIn:n=!1}=t,r=`app:${e}:`,o=[],i=[],s=a.state.ns(`app:${e}`);return{appId:e,state:{get:u=>s.get(u),set:(u,c)=>s.set(u,c),remove:u=>s.remove(u)},telemetry:a.telemetry?{emit:(u,c)=>{a.events.publish(u,{...c,_appId:e})},getSessionId:()=>a.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(u,c,d)=>{let f=a.surfaces.mount(u,c,{...d,adaptiveId:e});return{unmount:()=>f.unmount(),update:h=>f.update(h)}},canMount:(u,c)=>a.surfaces.canMount(u,c)},events:{subscribe:u=>a.events.subscribe(c=>{u(c)}),publish:(u,c)=>{a.events.publish(u,{...c,_appId:e})}},registerAction:u=>{a.executors.register(u.kind,u.executor,u.schema,e,n),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function jf(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var sO=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]),lO={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function sk(t){return lO[t]??t}function gy(t){return sO.has(t)}function vy(t){if(gy(t))return null;let e=t.indexOf(":");return e===-1?null:sk(t.slice(0,e))}function Gf(t){let e=t.indexOf(":");return e===-1?null:sk(t.slice(0,e))}function Zf(t){let{cdnBase:e,registry:a,timeout:n=1e4,onLoadStart:r,onLoadEnd:o}=t,i=new Map,s=new Set,l=new Map;function u(x){return`${e}/adaptives/${x}/index.js`}async function c(x){if(a.has(x))return{appId:x,success:!0,manifest:a.get(x)?.manifest};if(l.has(x))return l.get(x);if(i.has(x))return i.get(x);let b=(async()=>{r?.(x);try{let m=u(x);if(s.has(m)){let _=a.get(x);if(_)return o?.(x,!0),{appId:x,success:!0,manifest:_.manifest}}let g=new Promise((_,L)=>{setTimeout(()=>L(new Error(`Timeout loading app: ${x}`)),n)}),v=d(m,x);await Promise.race([v,g]),s.add(m);let y=a.get(x);if(!y)throw new Error(`App ${x} did not register after loading`);return o?.(x,!0),{appId:x,success:!0,manifest:y.manifest}}catch(m){let g=m instanceof Error?m.message:String(m);o?.(x,!1,g);let v={appId:x,success:!1,error:g};return l.set(x,v),v}finally{i.delete(x)}})();return i.set(x,b),b}async function d(x,b){if(typeof window<"u"){try{let m=await import(x);m.manifest?a.register(m.manifest):m.default?.manifest?a.register(m.default.manifest):m.default&&a.register(m.default);return}catch{}return new Promise((m,g)=>{let v=document.createElement("script");v.src=x,v.async=!0,v.onload=()=>{a.get(b)?m():g(new Error(`App ${b} did not self-register`))},v.onerror=()=>{g(new Error(`Failed to load app script: ${x}`))},document.head.appendChild(v)})}throw new Error("Dynamic app loading not supported in SSR")}function f(x){let b=new Set;if(x.apps)for(let m of x.apps)b.add(m);if(x.actions)for(let m of x.actions){let g=vy(m.kind);if(g&&b.add(g),m.kind==="core:mountWidget"){let v=m.widget?.widgetId;if(v){let y=Gf(v);y&&b.add(y)}}}if(x.tiles){for(let m of x.tiles)if(m.widget){let g=Gf(m.widget);g&&b.add(g)}}return Array.from(b)}async function h(x){let b=f(x);return b.length===0?[]:await Promise.all(b.map(g=>c(g)))}async function S(x){return Promise.all(x.map(b=>c(b)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:S,getRequiredApps:f,getAppUrl:u}}var Lu=class{constructor(){B(this,"apps",new Map);B(this,"eventListeners",new Set);B(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,a]of this.apps)a.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let a={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,a),this.emit({type:"app:registered",appId:e.id,manifest:e}),a}async activate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state==="active"||a.state==="activating"){console.warn(`[AppRegistry] App already ${a.state}: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(a.manifest.dependencies)for(let n of a.manifest.dependencies){let r=this.apps.get(n);if(!r||r.state!=="active")throw new Error(`App ${e} depends on ${n}, which is not active`)}a.state="activating";try{let n=a.manifest.metadata?.isBuiltIn===!0,r=Vf({appId:e,runtime:this.runtime,isBuiltIn:n}),{runtime:o}=a.manifest,i=[];if(o){if(o.actions)for(let s of o.actions)r.registerAction(s);if(o.widgets)for(let s of o.widgets)r.registerWidget(s);if(o.events)for(let s of o.events){let l=this.runtime.events.subscribe(u=>{if(s.names.includes(u.name)){let c={appId:e,state:r.state,telemetry:r.telemetry,surfaces:r.surfaces};try{s.handler(u,c)}catch(d){console.error(`[AppRegistry] Event handler error in ${e}:`,d)}}});i.push(l)}}a.cleanup=async()=>{for(let s of i)try{await s()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}jf(e,this.runtime)},a.state="active",a.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(n){throw a.state="error",a.error=String(n),this.emit({type:"app:error",appId:e,error:String(n)}),n}}async deactivate(e){let a=this.apps.get(e);if(!a)throw new Error(`App not registered: ${e}`);if(a.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[n,r]of this.apps)if(r.state==="active"&&r.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${n} depends on it`);a.state="deactivating";try{a.cleanup&&(await a.cleanup(),a.cleanup=void 0),a.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(n){throw a.state="error",a.error=String(n),this.emit({type:"app:error",appId:e,error:String(n)}),n}}async unregister(e){let a=this.apps.get(e);a&&(a.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let a of this.eventListeners)try{a(e)}catch(n){console.error("[AppRegistry] Event listener error:",n)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},bs=new Lu;var Ka=Y(Ae(),1);var Xo=Y(Ye(),1),xy=Y(qo(),1);var Xn=Y(Ye(),1);var lk=/```json\s*\n([\s\S]*?)```/g;function uk(t){let e=[],a=t,n=[],r;for(lk.lastIndex=0;(r=lk.exec(t))!==null;)n.push({fullMatch:r[0],json:r[1],index:r.index});for(let o=n.length-1;o>=0;o--){let{fullMatch:i,json:s}=n[o],l;try{l=JSON.parse(s)}catch{continue}typeof l=="object"&&l!==null&&"kind"in l&&typeof l.kind=="string"&&(e.unshift(l),a=a.replace(i,""))}return a=a.replace(/\n{3,}/g,`
98
98
 
99
- `).trim(),{displayText:a,actions:e}}var mu=class extends Error{constructor(e){super(e),this.name="AuthError"}};function Q2(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new mu("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new mu("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function xI(t,e){let a=Q2(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new mu("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var J2=0;function qv(){return`msg-${Date.now()}-${++J2}`}function bI(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,$r.useState)(()=>n?[{id:qv(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,$r.useState)(!1),[h,g]=(0,$r.useState)(null),S=(0,$r.useRef)(null),b=(0,$r.useCallback)(async f=>{let m=f.trim();if(!m)return;g(null);let v={id:qv(),role:"user",text:m,timestamp:Date.now()};u(y=>[...y,v]),d(!0);try{let _=[...l,v].slice(-o).map(I=>({role:I.role,content:I.text})),L=await xI(e,{message:m,history:_,mlflow_run_id:i,current_config:s}),{displayText:C,actions:k}=yI(L.response),w={id:qv(),role:"assistant",text:C,timestamp:Date.now()};u(I=>[...I,w]),k.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(k),r.events.publish("chatbot.actions_applied",{count:k.length,kinds:k.map(I=>I.kind),tileId:a}))}catch(y){let _=y instanceof Error?y.message:"An unexpected error occurred";g(_)}finally{d(!1)}},[e,l,o,i,s,r,a]),x=(0,$r.useCallback)(()=>{u([]),g(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:h,sendMessage:b,clearMessages:x}}var Wa={container:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",touchAction:"none"},messageList:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},messageBubble:{maxWidth:"85%",padding:"8px 12px",borderRadius:"12px",lineHeight:1.5,wordBreak:"break-word"},userMessage:{alignSelf:"flex-end",backgroundColor:Ft[4],color:Va.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:A[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:A[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:ze[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:A[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Ft[4],color:Va.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function eD({message:t}){let e=t.role==="user",a={...Wa.messageBubble,...e?Wa.userMessage:Wa.assistantMessage};return(0,Za.jsx)("div",{style:a,children:t.text})}function tD({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=bI({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,qo.useRef)(null),u=(0,qo.useRef)(null);(0,qo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let h=u.current;if(!h||!h.value.trim()||n)return;let g=h.value;h.value="",i(g)};return(0,Za.jsxs)("div",{style:Wa.container,"data-testid":"chat-assistant",children:[(0,Za.jsxs)("div",{ref:l,style:Wa.messageList,children:[r.map(d=>(0,Za.jsx)(eD,{message:d},d.id)),n&&(0,Za.jsx)("div",{style:Wa.loadingDots,children:"Thinking..."})]}),o&&(0,Za.jsx)("div",{style:Wa.errorBanner,children:o}),(0,Za.jsxs)("form",{onSubmit:c,style:Wa.inputForm,children:[(0,Za.jsx)("input",{ref:u,style:Wa.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,Za.jsx)("button",{type:"submit",disabled:n,style:{...Wa.sendButton,...n?Wa.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var SI={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof zv.createRoot=="function"){let o=(0,zv.createRoot)(t);return o.render(qo.default.createElement(tD,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${A[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
99
+ `).trim(),{displayText:a,actions:e}}var ku=class extends Error{constructor(e){super(e),this.name="AuthError"}};function uO(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new ku("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new ku("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function ck(t,e){let a=uO(),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!n.ok)throw n.status===401?new ku("Session expired or unauthorized"):new Error(`Chat request failed: ${n.status} ${n.statusText}`);return n.json()}var cO=0;function yy(){return`msg-${Date.now()}-${++cO}`}function dk(t){let{backendUrl:e,tileId:a,runtime:n,greeting:r,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,Xn.useState)(()=>r?[{id:yy(),role:"assistant",text:r,timestamp:Date.now()}]:[]),[c,d]=(0,Xn.useState)(!1),[f,h]=(0,Xn.useState)(null),S=(0,Xn.useRef)(null),x=(0,Xn.useCallback)(async m=>{let g=m.trim();if(!g)return;h(null);let v={id:yy(),role:"user",text:g,timestamp:Date.now()};u(y=>[...y,v]),d(!0);try{let _=[...l,v].slice(-o).map(k=>({role:k.role,content:k.text})),L=await ck(e,{message:g,history:_,mlflow_run_id:i,current_config:s}),{displayText:C,actions:I}=uk(L.response),w={id:yy(),role:"assistant",text:C,timestamp:Date.now()};u(k=>[...k,w]),I.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await n.actions.applyBatch(I),n.events.publish("chatbot.actions_applied",{count:I.length,kinds:I.map(k=>k.kind),tileId:a}))}catch(y){let _=y instanceof Error?y.message:"An unexpected error occurred";h(_)}finally{d(!1)}},[e,l,o,i,s,n,a]),b=(0,Xn.useCallback)(()=>{u([]),h(null),S.current?.isApplied()&&(S.current.revertAll(),S.current=null),sessionStorage.removeItem(`syntro:chatbot:history:${a}`)},[a]);return{messages:l,isLoading:c,error:f,sendMessage:x,clearMessages:b}}var Ya={container:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",touchAction:"none"},messageList:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:"8px"},messageBubble:{maxWidth:"85%",padding:"8px 12px",borderRadius:"12px",lineHeight:1.5,wordBreak:"break-word"},userMessage:{alignSelf:"flex-end",backgroundColor:Nt[4],color:Ga.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:A[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:A[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:je[4],fontSize:"13px",borderRadius:"8px",margin:"0 12px"},inputForm:{display:"flex",gap:"8px",padding:"12px",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},input:{flex:1,padding:"8px 12px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",backgroundColor:"rgba(0, 0, 0, 0.2)",color:A[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:Nt[4],color:Ga.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function dO({message:t}){let e=t.role==="user",a={...Ya.messageBubble,...e?Ya.userMessage:Ya.assistantMessage};return(0,Ka.jsx)("div",{style:a,children:t.text})}function fO({config:t,runtime:e,tileId:a}){let{messages:n,isLoading:r,error:o,sendMessage:i,clearMessages:s}=dk({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Xo.useRef)(null),u=(0,Xo.useRef)(null);(0,Xo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let f=u.current;if(!f||!f.value.trim()||r)return;let h=f.value;f.value="",i(h)};return(0,Ka.jsxs)("div",{style:Ya.container,"data-testid":"chat-assistant",children:[(0,Ka.jsxs)("div",{ref:l,style:Ya.messageList,children:[n.map(d=>(0,Ka.jsx)(dO,{message:d},d.id)),r&&(0,Ka.jsx)("div",{style:Ya.loadingDots,children:"Thinking..."})]}),o&&(0,Ka.jsx)("div",{style:Ya.errorBanner,children:o}),(0,Ka.jsxs)("form",{onSubmit:c,style:Ya.inputForm,children:[(0,Ka.jsx)("input",{ref:u,style:Ya.input,placeholder:"Ask anything...",disabled:r,"data-testid":"chat-input"}),(0,Ka.jsx)("button",{type:"submit",disabled:r,style:{...Ya.sendButton,...r?Ya.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var fk={mount(t,e){let{config:a,runtime:n,tileId:r="chatbot-widget"}=e||{};if(a&&n&&typeof xy.createRoot=="function"){let o=(0,xy.createRoot)(t);return o.render(Xo.default.createElement(fO,{config:a,runtime:n,tileId:r})),()=>{o.unmount()}}return!a||!n?(t.innerHTML=`<div style="padding: 16px; color: ${A[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
100
100
  <div style="padding: 16px; font-family: system-ui; color: ${A[10]};">
101
101
  <p style="margin: 0 0 8px; color: ${A[8]};">${a.greeting||"Hi! How can I help?"}</p>
102
102
  <p style="margin: 0; font-size: 12px; color: ${A[7]};">Chat widget mounted. Awaiting React renderer.</p>
103
103
  </div>
104
- `,()=>{t.innerHTML=""})}};var CI={id:"adaptive-chatbot",version:"1.0.0",name:"Chat Assistant",description:"AI chat assistant with action execution capabilities",executors:[],widgets:[{id:"adaptive-chatbot:assistant",component:SI,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function _I(t,e,a){if(e){let r=t.getState().items.find(n=>n.config.id===e);if(r)return r}if(a){let r=t.findByQuestion(a);if(r)return r}throw new Error("FAQ item not found")}async function aD(t,e,a){let r=_I(a,t.itemId,t.itemQuestion),{id:n}=r.config;t.expand!==!1&&a.expand(n);let o=document.querySelector(`[data-faq-item-id="${n}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:n}),{cleanup:()=>{}}}async function rD(t,e,a){let r=_I(a,t.itemId,t.itemQuestion),{id:n}=r.config,o=t.state??"toggle",i;switch(o){case"open":a.expand(n),i="open";break;case"closed":a.collapse(n),i="closed";break;default:{let s=a.getState().expandedItems.has(n);a.toggle(n),i=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:n,newState:i}),{cleanup:()=>{}}}async function nD(t,e,a){switch(t.operation){case"add":{let r=t.items??[],n=t.position==="prepend"?"prepend":"append";a.addItems(r,n);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!a.getState().items.some(n=>n.config.id===t.itemId))throw new Error("FAQ item not found");a.removeItem(t.itemId);break}case"reorder":{let r=t.order??[];a.reorderItems(r);break}case"replace":{let r=t.items??[];a.replaceItems(r);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var wI=[{kind:"faq:scroll_to",executor:aD},{kind:"faq:toggle_item",executor:rD},{kind:"faq:update",executor:nD}];var He=K(Me(),1);var Ee=K(We(),1),Vv=K(Oo(),1);function LI(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function oD(t){return typeof t=="string"?(0,He.jsx)("p",{style:{margin:0},children:t}):t.type==="rich"?(0,He.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}}):(0,He.jsx)("p",{style:{margin:0},children:t.content})}function iD(t){return t?t===!0?{style:"thumbs"}:t:null}function sD(t){return t.prompt||"Was this helpful?"}var Et={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"8px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease",backgroundColor:"var(--sc-content-search-background)",color:"var(--sc-content-search-color)"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",color:"var(--sc-content-chevron-color, currentColor)"},answer:{padding:"var(--sc-content-body-padding, 0 16px 12px 16px)",fontSize:"var(--sc-content-body-font-size, 14px)",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"var(--sc-content-category-font-size, 12px)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)",marginTop:"var(--sc-content-category-gap, 4px)"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},ds={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${A[11]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[8],color:Ft[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]},feedbackPrompt:{color:A[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${A[5]}`},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Ft[0],color:Ft[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]},feedbackPrompt:{color:A[8]}}};function lD({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Ee.useState)(!1),d=ds[o],{question:h,answer:g}=t.config,S={...Et.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{},...r?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Et.question,...d.question,...u?d.questionHover:{}},x={...Et.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Et.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m={...Et.feedback,...d.feedbackPrompt};return(0,He.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,He.jsxs)("button",{type:"button",style:b,onClick:n,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,He.jsx)("span",{children:h}),(0,He.jsx)("span",{style:x,children:"\u203A"})]}),(0,He.jsxs)("div",{style:f,"aria-hidden":!e,children:[oD(g),e&&i&&(0,He.jsxs)("div",{style:m,children:[(0,He.jsx)("span",{children:sD(i)}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="up"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,h,"up"),children:"\u{1F44D}"}),(0,He.jsx)("button",{type:"button",style:{...Et.feedbackButton,...s==="down"?Et.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,h,"down"),children:"\u{1F44E}"})]})]})]})}function uD({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Ee.useReducer)(T=>T+1,0),[o,i]=(0,Ee.useState)(new Set),[s,l]=(0,Ee.useState)(null),[u,c]=(0,Ee.useState)(""),[d,h]=(0,Ee.useState)(new Map),g=(0,Ee.useMemo)(()=>iD(t.feedback),[t.feedback]);(0,Ee.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Ee.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let M=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(B=>{let F=B.props?.actionId;return typeof F=="string"&&F.startsWith("faq:open:")}).pop();if(M&&Date.now()-M.ts<1e4){let B=M.props.actionId.replace("faq:open:","");i(new Set([B])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${B}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},D=>{let M=D.props?.actionId;if(typeof M!="string"||!M.startsWith("faq:open:"))return;let B=M.replace("faq:open:","");i(new Set([B])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${B}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Ee.useEffect)(()=>{if(!e.events.subscribe)return;let T=M=>{let B=M.props?.tileId,F=M.props?.itemId;B===a&&F&&(i(new Set([F])),l(F),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let H=document.querySelector(`[data-faq-item-id="${F}"]`);H&&H.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let B=e.events.getRecent({names:["notification.deep_link"]},5).filter(F=>F.props?.tileId===a&&F.props?.itemId).pop();B&&Date.now()-B.ts<1e4&&T(B)}return e.events.subscribe({names:["notification.deep_link"]},T)},[e,a]);let S=(0,Ee.useMemo)(()=>t.actions.filter(T=>T.triggerWhen?e.evaluateSync(T.triggerWhen).value:!0),[t.actions,e,r]),b=(0,Ee.useMemo)(()=>t.ordering==="priority"?[...S].sort((T,D)=>(D.config.priority??0)-(T.config.priority??0)):S,[S,t.ordering]),x=(0,Ee.useMemo)(()=>{if(!t.searchable||!u.trim())return b;let T=u.toLowerCase();return b.filter(D=>D.config.question.toLowerCase().includes(T)||LI(D.config.answer).toLowerCase().includes(T)||D.config.category?.toLowerCase().includes(T))},[b,u,t.searchable]),f=(0,Ee.useMemo)(()=>{let T=new Map;for(let D of x){let M=D.config.category;T.has(M)||T.set(M,[]),T.get(M).push(D)}return T},[x]),m=(0,Ee.useMemo)(()=>x.some(T=>T.config.category),[x]),v=(0,Ee.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,Ee.useCallback)(T=>{i(D=>{let M=new Set(D);return t.expandBehavior==="single"?D.has(T)?new Set:new Set([T]):(D.has(T)?M.delete(T):M.add(T),M)}),e.events.publish("faq:toggled",{instanceId:a,questionId:T,expanded:!o.has(T),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,Ee.useCallback)((T,D,M)=>{h(B=>{let F=new Map(B);return F.set(T,M),F}),e.events.publish("faq:feedback",{itemId:T,question:D,value:M})},[e.events]),L={...Et.container,...ds[v].container},C={...Et.searchInput,...ds[v].searchInput},k={...Et.emptyState,...ds[v].emptyState},w={...Et.categoryHeader,...ds[v].categoryHeader},I=T=>T.map((D,M)=>(0,He.jsx)(lD,{item:D,isExpanded:o.has(D.config.id),isHighlighted:s===D.config.id,isLast:M===T.length-1,onToggle:()=>y(D.config.id),theme:v,feedbackConfig:g,feedbackValue:d.get(D.config.id),onFeedback:_},D.config.id));return S.length===0?(0,He.jsx)("div",{style:L,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,He.jsx)("div",{style:k,children:"You're all set for now! We'll surface answers here when they're relevant to what you're doing."})}):(0,He.jsxs)("div",{style:L,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,He.jsxs)("div",{style:Et.searchWrapper,children:[(0,He.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,He.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:T=>c(T.target.value),style:C})]}),(0,He.jsx)("div",{style:Et.accordion,children:m?Array.from(f.entries()).map(([T,D])=>(0,He.jsxs)(Ee.default.Fragment,{children:[T&&(0,He.jsx)("div",{style:w,"data-category-header":T,children:T}),I(D)]},T??"__ungrouped")):I(x)}),t.searchable&&x.length===0&&u&&(0,He.jsxs)("div",{style:{...Et.noResults,...ds[v].emptyState},children:['No questions found matching "',u,'"']})]})}var II={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof Vv.createRoot=="function"){let i=(0,Vv.createRoot)(t);return i.render(Ee.default.createElement(uD,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
104
+ `,()=>{t.innerHTML=""})}};var pk={id:"adaptive-chatbot",version:"1.0.0",name:"Chat Assistant",description:"AI chat assistant with action execution capabilities",executors:[],widgets:[{id:"adaptive-chatbot:assistant",component:fk,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function hk(t,e,a){if(e){let n=t.getState().items.find(r=>r.config.id===e);if(n)return n}if(a){let n=t.findByQuestion(a);if(n)return n}throw new Error("FAQ item not found")}async function pO(t,e,a){let n=hk(a,t.itemId,t.itemQuestion),{id:r}=n.config;t.expand!==!1&&a.expand(r);let o=document.querySelector(`[data-faq-item-id="${r}"]`);return o&&o.scrollIntoView({behavior:t.behavior??"smooth"}),e.publishEvent("faq:scroll_to",{itemId:r}),{cleanup:()=>{}}}async function hO(t,e,a){let n=hk(a,t.itemId,t.itemQuestion),{id:r}=n.config,o=t.state??"toggle",i;switch(o){case"open":a.expand(r),i="open";break;case"closed":a.collapse(r),i="closed";break;default:{let s=a.getState().expandedItems.has(r);a.toggle(r),i=s?"closed":"open";break}}return e.publishEvent("faq:toggle",{itemId:r,newState:i}),{cleanup:()=>{}}}async function mO(t,e,a){switch(t.operation){case"add":{let n=t.items??[],r=t.position==="prepend"?"prepend":"append";a.addItems(n,r);break}case"remove":{if(!t.itemId)throw new Error("FAQ item not found");if(!a.getState().items.some(r=>r.config.id===t.itemId))throw new Error("FAQ item not found");a.removeItem(t.itemId);break}case"reorder":{let n=t.order??[];a.reorderItems(n);break}case"replace":{let n=t.items??[];a.replaceItems(n);break}}return e.publishEvent("faq:update",{operation:t.operation}),{cleanup:()=>{}}}var mk=[{kind:"faq:scroll_to",executor:pO},{kind:"faq:toggle_item",executor:hO},{kind:"faq:update",executor:mO}];var qe=Y(Ae(),1);function wy(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ko=wy();function Sk(t){Ko=t}var Eu={exec:()=>null};function Se(t,e=""){let a=typeof t=="string"?t:t.source,n={replace:(r,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(Ht.caret,"$1"),a=a.replace(r,i),n},getRegex:()=>new RegExp(a,e)};return n}var Ht={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},gO=/^(?:[ \t]*(?:\n|$))+/,vO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ly=/(?:[*+-]|\d{1,9}[.)])/,Ck=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_k=Se(Ck).replace(/bull/g,Ly).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),bO=Se(Ck).replace(/bull/g,Ly).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ky=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,SO=/^[^\n]+/,Iy=/(?!\s*\])(?:\\.|[^\[\]\\])+/,CO=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Iy).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_O=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ly).getRegex(),Jf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ay=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wO=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ay).replace("tag",Jf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wk=Se(ky).replace("hr",Tu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jf).getRegex(),LO=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wk).getRegex(),Ey={blockquote:LO,code:vO,def:CO,fences:yO,heading:xO,hr:Tu,html:wO,lheading:_k,list:_O,newline:gO,paragraph:wk,table:Eu,text:SO},gk=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jf).getRegex(),kO={...Ey,lheading:bO,table:gk,paragraph:Se(ky).replace("hr",Tu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gk).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jf).getRegex()},IO={...Ey,html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ay).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Eu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(ky).replace("hr",Tu).replace("heading",` *#{1,6} *[^
105
+ ]`).replace("lheading",_k).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},AO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,EO=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lk=/^( {2,}|\\)\n(?!\s*$)/,TO=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ep=/[\p{P}\p{S}]/u,Ty=/[\s\p{P}\p{S}]/u,kk=/[^\s\p{P}\p{S}]/u,RO=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ty).getRegex(),Ik=/(?!~)[\p{P}\p{S}]/u,MO=/(?!~)[\s\p{P}\p{S}]/u,DO=/(?:[^\s\p{P}\p{S}]|~)/u,OO=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ak=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,BO=Se(Ak,"u").replace(/punct/g,ep).getRegex(),PO=Se(Ak,"u").replace(/punct/g,Ik).getRegex(),Ek="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",FO=Se(Ek,"gu").replace(/notPunctSpace/g,kk).replace(/punctSpace/g,Ty).replace(/punct/g,ep).getRegex(),NO=Se(Ek,"gu").replace(/notPunctSpace/g,DO).replace(/punctSpace/g,MO).replace(/punct/g,Ik).getRegex(),HO=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kk).replace(/punctSpace/g,Ty).replace(/punct/g,ep).getRegex(),UO=Se(/\\(punct)/,"gu").replace(/punct/g,ep).getRegex(),zO=Se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),qO=Se(Ay).replace("(?:-->|$)","-->").getRegex(),$O=Se("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",qO).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yf=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,VO=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Yf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tk=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",Yf).replace("ref",Iy).getRegex(),Rk=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",Iy).getRegex(),jO=Se("reflink|nolink(?!\\()","g").replace("reflink",Tk).replace("nolink",Rk).getRegex(),Ry={_backpedal:Eu,anyPunctuation:UO,autolink:zO,blockSkip:OO,br:Lk,code:EO,del:Eu,emStrongLDelim:BO,emStrongRDelimAst:FO,emStrongRDelimUnd:HO,escape:AO,link:VO,nolink:Rk,punctuation:RO,reflink:Tk,reflinkSearch:jO,tag:$O,text:TO,url:Eu},GO={...Ry,link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Yf).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yf).getRegex()},Sy={...Ry,emStrongRDelimAst:NO,emStrongLDelim:PO,url:Se(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ZO={...Sy,br:Se(Lk).replace("{2,}","*").getRegex(),text:Se(Sy.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Wf={normal:Ey,gfm:kO,pedantic:IO},Iu={normal:Ry,gfm:Sy,breaks:ZO,pedantic:GO},WO={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vk=t=>WO[t];function hn(t,e){if(e){if(Ht.escapeTest.test(t))return t.replace(Ht.escapeReplace,vk)}else if(Ht.escapeTestNoEncode.test(t))return t.replace(Ht.escapeReplaceNoEncode,vk);return t}function yk(t){try{t=encodeURI(t).replace(Ht.percentDecode,"%")}catch{return null}return t}function xk(t,e){let a=t.replace(Ht.findPipe,(o,i,s)=>{let l=!1,u=i;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=a.split(Ht.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(Ht.slashPipe,"|");return n}function Au(t,e,a){let n=t.length;if(n===0)return"";let r=0;for(;r<n;){let o=t.charAt(n-r-1);if(o===e&&!a)r++;else if(o!==e&&a)r++;else break}return t.slice(0,n-r)}function XO(t,e){if(t.indexOf(e[1])===-1)return-1;let a=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])a++;else if(t[n]===e[1]&&(a--,a<0))return n;return a>0?-2:-1}function bk(t,e,a,n,r){let o=e.href,i=e.title||null,s=t[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function YO(t,e,a){let n=t.match(a.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
106
+ `).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
107
+ `)}var Kf=class{constructor(t){B(this,"options");B(this,"rules");B(this,"lexer");this.options=t||Ko}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let a=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?a:Au(a,`
108
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let a=e[0],n=YO(a,e[3]||"",this.rules);return{type:"code",raw:a,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let a=e[2].trim();if(this.rules.other.endingHash.test(a)){let n=Au(a,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(a=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Au(e[0],`
109
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let a=Au(e[0],`
110
+ `).split(`
111
+ `),n="",r="",o=[];for(;a.length>0;){let i=!1,s=[],l;for(l=0;l<a.length;l++)if(this.rules.other.blockquoteStart.test(a[l]))s.push(a[l]),i=!0;else if(!i)s.push(a[l]);else break;a=a.slice(l);let u=s.join(`
112
+ `),c=u.replace(this.rules.other.blockquoteSetextReplace,`
113
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
114
+ ${u}`:u,r=r?`${r}
115
+ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=d,a.length===0)break;let f=o.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let h=f,S=h.raw+`
116
+ `+a.join(`
117
+ `),x=this.blockquote(S);o[o.length-1]=x,n=n.substring(0,n.length-h.raw.length)+x.raw,r=r.substring(0,r.length-h.text.length)+x.text;break}else if(f?.type==="list"){let h=f,S=h.raw+`
118
+ `+a.join(`
119
+ `),x=this.list(S);o[o.length-1]=x,n=n.substring(0,n.length-f.raw.length)+x.raw,r=r.substring(0,r.length-h.raw.length)+x.raw,a=S.substring(o.at(-1).raw.length).split(`
120
+ `);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let a=e[1].trim(),n=a.length>1,r={type:"list",raw:"",ordered:n,start:n?+a.slice(0,-1):"",loose:!1,items:[]};a=n?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=n?a:"[*+-]");let o=this.rules.other.listItemRegex(a),i=!1;for(;t;){let l=!1,u="",c="";if(!(e=o.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let d=e[2].split(`
121
+ `,1)[0].replace(this.rules.other.listReplaceTabs,m=>" ".repeat(3*m.length)),f=t.split(`
122
+ `,1)[0],h=!d.trim(),S=0;if(this.options.pedantic?(S=2,c=d.trimStart()):h?S=e[1].length+1:(S=e[2].search(this.rules.other.nonSpaceChar),S=S>4?1:S,c=d.slice(S),S+=e[1].length),h&&this.rules.other.blankLine.test(f)&&(u+=f+`
123
+ `,t=t.substring(f.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(S),g=this.rules.other.hrRegex(S),v=this.rules.other.fencesBeginRegex(S),y=this.rules.other.headingBeginRegex(S),_=this.rules.other.htmlBeginRegex(S);for(;t;){let L=t.split(`
124
+ `,1)[0],C;if(f=L,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),C=f):C=f.replace(this.rules.other.tabCharGlobal," "),v.test(f)||y.test(f)||_.test(f)||m.test(f)||g.test(f))break;if(C.search(this.rules.other.nonSpaceChar)>=S||!f.trim())c+=`
125
+ `+C.slice(S);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(d)||y.test(d)||g.test(d))break;c+=`
126
+ `+f}!h&&!f.trim()&&(h=!0),u+=L+`
127
+ `,t=t.substring(L.length+1),d=C.slice(S)}}r.loose||(i?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0));let x=null,b;this.options.gfm&&(x=this.rules.other.listIsTask.exec(c),x&&(b=x[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!x,checked:b,loose:!1,text:c,tokens:[]}),r.raw+=u}let s=r.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l=0;l<r.items.length;l++)if(this.lexer.state.top=!1,r.items[l].tokens=this.lexer.blockTokens(r.items[l].text,[]),!r.loose){let u=r.items[l].tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=c}if(r.loose)for(let l=0;l<r.items.length;l++)r.items[l].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let a=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:a,raw:e[0],href:n,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let a=xk(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
128
+ `):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(a.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<a.length;i++)o.header.push({text:a[i],tokens:this.lexer.inline(a[i]),header:!0,align:o.align[i]});for(let i of r)o.rows.push(xk(i,o.header.length).map((s,l)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:o.align[l]})));return o}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let a=e[1].charAt(e[1].length-1)===`
129
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:a,tokens:this.lexer.inline(a)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let a=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let o=Au(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=XO(e[2],"()");if(o===-2)return;if(o>-1){let s=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?n=n.slice(1):n=n.slice(1,-1)),bk(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let a;if((a=this.rules.inline.reflink.exec(t))||(a=this.rules.inline.nolink.exec(t))){let n=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[n.toLowerCase()];if(!r){let o=a[0].charAt(0);return{type:"text",raw:o,text:o}}return bk(a,r,a[0],this.lexer,this.rules)}}emStrong(t,e,a=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!n||n[3]&&a.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!a||this.rules.inline.punctuation.exec(a)){let o=[...n[0]].length-1,i,s,l=o,u=0,c=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+o);(n=c.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(s=[...i].length,n[3]||n[4]){l+=s;continue}else if((n[5]||n[6])&&o%3&&!((o+s)%3)){u+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+u);let d=[...n[0]][0].length,f=t.slice(0,o+n.index+d+s);if(Math.min(o,s)%2){let S=f.slice(1,-1);return{type:"em",raw:f,text:S,tokens:this.lexer.inlineTokens(S)}}let h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let a=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(a),r=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return n&&r&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:e[0],text:a}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let a,n;return e[2]==="@"?(a=e[1],n="mailto:"+a):(a=e[1],n=a),{type:"link",raw:e[0],text:a,href:n,tokens:[{type:"text",raw:a,text:a}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let a,n;if(e[2]==="@")a=e[0],n="mailto:"+a;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);a=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:a,href:n,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let a=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:a}}}},Yn=class Cy{constructor(e){B(this,"tokens");B(this,"options");B(this,"state");B(this,"tokenizer");B(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ko,this.options.tokenizer=this.options.tokenizer||new Kf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let a={other:Ht,block:Wf.normal,inline:Iu.normal};this.options.pedantic?(a.block=Wf.pedantic,a.inline=Iu.pedantic):this.options.gfm&&(a.block=Wf.gfm,this.options.breaks?a.inline=Iu.breaks:a.inline=Iu.gfm),this.tokenizer.rules=a}static get rules(){return{block:Wf,inline:Iu}}static lex(e,a){return new Cy(a).lex(e)}static lexInline(e,a){return new Cy(a).inlineTokens(e)}lex(e){e=e.replace(Ht.carriageReturn,`
130
+ `),this.blockTokens(e,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let n=this.inlineQueue[a];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,a=[],n=!1){for(this.options.pedantic&&(e=e.replace(Ht.tabCharGlobal," ").replace(Ht.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(i=>(r=i.call({lexer:this},e,a))?(e=e.substring(r.raw.length),a.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let i=a.at(-1);r.raw.length===1&&i!==void 0?i.raw+=`
131
+ `:a.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=`
132
+ `+r.raw,i.text+=`
133
+ `+r.text,this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=`
134
+ `+r.raw,i.text+=`
135
+ `+r.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),a.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),a.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let i=1/0,s=e.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},s),typeof l=="number"&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(o=e.substring(0,i+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let i=a.at(-1);n&&i?.type==="paragraph"?(i.raw+=`
136
+ `+r.raw,i.text+=`
137
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r),n=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let i=a.at(-1);i?.type==="text"?(i.raw+=`
138
+ `+r.raw,i.text+=`
139
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(r);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,a}inline(e,a=[]){return this.inlineQueue.push({src:e,tokens:a}),a}inlineTokens(e,a=[]){let n=e,r=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,i="";for(;e;){o||(i=""),o=!1;let s;if(this.options.extensions?.inline?.some(u=>(s=u.call({lexer:this},e,a))?(e=e.substring(s.raw.length),a.push(s),!0):!1))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let u=a.at(-1);s.type==="text"&&u?.type==="text"?(u.raw+=s.raw,u.text+=s.text):a.push(s);continue}if(s=this.tokenizer.emStrong(e,n,i)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),a.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),a.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),a.push(s);continue}let l=e;if(this.options.extensions?.startInline){let u=1/0,c=e.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},c),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(s=this.tokenizer.inlineText(l)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(i=s.raw.slice(-1)),o=!0;let u=a.at(-1);u?.type==="text"?(u.raw+=s.raw,u.text+=s.text):a.push(s);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return a}},Qf=class{constructor(t){B(this,"options");B(this,"parser");this.options=t||Ko}space(t){return""}code({text:t,lang:e,escaped:a}){let n=(e||"").match(Ht.notSpaceStart)?.[0],r=t.replace(Ht.endingNewline,"")+`
140
+ `;return n?'<pre><code class="language-'+hn(n)+'">'+(a?r:hn(r,!0))+`</code></pre>
141
+ `:"<pre><code>"+(a?r:hn(r,!0))+`</code></pre>
142
+ `}blockquote({tokens:t}){return`<blockquote>
143
+ ${this.parser.parse(t)}</blockquote>
144
+ `}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
145
+ `}hr(t){return`<hr>
146
+ `}list(t){let e=t.ordered,a=t.start,n="";for(let i=0;i<t.items.length;i++){let s=t.items[i];n+=this.listitem(s)}let r=e?"ol":"ul",o=e&&a!==1?' start="'+a+'"':"";return"<"+r+o+`>
147
+ `+n+"</"+r+`>
148
+ `}listitem(t){let e="";if(t.task){let a=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=a+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=a+" "+hn(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:a+" ",text:a+" ",escaped:!0}):e+=a+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
149
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
150
+ `}table(t){let e="",a="";for(let r=0;r<t.header.length;r++)a+=this.tablecell(t.header[r]);e+=this.tablerow({text:a});let n="";for(let r=0;r<t.rows.length;r++){let o=t.rows[r];a="";for(let i=0;i<o.length;i++)a+=this.tablecell(o[i]);n+=this.tablerow({text:a})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
151
+ <thead>
152
+ `+e+`</thead>
153
+ `+n+`</table>
154
+ `}tablerow({text:t}){return`<tr>
155
+ ${t}</tr>
156
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),a=t.header?"th":"td";return(t.align?`<${a} align="${t.align}">`:`<${a}>`)+e+`</${a}>
157
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${hn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:a}){let n=this.parser.parseInline(a),r=yk(t);if(r===null)return n;t=r;let o='<a href="'+t+'"';return e&&(o+=' title="'+hn(e)+'"'),o+=">"+n+"</a>",o}image({href:t,title:e,text:a,tokens:n}){n&&(a=this.parser.parseInline(n,this.parser.textRenderer));let r=yk(t);if(r===null)return hn(a);t=r;let o=`<img src="${t}" alt="${a}"`;return e&&(o+=` title="${hn(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:hn(t.text)}},My=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Kn=class _y{constructor(e){B(this,"options");B(this,"renderer");B(this,"textRenderer");this.options=e||Ko,this.options.renderer=this.options.renderer||new Qf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new My}static parse(e,a){return new _y(a).parse(e)}static parseInline(e,a){return new _y(a).parseInline(e)}parse(e,a=!0){let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let s=o,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=l||"";continue}}let i=o;switch(i.type){case"space":{n+=this.renderer.space(i);continue}case"hr":{n+=this.renderer.hr(i);continue}case"heading":{n+=this.renderer.heading(i);continue}case"code":{n+=this.renderer.code(i);continue}case"table":{n+=this.renderer.table(i);continue}case"blockquote":{n+=this.renderer.blockquote(i);continue}case"list":{n+=this.renderer.list(i);continue}case"html":{n+=this.renderer.html(i);continue}case"paragraph":{n+=this.renderer.paragraph(i);continue}case"text":{let s=i,l=this.renderer.text(s);for(;r+1<e.length&&e[r+1].type==="text";)s=e[++r],l+=`
158
+ `+this.renderer.text(s);a?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):n+=l;continue}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,a=this.renderer){let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=s||"";continue}}let i=o;switch(i.type){case"escape":{n+=a.text(i);break}case"html":{n+=a.html(i);break}case"link":{n+=a.link(i);break}case"image":{n+=a.image(i);break}case"strong":{n+=a.strong(i);break}case"em":{n+=a.em(i);break}case"codespan":{n+=a.codespan(i);break}case"br":{n+=a.br(i);break}case"del":{n+=a.del(i);break}case"text":{n+=a.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},by,Xf=(by=class{constructor(t){B(this,"options");B(this,"block");this.options=t||Ko}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Yn.lex:Yn.lexInline}provideParser(){return this.block?Kn.parse:Kn.parseInline}},B(by,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),by),Dy=class{constructor(...t){B(this,"defaults",wy());B(this,"options",this.setOptions);B(this,"parse",this.parseMarkdown(!0));B(this,"parseInline",this.parseMarkdown(!1));B(this,"Parser",Kn);B(this,"Renderer",Qf);B(this,"TextRenderer",My);B(this,"Lexer",Yn);B(this,"Tokenizer",Kf);B(this,"Hooks",Xf);this.use(...t)}walkTokens(t,e){let a=[];for(let n of t)switch(a=a.concat(e.call(this,n)),n.type){case"table":{let r=n;for(let o of r.header)a=a.concat(this.walkTokens(o.tokens,e));for(let o of r.rows)for(let i of o)a=a.concat(this.walkTokens(i.tokens,e));break}case"list":{let r=n;a=a.concat(this.walkTokens(r.items,e));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(o=>{let i=r[o].flat(1/0);a=a.concat(this.walkTokens(i,e))}):r.tokens&&(a=a.concat(this.walkTokens(r.tokens,e)))}}return a}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(a=>{let n={...a};if(n.async=this.defaults.async||n.async||!1,a.extensions&&(a.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let o=e.renderers[r.name];o?e.renderers[r.name]=function(...i){let s=r.renderer.apply(this,i);return s===!1&&(s=o.apply(this,i)),s}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[r.level];o?o.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),a.renderer){let r=this.defaults.renderer||new Qf(this.defaults);for(let o in a.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,s=a.renderer[i],l=r[i];r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c||""}}n.renderer=r}if(a.tokenizer){let r=this.defaults.tokenizer||new Kf(this.defaults);for(let o in a.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,s=a.tokenizer[i],l=r[i];r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c}}n.tokenizer=r}if(a.hooks){let r=this.defaults.hooks||new Xf;for(let o in a.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,s=a.hooks[i],l=r[i];Xf.passThroughHooks.has(o)?r[i]=u=>{if(this.defaults.async)return Promise.resolve(s.call(r,u)).then(d=>l.call(r,d));let c=s.call(r,u);return l.call(r,c)}:r[i]=(...u)=>{let c=s.apply(r,u);return c===!1&&(c=l.apply(r,u)),c}}n.hooks=r}if(a.walkTokens){let r=this.defaults.walkTokens,o=a.walkTokens;n.walkTokens=function(i){let s=[];return s.push(o.call(this,i)),r&&(s=s.concat(r.call(this,i))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Yn.lex(t,e??this.defaults)}parser(t,e){return Kn.parse(t,e??this.defaults)}parseMarkdown(t){return(a,n)=>{let r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof a>"u"||a===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof a!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=t);let s=o.hooks?o.hooks.provideLexer():t?Yn.lex:Yn.lexInline,l=o.hooks?o.hooks.provideParser():t?Kn.parse:Kn.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(a):a).then(u=>s(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>l(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(i);try{o.hooks&&(a=o.hooks.preprocess(a));let u=s(a,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let c=l(u,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(u){return i(u)}}}onError(t,e){return a=>{if(a.message+=`
159
+ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+hn(a.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(a);throw a}}},Yo=new Dy;function Ee(t,e){return Yo.parse(t,e)}Ee.options=Ee.setOptions=function(t){return Yo.setOptions(t),Ee.defaults=Yo.defaults,Sk(Ee.defaults),Ee};Ee.getDefaults=wy;Ee.defaults=Ko;Ee.use=function(...t){return Yo.use(...t),Ee.defaults=Yo.defaults,Sk(Ee.defaults),Ee};Ee.walkTokens=function(t,e){return Yo.walkTokens(t,e)};Ee.parseInline=Yo.parseInline;Ee.Parser=Kn;Ee.parser=Kn.parse;Ee.Renderer=Qf;Ee.TextRenderer=My;Ee.Lexer=Yn;Ee.lexer=Yn.lex;Ee.Tokenizer=Kf;Ee.Hooks=Xf;Ee.parse=Ee;var Iz=Ee.options,Az=Ee.setOptions,Ez=Ee.use,Tz=Ee.walkTokens,Rz=Ee.parseInline;var Mz=Kn.parse,Dz=Yn.lex;var De=Y(Ye(),1),Oy=Y(qo(),1),KO=new Dy({async:!1,gfm:!0,breaks:!0});function Mk(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function QO(t){if(typeof t=="string")return(0,qe.jsx)("p",{style:{margin:0},children:t});if(t.type==="rich")return(0,qe.jsx)("div",{style:{margin:0},dangerouslySetInnerHTML:{__html:t.html}});let e=KO.parse(t.content);return(0,qe.jsx)("div",{style:{margin:0},"data-faq-markdown":"",dangerouslySetInnerHTML:{__html:e}})}function JO(t){return t?t===!0?{style:"thumbs"}:t:null}function eB(t){return t.prompt||"Was this helpful?"}var Mt={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"800px",margin:"0 auto"},searchWrapper:{marginBottom:"8px"},searchInput:{width:"100%",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",outline:"none",transition:"border-color 0.15s ease",backgroundColor:"var(--sc-content-search-background)",color:"var(--sc-content-search-color)"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.15s ease"},question:{width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",color:"var(--sc-content-chevron-color, currentColor)"},answer:{padding:"var(--sc-content-body-padding, 0 16px 12px 16px)",fontSize:"var(--sc-content-body-font-size, 14px)",lineHeight:1.6,overflow:"hidden",transition:"max-height 0.2s ease, padding 0.2s ease"},category:{display:"inline-block",fontSize:"11px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"4px 8px",borderRadius:"4px",marginBottom:"8px"},categoryHeader:{fontSize:"var(--sc-content-category-font-size, 12px)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)",marginTop:"var(--sc-content-category-gap, 4px)"},feedback:{display:"flex",alignItems:"center",gap:"8px",marginTop:"12px",paddingTop:"10px",borderTop:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"13px"},feedbackButton:{background:"none",border:"1px solid transparent",cursor:"pointer",fontSize:"16px",padding:"4px 8px",borderRadius:"4px",transition:"background-color 0.15s ease, border-color 0.15s ease"},feedbackButtonSelected:{borderColor:"rgba(0, 0, 0, 0.2)",backgroundColor:"rgba(0, 0, 0, 0.04)"},emptyState:{textAlign:"center",padding:"48px 24px",fontSize:"14px"},noResults:{textAlign:"center",padding:"32px 16px",fontSize:"14px"}},Ss={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${A[11]}`},item:{backgroundColor:"var(--sc-content-background)",borderTop:"var(--sc-content-border)",borderRight:"var(--sc-content-border)",borderBottom:"var(--sc-content-border)",borderLeft:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Nt[8],color:Nt[2]},categoryHeader:{color:A[7]},emptyState:{color:A[8]},feedbackPrompt:{color:A[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${A[5]}`},item:{backgroundColor:"var(--sc-content-background)",borderTop:"var(--sc-content-border)",borderRight:"var(--sc-content-border)",borderBottom:"var(--sc-content-border)",borderLeft:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},question:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},questionHover:{backgroundColor:"var(--sc-content-background-hover)"},answer:{color:"var(--sc-content-text-secondary-color)"},category:{backgroundColor:Nt[0],color:Nt[6]},categoryHeader:{color:A[8]},emptyState:{color:A[7]},feedbackPrompt:{color:A[8]}}};function tB({item:t,isExpanded:e,isHighlighted:a,isLast:n,onToggle:r,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,De.useState)(!1),d=Ss[o],{question:f,answer:h}=t.config,S={...Mt.item,...d.item,...e?d.itemExpanded:{},...a?{boxShadow:"0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",transition:"box-shadow 0.3s ease"}:{},...n?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},x={...Mt.question,...d.question,...u?d.questionHover:{}},b={...Mt.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},m={...Mt.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},g={...Mt.feedback,...d.feedbackPrompt};return(0,qe.jsxs)("div",{style:S,"data-faq-item-id":t.config.id,children:[(0,qe.jsxs)("button",{type:"button",style:x,onClick:r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-expanded":e,children:[(0,qe.jsx)("span",{children:f}),(0,qe.jsx)("span",{style:b,children:"\u203A"})]}),(0,qe.jsxs)("div",{style:m,"aria-hidden":!e,children:[QO(h),e&&i&&(0,qe.jsxs)("div",{style:g,children:[(0,qe.jsx)("span",{children:eB(i)}),(0,qe.jsx)("button",{type:"button",style:{...Mt.feedbackButton,...s==="up"?Mt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,f,"up"),children:"\u{1F44D}"}),(0,qe.jsx)("button",{type:"button",style:{...Mt.feedbackButton,...s==="down"?Mt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,f,"down"),children:"\u{1F44E}"})]})]})]})}function aB({config:t,runtime:e,instanceId:a}){let[n,r]=(0,De.useReducer)(T=>T+1,0),[o,i]=(0,De.useState)(new Set),[s,l]=(0,De.useState)(null),[u,c]=(0,De.useState)(""),[d,f]=(0,De.useState)(new Map),h=(0,De.useMemo)(()=>JO(t.feedback),[t.feedback]);(0,De.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,De.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]),(0,De.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let M=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(P=>{let F=P.props?.actionId;return typeof F=="string"&&F.startsWith("faq:open:")}).pop();if(M&&Date.now()-M.ts<1e4){let P=M.props.actionId.replace("faq:open:","");i(new Set([P])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${P}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},D=>{let M=D.props?.actionId;if(typeof M!="string"||!M.startsWith("faq:open:"))return;let P=M.replace("faq:open:","");i(new Set([P])),requestAnimationFrame(()=>{let F=document.querySelector(`[data-faq-item-id="${P}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,De.useEffect)(()=>{if(!e.events.subscribe)return;let T=M=>{let P=M.props?.tileId,F=M.props?.itemId;P===a&&F&&(i(new Set([F])),l(F),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let U=document.querySelector(`[data-faq-item-id="${F}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let P=e.events.getRecent({names:["notification.deep_link"]},5).filter(F=>F.props?.tileId===a&&F.props?.itemId).pop();P&&Date.now()-P.ts<1e4&&T(P)}return e.events.subscribe({names:["notification.deep_link"]},T)},[e,a]);let S=(0,De.useMemo)(()=>t.actions.filter(T=>T.triggerWhen?e.evaluateSync(T.triggerWhen).value:!0),[t.actions,e,n]),x=(0,De.useMemo)(()=>t.ordering==="priority"?[...S].sort((T,D)=>(D.config.priority??0)-(T.config.priority??0)):S,[S,t.ordering]),b=(0,De.useMemo)(()=>{if(!t.searchable||!u.trim())return x;let T=u.toLowerCase();return x.filter(D=>D.config.question.toLowerCase().includes(T)||Mk(D.config.answer).toLowerCase().includes(T)||D.config.category?.toLowerCase().includes(T))},[x,u,t.searchable]),m=(0,De.useMemo)(()=>{let T=new Map;for(let D of b){let M=D.config.category;T.has(M)||T.set(M,[]),T.get(M).push(D)}return T},[b]),g=(0,De.useMemo)(()=>b.some(T=>T.config.category),[b]),v=(0,De.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,De.useCallback)(T=>{i(D=>{let M=new Set(D);return t.expandBehavior==="single"?D.has(T)?new Set:new Set([T]):(D.has(T)?M.delete(T):M.add(T),M)}),e.events.publish("faq:toggled",{instanceId:a,questionId:T,expanded:!o.has(T),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),_=(0,De.useCallback)((T,D,M)=>{f(P=>{let F=new Map(P);return F.set(T,M),F}),e.events.publish("faq:feedback",{itemId:T,question:D,value:M})},[e.events]),L={...Mt.container,...Ss[v].container},C={...Mt.searchInput,...Ss[v].searchInput},I={...Mt.emptyState,...Ss[v].emptyState},w={...Mt.categoryHeader,...Ss[v].categoryHeader},k=T=>T.map((D,M)=>(0,qe.jsx)(tB,{item:D,isExpanded:o.has(D.config.id),isHighlighted:s===D.config.id,isLast:M===T.length-1,onToggle:()=>y(D.config.id),theme:v,feedbackConfig:h,feedbackValue:d.get(D.config.id),onFeedback:_},D.config.id));return S.length===0?(0,qe.jsx)("div",{style:L,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,qe.jsx)("div",{style:I,children:"You're all set for now! We'll surface answers here when they're relevant to what you're doing."})}):(0,qe.jsxs)("div",{style:L,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,qe.jsxs)("div",{style:Mt.searchWrapper,children:[(0,qe.jsx)("style",{children:`[data-adaptive-id="${a}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }`}),(0,qe.jsx)("input",{type:"text",placeholder:"Search questions...",value:u,onChange:T=>c(T.target.value),style:C})]}),(0,qe.jsx)("div",{style:Mt.accordion,children:g?Array.from(m.entries()).map(([T,D])=>(0,qe.jsxs)(De.default.Fragment,{children:[T&&(0,qe.jsx)("div",{style:w,"data-category-header":T,children:T}),k(D)]},T??"__ungrouped")):k(b)}),t.searchable&&b.length===0&&u&&(0,qe.jsxs)("div",{style:{...Mt.noResults,...Ss[v].emptyState},children:['No questions found matching "',u,'"']})]})}var Dk={mount(t,e){let{runtime:a,instanceId:n="faq-widget",...r}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof Oy.createRoot=="function"){let i=(0,Oy.createRoot)(t);return i.render(De.default.createElement(aB,{config:r,runtime:a,instanceId:n})),()=>{i.unmount()}}let o=r.actions||[];return t.innerHTML=`
105
160
  <div style="font-family: system-ui; max-width: 800px;">
106
161
  ${o.map(i=>`
107
162
  <div style="margin-bottom: 8px; padding: 16px; background: ${A[12]}; border-radius: 8px;">
108
163
  <strong>${i.config.question}</strong>
109
- <p style="margin-top: 8px; color: ${A[6]};">${LI(i.config.answer)}</p>
164
+ <p style="margin-top: 8px; color: ${A[6]};">${Mk(i.config.answer)}</p>
110
165
  </div>
111
166
  `).join("")}
112
167
  </div>
113
- `,()=>{t.innerHTML=""}}};var AI={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:wI,widgets:[{id:"adaptive-faq:accordion",component:II,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753",subtitle:"Curated just for you."}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`faq:${a.config.id}`,strategy:a.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:a.config.id,question:a.config.question,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var cD=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},dD=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},fD={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},pD=[{kind:"gamification:awardBadge",executor:cD},{kind:"gamification:addPoints",executor:dD}],hD=[fD],kI={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:pD,eventHandlers:hD};var _t=K(Me(),1);var st=K(We(),1),$v=K(Oo(),1);function Lf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Xa={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0,color:"var(--sc-content-chevron-color, currentColor)"},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"var(--sc-content-body-padding, 0 16px 12px 16px)"},description:{fontSize:"var(--sc-content-body-font-size, 14px)",lineHeight:"1.5",margin:0},linkButton:{display:"inline-flex",alignItems:"center",gap:"4px",marginTop:"10px",padding:"6px 12px",borderRadius:"6px",textDecoration:"none",fontSize:"13px",fontWeight:500,cursor:"pointer",border:"none",transition:"background-color 0.15s ease"},categoryHeader:{fontSize:"var(--sc-content-category-font-size, 12px)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},If={light:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:A[7]},emptyState:{color:A[8]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:A[8]},emptyState:{color:A[7]}}};function mD({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,theme:o}){let[i,s]=(0,st.useState)(!1),l=If[o],{title:u,description:c,href:d,icon:h,external:g}=t.config,S={...Xa.item,...l.item,...e?l.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},b={...Xa.header,...l.header,...i?l.headerHover:{}},x={...Xa.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},f={...Xa.body,...l.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m=v=>{v.preventDefault(),v.stopPropagation(),d&&n(d,g??!1)};return(0,_t.jsxs)("div",{style:S,"data-nav-tip-id":t.config.id,children:[(0,_t.jsxs)("button",{type:"button",style:b,onClick:r,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),"aria-expanded":e,children:[h&&(0,_t.jsx)("span",{style:Xa.icon,children:h}),(0,_t.jsx)("span",{children:u}),(0,_t.jsx)("span",{style:x,children:"\u203A"})]}),(0,_t.jsxs)("div",{style:f,"aria-hidden":!e,children:[(0,_t.jsx)("p",{style:Xa.description,children:c}),d&&(0,_t.jsxs)("a",{href:d,onClick:m,style:{...Xa.linkButton,...l.linkButton},target:g?"_blank":void 0,rel:g?"noopener noreferrer":void 0,children:["Go ",g?"\u2197":"\u2192"]})]})]})}function gD({config:t,runtime:e,instanceId:a}){let[r,n]=(0,st.useReducer)(f=>f+1,0),[o,i]=(0,st.useState)(new Set);(0,st.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,st.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]);let s=(0,st.useMemo)(()=>t.actions.filter(f=>{if(!f.triggerWhen)return!0;try{return e.evaluateSync(f.triggerWhen).value}catch{return!1}}),[t.actions,e,r]),l=(0,st.useMemo)(()=>{let f=new Map;for(let m of s){let v=m.config.category;f.has(v)||f.set(v,[]),f.get(v).push(m)}return f},[s]),u=(0,st.useMemo)(()=>s.some(f=>f.config.category),[s]),c=(0,st.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,st.useCallback)(f=>{i(m=>{let v=m.has(f),y;if(t.expandBehavior==="single"){for(let _ of m)_!==f&&e.events.publish("nav:toggled",{instanceId:a,tipId:_,expanded:!1,timestamp:Date.now()});y=v?new Set:new Set([f])}else y=new Set(m),v?y.delete(f):y.add(f);return e.events.publish("nav:toggled",{instanceId:a,tipId:f,expanded:!v,timestamp:Date.now()}),y})},[t.expandBehavior,e.events,a]),h=(0,st.useCallback)((f,m)=>{let v=f.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:f,external:m,timestamp:Date.now()}),m)window.open(f,"_blank","noopener,noreferrer");else{let y=new URL(f,window.location.origin);y.search=window.location.search,window.location.href=y.toString()}},[e.events,a]),g={...Xa.container,...If[c].container},S={...Xa.categoryHeader,...If[c].categoryHeader},b={...Xa.emptyState,...If[c].emptyState},x=f=>f.map((m,v)=>(0,_t.jsx)(mD,{item:m,isExpanded:o.has(m.config.id),isLast:v===f.length-1,onToggle:()=>d(m.config.id),onNavigate:h,theme:c},m.config.id));return s.length===0?(0,_t.jsx)("div",{style:g,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:b,children:"You're all set for now! We'll share helpful tips here when they're relevant to what you're doing."})}):(0,_t.jsx)("div",{style:g,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,_t.jsx)("div",{style:Xa.accordion,children:u?Array.from(l.entries()).map(([f,m])=>(0,_t.jsxs)(st.default.Fragment,{children:[f&&(0,_t.jsx)("div",{style:S,"data-category-header":f,children:f}),x(m)]},f??"__ungrouped")):x(s)})})}var EI={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof $v.createRoot=="function"){let i=(0,$v.createRoot)(t);return i.render(st.default.createElement(gD,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
168
+ `,()=>{t.innerHTML=""}}};var Ok={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:mk,widgets:[{id:"adaptive-faq:accordion",component:Dk,metadata:{name:"FAQ Accordion",description:"Collapsible Q&A accordion with search, categories, and feedback",icon:"\u2753",subtitle:"Curated just for you."}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`faq:${a.config.id}`,strategy:a.triggerWhen,eventName:"faq:question_revealed",eventProps:{questionId:a.config.id,question:a.config.question,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var nB=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},rB=async(t,e)=>{let{points:a,reason:n}=t;return e.publishEvent("gamification.points_added",{points:a,reason:n,timestamp:Date.now()}),{cleanup:()=>{}}},oB={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},iB=[{kind:"gamification:awardBadge",executor:nB},{kind:"gamification:addPoints",executor:rB}],sB=[oB],Bk={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:iB,eventHandlers:sB};var kt=Y(Ae(),1);var st=Y(Ye(),1),By=Y(qo(),1),lB={"\u{1F4B5}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="12" x="2" y="6" rx="2"/><circle cx="12" cy="12" r="2"/><path d="M6 12h.01M18 12h.01"/></svg>',"\u{1F3DB}\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" x2="21" y1="22" y2="22"/><line x1="6" x2="6" y1="18" y2="11"/><line x1="10" x2="10" y1="18" y2="11"/><line x1="14" x2="14" y1="18" y2="11"/><line x1="18" x2="18" y1="18" y2="11"/><polygon points="12 2 20 7 4 7"/></svg>',"\u23ED\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 4 15 12 5 20 5 4"/><line x1="19" x2="19" y1="5" y2="19"/></svg>',"\u27A1\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>',"\u{1F4A1}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/></svg>',"\u{1F4B0}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="20" height="12" x="2" y="6" rx="2"/><circle cx="12" cy="12" r="2"/><path d="M6 12h.01M18 12h.01"/></svg>',"\u{1F4CB}":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/></svg>',"\u2705":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/></svg>',"\u26A0\uFE0F":'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>'};function Fk(t){return lB[t]??tp(t)}function tp(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Qa={container:{fontFamily:"var(--sc-font-family, system-ui, -apple-system, sans-serif)",maxWidth:"100%",overflow:"hidden"},accordion:{display:"flex",flexDirection:"column",gap:"var(--sc-content-item-gap, 6px)"},item:{borderRadius:"var(--sc-content-border-radius, 8px)",overflow:"hidden",transition:"box-shadow 0.2s ease"},header:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"var(--sc-content-item-padding, 12px 16px)",border:"none",cursor:"pointer",fontSize:"var(--sc-content-item-font-size, 15px)",fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"background-color 0.15s ease"},chevron:{fontSize:"20px",transition:"transform 0.2s ease",marginLeft:"auto",flexShrink:0,color:"var(--sc-content-chevron-color, currentColor)"},icon:{fontSize:"16px",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, padding-bottom 0.25s ease",padding:"var(--sc-content-body-padding, 0 16px 12px 16px)"},description:{fontSize:"var(--sc-content-body-font-size, 14px)",lineHeight:"1.5",margin:0},linkButton:{display:"inline-flex",alignItems:"center",gap:"4px",marginTop:"10px",padding:"6px 12px",borderRadius:"6px",textDecoration:"none",fontSize:"13px",fontWeight:500,cursor:"pointer",border:"none",transition:"background-color 0.15s ease"},categoryHeader:{fontSize:"var(--sc-content-category-font-size, 12px)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"var(--sc-content-category-padding, 8px 4px 4px 4px)"},emptyState:{fontSize:"13px",padding:"16px",textAlign:"center"}},ap={light:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:A[7]},emptyState:{color:A[8]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},item:{backgroundColor:"var(--sc-content-background)",border:"var(--sc-content-border)"},itemExpanded:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},header:{backgroundColor:"transparent",color:"var(--sc-content-text-color)"},headerHover:{backgroundColor:"var(--sc-content-background-hover)"},body:{color:"var(--sc-content-text-secondary-color)"},linkButton:{backgroundColor:"var(--sc-color-primary, #6366f1)",color:"#ffffff"},categoryHeader:{color:A[8]},emptyState:{color:A[7]}}};function Pk(t){if(typeof window>"u")return!1;let e=window.location.pathname;return t.some(a=>{let n=a.split("?")[0].split("#")[0];return n.endsWith("/**")?e.startsWith(n.slice(0,-3)):e===n})}function uB(t){let e=[{boxShadow:"0 0 0 0 rgba(13, 148, 136, 0.5)"},{boxShadow:"0 0 0 8px rgba(13, 148, 136, 0)"}];t.animate(e,{duration:600,iterations:3,easing:"ease-out"})}function cB({item:t,isExpanded:e,isLast:a,onToggle:n,onNavigate:r,onFocusAnchor:o,theme:i}){let[s,l]=(0,st.useState)(!1),u=ap[i],{title:c,description:d,href:f,icon:h,external:S,anchor:x}=t.config,b={...Qa.item,...u.item,...e?u.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},m={...Qa.header,...u.header,...s?u.headerHover:{}},g={...Qa.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},v={...Qa.body,...u.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},y=x?Array.isArray(x.route)?x.route[0]:x.route:f,_=x?Pk(Array.isArray(x.route)?x.route:[x.route]):y?Pk([y]):!1,L=x?.selector&&x.selector!=="*",C=_&&L,I=!!y||C,w=T=>{T.preventDefault(),T.stopPropagation(),C&&x?o(x):y&&r(y,S??!1)},k=C?"Focus \u2192":S?"Go \u2197":"Go \u2192";return(0,kt.jsxs)("div",{style:b,"data-nav-tip-id":t.config.id,children:[(0,kt.jsxs)("button",{type:"button",style:m,onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[h&&(0,kt.jsx)("span",{style:Qa.icon,dangerouslySetInnerHTML:{__html:Fk(h)}}),(0,kt.jsx)("span",{children:c}),(0,kt.jsx)("span",{style:g,children:"\u203A"})]}),(0,kt.jsxs)("div",{style:v,"aria-hidden":!e,children:[(0,kt.jsx)("p",{style:Qa.description,children:d}),I&&(0,kt.jsx)("a",{href:y||"#",onClick:w,style:{...Qa.linkButton,...u.linkButton},target:S?"_blank":void 0,rel:S?"noopener noreferrer":void 0,children:k})]})]})}function dB({config:t,runtime:e,instanceId:a}){let[n,r]=(0,st.useReducer)(g=>g+1,0),[o,i]=(0,st.useState)(new Set);(0,st.useEffect)(()=>e.context.subscribe(()=>{r()}),[e.context]),(0,st.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{r()})},[e.accumulator]);let s=(0,st.useMemo)(()=>t.actions.filter(g=>{if(!g.triggerWhen)return!0;try{return e.evaluateSync(g.triggerWhen).value}catch{return!1}}),[t.actions,e,n]),l=(0,st.useMemo)(()=>{let g=new Map;for(let v of s){let y=v.config.category;g.has(y)||g.set(y,[]),g.get(y).push(v)}return g},[s]),u=(0,st.useMemo)(()=>s.some(g=>g.config.category),[s]),c=(0,st.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,st.useCallback)(g=>{i(v=>{let y=v.has(g),_;if(t.expandBehavior==="single"){for(let L of v)L!==g&&e.events.publish("nav:toggled",{instanceId:a,tipId:L,expanded:!1,timestamp:Date.now()});_=y?new Set:new Set([g])}else _=new Set(v),y?_.delete(g):_.add(g);return e.events.publish("nav:toggled",{instanceId:a,tipId:g,expanded:!y,timestamp:Date.now()}),_})},[t.expandBehavior,e.events,a]),f=(0,st.useCallback)((g,v)=>{let y=g.trim().toLowerCase();if(!(y.startsWith("javascript:")||y.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:g,external:v,timestamp:Date.now()}),v)window.open(g,"_blank","noopener,noreferrer");else{let _=new URL(g,window.location.origin);_.search=window.location.search,window.history.pushState(null,"",_.toString()),window.dispatchEvent(new PopStateEvent("popstate"))}},[e.events,a]),h=(0,st.useCallback)(g=>{let v=document.querySelector(g.selector);v instanceof HTMLElement&&(e.events.publish("nav:tip_focused",{instanceId:a,selector:g.selector,route:g.route,timestamp:Date.now()}),v.scrollIntoView({behavior:"smooth",block:"center"}),uB(v),setTimeout(()=>v.focus(),400))},[e.events,a]),S={...Qa.container,...ap[c].container},x={...Qa.categoryHeader,...ap[c].categoryHeader},b={...Qa.emptyState,...ap[c].emptyState},m=g=>g.map((v,y)=>(0,kt.jsx)(cB,{item:v,isExpanded:o.has(v.config.id),isLast:y===g.length-1,onToggle:()=>d(v.config.id),onNavigate:f,onFocusAnchor:h,theme:c},v.config.id));return s.length===0?(0,kt.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,kt.jsx)("div",{style:b,children:"You're all set for now! We'll share helpful tips here when they're relevant to what you're doing."})}):(0,kt.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,kt.jsx)("div",{style:Qa.accordion,children:u?Array.from(l.entries()).map(([g,v])=>(0,kt.jsxs)(st.default.Fragment,{children:[g&&(0,kt.jsx)("div",{style:x,"data-category-header":g,children:g}),m(v)]},g??"__ungrouped")):m(s)})})}var Nk={mount(t,e){let{runtime:a,instanceId:n="nav-widget",...r}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof By.createRoot=="function"){let i=(0,By.createRoot)(t);return i.render(st.default.createElement(dB,{config:r,runtime:a,instanceId:n})),()=>{i.unmount()}}let o=r.actions||[];return t.innerHTML=`
114
169
  <div style="font-family: system-ui; max-width: 100%;">
115
170
  ${o.map(i=>`
116
171
  <div style="margin-bottom: 4px; padding: 12px 16px; background: ${A[12]}; border-radius: 8px;">
117
- ${i.config.icon?`<span>${Lf(i.config.icon)}</span> `:""}<strong>${Lf(i.config.title)}</strong>
118
- <p style="margin-top: 8px; color: ${A[6]}; font-size: 13px;">${Lf(i.config.description)}</p>
119
- ${i.config.href?`<a href="${Lf(i.config.href)}" style="color: ${Ft[2]}; font-size: 13px;">Go &rarr;</a>`:""}
172
+ ${i.config.icon?`<span>${Fk(i.config.icon)}</span> `:""}<strong>${tp(i.config.title)}</strong>
173
+ <p style="margin-top: 8px; color: ${A[6]}; font-size: 13px;">${tp(i.config.description)}</p>
174
+ ${i.config.href?`<a href="${tp(i.config.href)}" style="color: ${Nt[2]}; font-size: 13px;">Go &rarr;</a>`:""}
120
175
  </div>
121
176
  `).join("")}
122
177
  </div>
123
- `,()=>{t.innerHTML=""}}};var vD=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);return a?(a.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}):(console.error(`[adaptive-nav] Anchor not found for scrollTo, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}})};function yD(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var xD=async(t,e)=>{let a=t.url.trim();if(a.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let r=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:r}),r==="_blank"?window.open(a,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&yD(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},bD=[{kind:"navigation:scrollTo",executor:vD},{kind:"navigation:navigate",executor:xD}],TI={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:bD,widgets:[{id:"adaptive-nav:tips",component:EI,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`nav:${a.config.id}`,strategy:a.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:a.config.id,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var SD=[CI,ef,AI,kI,TI,bf],CD=SD.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:a})=>({kind:e,executor:a})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function RI(t){let e=0;for(let a of CD)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var MI={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function DI(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...MI,...t};if(n&&document.querySelector(n))return()=>{};let i=document.createElement("style");i.textContent=`.${a} { ${r} }`,document.head.appendChild(i),document.documentElement.classList.add(a);let s=!1,l=()=>{s||(s=!0,clearTimeout(c),document.documentElement.classList.remove(a),i.remove(),o&&u&&document.removeEventListener(o,u))},u;o&&(u=()=>l(),document.addEventListener(o,u));let c=setTimeout(()=>{l()},e);return()=>{l()}}function OI(t={}){let{className:e,style:a}={...MI,...t};return`
178
+ `,()=>{t.innerHTML=""}}};var fB=async(t,e)=>{let a=e.resolveAnchor(t.anchorId);return a?(a.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}):(console.error(`[adaptive-nav] Anchor not found for scrollTo, skipping: ${t.anchorId.selector}`),{cleanup:()=>{}})};function pB(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var hB=async(t,e)=>{let a=t.url.trim();if(a.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let n=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:n}),n==="_blank"?window.open(a,"_blank","noopener,noreferrer"):!t.forceFullNavigation&&pB(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},mB=[{kind:"navigation:scrollTo",executor:fB},{kind:"navigation:navigate",executor:hB}],Hk={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:mB,widgets:[{id:"adaptive-nav:tips",component:Nk,metadata:{name:"Navigation Tips",description:"Accordion of contextual navigation tips with per-item visibility",icon:"\u{1F9ED}"}}],notifyWatchers(t){return(t.actions??[]).filter(a=>a.notify&&a.triggerWhen).map(a=>({id:`nav:${a.config.id}`,strategy:a.triggerWhen,eventName:"nav:tip_revealed",eventProps:{tipId:a.config.id,title:a.notify.title,body:a.notify.body,icon:a.notify.icon}}))}};var gB=[pk,wf,Ok,Bk,Hk,$f],vB=gB.map(t=>({id:t.id,version:t.version,name:t.name,description:t.description,runtime:{actions:(t.executors||[]).map(({kind:e,executor:a})=>({kind:e,executor:a})),widgets:t.widgets,notifyWatchers:t.notifyWatchers,events:t.eventHandlers},editor:void 0,metadata:{isBuiltIn:!0}}));function Uk(t){let e=0;for(let a of vB)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var zk={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function qk(t={}){let{timeout:e,className:a,style:n,hostLoadingSelector:r,waitForHostReady:o}={...zk,...t};if(r&&document.querySelector(r))return()=>{};let i=document.createElement("style");i.textContent=`.${a} { ${n} }`,document.head.appendChild(i),document.documentElement.classList.add(a);let s=!1,l=()=>{s||(s=!0,clearTimeout(c),document.documentElement.classList.remove(a),i.remove(),o&&u&&document.removeEventListener(o,u))},u;o&&(u=()=>l(),document.addEventListener(o,u));let c=setTimeout(()=>{l()},e);return()=>{l()}}function $k(t={}){let{className:e,style:a}={...zk,...t};return`
124
179
  (function() {
125
180
  var s = document.createElement('style');
126
181
  s.textContent = '.${e} { ${a} }';
127
182
  document.head.appendChild(s);
128
183
  document.documentElement.className += ' ${e}';
129
- })();`}function Af(t,e,a="first-match"){for(let r of e){let n=t.getFeatureValue?.(r,null);if(!n||typeof n!="object")continue;let o=n,i=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(i||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var jv=!1;function BI(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function Gv(t){if(BI()){jv=!0;return}jv=t??!1}function _D(){return BI()?!0:jv}function Y(t,e,a){_D()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function ma(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function kf(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var Ef="2.7.0";var jr="2.0";var wD=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function LD(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):wD.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function ID(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var FI="syntro_config_cache",AD=1440*60*1e3;function NI(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function kD(t,e){if(NI())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(FI,JSON.stringify(a))}catch{}}function ED(t){if(!NI())return null;try{let e=localStorage.getItem(FI);if(!e)return null;let a=JSON.parse(e);return!a.config||typeof a.timestamp!="number"||!a.sdkVersion||a.sdkVersion!==t||Date.now()-a.timestamp>AD?null:a.config}catch{return null}}var Tf=({configUri:t,experiments:e,featureKey:a="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(a,null);if(r)return r};function TD(t,e,a){if(e){let r=t.getFeatureValue?.(e,null);if(r&&typeof r=="object"){let n=r.variant_flags;if(n&&n.length>0)return n}}if(t.getAllFeatures){let r=t.getAllFeatures();return a?Object.keys(r).filter(n=>n.startsWith(a)):Object.keys(r)}return[]}var zo=({configUri:t,experiments:e,featureKey:a,credentials:r,configFeatureKey:n="smart-canvas-config",manifestKey:o,variantFlagPrefix:i,sdkVersion:s})=>async()=>{if(e&&n){let c=e.getFeatureValue?.(n,null);if(c&&typeof c=="object")return Y("SmartCanvas Config","Resolved config directly from feature flag",c),c}if(e&&(o||i||e.getAllFeatures)){let c=TD(e,o,i);if(c.length>0){let d=Af(e,c);if(d)return Y("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=Tf({configUri:t,experiments:e,featureKey:a});if(!l)return Y("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!LD(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(ID(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":Ef,"X-SDK-Schema-Version":jr}});if(!c.ok)throw new Error(`SmartCanvas: failed to fetch config (${c.status})`);let d=await c.json();return Y("SmartCanvas Config","Fetched config from URI",d),s&&kD(d,s),d}catch(c){if(s){let d=ED(s);if(d)return Y("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var RD=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function PI(t){if(typeof window>"u")return null;let a=new URLSearchParams(window.location.search).get(t);if(!a)return null;try{let r=a.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(r))}catch(r){return ma("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var fs,ps;function vu(){if(fs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)fs={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${fs.token.slice(0,15)}...)`);else{let e=PI("editor_source");e&&(fs=e),console.log(`[DIAG] getEditorSource: from URL param \u2192 ${e?`token=${e.token?.slice(0,15)}...`:"NULL"}`),!e&&typeof window<"u"&&console.log(`[DIAG] getEditorSource: URL search = ${window.location.search.slice(0,200)}`)}}return fs??null}function Rf(){if(ps==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)ps={mode:t.mode,audit_session_id:t.auditSessionId,syntro_token:t.syntroToken,workspace_id:t.workspaceId},console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${ps.mode})`);else{let e=PI("editor_conf");e&&(ps=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return ps??null}function MD(t){Y("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return Y("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(ma("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):RD.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(Y("Syntro Runtime","\u2713 Editor URL validated"),!0):(ma("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ma("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var Mf=()=>{let t=Rf();return!vu()?.token||!t?.mode?null:t.mode};function DD(){return vu()?.token??null}function OD(){return vu()?.api_base??null}var gu=null,HI=async t=>{if(Y("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){Y("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){Y("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(gu)return Y("Syntro Runtime","Editor SDK load already in progress, waiting..."),gu;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){Y("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),Y("Syntro Runtime","================================");return}let a=OD(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){ma("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),Y("Syntro Runtime","================================");return}let o=DD();if(!o){ma("Syntro Runtime","\u274C No token found in editor_source."),Y("Syntro Runtime","================================");return}let i=`${n}?token=${encodeURIComponent(o)}`;if(Y("Syntro Runtime","Editor URL:",i),Y("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!n,hasApiBase:!!a,tokenPrefix:`${o.slice(0,10)}...`}),!MD(n)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",n),Y("Syntro Runtime","================================");return}return Y("Syntro Runtime","\u2713 URL validated, injecting script tag..."),gu=new Promise((s,l)=>{let u=document.createElement("script");u.src=i,u.async=!0,e.integrity&&(u.integrity=e.integrity,u.crossOrigin="anonymous",Y("Syntro Runtime","SRI integrity check enabled")),u.onload=()=>{Y("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),Y("Syntro Runtime","================================"),s()},u.onerror=c=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",c),console.error("[Syntro Runtime] URL attempted:",i),Y("Syntro Runtime","================================"),gu=null,l(c)},document.head.appendChild(u),Y("Syntro Runtime","Script tag appended to <head>")}),gu};var BD=new Set(["tag_name","$el_text"]);function FD(t){return BD.has(t)||t.startsWith("attr__")}function UI(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function ND(t){let{events:e,match:a}=t;return r=>{if(!e.includes(r.name))return!1;if(a){for(let[n,o]of Object.entries(a))if(FD(n)){let i=r.props?.elements;if(!i||!i.some(l=>UI(o,l[n])))return!1}else if(!UI(o,r.props?.[n]))return!1}return!0}}function qI(t,e){for(let a of t.rules)for(let r of a.conditions)if(r.type==="event_count"&&r.key){let n=r.counter,o=n?ND(n):()=>!0;e.register(r.key,o)}}function yu(t,e,a){for(let r of t){let n=r.props;if(!n)continue;let o=n.actions;if(o)for(let i of o)i.triggerWhen?.type==="rules"&&qI(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&qI(n.triggerWhen,e)}}var cr=null;function VI(t){cr&&cr!==t?t.appendChild(cr):cr=t;let e=t.getRootNode();e instanceof ShadowRoot&&PD(e)}function $I(){return cr||(cr=document.createElement("div"),cr.id="syntro-overlays",Object.assign(cr.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(cr)),cr}var zI=!1;function PD(t){if(zI)return;let e=`
184
+ })();`}function np(t,e,a="first-match"){for(let n of e){let r=t.getFeatureValue?.(n,null);if(!r||typeof r!="object")continue;let o=r,i=o.tiles&&o.tiles.length>0,s=o.actions&&o.actions.length>0;if(i||s)return{tiles:o.tiles??[],actions:o.actions??[],fetchedAt:o.fetchedAt??new Date().toISOString(),...o.schemaVersion&&{schemaVersion:o.schemaVersion},...o.configVersion&&{configVersion:o.configVersion},...o.canvasTitle&&{canvasTitle:o.canvasTitle},...o.theme&&{theme:o.theme},...o.launcher&&{launcher:o.launcher}}}return null}var Py=!1;function Vk(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function Fy(t){if(Vk()){Py=!0;return}Py=t??!1}function yB(){return Vk()?!0:Py}function K(t,e,a){yB()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function ya(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function rp(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var op="2.8.0-canary.10";var Qn="2.0";var xB=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function bB(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):xB.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function SB(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var jk="syntro_config_cache",CB=1440*60*1e3;function Gk(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function _B(t,e){if(Gk())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(jk,JSON.stringify(a))}catch{}}function wB(t){if(!Gk())return null;try{let e=localStorage.getItem(jk);if(!e)return null;let a=JSON.parse(e);return!a.config||typeof a.timestamp!="number"||!a.sdkVersion||a.sdkVersion!==t||Date.now()-a.timestamp>CB?null:a.config}catch{return null}}var ip=({configUri:t,experiments:e,featureKey:a="smart-canvas-config-uri"})=>{if(t)return t;let n=e?.getFeatureValue?.(a,null);if(n)return n};function LB(t,e,a){if(e){let n=t.getFeatureValue?.(e,null);if(n&&typeof n=="object"){let r=n.variant_flags;if(r&&r.length>0)return r}}if(t.getAllFeatures){let n=t.getAllFeatures();return a?Object.keys(n).filter(r=>r.startsWith(a)):Object.keys(n)}return[]}var Qo=({configUri:t,experiments:e,featureKey:a,credentials:n,configFeatureKey:r="smart-canvas-config",manifestKey:o,variantFlagPrefix:i,sdkVersion:s})=>async()=>{if(e&&r){let c=e.getFeatureValue?.(r,null);if(c&&typeof c=="object")return K("SmartCanvas Config","Resolved config directly from feature flag",c),c}if(e&&(o||i||e.getAllFeatures)){let c=LB(e,o,i);if(c.length>0){let d=np(e,c);if(d)return K("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=ip({configUri:t,experiments:e,featureKey:a});if(!l)return K("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],actions:[],fetchedAt:new Date().toISOString()};if(!bB(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=n??(SB(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":op,"X-SDK-Schema-Version":Qn}});if(!c.ok)throw new Error(`SmartCanvas: failed to fetch config (${c.status})`);let d=await c.json();return K("SmartCanvas Config","Fetched config from URI",d),s&&_B(d,s),d}catch(c){if(s){let d=wB(s);if(d)return K("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var kB=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function Zk(t){if(typeof window>"u")return null;let a=new URLSearchParams(window.location.search).get(t);if(!a)return null;try{let n=a.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(n))}catch(n){return ya("Syntro Runtime",`Failed to decode ${t}:`,n),null}}var Cs,_s;function Mu(){if(Cs==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)Cs={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${Cs.token.slice(0,15)}...)`);else{let e=Zk("editor_source");e&&(Cs=e),console.log(`[DIAG] getEditorSource: from URL param \u2192 ${e?`token=${e.token?.slice(0,15)}...`:"NULL"}`),!e&&typeof window<"u"&&console.log(`[DIAG] getEditorSource: URL search = ${window.location.search.slice(0,200)}`)}}return Cs??null}function sp(){if(_s==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)_s={mode:t.mode,audit_session_id:t.auditSessionId,syntro_token:t.syntroToken,workspace_id:t.workspaceId},console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${_s.mode})`);else{let e=Zk("editor_conf");e&&(_s=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return _s??null}function IB(t){K("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return K("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(ya("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):kB.some(r=>r.startsWith(".")?e.hostname.endsWith(r)||e.hostname===r.slice(1):e.hostname===r)?(K("Syntro Runtime","\u2713 Editor URL validated"),!0):(ya("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ya("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var lp=()=>{let t=sp();return!Mu()?.token||!t?.mode?null:t.mode};function AB(){return Mu()?.token??null}function EB(){return Mu()?.api_base??null}var Ru=null,Wk=async t=>{if(K("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){K("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){K("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}if(Ru)return K("Syntro Runtime","Editor SDK load already in progress, waiting..."),Ru;let e=typeof t=="string"?{editorUrl:t}:t??{};if(e.editorUrl==="skip"){K("Syntro Runtime",'editorUrl="skip" \u2014 deferring to caller'),K("Syntro Runtime","================================");return}let a=EB(),r=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!r){ya("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),K("Syntro Runtime","================================");return}let o=AB();if(!o){ya("Syntro Runtime","\u274C No token found in editor_source."),K("Syntro Runtime","================================");return}let i=`${r}?token=${encodeURIComponent(o)}`;if(K("Syntro Runtime","Editor URL:",i),K("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!r,hasApiBase:!!a,tokenPrefix:`${o.slice(0,10)}...`}),!IB(r)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",r),K("Syntro Runtime","================================");return}return K("Syntro Runtime","\u2713 URL validated, injecting script tag..."),Ru=new Promise((s,l)=>{let u=document.createElement("script");u.src=i,u.async=!0,e.integrity&&(u.integrity=e.integrity,u.crossOrigin="anonymous",K("Syntro Runtime","SRI integrity check enabled")),u.onload=()=>{K("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),K("Syntro Runtime","================================"),s()},u.onerror=c=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",c),console.error("[Syntro Runtime] URL attempted:",i),K("Syntro Runtime","================================"),Ru=null,l(c)},document.head.appendChild(u),K("Syntro Runtime","Script tag appended to <head>")}),Ru};var TB=new Set(["tag_name","$el_text"]);function RB(t){return TB.has(t)||t.startsWith("attr__")}function Xk(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function MB(t){let{events:e,match:a}=t;return n=>{if(!e.includes(n.name))return!1;if(a){for(let[r,o]of Object.entries(a))if(RB(r)){let i=n.props?.elements;if(!i||!i.some(l=>Xk(o,l[r])))return!1}else if(!Xk(o,n.props?.[r]))return!1}return!0}}function Yk(t,e){for(let a of t.rules)for(let n of a.conditions)if(n.type==="event_count"&&n.key){let r=n.counter,o=r?MB(r):()=>!0,i=typeof n.withinMs=="number";e.register(n.key,o,i)}}function Du(t,e,a){for(let n of t){let r=n.props;if(!r)continue;let o=r.actions;if(o)for(let i of o)i.triggerWhen?.type==="rules"&&Yk(i.triggerWhen,e)}if(a)for(let n of a){let r=n;r.triggerWhen?.type==="rules"&&Yk(r.triggerWhen,e)}}var mn=null;function Qk(t){mn&&mn!==t?t.appendChild(mn):mn=t;let e=t.getRootNode();e instanceof ShadowRoot&&DB(e)}function Jk(){return mn||(mn=document.createElement("div"),mn.id="syntro-overlays",Object.assign(mn.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(mn)),mn}var Kk=!1;function DB(t){if(Kk)return;let e=`
130
185
  :host {
131
186
  --syntro-surface: var(--sc-overlay-background, #0f1318);
132
187
  --syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
@@ -388,7 +443,7 @@ Error generating stack: `+r.message+`
388
443
  .syntro-modal-btn-primary:hover {
389
444
  background: var(--syntro-accent-hover, #d44844);
390
445
  }
391
- `,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),zI=!0}var p1=K(Oo(),1);var Df=class{constructor(e){j(this,"state");j(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let r=sessionStorage?.getItem("syntro:editor:panel-open");r!==null&&(a=JSON.parse(r))}catch{}this.state={open:a}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},Wv=t=>new Df(t);var Of=K(We(),1),GI=K(Me(),1),jI=(0,Of.createContext)(null);function Zv({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,GI.jsx)(jI.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function Vo(){let t=(0,Of.useContext)(jI);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Pt=K(We(),1);var lt=K(We(),1),oy=K(ol(),1);var be={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",NOTIFICATION_SHOWN:"notification.shown",NOTIFICATION_CLICKED:"notification.clicked",NOTIFICATION_DISMISSED:"notification.dismissed",NOTIFICATION_DEEP_LINK:"notification.deep_link",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},$o="1.0.0";function Ya(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:$o}}function HD(t){return Ya(be.CANVAS_OPENED,{surface:t})}function UD(t){return Ya(be.CANVAS_CLOSED,{surface:t})}function qD(t,e){return Ya(be.TILE_VIEWED,{tileId:t,surface:e})}function zD(t,e){return Ya(be.TILE_EXPANDED,{tileId:t,surface:e})}function VD(t,e){return Ya(be.TILE_COLLAPSED,{tileId:t,surface:e})}function $D(t,e,a){return Ya(be.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function jD(t,e){return Ya(be.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function GD(t,e){return Ya(be.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function WD(t,e,a){return Ya(be.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function ZD(t,e,a){return Ya(be.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function XD(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ya(a,e)}var hs={canvasOpened:HD,canvasClosed:UD,tileViewed:qD,tileExpanded:zD,tileCollapsed:VD,tileAction:$D,overlayStarted:jD,overlayCompleted:GD,overlayDismissed:WD,overlayStepViewed:ZD,custom:XD};var Ma=K(Me(),1),WI="syntro-toast-styles",YD=`
446
+ `,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),Kk=!0}var _I=Y(qo(),1);var up=class{constructor(e){B(this,"state");B(this,"listeners",new Set);let a=e?.open??!1;if(e?.open===void 0)try{let n=sessionStorage?.getItem("syntro:editor:panel-open");n!==null&&(a=JSON.parse(n))}catch{}this.state={open:a}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){if(this.state.open!==e){this.state={...this.state,open:e};try{sessionStorage?.setItem("syntro:editor:panel-open",JSON.stringify(e))}catch{}this.emit()}}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},Ny=t=>new up(t);var cp=Y(Ye(),1),tI=Y(Ae(),1),eI=(0,cp.createContext)(null);function Hy({shadowRoot:t,portalRoot:e,overlayContainer:a,children:n}){return(0,tI.jsx)(eI.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:n})}function Jo(){let t=(0,cp.useContext)(eI);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var zt=Y(Ye(),1);var dt=Y(Ye(),1),Yy=Y(gl(),1);var Ce={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",NOTIFICATION_SHOWN:"notification.shown",NOTIFICATION_CLICKED:"notification.clicked",NOTIFICATION_DISMISSED:"notification.dismissed",NOTIFICATION_DEEP_LINK:"notification.deep_link",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ei="1.0.0";function Ja(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ei}}function OB(t){return Ja(Ce.CANVAS_OPENED,{surface:t})}function BB(t){return Ja(Ce.CANVAS_CLOSED,{surface:t})}function PB(t,e){return Ja(Ce.TILE_VIEWED,{tileId:t,surface:e})}function FB(t,e){return Ja(Ce.TILE_EXPANDED,{tileId:t,surface:e})}function NB(t,e){return Ja(Ce.TILE_COLLAPSED,{tileId:t,surface:e})}function HB(t,e,a){return Ja(Ce.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function UB(t,e){return Ja(Ce.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function zB(t,e){return Ja(Ce.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function qB(t,e,a){return Ja(Ce.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function $B(t,e,a){return Ja(Ce.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function VB(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ja(a,e)}var ws={canvasOpened:OB,canvasClosed:BB,tileViewed:PB,tileExpanded:FB,tileCollapsed:NB,tileAction:HB,overlayStarted:UB,overlayCompleted:zB,overlayDismissed:qB,overlayStepViewed:$B,custom:VB};var fp=Y(Ye());var dp=(...t)=>t.filter((e,a,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===a).join(" ").trim();var aI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var nI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,n)=>n?n.toUpperCase():a.toLowerCase());var Uy=t=>{let e=nI(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Ou=Y(Ye());var rI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var oI=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var iI=(0,Ou.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...s},l)=>(0,Ou.createElement)("svg",{ref:l,...rI,width:e,height:e,stroke:t,strokeWidth:n?Number(a)*24/Number(e):a,className:dp("lucide",r),...!o&&!oI(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,Ou.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var ue=(t,e)=>{let a=(0,fp.forwardRef)(({className:n,...r},o)=>(0,fp.createElement)(iI,{ref:o,iconNode:e,className:dp(`lucide-${aI(Uy(t))}`,`lucide-${t}`,n),...r}));return a.displayName=Uy(t),a};var jB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Bu=ue("arrow-right",jB);var GB=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Ls=ue("banknote",GB);var ZB=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Pu=ue("bell",ZB);var WB=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Fu=ue("book-open",WB);var XB=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Yr=ue("circle-check-big",XB);var YB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],en=ue("circle-question-mark",YB);var KB=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Nu=ue("clipboard-list",KB);var QB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],Hu=ue("compass",QB);var JB=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Uu=ue("file-text",JB);var eP=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],zu=ue("gamepad-2",eP);var tP=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],qu=ue("landmark",tP);var aP=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kr=ue("layers",aP);var nP=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],$u=ue("lightbulb",nP);var rP=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Vu=ue("message-circle",rP);var oP=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],ju=ue("skip-forward",oP);var iP=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Qr=ue("sparkles",iP);var sP=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Gu=ue("timer",sP);var lP=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Jr=ue("triangle-alert",lP);var uP=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Zu=ue("trophy",uP);var zy=Y(Ae(),1),cP={"\u2753":en,"\u{1F9ED}":Hu,"\u{1F4DD}":Uu,"\u{1F3AF}":Kr,"\u{1F3C6}":Zu,"\u2728":Qr,"\u{1F4AC}":Vu,"\u{1F3AE}":zu,"\u{1F4A1}":$u,"\u{1F4B0}":Ls,"\u{1F4CB}":Nu,"\u2705":Yr,"\u26A0\uFE0F":Jr,"\u{1F4B5}":Ls,"\u{1F3DB}\uFE0F":qu,"\u23ED\uFE0F":ju,"\u27A1\uFE0F":Bu,"\u23F1\uFE0F":Gu,"\u{1F4D6}":Fu,"\u{1F514}":Pu};function pp({emoji:t,size:e=14,color:a="currentColor"}){let n=cP[t];return n?(0,zy.jsx)(n,{size:e,color:a}):(0,zy.jsx)("span",{children:t})}var xa=Y(Ae(),1),sI="syntro-toast-styles",dP=`
392
447
  @keyframes syntro-toast-slide-in {
393
448
  from { opacity: 0; transform: translateY(12px); }
394
449
  to { opacity: 1; transform: translateY(0); }
@@ -406,10 +461,10 @@ Error generating stack: `+r.message+`
406
461
  .syntro-toast-progress.paused {
407
462
  animation-play-state: paused;
408
463
  }
409
- `;function KD(t){if(t.querySelector(`#${WI}`))return;let e=document.createElement("style");e.id=WI,e.textContent=YD,t.appendChild(e)}function Bf({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=Vo();return KD(n),t.length===0?null:(0,Ma.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[r==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,Ma.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:i=>{i.currentTarget.style.transform="translateY(-1px)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:i=>{i.currentTarget.style.transform="translateY(0)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,Ma.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Ma.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"8px",background:"var(--sc-notification-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"14px"},children:o.icon??"\u{1F514}"}),(0,Ma.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ma.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--sc-notification-text-color)",lineHeight:"1.3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.title}),o.body&&(0,Ma.jsx)("div",{style:{fontSize:"12px",color:"var(--sc-notification-text-secondary-color)",lineHeight:"1.3",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.body})]}),(0,Ma.jsx)("button",{type:"button",onClick:i=>{i.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,Ma.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Ma.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Ka=K(We(),1);var Ff=3,Nf=8e3,Pf=3e4;var QD=0;function xu(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function JD(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Hf(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!JD(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++QD}-${o}`,title:xu(n.title,t.props),body:n.body?xu(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?xu(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function Uf(t,e){let[a,r]=(0,Ka.useState)([]),n=(0,Ka.useRef)(new Map),o=(0,Ka.useRef)(new Map),i=(0,Ka.useCallback)(u=>{t?.publish(be.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,Ka.useCallback)(u=>{let c=setTimeout(()=>{r(d=>d.filter(h=>h.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,Ka.useCallback)(u=>{r(d=>{let h=d.find(g=>g.id===u);return h&&i(h),d.filter(g=>g.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,Ka.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Hf(c,e);if(!d)return;let{notification:h,rule:g}=d,S=h.itemId?`${h.tileId}:${c.name}:${h.itemId}`:`${h.tileId}:${c.name}`,b=n.current.get(S),x=Date.now(),f=g.cooldown??3e4;b!==void 0&&x-b<f||(n.current.set(S,x),r(m=>{if(h.itemId&&m.some(_=>_.tileId===h.tileId&&_.itemId===h.itemId))return m;let v=[...m,h];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(be.NOTIFICATION_SHOWN,{notificationId:h.id,tileId:h.tileId,itemId:h.itemId,title:h.title}),s(h))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var qf=K(We(),1);function eO(t,e){let a=[];for(let r of t){let n=r.widget.split(":")[0],i=e.get(n)?.manifest.runtime?.notifyWatchers;i&&a.push(...i(r.props??{}))}return a}function zf(t,e,a){let r=(0,qf.useRef)(new Map);(0,qf.useEffect)(()=>{if(!t?.events||!a)return;let n=eO(e,a);if(n.length===0)return;let o=t.state.ns("notified");for(let s of n)if(!r.current.has(s.id)){let l=t.evaluateSync(s.strategy);r.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of n){let l=t.evaluateSync(s.strategy),u=r.current.get(s.id)??!1;r.current.set(s.id,l.value),!u&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):u&&!l.value&&o.remove(s.id)}})},[t,e,a])}var Yt=K(We(),1),JI=K(Me(),1),Xv=(0,Yt.createContext)({runtime:null,context:null});function Vf({runtime:t,children:e}){let[a,r]=(0,Yt.useState)(t?t.context.get():null);(0,Yt.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,Yt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,JI.jsx)(Xv.Provider,{value:n,children:e})}function dr(){let{runtime:t}=(0,Yt.useContext)(Xv);return t}function bu(){let{context:t}=(0,Yt.useContext)(Xv);return t}function $f(){return bu()?.page??null}function ZI(){return bu()?.session??null}function XI(){return bu()?.viewport??null}function YI(t,e,a=[]){let r=dr();(0,Yt.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function KI(){return dr()?.state??null}function QI(t,e){let a=dr(),[r,n]=(0,Yt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Yt.useEffect)(()=>{if(!a||!t){n({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||n({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),r}function ae(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var tO={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:ae(A[1],.95),colorBackgroundElevated:ae(A[3],.95),colorBackgroundSubtle:ae(A[0],.2),colorSurface:ae(A[4],.8),colorSurfaceHover:ae(A[5],.8),colorText:pa.primary,colorTextSecondary:pa.secondary,colorTextMuted:pa.tertiary,colorTextInverse:A[1],colorBorder:Rv.primary,colorBorderSubtle:Rv.secondary,colorSuccess:ke[4],colorSuccessMuted:ke[0],colorWarning:Ct[4],colorWarningMuted:Ct[0],colorError:ze[4],colorErrorMuted:ze[0],colorInfo:fa[4],colorInfoMuted:fa[0],colorNotification:ne[4],colorNotificationMuted:ae(ne[4],.4),glassBackground:ae(A[1],.6),glassBackgroundHover:ae(A[1],.7),glassBorder:"rgba(255, 255, 255, 0.08)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.2)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.3)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.4)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.5)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"},aO={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:ae(ne[5],.1),colorBackground:ae(A[12],.95),colorBackgroundElevated:ae(A[11],.95),colorBackgroundSubtle:ae(A[0],.02),colorSurface:ae(A[11],.6),colorSurfaceHover:ae(A[10],.6),colorText:A[1],colorTextSecondary:A[6],colorTextMuted:A[8],colorTextInverse:A[12],colorBorder:ae(A[0],.12),colorBorderSubtle:ae(A[0],.06),colorSuccess:ke[4],colorSuccessMuted:ae(ke[4],.12),colorWarning:Ct[4],colorWarningMuted:ae(Ct[4],.12),colorError:ze[4],colorErrorMuted:ae(ze[4],.12),colorInfo:fa[4],colorInfoMuted:ae(fa[4],.12),colorNotification:ne[3],colorNotificationMuted:ae(ne[3],.4),glassBackground:ae(A[12],.7),glassBackgroundHover:ae(A[12],.8),glassBorder:"rgba(0, 0, 0, 0.06)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.08)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.12)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.16)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.2)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"};function rO(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Yv={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ae(A[1],.6),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:rf.primary.backgroundDefault,backgroundHover:rf.primary.backgroundHover,color:rf.primary.icon,size:"56px",shadow:`0 8px 32px ${ae(A[0],.6)}`,borderRadius:"9999px"},tile:{background:ae(A[1],.6),backgroundHover:ae(A[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:pa.primary,textColor:pa.secondary,iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(A[1],.6),textColor:pa.primary,titleColor:pa.primary,arrowColor:ae(A[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:ae(A[0],.95),textColor:pa.primary,textSecondaryColor:pa.secondary,border:`1px solid ${A[5]}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:ae(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`},content:{background:ae(A[3],.8),backgroundHover:ae(A[5],.6),border:`1px solid ${ae(A[5],.5)}`,borderRadius:"8px",textColor:pa.primary,textSecondaryColor:pa.secondary,itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:ae(A[3],.8),searchColor:pa.primary,chevronColor:"currentColor"}},Kv={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:ne[3],colorPrimaryHover:ne[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ae(A[12],.7),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:ne[3],backgroundHover:ne[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:ae(A[12],.7),backgroundHover:ae(A[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:A[1],textColor:A[6],iconBackground:`linear-gradient(135deg, ${ne[3]} 0%, ${ne[3]}cc 100%)`,iconShadow:`0 2px 8px ${ne[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(A[12],.7),textColor:A[1],titleColor:A[1],arrowColor:ae(A[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:ae(A[12],.95),textColor:A[1],textSecondaryColor:A[6],border:`1px solid ${ae(A[0],.12)}`,borderRadius:"12px",successColor:ke[4],warningColor:Ct[4],errorColor:ze[4],iconBackground:ae(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`},content:{background:ae(A[12],.8),backgroundHover:ae(A[11],.6),border:`1px solid ${A[11]}`,borderRadius:"8px",textColor:A[1],textSecondaryColor:A[6],itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:A[12],searchColor:A[1],chevronColor:"currentColor"}};function Qv(t){let e=t.mode==="light"?Kv:Yv;return{mode:t.mode??e.mode,fontFamily:t.fontFamily??e.fontFamily,colorPrimary:t.colorPrimary??e.colorPrimary,colorPrimaryHover:t.colorPrimaryHover??e.colorPrimaryHover,borderRadius:t.borderRadius??e.borderRadius,canvas:{...e.canvas,...t.canvas},launcher:{...e.launcher,...t.launcher},tile:{...e.tile,...t.tile},overlay:{...e.overlay,...t.overlay},notification:{...e.notification,...t.notification},content:{...e.content,...t.content}}}function Jv(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?Kv:Yv;return{mode:a,fontFamily:e.fontFamily??t.fontFamily??r.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??r.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??r.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??r.borderRadius,canvas:{...r.canvas,...t.canvas,...e.canvas},launcher:{...r.launcher,...t.launcher,...e.launcher},tile:{...r.tile,...t.tile,...e.tile},overlay:{...r.overlay,...t.overlay,...e.overlay},notification:{...r.notification,...t.notification,...e.notification},content:{...r.content,...t.content,...e.content}}}var nO=["canvas","launcher","tile","overlay","notification","content"];function ey(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let a of nO){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${rO(n)}`]=o)}return e}var Gr=K(We(),1);var t1=K(Me(),1),e1=(0,Gr.createContext)(null);function ty({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,Gr.useMemo)(()=>a?Jv(a,e??{}):Qv(e??{}),[e,a]),o=(0,Gr.useMemo)(()=>ey(n),[n]);(0,Gr.useEffect)(()=>{if(!r)return;let s=r.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",r.insertBefore(s,r.firstChild));let l=Object.entries(o).map(([u,c])=>` ${u}: ${c};`).join(`
464
+ `;function fP(t){if(t.querySelector(`#${sI}`))return;let e=document.createElement("style");e.id=sI,e.textContent=dP,t.appendChild(e)}function hp({notifications:t,onDismiss:e,onClickNotification:a,position:n}){let{shadowRoot:r}=Jo();return fP(r),t.length===0?null:(0,xa.jsx)("div",{"data-testid":"notification-toast-stack",style:{position:"fixed",bottom:"6rem",[n==="right"?"right":"left"]:"2.5rem",display:"flex",flexDirection:"column",gap:"8px",zIndex:2147483648,pointerEvents:"auto",width:"280px"},children:t.map(o=>(0,xa.jsxs)("div",{className:"syntro-toast-enter",style:{background:"var(--sc-notification-background)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"var(--sc-notification-border)",borderRadius:"var(--sc-notification-border-radius)",overflow:"hidden",cursor:"pointer",transition:"transform 0.15s ease"},onMouseEnter:i=>{i.currentTarget.style.transform="translateY(-1px)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.add("paused")},onMouseLeave:i=>{i.currentTarget.style.transform="translateY(0)";let s=i.currentTarget.querySelector(".syntro-toast-progress");s&&s.classList.remove("paused")},children:[(0,xa.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,xa.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"8px",background:"var(--sc-notification-icon-background)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:"14px"},children:(0,xa.jsx)(pp,{emoji:o.icon??"\u{1F514}",size:14})}),(0,xa.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,xa.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--sc-notification-text-color)",lineHeight:"1.3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.title}),o.body&&(0,xa.jsx)("div",{style:{fontSize:"12px",color:"var(--sc-notification-text-secondary-color)",lineHeight:"1.3",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.body})]}),(0,xa.jsx)("button",{type:"button",onClick:i=>{i.stopPropagation(),e(o.id)},"aria-label":"Dismiss notification",style:{background:"none",border:"none",color:"var(--sc-notification-text-secondary-color)",cursor:"pointer",padding:"2px",fontSize:"14px",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,xa.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,xa.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var tn=Y(Ye(),1);var mp=3,gp=8e3,vp=3e4;var pP=0;function Wu(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,n)=>!e||!(n in e)?a:String(e[n]))}function hP(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function yp(t,e){for(let a of e){let n=a.notifications;if(!(!n||n.length===0))for(let r of n){if(!hP(t.name,r.on))continue;let o=Date.now(),i=r.ttl??8e3;return{notification:{id:`notif-${++pP}-${o}`,title:Wu(r.title,t.props),body:r.body?Wu(r.body,t.props):void 0,icon:r.icon,tileId:a.id,itemId:r.deepLink?.itemId?Wu(r.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:r}}}return null}function xp(t,e){let[a,n]=(0,tn.useState)([]),r=(0,tn.useRef)(new Map),o=(0,tn.useRef)(new Map),i=(0,tn.useCallback)(u=>{t?.publish(Ce.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,tn.useCallback)(u=>{let c=setTimeout(()=>{n(d=>d.filter(f=>f.id!==u.id)),o.current.delete(u.id),i(u)},u.ttl);o.current.set(u.id,c)},[i]),l=(0,tn.useCallback)(u=>{n(d=>{let f=d.find(h=>h.id===u);return f&&i(f),d.filter(h=>h.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,tn.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=yp(c,e);if(!d)return;let{notification:f,rule:h}=d,S=f.itemId?`${f.tileId}:${c.name}:${f.itemId}`:`${f.tileId}:${c.name}`,x=r.current.get(S),b=Date.now(),m=h.cooldown??3e4;x!==void 0&&b-x<m||(r.current.set(S,b),n(g=>{if(f.itemId&&g.some(_=>_.tileId===f.tileId&&_.itemId===f.itemId))return g;let v=[...g,f];if(v.length>3){let y=v.shift(),_=o.current.get(y.id);_&&(clearTimeout(_),o.current.delete(y.id))}return v}),t.publish(Ce.NOTIFICATION_SHOWN,{notificationId:f.id,tileId:f.tileId,itemId:f.itemId,title:f.title}),s(f))});return()=>{u();for(let c of o.current.values())clearTimeout(c);o.current.clear()}},[t,e,s]),{notifications:a,dismiss:l}}var bp=Y(Ye(),1);function mP(t,e){let a=[];for(let n of t){let r=n.widget.split(":")[0],i=e.get(r)?.manifest.runtime?.notifyWatchers;i&&a.push(...i(n.props??{}))}return a}function Sp(t,e,a){let n=(0,bp.useRef)(new Map);(0,bp.useEffect)(()=>{if(!t?.events||!a)return;let r=mP(e,a);if(r.length===0)return;let o=t.state.ns("notified");for(let s of r)if(!n.current.has(s.id)){let l=t.evaluateSync(s.strategy);n.current.set(s.id,l.value),l.value&&!o.has(s.id)&&(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps))}return t.events.subscribe(()=>{for(let s of r){let l=t.evaluateSync(s.strategy),u=n.current.get(s.id)??!1;n.current.set(s.id,l.value),!u&&l.value?(o.set(s.id,!0),t.events.publish(s.eventName,s.eventProps)):u&&!l.value&&o.remove(s.id)}})},[t,e,a])}var Jt=Y(Ye(),1),pI=Y(Ae(),1),qy=(0,Jt.createContext)({runtime:null,context:null});function Cp({runtime:t,children:e}){let[a,n]=(0,Jt.useState)(t?t.context.get():null);(0,Jt.useEffect)(()=>t?(n(t.context.get()),t.context.subscribe(i=>{n(i)})):void 0,[t]);let r=(0,Jt.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,pI.jsx)(qy.Provider,{value:r,children:e})}function gn(){let{runtime:t}=(0,Jt.useContext)(qy);return t}function Xu(){let{context:t}=(0,Jt.useContext)(qy);return t}function _p(){return Xu()?.page??null}function lI(){return Xu()?.session??null}function uI(){return Xu()?.viewport??null}function cI(t,e,a=[]){let n=gn();(0,Jt.useEffect)(()=>n?t?n.events.subscribe(t,e):n.events.subscribe(e):void 0,[n,...a,e,t])}function dI(){return gn()?.state??null}function fI(t,e){let a=gn(),[n,r]=(0,Jt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Jt.useEffect)(()=>{if(!a||!t){r({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return a.evaluate(t).then(i=>{o||r({value:i.value,isFallback:i.isFallback,isLoading:!1})}),()=>{o=!0}},[a,t,e]),n}function ae(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var gP={colorPrimary:re[3],colorPrimaryHover:re[4],colorPrimaryMuted:re[0],colorBackground:ae(A[1],.95),colorBackgroundElevated:ae(A[3],.95),colorBackgroundSubtle:ae(A[0],.2),colorSurface:ae(A[4],.8),colorSurfaceHover:ae(A[5],.8),colorText:ga.primary,colorTextSecondary:ga.secondary,colorTextMuted:ga.tertiary,colorTextInverse:A[1],colorBorder:ly.primary,colorBorderSubtle:ly.secondary,colorSuccess:Me[4],colorSuccessMuted:Me[0],colorWarning:Lt[4],colorWarningMuted:Lt[0],colorError:je[4],colorErrorMuted:je[0],colorInfo:ma[4],colorInfoMuted:ma[0],colorNotification:re[4],colorNotificationMuted:ae(re[4],.4),glassBackground:ae(A[1],.6),glassBackgroundHover:ae(A[1],.7),glassBorder:"rgba(255, 255, 255, 0.08)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.2)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.3)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.4)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.5)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"},vP={colorPrimary:re[3],colorPrimaryHover:re[2],colorPrimaryMuted:ae(re[5],.1),colorBackground:ae(A[12],.95),colorBackgroundElevated:ae(A[11],.95),colorBackgroundSubtle:ae(A[0],.02),colorSurface:ae(A[11],.6),colorSurfaceHover:ae(A[10],.6),colorText:A[1],colorTextSecondary:A[6],colorTextMuted:A[8],colorTextInverse:A[12],colorBorder:ae(A[0],.12),colorBorderSubtle:ae(A[0],.06),colorSuccess:Me[4],colorSuccessMuted:ae(Me[4],.12),colorWarning:Lt[4],colorWarningMuted:ae(Lt[4],.12),colorError:je[4],colorErrorMuted:ae(je[4],.12),colorInfo:ma[4],colorInfoMuted:ae(ma[4],.12),colorNotification:re[3],colorNotificationMuted:ae(re[3],.4),glassBackground:ae(A[12],.7),glassBackgroundHover:ae(A[12],.8),glassBorder:"rgba(0, 0, 0, 0.06)",glassBlur:"blur(24px)",glassSaturate:"saturate(1.2)",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",fontFamilyMono:"'SF Mono', 'Fira Code', Consolas, monospace",fontSizeXs:"0.7rem",fontSizeSm:"0.8rem",fontSizeMd:"0.9rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontSizeXxl:"1.5rem",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightSemibold:"600",fontWeightBold:"700",lineHeightTight:"1.25",lineHeightNormal:"1.5",lineHeightRelaxed:"1.75",spacingXs:"0.25rem",spacingSm:"0.5rem",spacingMd:"0.75rem",spacingLg:"1rem",spacingXl:"1.5rem",borderRadiusSm:"6px",borderRadiusMd:"10px",borderRadiusLg:"14px",borderRadiusXl:"20px",borderRadiusFull:"9999px",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.08)",shadowMd:"0 2px 12px rgba(0, 0, 0, 0.12)",shadowLg:"0 8px 24px rgba(0, 0, 0, 0.16)",shadowXl:"0 16px 48px rgba(0, 0, 0, 0.2)",backdropBlur:"blur(20px)",backdropSaturate:"saturate(180%)",transitionFast:"0.1s ease",transitionNormal:"0.25s ease",transitionSlow:"0.4s ease"};function yP(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var $y={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:re[3],colorPrimaryHover:re[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ae(A[1],.6),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:If.primary.backgroundDefault,backgroundHover:If.primary.backgroundHover,color:If.primary.icon,size:"56px",shadow:`0 8px 32px ${ae(A[0],.6)}`,borderRadius:"9999px"},tile:{background:ae(A[1],.6),backgroundHover:ae(A[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:ga.primary,textColor:ga.secondary,iconBackground:`linear-gradient(135deg, ${re[3]} 0%, ${re[3]}cc 100%)`,iconShadow:`0 2px 8px ${re[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(A[1],.6),textColor:ga.primary,titleColor:ga.primary,arrowColor:ae(A[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${re[3]}`},notification:{background:ae(A[0],.95),textColor:ga.primary,textSecondaryColor:ga.secondary,border:`1px solid ${A[5]}`,borderRadius:"12px",successColor:Me[4],warningColor:Lt[4],errorColor:je[4],iconBackground:ae(re[3],.15),progressGradient:`linear-gradient(90deg, ${re[3]}, ${re[4]})`},content:{background:ae(A[3],.8),backgroundHover:ae(A[5],.6),border:`1px solid ${ae(A[5],.5)}`,borderRadius:"8px",textColor:ga.primary,textSecondaryColor:ga.secondary,itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:ae(A[3],.8),searchColor:ga.primary,chevronColor:"currentColor"}},Vy={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:re[3],colorPrimaryHover:re[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ae(A[12],.7),blur:"blur(24px)",border:"none",width:"clamp(380px, 25vw, 520px)",transitionDuration:"300ms",transitionEasing:"cubic-bezier(0.16, 1, 0.3, 1)",transitionFade:"6%"},launcher:{background:re[3],backgroundHover:re[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:ae(A[12],.7),backgroundHover:ae(A[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:A[1],textColor:A[6],iconBackground:`linear-gradient(135deg, ${re[3]} 0%, ${re[3]}cc 100%)`,iconShadow:`0 2px 8px ${re[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ae(A[12],.7),textColor:A[1],titleColor:A[1],arrowColor:ae(A[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${re[3]}`},notification:{background:ae(A[12],.95),textColor:A[1],textSecondaryColor:A[6],border:`1px solid ${ae(A[0],.12)}`,borderRadius:"12px",successColor:Me[4],warningColor:Lt[4],errorColor:je[4],iconBackground:ae(re[3],.1),progressGradient:`linear-gradient(90deg, ${re[3]}, ${re[2]})`},content:{background:ae(A[12],.8),backgroundHover:ae(A[11],.6),border:`1px solid ${A[11]}`,borderRadius:"8px",textColor:A[1],textSecondaryColor:A[6],itemDivider:"none",itemGap:"6px",itemPadding:"12px 16px",itemFontSize:"15px",bodyPadding:"0 16px 12px 16px",bodyFontSize:"14px",categoryPadding:"8px 4px 4px 4px",categoryGap:"4px",categoryFontSize:"12px",searchBackground:A[12],searchColor:A[1],chevronColor:"currentColor"}};function jy(t){let e=t.mode==="light"?Vy:$y;return{mode:t.mode??e.mode,fontFamily:t.fontFamily??e.fontFamily,colorPrimary:t.colorPrimary??e.colorPrimary,colorPrimaryHover:t.colorPrimaryHover??e.colorPrimaryHover,borderRadius:t.borderRadius??e.borderRadius,canvas:{...e.canvas,...t.canvas},launcher:{...e.launcher,...t.launcher},tile:{...e.tile,...t.tile},overlay:{...e.overlay,...t.overlay},notification:{...e.notification,...t.notification},content:{...e.content,...t.content}}}function Gy(t,e){let a=e.mode??t.mode??"dark",n=a==="light"?Vy:$y;return{mode:a,fontFamily:e.fontFamily??t.fontFamily??n.fontFamily,colorPrimary:e.colorPrimary??t.colorPrimary??n.colorPrimary,colorPrimaryHover:e.colorPrimaryHover??t.colorPrimaryHover??n.colorPrimaryHover,borderRadius:e.borderRadius??t.borderRadius??n.borderRadius,canvas:{...n.canvas,...t.canvas,...e.canvas},launcher:{...n.launcher,...t.launcher,...e.launcher},tile:{...n.tile,...t.tile,...e.tile},overlay:{...n.overlay,...t.overlay,...e.overlay},notification:{...n.notification,...t.notification,...e.notification},content:{...n.content,...t.content,...e.content}}}var xP=["canvas","launcher","tile","overlay","notification","content"];function Zy(t){let e={};t.fontFamily&&(e["--sc-font-family"]=t.fontFamily),t.colorPrimary&&(e["--sc-color-primary"]=t.colorPrimary),t.colorPrimaryHover&&(e["--sc-color-primary-hover"]=t.colorPrimaryHover),t.borderRadius&&(e["--sc-border-radius"]=t.borderRadius);for(let a of xP){let n=t[a];if(n)for(let[r,o]of Object.entries(n))o!==void 0&&(e[`--sc-${a}-${yP(r)}`]=o)}return e}var Jn=Y(Ye(),1);var mI=Y(Ae(),1),hI=(0,Jn.createContext)(null);function Wy({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:n}){let r=(0,Jn.useMemo)(()=>a?Gy(a,e??{}):jy(e??{}),[e,a]),o=(0,Jn.useMemo)(()=>Zy(r),[r]);(0,Jn.useEffect)(()=>{if(!n)return;let s=n.querySelector("#sc-theme-vars");s||(s=document.createElement("style"),s.id="sc-theme-vars",n.insertBefore(s,n.firstChild));let l=Object.entries(o).map(([u,c])=>` ${u}: ${c};`).join(`
410
465
  `);s.textContent=`:host {
411
466
  ${l}
412
- }`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,t1.jsx)(e1.Provider,{value:i,children:t})}function ay(){let t=(0,Gr.useContext)(e1);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var Ye=K(We(),1);var Gf=K(We());var jf=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var a1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var r1=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var ry=t=>{let e=r1(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Su=K(We());var n1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var o1=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var i1=(0,Su.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,Su.createElement)("svg",{ref:l,...n1,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:jf("lucide",n),...!o&&!o1(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,Su.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Tt=(t,e)=>{let a=(0,Gf.forwardRef)(({className:r,...n},o)=>(0,Gf.createElement)(i1,{ref:o,iconNode:e,className:jf(`lucide-${a1(ry(t))}`,`lucide-${t}`,r),...n}));return a.displayName=ry(t),a};var oO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Qa=Tt("circle-question-mark",oO);var iO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],Cu=Tt("compass",iO);var sO=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_u=Tt("file-text",sO);var lO=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],wu=Tt("gamepad-2",lO);var uO=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],$n=Tt("layers",uO);var cO=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Lu=Tt("message-circle",cO);var dO=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],jn=Tt("sparkles",dO);var fO=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Iu=Tt("trophy",fO);var ny=K(Me(),1),pO={"\u2753":Qa,"\u{1F9ED}":Cu,"\u{1F4DD}":_u,"\u{1F3AF}":$n,"\u{1F3C6}":Iu,"\u2728":jn,"\u{1F4AC}":Lu,"\u{1F3AE}":wu};function s1({emoji:t,size:e=18,color:a="currentColor"}){let r=pO[t];return r?(0,ny.jsx)(r,{size:e,color:a}):(0,ny.jsx)("span",{children:t})}var Kt=K(Me(),1);function hO({widgetId:t,props:e}){let a=dr(),r=(0,Ye.useRef)(null),n=(0,Ye.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,Ye.useRef)(e);s.current=e;let[,l]=(0,Ye.useReducer)(d=>d+1,0);(0,Ye.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,Ye.useEffect)(()=>{if(!r.current||!o||!i)return;let d=document.createElement("div");d.style.width="100%",d.style.minHeight="40px",r.current.appendChild(d);let h=o.mount(t,d,s.current);return n.current=h,()=>{h.unmount(),n.current=null,d.remove()}},[o,t,i]);let u=JSON.stringify(e),c=(0,Ye.useRef)(u);return(0,Ye.useEffect)(()=>{c.current!==u&&(c.current=u,n.current?.update(s.current))},[u]),!o||!o.has(t)?(0,Kt.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,Kt.jsx)("div",{ref:r})}function ms({config:t,surface:e,telemetry:a,style:r}){let{title:n,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,Ye.useState)(0),c=dr();(0,Ye.useEffect)(()=>{c&&u(_=>_+1)},[c]);let d=(0,Ye.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),h=(0,Ye.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),g=(0,Ye.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,b]=(0,Ye.useState)(!1),x=(0,Ye.useCallback)(()=>b(!0),[]),f=(0,Ye.useCallback)(()=>b(!1),[]),m={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:S?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:S?"scale(1.01)":"scale(1)",...r},v={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},y={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,Kt.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:m,onMouseEnter:x,onMouseLeave:f,children:[(0,Kt.jsxs)("div",{style:v,children:[(0,Kt.jsx)("div",{style:y,children:(0,Kt.jsx)(s1,{emoji:h,size:g?36:24})}),(0,Kt.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Kt.jsx)("h3",{style:{fontSize:"1.14rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n??i}),g&&(0,Kt.jsx)("p",{style:{fontSize:"0.8rem",fontWeight:400,color:"var(--sc-tile-text-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:g})]})]}),(0,Kt.jsx)("div",{style:{padding:"var(--sc-tile-body-padding, 0 0.75rem 0.5rem)",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,Kt.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,Kt.jsx)(hO,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var ge=K(Me(),1),l1="syntro-launcher-styles";function mO(t,e){if(t.querySelector(`#${l1}`))return;let a=document.createElement("style");a.id=l1,a.textContent=e,t.appendChild(a)}function iy({isOpen:t,onToggle:e,telemetry:a,launcherLabel:r="Adaptives",launcherIcon:n,launcherAnimate:o=!1,launcherAnimationStyle:i="pulse",notificationCount:s,footerSlot:l,tiles:u,isLoading:c,error:d,canvasTitle:h,displayMode:g="standard"}){let[S,b]=(0,lt.useState)(!1),[x,f]=(0,lt.useState)(null),m=(0,lt.useRef)(null),v=dr(),{shadowRoot:y,portalRoot:_}=Vo(),{config:L}=ay(),{notifications:C,dismiss:k}=Uf(v?.events??null,u);zf(v,u,v?.apps);let w=(0,lt.useCallback)(G=>{v&&v.events.publish(be.NOTIFICATION_CLICKED,{notificationId:G.id,tileId:G.tileId,itemId:G.itemId}),t||e(),v&&G.tileId&&v.events.publish(be.NOTIFICATION_DEEP_LINK,{tileId:G.tileId,itemId:G.itemId}),k(G.id)},[v,t,e,k]),I=(0,lt.useMemo)(()=>`
467
+ }`},[n,o]);let i={config:r,mode:r.mode,cssVariables:o};return(0,mI.jsx)(hI.Provider,{value:i,children:t})}function Xy(){let t=(0,Jn.useContext)(hI);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var Je=Y(Ye(),1);var vI=Y(Ae(),1);function gI({emoji:t,size:e=18,color:a="currentColor"}){return(0,vI.jsx)(pp,{emoji:t,size:e,color:a})}var ea=Y(Ae(),1);function bP({widgetId:t,props:e}){let a=gn(),n=(0,Je.useRef)(null),r=(0,Je.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,Je.useRef)(e);s.current=e;let[,l]=(0,Je.useReducer)(d=>d+1,0);(0,Je.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,Je.useEffect)(()=>{if(!n.current||!o||!i)return;let d=document.createElement("div");d.style.width="100%",d.style.minHeight="40px",n.current.appendChild(d);let f=o.mount(t,d,s.current);return r.current=f,()=>{f.unmount(),r.current=null}},[o,t,i]);let u=JSON.stringify(e),c=(0,Je.useRef)(u);return(0,Je.useEffect)(()=>{c.current!==u&&(c.current=u,r.current?.update(s.current))},[u]),!o||!o.has(t)?(0,ea.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,ea.jsx)("div",{ref:n})}function ks({config:t,surface:e,telemetry:a,style:n}){let{title:r,subtitle:o,widget:i,props:s,icon:l}=t,[,u]=(0,Je.useState)(0),c=gn();(0,Je.useEffect)(()=>{c&&u(_=>_+1)},[c]);let d=(0,Je.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),f=(0,Je.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),h=(0,Je.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,x]=(0,Je.useState)(!1),b=(0,Je.useCallback)(()=>x(!0),[]),m=(0,Je.useCallback)(()=>x(!1),[]),g={display:"flex",flexDirection:"column",borderRadius:"var(--sc-tile-border-radius)",background:S?"var(--sc-tile-background-hover)":"var(--sc-tile-background)",backdropFilter:"blur(16px) saturate(1.2)",WebkitBackdropFilter:"blur(16px) saturate(1.2)",border:"var(--sc-tile-border)",boxShadow:"var(--sc-tile-shadow)",color:"var(--sc-tile-title-color)",fontFamily:"var(--sc-font-family)",overflow:"hidden",cursor:"default",transition:"all 0.25s ease",transform:S?"scale(1.01)":"scale(1)",...n},v={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},y={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,ea.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:g,onMouseEnter:b,onMouseLeave:m,children:[(0,ea.jsxs)("div",{style:v,children:[(0,ea.jsx)("div",{style:y,children:(0,ea.jsx)(gI,{emoji:f,size:h?36:24})}),(0,ea.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,ea.jsx)("h3",{style:{fontSize:"1.14rem",fontWeight:600,color:"var(--sc-tile-title-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r??i}),h&&(0,ea.jsx)("p",{style:{fontSize:"0.8rem",fontWeight:400,color:"var(--sc-tile-text-color)",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:h})]})]}),(0,ea.jsx)("div",{style:{padding:"var(--sc-tile-body-padding, 0 0.75rem 0.5rem)",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},children:(0,ea.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,ea.jsx)(bP,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var ve=Y(Ae(),1),yI="syntro-launcher-styles";function SP(t,e){if(t.querySelector(`#${yI}`))return;let a=document.createElement("style");a.id=yI,a.textContent=e,t.appendChild(a)}function Ky({isOpen:t,onToggle:e,telemetry:a,launcherLabel:n="Adaptives",launcherIcon:r,launcherAnimate:o=!1,launcherAnimationStyle:i="pulse",notificationCount:s,footerSlot:l,tiles:u,isLoading:c,error:d,canvasTitle:f,displayMode:h="standard"}){let[S,x]=(0,dt.useState)(!1),[b,m]=(0,dt.useState)(null),g=(0,dt.useRef)(null),v=gn(),{shadowRoot:y,portalRoot:_}=Jo(),{config:L}=Xy(),{notifications:C,dismiss:I}=xp(v?.events??null,u);Sp(v,u,v?.apps);let w=(0,dt.useCallback)(G=>{v&&v.events.publish(Ce.NOTIFICATION_CLICKED,{notificationId:G.id,tileId:G.tileId,itemId:G.itemId}),t||e(),v&&G.tileId&&v.events.publish(Ce.NOTIFICATION_DEEP_LINK,{tileId:G.tileId,itemId:G.itemId}),I(G.id)},[v,t,e,I]),k=(0,dt.useMemo)(()=>`
413
468
  @keyframes syntro-launcher-pulse {
414
469
  0%, 100% {
415
470
  box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${L.colorPrimary}66;
@@ -442,7 +497,7 @@ ${l}
442
497
  .syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
443
498
  .syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
444
499
  .syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
445
- `,[L.colorPrimary,L.colorPrimaryHover]);(0,lt.useEffect)(()=>{t&&u.forEach(G=>{if(a?.trackRectangleViewed(G.id,"overlay"),v){let re=hs.tileViewed(G.id,"overlay");v.events.publish(re.name,re.props,re.source)}})},[a,v,t,u]),(0,lt.useEffect)(()=>{b(!0),mO(y,I)},[y,I]);let T=(0,lt.useCallback)(()=>{let G=!t;if(G?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let re=G?hs.canvasOpened("overlay"):hs.canvasClosed("overlay");v.events.publish(re.name,re.props,re.source)}e()},[t,a,v,e]),D=(0,lt.useCallback)(G=>{let re=G.currentTarget.getBoundingClientRect();m.current={startX:G.clientX,startY:G.clientY,startElX:re.left,startElY:re.top,dragged:!1},G.currentTarget.setPointerCapture(G.pointerId)},[]),M=(0,lt.useCallback)(G=>{let re=m.current;if(!re)return;let At=G.clientX-re.startX,dn=G.clientY-re.startY;(Math.abs(At)>5||Math.abs(dn)>5)&&(re.dragged=!0),re.dragged&&f({x:re.startElX+At,y:re.startElY+dn})},[]),B=(0,lt.useCallback)(G=>{let re=m.current;m.current=null,re&&!re.dragged&&T()},[T]),F=g==="focused",H=L.canvas.position==="right",V=L.canvas.layout==="push",N=L.canvas.border??"none",X=(0,lt.useRef)(null),ve=2147483600;(0,lt.useEffect)(()=>{if(!V)return;let G=document.documentElement,re=H?"marginRight":"marginLeft",At=L.canvas.transitionDuration??"300ms",dn=L.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",Nh=G.style.transition;if(G.style.transition=`${re} ${At} ${dn}`,t){let Ph=X.current?.offsetWidth??380;G.style[re]=`${Ph}px`}else G.style[re]="0px";return()=>{G.style[re]="",G.style.transition=Nh}},[V,t,H,L.canvas.transitionDuration,L.canvas.transitionEasing]),(0,lt.useEffect)(()=>{if(!V||!t)return;let G=X.current;if(!G)return;let re=H?"marginRight":"marginLeft",At=new ResizeObserver(([dn])=>{document.documentElement.style[re]=`${dn.contentRect.width}px`});return At.observe(G),()=>At.disconnect()},[V,t,H]);let Ha={display:"flex",flexDirection:"column",width:F?"40vw":L.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let G=L.canvas.transitionDuration??"300ms",re=L.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${G} ${re}, opacity ${G} ease-out`:`transform ${G} ${re}, opacity ${G} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let G=L.canvas.blur??"blur(24px)",re=F&&G!=="none"?`${G} saturate(1.2)`:G;return{backdropFilter:re,WebkitBackdropFilter:re}})(),...(()=>{if(F||N&&N!=="none")return{};let G=L.canvas.transitionFade??"6%",re=H?`linear-gradient(to right, transparent, black ${G})`:`linear-gradient(to left, transparent, black ${G})`;return{maskImage:re,WebkitMaskImage:re}})(),border:N,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":H?"translateX(120%)":"translateX(-120%)"},qt=(0,ge.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:ve},children:(0,ge.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:H?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,ge.jsxs)("div",{ref:X,"data-shadow-canvas-id":"overlay-container",style:Ha,children:[F&&h&&(0,ge.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ge.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:h})}),(0,ge.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:c?(0,ge.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):d?(0,ge.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",d]}):F?u.length>0?(0,ge.jsx)(ms,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,ge.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(G=>(0,ge.jsx)(ms,{config:G,surface:"overlay",telemetry:a,style:{width:"100%"}},G.id))})}),l]}),(0,ge.jsx)("div",{onClick:T,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ge.jsxs)(ge.Fragment,{children:[(0,oy.createPortal)((0,ge.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:ve+47},children:[(0,ge.jsx)(Bf,{notifications:C,onDismiss:k,onClickNotification:w,position:L.canvas.position??"right"}),(0,ge.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...x?{top:x.y,left:x.x}:{bottom:"2.5rem",right:H?"2.5rem":void 0,left:H?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"var(--sc-launcher-border-radius, 9999px)",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:m.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:m.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:D,onPointerMove:M,onPointerUp:B,onMouseEnter:G=>{m.current?.dragged||(G.currentTarget.style.backgroundColor=L.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:G=>{m.current?.dragged||(G.currentTarget.style.backgroundColor=L.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,ge.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ge.jsx)("path",{d:"M18 6L6 18"}),(0,ge.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,ge.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,ge.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ge.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,ge.jsx)("path",{d:"M5 3v4"}),(0,ge.jsx)("path",{d:"M3 5h4"}),(0,ge.jsx)("path",{d:"M19 17v4"}),(0,ge.jsx)("path",{d:"M17 19h4"})]}),!t&&C.length>0&&(0,ge.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,ge.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${L.colorPrimaryHover}66`}}),(0,ge.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,ge.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:L.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:C.length>99?"99+":C.length})]})]})]}),_),(0,oy.createPortal)(qt,_)]}):null}var Nt=K(We(),1);var u1=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function sy({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,Nt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Nt.useRef)("[]"),l=(0,Nt.useRef)(null),u=(0,Nt.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let h=d.tiles||[];h=await a.filterTiles(h),e&&(h=h.filter(g=>e.shouldRenderRectangle(g))),i(g=>({...g,tiles:u1(h)}))},[a,e]),c=(0,Nt.useCallback)(async()=>{try{i(x=>({...x,isLoading:!0,error:void 0}));let d=await t();Y("SmartCanvas Config","Raw config response",d),l.current=d;let h=d.tiles||[];a?(h=await a.filterTiles(h),e&&(h=h.filter(x=>e.shouldRenderRectangle(x)))):e&&(h=h.filter(x=>e.shouldRenderRectangle(x))),Y("SmartCanvas Config",`Tile count after filtering: ${h.length}`);let g=d.actions||[],S=JSON.stringify(g),b=S!==s.current;b&&(s.current=S),i(x=>({tiles:u1(h),actions:b?g:x.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let h=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",h,d),i(g=>({...g,isLoading:!1,error:h}))}},[e,t,a]);return(0,Nt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,Nt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Nt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,Nt.useMemo)(()=>o,[o])}var gs=K(Me(),1);function ly({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m}){return u?(0,gs.jsx)(Vf,{runtime:u,children:(0,gs.jsx)(c1,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m})}):(0,gs.jsx)(c1,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m})}function c1({controller:t,fetcher:e,configUri:a,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:n="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:S,launcherLabel:b,canvasHost:x,initialBatchHandle:f,workspaceTheme:m}){let[v,y]=(0,Pt.useState)(t.getState().open),_=$f(),[L,C]=(0,Pt.useState)(()=>typeof window<"u"?window.location.href:"/"),k=_?.url??L;(0,Pt.useEffect)(()=>{if(u||typeof window>"u")return;let V=()=>C(window.location.href);window.addEventListener("popstate",V),window.addEventListener("hashchange",V);let N=history.pushState,X=history.replaceState;return history.pushState=function(...ve){N.apply(this,ve),queueMicrotask(V)},history.replaceState=function(...ve){X.apply(this,ve),queueMicrotask(V)},()=>{window.removeEventListener("popstate",V),window.removeEventListener("hashchange",V),history.pushState=N,history.replaceState=X}},[u]);let w=(0,Pt.useMemo)(()=>e||zo({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),I=sy({fetcher:w,experiments:s,runtime:u,pageUrl:k}),T=I.tiles.length>0&&!I.error;(0,Pt.useEffect)(()=>t.subscribe(V=>y(V.open)),[t]),(0,Pt.useEffect)(()=>{!I.isLoading&&!T&&t.getState().open&&t.setOpen(!1)},[t,T,I.isLoading]);let D=(0,Pt.useRef)(f??null),M=(0,Pt.useRef)(!!f),B=(0,Pt.useRef)(0);(0,Pt.useEffect)(()=>{if(!u?.actions)return;if(M.current){I.actions.length>0&&(M.current=!1);return}let V=++B.current,N=()=>V!==B.current;return(async()=>{if(D.current){try{await D.current.revertAll()}catch(ve){console.error("[SmartCanvasApp] Failed to revert actions:",ve)}D.current=null}if(!N()&&I.actions.length>0)try{let ve=await u.actions.applyBatch(I.actions);N()?await ve.revertAll():D.current=ve}catch(ve){N()||console.error("[SmartCanvasApp] Failed to apply actions:",ve)}})(),()=>{D.current&&(D.current.revertAll().catch(ve=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",ve)}),D.current=null)}},[u,I.actions,k]),(0,Pt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:F}=Vo(),H=I.theme;return!I.isLoading&&!T?null:(0,gs.jsx)(ty,{themeConfig:H,workspaceTheme:m,shadowRoot:F,children:(0,gs.jsx)(iy,{tiles:I.tiles,isLoading:I.isLoading,error:I.error,canvasTitle:I.canvasTitle,telemetry:l,launcherLabel:b??I.launcher?.label,launcherIcon:I.launcher?.icon,launcherAnimate:I.launcher?.animate,launcherAnimationStyle:I.launcher?.animationStyle,notificationCount:I.launcher?.notificationCount??I.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:I.displayMode})})}var uy=K(Me(),1),d1="smart-canvas",f1=`
500
+ `,[L.colorPrimary,L.colorPrimaryHover]);(0,dt.useEffect)(()=>{t&&u.forEach(G=>{if(a?.trackRectangleViewed(G.id,"overlay"),v){let ne=ws.tileViewed(G.id,"overlay");v.events.publish(ne.name,ne.props,ne.source)}})},[a,v,t,u]),(0,dt.useEffect)(()=>{x(!0),SP(y,k)},[y,k]);let T=(0,dt.useCallback)(()=>{let G=!t;if(G?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),v){let ne=G?ws.canvasOpened("overlay"):ws.canvasClosed("overlay");v.events.publish(ne.name,ne.props,ne.source)}e()},[t,a,v,e]),D=(0,dt.useCallback)(G=>{let ne=G.currentTarget.getBoundingClientRect();g.current={startX:G.clientX,startY:G.clientY,startElX:ne.left,startElY:ne.top,dragged:!1},G.currentTarget.setPointerCapture(G.pointerId)},[]),M=(0,dt.useCallback)(G=>{let ne=g.current;if(!ne)return;let Tt=G.clientX-ne.startX,vr=G.clientY-ne.startY;(Math.abs(Tt)>5||Math.abs(vr)>5)&&(ne.dragged=!0),ne.dragged&&m({x:ne.startElX+Tt,y:ne.startElY+vr})},[]),P=(0,dt.useCallback)(G=>{let ne=g.current;g.current=null,ne&&!ne.dragged&&T()},[T]),F=h==="focused",U=L.canvas.position==="right",j=L.canvas.layout==="push",N=L.canvas.border??"none",X=(0,dt.useRef)(null),ye=2147483600;(0,dt.useEffect)(()=>{if(!j)return;let G=document.documentElement,ne=U?"marginRight":"marginLeft",Tt=L.canvas.transitionDuration??"300ms",vr=L.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",hm=G.style.transition;if(G.style.transition=`${ne} ${Tt} ${vr}`,t){let mm=X.current?.offsetWidth??380;G.style[ne]=`${mm}px`}else G.style[ne]="0px";return()=>{G.style[ne]="",G.style.transition=hm}},[j,t,U,L.canvas.transitionDuration,L.canvas.transitionEasing]),(0,dt.useEffect)(()=>{if(!j||!t)return;let G=X.current;if(!G)return;let ne=U?"marginRight":"marginLeft",Tt=new ResizeObserver(([vr])=>{document.documentElement.style[ne]=`${vr.contentRect.width}px`});return Tt.observe(G),()=>Tt.disconnect()},[j,t,U]);let qa={display:"flex",flexDirection:"column",width:F?"40vw":L.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let G=L.canvas.transitionDuration??"300ms",ne=L.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${G} ${ne}, opacity ${G} ease-out`:`transform ${G} ${ne}, opacity ${G} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let G=L.canvas.blur??"blur(24px)",ne=F&&G!=="none"?`${G} saturate(1.2)`:G;return{backdropFilter:ne,WebkitBackdropFilter:ne}})(),...(()=>{if(F||N&&N!=="none")return{};let G=L.canvas.transitionFade??"6%",ne=U?`linear-gradient(to right, transparent, black ${G})`:`linear-gradient(to left, transparent, black ${G})`;return{maskImage:ne,WebkitMaskImage:ne}})(),border:N,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":U?"translateX(120%)":"translateX(-120%)"},Vt=(0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:ye},children:(0,ve.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:U?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,ve.jsxs)("div",{ref:X,"data-shadow-canvas-id":"overlay-container",style:qa,children:[F&&f&&(0,ve.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ve.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:f})}),(0,ve.jsx)("div",{style:{flex:1,overflowY:"auto",padding:F?"0":"1rem"},children:c?(0,ve.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:F?"1rem":"0"},children:"Loading..."}):d?(0,ve.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:F?"1rem":"0"},children:["Failed to load: ",d]}):F?u.length>0?(0,ve.jsx)(ks,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,ve.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(G=>(0,ve.jsx)(ks,{config:G,surface:"overlay",telemetry:a,style:{width:"100%"}},G.id))})}),l]}),(0,ve.jsx)("div",{onClick:T,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return S?(0,ve.jsxs)(ve.Fragment,{children:[(0,Yy.createPortal)((0,ve.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:ye+47},children:[(0,ve.jsx)(hp,{notifications:C,onDismiss:I,onClickNotification:w,position:L.canvas.position??"right"}),(0,ve.jsxs)("button",{type:"button","aria-label":"Toggle shadow canvas",className:o&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",...b?{top:b.y,left:b.x}:{bottom:"2.5rem",right:U?"2.5rem":void 0,left:U?void 0:"2.5rem"},pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",width:"var(--sc-launcher-size, 56px)",height:"var(--sc-launcher-size, 56px)",borderRadius:"var(--sc-launcher-border-radius, 9999px)",color:"var(--sc-launcher-color)",boxShadow:"var(--sc-launcher-shadow)",transition:g.current?"none":"transform 0.2s ease, opacity 0.3s ease, background-color 0.2s ease",outline:"none",padding:0,border:"none",backgroundColor:"var(--sc-launcher-background)",cursor:g.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:D,onPointerMove:M,onPointerUp:P,onMouseEnter:G=>{g.current?.dragged||(G.currentTarget.style.backgroundColor=L.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:G=>{g.current?.dragged||(G.currentTarget.style.backgroundColor=L.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,ve.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ve.jsx)("path",{d:"M18 6L6 18"}),(0,ve.jsx)("path",{d:"M6 6l12 12"})]}):r?(0,ve.jsx)("img",{src:r,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,ve.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transition:"transform 200ms ease"},children:[(0,ve.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3Z"}),(0,ve.jsx)("path",{d:"M5 3v4"}),(0,ve.jsx)("path",{d:"M3 5h4"}),(0,ve.jsx)("path",{d:"M19 17v4"}),(0,ve.jsx)("path",{d:"M17 19h4"})]}),!t&&C.length>0&&(0,ve.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,ve.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${L.colorPrimaryHover}66`}}),(0,ve.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,ve.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:L.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:C.length>99?"99+":C.length})]})]})]}),_),(0,Yy.createPortal)(Vt,_)]}):null}var Ut=Y(Ye(),1);var xI=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function Qy({fetcher:t,experiments:e,runtime:a,pageUrl:n,pollIntervalMs:r}){let[o,i]=(0,Ut.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Ut.useRef)("[]"),l=(0,Ut.useRef)(null),u=(0,Ut.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let f=d.tiles||[];f=await a.filterTiles(f),e&&(f=f.filter(h=>e.shouldRenderRectangle(h))),i(h=>({...h,tiles:xI(f)}))},[a,e]),c=(0,Ut.useCallback)(async()=>{try{i(b=>({...b,isLoading:!0,error:void 0}));let d=await t();K("SmartCanvas Config","Raw config response",d),l.current=d;let f=d.tiles||[];a?(f=await a.filterTiles(f),e&&(f=f.filter(b=>e.shouldRenderRectangle(b)))):e&&(f=f.filter(b=>e.shouldRenderRectangle(b))),K("SmartCanvas Config",`Tile count after filtering: ${f.length}`);let h=d.actions||[],S=JSON.stringify(h),x=S!==s.current;x&&(s.current=S),i(b=>({tiles:xI(f),actions:x?h:b.actions,isLoading:!1,fetchedAt:d.fetchedAt,canvasTitle:d.canvasTitle,configVersion:d.configVersion,theme:d.theme,launcher:d.launcher}))}catch(d){let f=d instanceof Error?d.message:"Unknown error";console.error("[SmartCanvas Config] Failed to fetch/filter config:",f,d),i(h=>({...h,isLoading:!1,error:f}))}},[e,t,a]);return(0,Ut.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,n]),(0,Ut.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,Ut.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,Ut.useEffect)(()=>{if(!r)return;let d=setInterval(()=>{c()},r);return()=>clearInterval(d)},[c,r]),(0,Ut.useMemo)(()=>o,[o])}var Is=Y(Ae(),1);function Jy({controller:t,fetcher:e,configUri:a,configUriFeatureKey:n="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f="smart-canvas-overlay-uri",overlayFetchCredentials:h="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:g}){return u?(0,Is.jsx)(Cp,{runtime:u,children:(0,Is.jsx)(bI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:n,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:h,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:g})}):(0,Is.jsx)(bI,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:n,configFeatureKey:r,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:h,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:g})}function bI({controller:t,fetcher:e,configUri:a,configUriFeatureKey:n="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:i,experiments:s,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f="smart-canvas-overlay-uri",overlayFetchCredentials:h="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:g}){let[v,y]=(0,zt.useState)(t.getState().open),_=_p(),[L,C]=(0,zt.useState)(()=>typeof window<"u"?window.location.href:"/"),I=_?.url??L;(0,zt.useEffect)(()=>{if(u||typeof window>"u")return;let j=()=>C(window.location.href);window.addEventListener("popstate",j),window.addEventListener("hashchange",j);let N=history.pushState,X=history.replaceState;return history.pushState=function(...ye){N.apply(this,ye),queueMicrotask(j)},history.replaceState=function(...ye){X.apply(this,ye),queueMicrotask(j)},()=>{window.removeEventListener("popstate",j),window.removeEventListener("hashchange",j),history.pushState=N,history.replaceState=X}},[u]);let w=(0,zt.useMemo)(()=>e||Qo({configUri:a,experiments:s,featureKey:n,configFeatureKey:r,credentials:o}),[e,a,s,n,r,o]),k=Qy({fetcher:w,experiments:s,runtime:u,pageUrl:I}),T=k.tiles.length>0&&!k.error;(0,zt.useEffect)(()=>t.subscribe(j=>y(j.open)),[t]),(0,zt.useEffect)(()=>{!k.isLoading&&!T&&t.getState().open&&t.setOpen(!1)},[t,T,k.isLoading]);let D=(0,zt.useRef)(m??null),M=(0,zt.useRef)(!!m),P=(0,zt.useRef)(0);(0,zt.useEffect)(()=>{if(!u?.actions)return;if(M.current){k.actions.length>0&&(M.current=!1);return}let j=++P.current,N=()=>j!==P.current;return(async()=>{if(D.current){try{await D.current.revertAll()}catch(ye){console.error("[SmartCanvasApp] Failed to revert actions:",ye)}D.current=null}if(!N()&&k.actions.length>0)try{let ye=await u.actions.applyBatch(k.actions);N()?await ye.revertAll():D.current=ye}catch(ye){N()||console.error("[SmartCanvasApp] Failed to apply actions:",ye)}})(),()=>{D.current&&(D.current.revertAll().catch(ye=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",ye)}),D.current=null)}},[u,k.actions,I]),(0,zt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:F}=Jo(),U=k.theme;return(0,Is.jsx)(Wy,{themeConfig:U,workspaceTheme:g,shadowRoot:F,children:!k.isLoading&&!T?null:(0,Is.jsx)(Ky,{tiles:k.tiles,isLoading:k.isLoading,error:k.error,canvasTitle:k.canvasTitle,telemetry:l,launcherLabel:x??k.launcher?.label,launcherIcon:k.launcher?.icon,launcherAnimate:k.launcher?.animate,launcherAnimationStyle:k.launcher?.animationStyle,notificationCount:k.launcher?.notificationCount??k.tiles.length,footerSlot:S,isOpen:v,onToggle:()=>t.toggle(),displayMode:k.displayMode})})}var ex=Y(Ae(),1),SI="smart-canvas",CI=`
446
501
  :host {
447
502
  font: inherit;
448
503
  color: inherit;
@@ -456,12 +511,12 @@ ${l}
456
511
  *, *::before, *::after {
457
512
  box-sizing: border-box;
458
513
  }
459
- `,Da,Gn,Wn,Wr,Zr,Zn,Xr,Wf=class extends HTMLElement{constructor(){super();pn(this,Da);pn(this,Gn);pn(this,Wn);pn(this,Wr);pn(this,Zr);pn(this,Zn,null);pn(this,Xr,null);ar(this,Da,this.attachShadow({mode:"open",delegatesFocus:!0})),ar(this,Gn,document.createElement("div")),me(this,Gn).setAttribute("part","mount"),me(this,Da).appendChild(me(this,Gn)),ar(this,Wn,document.createElement("div")),me(this,Wn).id="portalRoot",me(this,Da).appendChild(me(this,Wn)),ar(this,Wr,document.createElement("div")),me(this,Wr).id="overlayContainer",Object.assign(me(this,Wr).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),me(this,Da).appendChild(me(this,Wr)),ar(this,Zr,Wv()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){me(this,Zn)?.unmount(),ar(this,Zn,null)}getMountNode(){return me(this,Gn)}getController(){return me(this,Zr)}getPortalRoot(){return me(this,Wn)}getOverlayContainer(){return me(this,Wr)}getShadowRoot(){return me(this,Da)}open(){me(this,Zr).setOpen(!0)}close(){me(this,Zr).setOpen(!1)}toggle(){me(this,Zr).toggle()}setOverrideFetcher(a){me(this,Xr)&&(ar(this,Xr,{...me(this,Xr),fetcher:a}),this.render())}mountReactApp(a){ar(this,Xr,a),this.render()}render(){!this.isConnected||!me(this,Xr)||(me(this,Zn)||ar(this,Zn,(0,p1.createRoot)(me(this,Gn))),me(this,Zn).render((0,uy.jsx)(Zv,{shadowRoot:me(this,Da),portalRoot:me(this,Wn),overlayContainer:me(this,Wr),children:(0,uy.jsx)(ly,{...me(this,Xr),controller:me(this,Zr),canvasHost:this})})))}applyBaseStyles(){if(me(this,Da).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(f1),me(this,Da).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=f1,me(this,Da).appendChild(a)}}};Da=new WeakMap,Gn=new WeakMap,Wn=new WeakMap,Wr=new WeakMap,Zr=new WeakMap,Zn=new WeakMap,Xr=new WeakMap;var cy=()=>{typeof window>"u"||customElements.get(d1)||customElements.define(d1,Wf)};var Zf=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let x=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=DI(x)}let a=null,r=null,n=null,{runtime:o}=t;async function i(x){!o?.actions||x.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(x))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let x=await t.fetcher();a=x,console.log("[SmartCanvas] Config fetched:",`tiles=${x.tiles?.length??0},`,`actions=${x.actions?.length??0},`,`theme=${x.theme?.mode??"default"}`),x.actions?.length&&console.log("[SmartCanvas] Actions to apply:",x.actions.map((f,m)=>`[${m}] ${f.kind}${f.anchorId?` anchor="${typeof f.anchorId=="string"?f.anchorId:f.anchorId.selector}"`:""}${f.label?` "${f.label}"`:""}`).join(", ")),x.actions&&x.actions.length>0&&o?.actions&&(await i(x.actions),console.log("[SmartCanvas] Initial actions applied successfully")),x.tiles&&o?.accumulator&&yu(x.tiles,o.accumulator,x.actions)}catch(x){console.error("[SmartCanvas] Error fetching/applying initial config:",x)}e&&e();let l=Mf();cy();let u=document.createElement("smart-canvas");if(VI(u.getOverlayContainer()),t.tokens)for(let[x,f]of Object.entries(t.tokens))u.style.setProperty(x,f);let c=()=>{let x=t.target??document.body;x&&x.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),HI(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,h=t.integrations?.telemetry,g=t.fetcher??zo({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=g);let S={fetcher:g,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:h,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:n,workspaceTheme:t.workspaceTheme};u.mountReactApp(S),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:x=>{for(let[f,m]of Object.entries(x))u.style.setProperty(f,m)},getConfig:async()=>{if(r)try{let x=await r();return a=x,x}catch(x){console.error("[SmartCanvas] Error fetching config:",x)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async x=>{x?a&&await i(a.actions):await s()},setOverrideFetcher:x=>{r=x,u.setOverrideFetcher(x),o?.accumulator&&x().then(f=>{f?.tiles&&yu(f.tiles,o.accumulator,f.actions)}).catch(()=>{})},registerTelemetryProperties:x=>{h?.register?.(x)},getSessionId:()=>h?.getSessionId?.(),startSessionRecording:()=>{h?.startSessionRecording?.()},track:(x,f)=>h?.track?(h.track(x,f),!0):!1,runtime:o};if(typeof window<"u"){let x=window.SynOS;x&&(x.handle=b)}return b};typeof window<"u"&&(window.SmartCanvas={async create(t){return Zf(t)}});var Yn=K(We(),1);var Xn=K(Me(),1);function gO({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,Yn.useState)(0),o=(0,Yn.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,Yn.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,Yn.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,Yn.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,Xn.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:"var(--sc-tile-border)",background:"var(--sc-tile-background)",padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,Xn.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,Xn.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,Xn.jsx)(ms,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,Xn.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,Xn.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===r?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>n(s)},i.id))})]}):null}function vs(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function vO(t){let e=[],a=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let r=t;if(r.tiles||a.push("Config missing required field: tiles"),r.actions||a.push("Config missing required field: actions"),r.fetchedAt||a.push("Config missing required field: fetchedAt"),a.length>0)return{valid:!1,errors:a,warnings:e};let n=r.schemaVersion||"1.0",o=vs(n),i=vs(jr);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${jr}. Some features may not work. Update SDK to latest version.`),o.major<i.major||!r.schemaVersion?(e.push(`Config schema v${n} is older than SDK v${jr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:yO(r,n)}):{valid:!0,warnings:e,errors:a}}function yO(t,e){let a={...t};return vs(e).major===1&&(a=xO(a)),a.schemaVersion=jr,a}function xO(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(a=>{let r={...a};return a.experiment&&delete r.experiment,r})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function bO(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=vs(a),n=vs(jr);return r.major<n.major||!e.schemaVersion}var m1={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function g1(){return m1}function dy(t){let e=2166136261,a=t.length;for(let r=0;r<a;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Au(t,e,a){return a===2?dy(dy(t+e)+"")%1e4/1e4:a===1?dy(e+t)%1e3/1e3:null}function SO(t){return t<=0?[]:new Array(t).fill(1/t)}function Xf(t,e){return t>=e[0]&&t<e[1]}function v1(t,e){let a=Au("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function y1(t,e){for(let a=0;a<e.length;a++)if(Xf(t,e[a]))return a;return-1}function py(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Yf(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=wO(t,e[n].type,e[n].pattern);if(e[n].include===!1){if(o)return!1}else a=!0,o&&(r=!0)}return r||!a}function CO(t,e,a){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return a&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function _O(t,e){try{let a=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,a.host,!1],[t.pathname,a.pathname,!0]];return a.hash&&r.push([t.hash,a.hash,!1]),a.searchParams.forEach((n,o)=>{r.push([t.searchParams.get(o)||"",n,!1])}),!r.some(n=>!CO(n[0],n[1],n[2]))}catch{return!1}}function wO(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=py(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return _O(r,a);return!1}catch{return!1}}function x1(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=SO(t);a=a||r,a.length!==t&&(a=r);let n=a.reduce((i,s)=>s+i,0);(n<.99||n>1.01)&&(a=r);let o=0;return a.map(i=>{let s=o;return o+=i,[s,s+e*i]})}function b1(t,e,a){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let n=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return n.length>0&&n[0]>=0&&n[0]<a?n[0]:null}function S1(t){try{return t()}catch(e){return console.error(e),!1}}var fy=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function jo(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||m1.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",fy(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:fy(n)},r,fy(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function ku(t){return typeof t=="string"?t:JSON.stringify(t)}function ga(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(a=>a.match(/^[0-9]+$/)?a.padStart(5," "):a).join("-")}function C1(){let t;try{t="1.6.4"}catch{t=""}return t}function _1(t,e){let a,r;try{a=new URL(t),r=new URL(e)}catch(n){return console.error(`Unable to merge query strings: ${n}`),e}return a.searchParams.forEach((n,o)=>{r.searchParams.has(o)||r.searchParams.set(o,n)}),r.toString()}function h1(t){return typeof t=="object"&&t!==null}function Kf(t){return t.urlPatterns&&t.variations.some(e=>h1(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>h1(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Qf(t,e){return new Promise(a=>{let r=!1,n,o=i=>{r||(r=!0,n&&clearTimeout(n),a(i||null))};e&&(n=setTimeout(()=>o(),e)),t.then(i=>o(i)).catch(()=>o())})}var Rt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},fr=g1(),ys={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>fr.fetch(`${t}/api/features/${e}`,{headers:a}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:a,headers:r})=>{let n={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(a)};return fr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new fr.EventSource(`${t}/sub/${e}`,{headers:a}):new fr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),AO()):document.visibilityState==="hidden"&&(t=window.setTimeout(IO,Rt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(fr.localStorage=globalThis.localStorage)}catch{}var xs=new Map,w1=!1,Yr=new Map,Jf=new Map,bs=new Map,Ss=new Set;function I1(t){Object.assign(Rt,t),Rt.backgroundSync||xy()}async function A1({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(Rt.backgroundSync=!1),kO({instance:t,allowStale:r,timeout:e,skipCache:a})}function LO(t){let e=Eu(t),a=xs.get(e)||new Set;a.add(t),xs.set(e,a)}function k1(t){xs.forEach(e=>e.delete(t))}function IO(){bs.forEach(t=>{t&&(t.state="idle",vy(t))})}function AO(){bs.forEach(t=>{t&&t.state==="idle"&&yy(t)})}async function L1(){try{if(!fr.localStorage)return;await fr.localStorage.setItem(Rt.cacheKey,JSON.stringify(Array.from(Yr.entries())))}catch{}}async function kO({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=Eu(t),o=my(t),i=new Date,s=new Date(i.getTime()-Rt.maxAge+Rt.staleTTL);await EO();let l=!Rt.disableCache&&!r?Yr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&Ss.add(n),l.staleAt<i?hy(t):gy(t),{data:l.data,success:!0,source:"cache"}):await Qf(hy(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Eu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function my(t){let e=Eu(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let a=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),n={};r.forEach(s=>{n[s]=a[s]});let o=t.getForcedVariations(),i=t.getUrl();return`${e}||${JSON.stringify({ca:n,fv:o,url:i})}`}async function EO(){if(!w1){w1=!0;try{if(fr.localStorage){let t=await fr.localStorage.getItem(Rt.cacheKey);if(!Rt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{Yr.set(a,{...r,staleAt:new Date(r.staleAt)})}),E1()}}}catch{}if(!Rt.disableIdleStreams){let t=ys.startIdleListener();t&&(ys.stopIdleListener=t)}}}function E1(){let t=Array.from(Yr.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,Yr.size-Rt.maxEntries),Yr.size);for(let a=0;a<e;a++)Yr.delete(t[a].key)}function T1(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+Rt.staleTTL),o=Rt.disableCache?void 0:Yr.get(e);if(o&&r&&o.version===r){o.staleAt=n,L1();return}Rt.disableCache||(Yr.set(e,{data:a,version:r,staleAt:n,sse:Ss.has(t)}),E1()),L1();let i=xs.get(t);i&&i.forEach(s=>TO(s,a))}async function TO(t,e){await t.setPayload(e||t.getPayload())}async function hy(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=Eu(t),i=my(t),s=Jf.get(i);return s||(s=(n?ys.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):ys.fetchFeaturesCall({host:e,clientKey:r,headers:a})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&Ss.add(o),u.json()}).then(u=>(T1(o,i,u),gy(t),Jf.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(Jf.delete(i),{data:null,source:"error",success:!1,error:u})),Jf.set(i,s)),s}function gy(t,e=!1){let a=Eu(t),r=my(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&Ss.add(a),Rt.backgroundSync&&Ss.has(a)&&fr.EventSource){if(bs.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=xs.get(a);u&&u.forEach(c=>{hy(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);T1(a,r,u)}s.errors=0}catch{R1(s)}},errors:0,state:"active"};bs.set(a,s),yy(s)}}function R1(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);vy(t),setTimeout(()=>{["idle","active"].includes(t.state)||yy(t)},Math.min(e,3e5))}}function vy(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function yy(t){t.src=ys.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>R1(t),t.src.onopen=()=>{t.errors=0}}function RO(t,e){vy(t),bs.delete(e)}function xy(){Ss.clear(),bs.forEach(RO),xs.clear(),ys.stopIdleListener()}function ep(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&gy(t,!0),LO(t)}}var MO=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Cy={revert:function(){}},np=new Map,_y=new Set;function DO(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function op(t){var e=np.get(t);return e||(e={element:t,attributes:{}},np.set(t,e)),e}function ip(t,e,a,r,n){var o=a(t),i={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&i._positionTimeout)){e==="position"&&(i._positionTimeout=setTimeout(function(){i._positionTimeout=null},1e3));var s=a(t);e==="position"&&s.parentNode===i.virtualValue.parentNode&&s.insertBeforeNode===i.virtualValue.insertBeforeNode||s!==i.virtualValue&&(i.originalValue=s,n(i))}}),mutationRunner:n,setValue:r,getCurrentValue:a};return e==="position"&&t.parentNode?i.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.observer.observe(t,DO(e)),i}function sp(t,e){var a=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!a||t.parentNode!==a.parentNode||t.insertBeforeNode!==a.insertBeforeNode)&&(e.isDirty=!0,M1()):t!==a&&(e.isDirty=!0,M1())}function OO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),sp(ZO(e),t)}function BO(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),sp(Array.from(e).filter(Boolean).join(" "),t)}function FO(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),sp(e,t)}function NO(t){var e=t.parentSelector,a=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var n=a?document.querySelector(a):null;return a&&!n?null:{parentNode:r,insertBeforeNode:n}}function PO(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=NO(r);e=n||e}),sp(e,t)}var HO=function(e){return e.innerHTML},UO=function(e,a){return e.innerHTML=a};function O1(t){var e=op(t);return e.html||(e.html=ip(t,"html",HO,UO,OO)),e.html}var qO=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},zO=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function B1(t){var e=op(t);return e.position||(e.position=ip(t,"position",qO,zO,PO)),e.position}var VO=function(e,a){return a?e.className=a:e.removeAttribute("class")},$O=function(e){return e.className};function F1(t){var e=op(t);return e.classes||(e.classes=ip(t,"class",$O,VO,BO)),e.classes}var jO=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},GO=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function N1(t,e){var a=op(t);return a.attributes[e]||(a.attributes[e]=ip(t,e,jO(e),GO(e),FO)),a.attributes[e]}function WO(t,e){var a=np.get(t);if(a)if(e==="html"){var r,n;(r=a.html)==null||(n=r.observer)==null||n.disconnect(),delete a.html}else if(e==="class"){var o,i;(o=a.classes)==null||(i=o.observer)==null||i.disconnect(),delete a.classes}else if(e==="position"){var s,l;(s=a.position)==null||(l=s.observer)==null||l.disconnect(),delete a.position}else{var u,c,d;(u=a.attributes)==null||(c=u[e])==null||(d=c.observer)==null||d.disconnect(),delete a.attributes[e]}}var tp;function ZO(t){return tp||(tp=document.createElement("div")),tp.innerHTML=t,tp.innerHTML}function ap(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||WO(t,e),a.setValue(t,r)}}function XO(t,e){t.html&&ap(e,"html",t.html),t.classes&&ap(e,"class",t.classes),t.position&&ap(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){ap(e,a,t.attributes[a])})}function M1(){np.forEach(XO)}function YO(t,e){var a=null;t.kind==="html"?a=O1(e):t.kind==="class"?a=F1(e):t.kind==="attribute"?a=N1(e,t.attribute):t.kind==="position"&&(a=B1(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function KO(t,e){var a=null;if(t.kind==="html"?a=O1(e):t.kind==="class"?a=F1(e):t.kind==="attribute"?a=N1(e,t.attribute):t.kind==="position"&&(a=B1(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function P1(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),a=document.querySelectorAll(t.selector);a.forEach(function(r){e.has(r)||(t.elements.add(r),YO(t,r))})}}function QO(t){t.elements.forEach(function(e){return KO(t,e)}),t.elements.clear(),_y.delete(t)}function D1(){_y.forEach(P1)}var by;function JO(){typeof document>"u"||(by||(by=new MutationObserver(function(){D1()})),D1(),by.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}JO();function lp(t){return typeof document>"u"?Cy:(_y.add(t),P1(t),{revert:function(){QO(t)}})}function Sy(t,e){return lp({kind:"html",elements:new Set,mutate:e,selector:t})}function H1(t,e){return lp({kind:"position",elements:new Set,mutate:e,selector:t})}function Tu(t,e){return lp({kind:"class",elements:new Set,mutate:e,selector:t})}function rp(t,e,a){return MO.test(e)?e==="class"||e==="className"?Tu(t,function(r){var n=a(Array.from(r).join(" "));r.clear(),n&&n.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):lp({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):Cy}function eB(t){var e=t.selector,a=t.action,r=t.value,n=t.attribute,o=t.parentSelector,i=t.insertBeforeSelector;if(n==="html"){if(a==="append")return Sy(e,function(s){return s+(r??"")});if(a==="set")return Sy(e,function(){return r??""})}else if(n==="class"){if(a==="append")return Tu(e,function(s){r&&s.add(r)});if(a==="remove")return Tu(e,function(s){r&&s.delete(r)});if(a==="set")return Tu(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return H1(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return rp(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return rp(e,n,function(){return r??""});if(a==="remove")return rp(e,n,function(){return null})}return Cy}var tB={html:Sy,classes:Tu,attribute:rp,position:H1,declarative:eB},U1=tB;var wy={};function Kn(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!V1(t,n,a))return!1;break;case"$nor":if(V1(t,n,a))return!1;break;case"$and":if(!iB(t,n,a))return!1;break;case"$not":if(Kn(t,n,a))return!1;break;default:if(!Ru(n,aB(t,r),a))return!1}return!0}function aB(t,e){let a=e.split("."),r=t;for(let n=0;n<a.length;n++)if(r&&typeof r=="object"&&a[n]in r)r=r[a[n]];else return null;return r}function q1(t,e=!1){let a=`${t}${e?"/i":""}`;return wy[a]||(wy[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),wy[a]}function Ru(t,e,a,r=!1){if(typeof t=="string")return r?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!$1(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!oB(n,e,t[n],a))return!1;return!0}function $1(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function rB(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function nB(t,e,a){if(!Array.isArray(t))return!1;let r=$1(e)?n=>Ru(e,n,a):n=>Kn(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function Cs(t,e,a=!1){if(a){let r=n=>typeof n=="string"?n.toLowerCase():n;return Array.isArray(t)?t.some(n=>e.some(o=>r(n)===r(o))):e.some(n=>r(t)===r(n))}return Array.isArray(t)?t.some(r=>e.includes(r)):e.includes(t)}function z1(t,e,a,r=!1){if(!Array.isArray(t))return!1;for(let n=0;n<e.length;n++){let o=!1;for(let i=0;i<t.length;i++)if(Ru(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function oB(t,e,a,r){switch(t){case"$veq":return ga(e)===ga(a);case"$vne":return ga(e)!==ga(a);case"$vgt":return ga(e)>ga(a);case"$vgte":return ga(e)>=ga(a);case"$vlt":return ga(e)<ga(a);case"$vlte":return ga(e)<=ga(a);case"$eq":return e===a;case"$ne":return e!==a;case"$lt":return e<a;case"$lte":return e<=a;case"$gt":return e>a;case"$gte":return e>=a;case"$exists":return a?e!=null:e==null;case"$in":return Array.isArray(a)?Cs(e,a):!1;case"$ini":return Array.isArray(a)?Cs(e,a,!0):!1;case"$inGroup":return Cs(e,r[a]||[]);case"$notInGroup":return!Cs(e,r[a]||[]);case"$nin":return Array.isArray(a)?!Cs(e,a):!1;case"$nini":return Array.isArray(a)?!Cs(e,a,!0):!1;case"$not":return!Ru(a,e,r);case"$size":return Array.isArray(e)?Ru(a,e.length,r):!1;case"$elemMatch":return nB(e,a,r);case"$all":return Array.isArray(a)?z1(e,a,r):!1;case"$alli":return Array.isArray(a)?z1(e,a,r,!0):!1;case"$regex":try{return q1(a).test(e)}catch{return!1}case"$regexi":try{return q1(a,!0).test(e)}catch{return!1}case"$type":return rB(e)===a;default:return console.error("Unknown operator: "+t),!1}}function V1(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Kn(t,e[r],a))return!0;return!1}function iB(t,e,a){for(let r=0;r<e.length;r++)if(!Kn(t,e[r],a))return!1;return!0}var sB="Feature Evaluated",lB="Experiment Viewed";function uB(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((a,r)=>e.set(r,a)),e}function cB(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function _s(t){try{await t()}catch{}}function j1(t,e,a){if(t.user.trackedExperiments){let n=dp(e,a);if(t.user.trackedExperiments.has(n))return[];t.user.trackedExperiments.add(n)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:a,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let n=t.global.trackingCallback;r.push(_s(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(_s(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(_s(()=>n(lB,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function dB(t,e,a){if(t.user.trackedFeatureUsage){let r=JSON.stringify(a.value);if(t.user.trackedFeatureUsage[e]===r)return;t.user.trackedFeatureUsage[e]=r,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:a,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;_s(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;_s(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;_s(()=>r(sB,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function up(t,e){if(e.stack.evaluatedFeatures.has(t))return Qn(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=uB(e);if(a.has(t))return Qn(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return Qn(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let n=new Set(e.stack.evaluatedFeatures);e:for(let o of r.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(n);let u=up(l.id,e);if(u.source==="cyclicPrerequisite")return Qn(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!Kn(c,l.condition||{})){if(l.gate)return Qn(e,t,null,"prerequisite");continue e}}if(o.filters&&Z1(o.filters,e))continue;if("force"in o){if(o.condition&&!W1(o.condition,e)||!fB(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!j1(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Qn(e,t,o.force,"force",o.id)}if(!o.variations)continue;let i={variations:o.variations,key:o.key||t};"coverage"in o&&(i.coverage=o.coverage),o.weights&&(i.weights=o.weights),o.hashAttribute&&(i.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(i.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(i.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(i.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(i.minBucketVersion=o.minBucketVersion),o.namespace&&(i.namespace=o.namespace),o.meta&&(i.meta=o.meta),o.ranges&&(i.ranges=o.ranges),o.name&&(i.name=o.name),o.phase&&(i.phase=o.phase),o.seed&&(i.seed=o.seed),o.hashVersion&&(i.hashVersion=o.hashVersion),o.filters&&(i.filters=o.filters),o.condition&&(i.condition=o.condition);let{result:s}=cp(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return Qn(e,t,s.value,"experiment",o.id,i,s)}}return Qn(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function cp(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:$e(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:$e(a,t,-1,!1,e)};if(t=pB(t,a),t.urlPatterns&&!Yf(a.user.url||"",t.urlPatterns))return{result:$e(a,t,-1,!1,e)};let o=b1(r,a.user.url||"",n);if(o!==null)return{result:$e(a,t,o,!1,e)};let i=cB(a);if(r in i){let x=i[r];return{result:$e(a,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:$e(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=Go(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:$e(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:f}=gB({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=x>=0,u=x,d=!!f}if(!c){if(t.filters){if(Z1(t.filters,a))return{result:$e(a,t,-1,!1,e)}}else if(t.namespace&&!v1(l,t.namespace))return{result:$e(a,t,-1,!1,e)};if(t.include&&!S1(t.include))return{result:$e(a,t,-1,!1,e)};if(t.condition&&!W1(t.condition,a))return{result:$e(a,t,-1,!1,e)};if(t.parentConditions){let x=new Set(a.stack.evaluatedFeatures);for(let f of t.parentConditions){a.stack.evaluatedFeatures=new Set(x);let m=up(f.id,a);if(m.source==="cyclicPrerequisite")return{result:$e(a,t,-1,!1,e)};let v={value:m.value};if(!Kn(v,f.condition||{}))return{result:$e(a,t,-1,!1,e)}}}if(t.groups&&!mB(t.groups,a))return{result:$e(a,t,-1,!1,e)}}if(t.url&&!hB(t.url,a))return{result:$e(a,t,-1,!1,e)};let h=Au(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:$e(a,t,-1,!1,e)};if(!c){let x=t.ranges||x1(n,t.coverage===void 0?1:t.coverage,t.weights);u=y1(h,x)}if(d)return{result:$e(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:$e(a,t,-1,!1,e)};if("force"in t)return{result:$e(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:$e(a,t,-1,!1,e)};if(t.status==="stopped")return{result:$e(a,t,-1,!1,e)};let g=$e(a,t,u,!0,e,h,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:f,doc:m}=yB(a,s,ku(l),{[Ly(t.key,t.bucketVersion)]:g.key});x&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[f]=m,a.user.saveStickyBucketAssignmentDoc(m))}let S=j1(a,t,g);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:g});let b=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&a.global.recordChangeId&&a.global.recordChangeId(t.changeId),{result:g,trackingCall:b}}function Qn(t,e,a,r,n,o,i){let s={value:a,on:!!a,off:!a,source:r,ruleId:n||""};return o&&(s.experiment=o),i&&(s.experimentResult=i),r!=="override"&&dB(t,e,s),s}function G1(t){return{...t.user.attributes,...t.user.attributeOverrides}}function W1(t,e){return Kn(G1(e),t,e.global.savedGroups||{})}function Z1(t,e){return t.some(a=>{let{hashValue:r}=Go(e,a.attribute);if(!r)return!0;let n=Au(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>Xf(n,o))})}function fB(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=Go(t,a,r);if(!s)return!1;let l=Au(e,s,i||1);return l===null?!1:n?Xf(l,n):o!==void 0?l<=o:!0}function $e(t,e,a,r,n,o,i){let s=!0;(a<0||a>=e.variations.length)&&(a=0,s=!1);let{hashAttribute:l,hashValue:u}=Go(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[a]:{},d={key:c.key||""+a,featureId:n,inExperiment:s,hashUsed:r,variationId:a,value:e.variations[a],hashAttribute:l,hashValue:u,stickyBucketUsed:!!i};return c.name&&(d.name=c.name),o!==void 0&&(d.bucket=o),c.passthrough&&(d.passthrough=c.passthrough),d}function pB(t,e){let a=t.key,r=e.global.overrides;return r&&r[a]&&(t=Object.assign({},t,r[a]),typeof t.url=="string"&&(t.url=py(t.url))),t}function Go(t,e,a){let r=e||"id",n="",o=G1(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function hB(t,e){let a=e.user.url;if(!a)return!1;let r=a.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(a)||t.test(r))}function mB(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function gB({ctx:t,expKey:e,expBucketVersion:a,expHashAttribute:r,expFallbackAttribute:n,expMinBucketVersion:o,expMeta:i}){a=a||0,o=o||0,r=r||"id",i=i||[];let s=Ly(e,a),l=vB(t,r,n);if(o>0)for(let d=0;d<o;d++){let h=Ly(e,d);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let u=l[s];if(u===void 0)return{variation:-1};let c=i.findIndex(d=>d.key===u);return c<0?{variation:-1}:{variation:c}}function Ly(t,e){return e=e||0,`${t}__${e}`}function Iy(t,e){return`${t}||${e}`}function vB(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=Go(t,e),o=Iy(r,ku(n)),{hashAttribute:i,hashValue:s}=Go(t,a),l=s?Iy(i,ku(s)):null,u={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[o].assignments||{}),u}function yB(t,e,a,r){let n=Iy(e,a),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[n]?t.user.stickyBucketAssignmentDocs[n].assignments||{}:{},i={...o,...r},s=JSON.stringify(o)!==JSON.stringify(i);return{key:n,doc:{attributeName:e,attributeValue:a,assignments:i},changed:s}}function xB(t,e){let a=new Set,r=e&&e.features?e.features:t.global.features||{},n=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let i=r[o];if(i.rules)for(let s of i.rules)s.variations&&(a.add(s.hashAttribute||"id"),s.fallbackAttribute&&a.add(s.fallbackAttribute))}),n.map(o=>{a.add(o.hashAttribute||"id"),o.fallbackAttribute&&a.add(o.fallbackAttribute)}),Array.from(a)}async function X1(t,e,a){let r=Ay(t,a);return e.getAllAssignments(r)}function Ay(t,e){let a={};return xB(t,e).forEach(n=>{let{hashValue:o}=Go(t,n);a[n]=ku(o)}),a}async function Y1(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await jo(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await jo(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await jo(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function K1(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function dp(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var ws=typeof window<"u"&&typeof document<"u",bB=C1(),Mu=class{constructor(e){if(e=e||{},this.version=bB,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let a=!1;try{a=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(a)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let a=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>a.saveAssignments(r)}if(e.plugins)for(let a of e.plugins)a(this);if(e.features&&(this.ready=!0),ws&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let a in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[a];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let a=await Y1(e,this._options.decryptionKey);this._decryptedPayload=a,await this.refreshStickyBuckets(a),a.features&&(this._options.features=a.features),a.savedGroups&&(this._options.savedGroups=a.savedGroups),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let a=e.payload;if(a.encryptedExperiments||a.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,a)),this._payload=a,this._decryptedPayload=a,a.features&&(this._options.features=a.features),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,ep(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&I1(e.cacheSettings),e.payload)return await this.setPayload(e.payload),ep(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return ep(this,e),await this.setPayload(a||{}),r}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let a=await this._refresh({...e||{},allowStale:!1});a.data&&await this.setPayload(a.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return K1(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:a,allowStale:r,streaming:n}){if(!this._options.clientKey)throw new Error("Missing clientKey");return A1({instance:this,timeout:e,skipCache:a||this._options.disableCache,allowStale:r,backgroundSync:n??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,a,r){let n=await jo(e,a||this._options.decryptionKey,r);this.setFeatures(JSON.parse(n))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,a,r){let n=await jo(e,a||this._options.decryptionKey,r);this.setExperiments(JSON.parse(n))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(a=>{try{a()}catch(r){console.error(r)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,k1(this),e.destroyAllStreams&&xy(),this.logs=[],ws&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(a=>{a.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,a){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=a,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:a}=cp(e,null,this._getEvalContext());return this._onExperimentEval(e,a),a}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(r=>r.key===e).map(r=>this._runAutoExperiment(r)).filter(r=>r!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,a){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let n=this._isAutoExperimentBlockedByContext(e),o,i;n?o=$e(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=cp(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!a&&o.inExperiment&&r&&r.valueHash===s)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Kf(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?_1(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Yf(u,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=u;let{navigate:c,delay:d}=this._getNavigateFunction();if(c)if(ws)Promise.all([...i?[Qf(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(h){console.error(h)}});else try{c(u)}catch(h){console.error(h)}}else if(l==="visual"){let u=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);u&&this._activeAutoExperiments.set(e,{undo:u,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let a=this._activeAutoExperiments.get(e);a&&(a.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let a=this._options.experiments||[],r=new Set(a);this._activeAutoExperiments.forEach((n,o)=>{r.has(o)||(n.undo(),this._activeAutoExperiments.delete(o))});for(let n of a){let o=this._runAutoExperiment(n,e);if(o&&o.inExperiment&&Kf(n)==="redirect")break}}_onExperimentEval(e,a){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:a}),this._subscriptions.size>0&&this._fireSubscriptions(e,a,r)}_fireSubscriptions(e,a,r){(!r||r.result.inExperiment!==a.inExperiment||r.result.variationId!==a.variationId)&&this._subscriptions.forEach(n=>{try{n(e,a)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,a){let r=this.evalFeature(e).value;return r===null?a:r}feature(e){return this.evalFeature(e)}evalFeature(e){return up(e,this._getEvalContext())}log(e,a){this.debug&&(this._options.log?this._options.log(e,a):console.log(e,a))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(a=>a&&a.experiment&&a.result).map(a=>[dp(a.experiment,a.result),a]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(a=>{!a||!a.experiment||!a.result?console.error("Invalid deferred tracking call",{call:a}):e.push(this._options.trackingCallback(a.experiment,a.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,a){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:a,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,a||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(dp(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(ws?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=Kf(e);if(a==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(a==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let n of e.variations){if(!n||!n.urlRedirect)continue;let o=new URL(n.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==r.protocol||o.host!==r.host))return!0}}catch(r){return this.log("Error parsing current or redirect URL",{id:e.key,error:r}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:ws?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!ws)return;let a=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),a.push(()=>r.remove())}if(e.js){let r=document.createElement("script");r.innerHTML=e.js,this._options.jsInjectionNonce&&(r.nonce=this._options.jsInjectionNonce),document.head.appendChild(r),a.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{a.push(U1.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await X1(a,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,a){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),n=Ay(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var SB="https://experiment.syntrologie.com",ky=class{constructor(e={}){j(this,"gb");j(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(r,n)=>{e.onExperimentViewed(r.key,n.variationId,typeof n.value=="string"?n.value:`variation_${n.variationId}`)}:void 0;this.gb=new Mu({...e,apiHost:e.apiHost??SB,enableDevMode:e.enableDevMode??!0,trackingCallback:a}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes({...this.gb.getAttributes(),...e})}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,a){return this.gb.getFeatureValue(e,a)}getAllFeatures(){let e=this.gb.getFeatures(),a={};for(let r of Object.keys(e))a[r]=this.gb.getFeatureValue(r,null);return a}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let a of this.featureListeners)a()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function fp(t={}){return new ky(t)}var Q1="syntro_session_metrics",Du=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let n=(this.metrics.get(e)??0)+a;return this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n),n}set(e,a){this.metrics.set(e,a),this.saveToStorage(),this.updateExperimentAttributes(e,a),this.onMetricChange?.(e,a)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,a){return this.get(e)>=a}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let a={};for(let r of e)a[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,r]of this.metrics)e[`${this.attributePrefix}${a}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(Q1);if(e){let a=JSON.parse(e);for(let[r,n]of Object.entries(a))this.metrics.set(r,n.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[a,r]of this.metrics)e[a]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(Q1,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function pp(t={}){return new Du(t)}var p={};bS(p,{BRAND:()=>WB,DIRTY:()=>Wo,EMPTY_PATH:()=>LB,INVALID:()=>Q,NEVER:()=>RF,OK:()=>Mt,ParseStatus:()=>wt,Schema:()=>le,ZodAny:()=>to,ZodArray:()=>en,ZodBigInt:()=>Xo,ZodBoolean:()=>Yo,ZodBranded:()=>Bu,ZodCatch:()=>si,ZodDate:()=>Ko,ZodDefault:()=>ii,ZodDiscriminatedUnion:()=>gp,ZodEffects:()=>Fa,ZodEnum:()=>ni,ZodError:()=>Qt,ZodFirstPartyTypeKind:()=>J,ZodFunction:()=>yp,ZodIntersection:()=>ti,ZodIssueCode:()=>O,ZodLazy:()=>ai,ZodLiteral:()=>ri,ZodMap:()=>Ts,ZodNaN:()=>Ms,ZodNativeEnum:()=>oi,ZodNever:()=>Ja,ZodNull:()=>Jo,ZodNullable:()=>mr,ZodNumber:()=>Zo,ZodObject:()=>Jt,ZodOptional:()=>Oa,ZodParsedType:()=>$,ZodPipeline:()=>Fu,ZodPromise:()=>ao,ZodReadonly:()=>li,ZodRecord:()=>vp,ZodSchema:()=>le,ZodSet:()=>Rs,ZodString:()=>eo,ZodSymbol:()=>ks,ZodTransformer:()=>Fa,ZodTuple:()=>hr,ZodType:()=>le,ZodUndefined:()=>Qo,ZodUnion:()=>ei,ZodUnknown:()=>Jr,ZodVoid:()=>Es,addIssueToContext:()=>P,any:()=>aF,array:()=>iF,bigint:()=>KB,boolean:()=>uA,coerce:()=>TF,custom:()=>iA,date:()=>QB,datetimeRegex:()=>nA,defaultErrorMap:()=>Kr,discriminatedUnion:()=>cF,effect:()=>CF,enum:()=>xF,function:()=>gF,getErrorMap:()=>Ls,getParsedType:()=>pr,instanceof:()=>XB,intersection:()=>dF,isAborted:()=>hp,isAsync:()=>Is,isDirty:()=>mp,isValid:()=>Jn,late:()=>ZB,lazy:()=>vF,literal:()=>yF,makeIssue:()=>Ou,map:()=>hF,nan:()=>YB,nativeEnum:()=>bF,never:()=>nF,null:()=>tF,nullable:()=>wF,number:()=>lA,object:()=>sF,objectUtil:()=>Ey,oboolean:()=>EF,onumber:()=>kF,optional:()=>_F,ostring:()=>AF,pipeline:()=>IF,preprocess:()=>LF,promise:()=>SF,quotelessJson:()=>CB,record:()=>pF,set:()=>mF,setErrorMap:()=>wB,strictObject:()=>lF,string:()=>sA,symbol:()=>JB,transformer:()=>CF,tuple:()=>fF,undefined:()=>eF,union:()=>uF,unknown:()=>rF,util:()=>de,void:()=>oF});var de;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function a(n){throw new Error}t.assertNever=a,t.arrayToEnum=n=>{let o={};for(let i of n)o[i]=i;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),i={};for(let s of o)i[s]=n[s];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(i);return o},t.find=(n,o)=>{for(let i of n)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,o=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(de||(de={}));var Ey;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ey||(Ey={}));var $=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pr=t=>{switch(typeof t){case"undefined":return $.undefined;case"string":return $.string;case"number":return Number.isNaN(t)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":return Array.isArray(t)?$.array:t===null?$.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?$.promise:typeof Map<"u"&&t instanceof Map?$.map:typeof Set<"u"&&t instanceof Set?$.set:typeof Date<"u"&&t instanceof Date?$.date:$.object;default:return $.unknown}};var O=de.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),CB=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(o){return o.message},r={_errors:[]},n=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let s=r,l=0;for(;l<i.path.length;){let u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(a(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];a[o]=a[o]||[],a[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Qt.create=t=>new Qt(t);var _B=(t,e)=>{let a;switch(t.code){case O.invalid_type:t.received===$.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:a=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case O.invalid_union:a="Invalid input";break;case O.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case O.invalid_enum_value:a=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:a="Invalid function arguments";break;case O.invalid_return_type:a="Invalid function return type";break;case O.invalid_date:a="Invalid date";break;case O.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case O.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case O.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case O.custom:a="Invalid input";break;case O.invalid_intersection_types:a="Intersection results could not be merged";break;case O.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:a="Number must be finite";break;default:a=e.defaultError,de.assertNever(t)}return{message:a}},Kr=_B;var J1=Kr;function wB(t){J1=t}function Ls(){return J1}var Ou=t=>{let{data:e,path:a,errorMaps:r,issueData:n}=t,o=[...a,...n.path||[]],i={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)s=u(i,{data:e,defaultError:s}).message;return{...n,path:o,message:s}},LB=[];function P(t,e){let a=Ls(),r=Ou({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Kr?void 0:Kr].filter(n=>!!n)});t.common.issues.push(r)}var wt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let n of a){if(n.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let n of a){let o=await n.key,i=await n.value;r.push({key:o,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let n of a){let{key:o,value:i}=n;if(o.status==="aborted"||i.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}},Q=Object.freeze({status:"aborted"}),Wo=t=>({status:"dirty",value:t}),Mt=t=>({status:"valid",value:t}),hp=t=>t.status==="aborted",mp=t=>t.status==="dirty",Jn=t=>t.status==="valid",Is=t=>typeof Promise<"u"&&t instanceof Promise;var Z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Z||(Z={}));var Ba=class{constructor(e,a,r,n){this._cachedPath=[],this.parent=e,this.data=a,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},eA=(t,e)=>{if(Jn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let a=new Qt(t.common.issues);return this._error=a,this._error}}};function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:n}=t;if(e&&(a||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:n}}var le=class{get description(){return this._def.description}_getType(e){return pr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(Is(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let r=this.safeParse(e,a);if(r.success)return r.data;throw r.error}safeParse(e,a){let r={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return eA(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return Jn(r)?{value:r.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(r=>Jn(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(e,a){let r=await this.safeParseAsync(e,a);if(r.success)return r.data;throw r.error}async safeParseAsync(e,a){let r={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(Is(n)?n:Promise.resolve(n));return eA(r,o)}refine(e,a){let r=n=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(n):a;return this._refinement((n,o)=>{let i=e(n),s=()=>o.addIssue({code:O.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,a){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof a=="function"?a(r,n):a),!1))}_refinement(e){return new Fa({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return Oa.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return en.create(this)}promise(){return ao.create(this,this._def)}or(e){return ei.create([this,e],this._def)}and(e){return ti.create(this,e,this._def)}transform(e){return new Fa({...se(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new ii({...se(this._def),innerType:this,defaultValue:a,typeName:J.ZodDefault})}brand(){return new Bu({typeName:J.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new si({...se(this._def),innerType:this,catchValue:a,typeName:J.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Fu.create(this,e)}readonly(){return li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},IB=/^c[^\s-]{8,}$/i,AB=/^[0-9a-z]+$/,kB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EB=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,TB=/^[a-z0-9_-]{21}$/i,RB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,MB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,DB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ty,BB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,FB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,NB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,PB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qB=new RegExp(`^${aA}$`);function rA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function zB(t){return new RegExp(`^${rA(t)}$`)}function nA(t){let e=`${aA}T${rA(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function VB(t,e){return!!((e==="v4"||!e)&&BB.test(t)||(e==="v6"||!e)&&NB.test(t))}function $B(t,e){if(!RB.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function jB(t,e){return!!((e==="v4"||!e)&&FB.test(t)||(e==="v6"||!e)&&PB.test(t))}var eo=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==$.string){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_type,expected:$.string,received:o.parsedType}),Q}let r=new wt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(n=this._getOrReturnCtx(e,n),i?P(n,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&P(n,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")DB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"email",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Ty||(Ty=new RegExp(OB,"u")),Ty.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"emoji",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")EB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"uuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")TB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"nanoid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")IB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"cuid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")AB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"cuid2",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")kB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"ulid",code:O.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),P(n,{validation:"url",code:O.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"regex",code:O.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?nA(o).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?qB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?zB(o).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:O.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?MB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"duration",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?VB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"ip",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?$B(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"jwt",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?jB(e.data,o.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"cidr",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?HB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"base64",code:O.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?UB.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:"base64url",code:O.invalid_string,message:o.message}),r.dirty()):de.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:O.invalid_string,...Z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...Z.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...Z.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...Z.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...Z.errToObj(a)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};eo.create=t=>new eo({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...se(t)});function GB(t,e){let a=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=a>r?a:r,o=Number.parseInt(t.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return o%i/10**n}var Zo=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==$.number){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_type,expected:$.number,received:o.parsedType}),Q}let r,n=new wt;for(let o of this._def.checks)o.kind==="int"?de.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:O.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?GB(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:O.not_finite,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};Zo.create=t=>new Zo({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...se(t)});var Xo=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==$.bigint)return this._getInvalidInput(e);let r,n=new wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),P(r,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):de.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return P(a,{code:O.invalid_type,expected:$.bigint,received:a.parsedType}),Q}gte(e,a){return this.setLimit("min",e,!0,Z.toString(a))}gt(e,a){return this.setLimit("min",e,!1,Z.toString(a))}lte(e,a){return this.setLimit("max",e,!0,Z.toString(a))}lt(e,a){return this.setLimit("max",e,!1,Z.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:Z.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Xo.create=t=>new Xo({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var Yo=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==$.boolean){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:$.boolean,received:r.parsedType}),Q}return Mt(e.data)}};Yo.create=t=>new Yo({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var Ko=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==$.date){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_type,expected:$.date,received:o.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return P(o,{code:O.invalid_date}),Q}let r=new wt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:O.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):de.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}};Ko.create=t=>new Ko({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...se(t)});var ks=class extends le{_parse(e){if(this._getType(e)!==$.symbol){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:$.symbol,received:r.parsedType}),Q}return Mt(e.data)}};ks.create=t=>new ks({typeName:J.ZodSymbol,...se(t)});var Qo=class extends le{_parse(e){if(this._getType(e)!==$.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:$.undefined,received:r.parsedType}),Q}return Mt(e.data)}};Qo.create=t=>new Qo({typeName:J.ZodUndefined,...se(t)});var Jo=class extends le{_parse(e){if(this._getType(e)!==$.null){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:$.null,received:r.parsedType}),Q}return Mt(e.data)}};Jo.create=t=>new Jo({typeName:J.ZodNull,...se(t)});var to=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Mt(e.data)}};to.create=t=>new to({typeName:J.ZodAny,...se(t)});var Jr=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mt(e.data)}};Jr.create=t=>new Jr({typeName:J.ZodUnknown,...se(t)});var Ja=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return P(a,{code:O.invalid_type,expected:$.never,received:a.parsedType}),Q}};Ja.create=t=>new Ja({typeName:J.ZodNever,...se(t)});var Es=class extends le{_parse(e){if(this._getType(e)!==$.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:$.void,received:r.parsedType}),Q}return Mt(e.data)}};Es.create=t=>new Es({typeName:J.ZodVoid,...se(t)});var en=class t extends le{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==$.array)return P(a,{code:O.invalid_type,expected:$.array,received:a.parsedType}),Q;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(P(a,{code:i?O.too_big:O.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&a.data.length<n.minLength.value&&(P(a,{code:O.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&a.data.length>n.maxLength.value&&(P(a,{code:O.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((i,s)=>n.type._parseAsync(new Ba(a,i,a.path,s)))).then(i=>wt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new Ba(a,i,a.path,s)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:Z.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:Z.toString(a)}})}nonempty(e){return this.min(1,e)}};en.create=(t,e)=>new en({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...se(e)});function As(t){if(t instanceof Jt){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=Oa.create(As(r))}return new Jt({...t._def,shape:()=>e})}else return t instanceof en?new en({...t._def,type:As(t.element)}):t instanceof Oa?Oa.create(As(t.unwrap())):t instanceof mr?mr.create(As(t.unwrap())):t instanceof hr?hr.create(t.items.map(e=>As(e))):t}var Jt=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),a=de.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==$.object){let u=this._getOrReturnCtx(e);return P(u,{code:O.invalid_type,expected:$.object,received:u.parsedType}),Q}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ja&&this._def.unknownKeys==="strip"))for(let u in n.data)i.includes(u)||s.push(u);let l=[];for(let u of i){let c=o[u],d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ba(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Ja){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")s.length>0&&(P(n,{code:O.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of s){let d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ba(n,d,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,h=await c.value;u.push({key:d,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>wt.mergeObjectSync(r,u)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,r)=>{let n=this._def.errorMap?.(a,r).message??r.defaultError;return a.code==="unrecognized_keys"?{message:Z.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let a={};for(let r of de.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let r of de.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return As(this)}partial(e){let a={};for(let r of de.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?a[r]=n:a[r]=n.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let r of de.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oa;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return oA(de.objectKeys(this.shape))}};Jt.create=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strip",catchall:Ja.create(),typeName:J.ZodObject,...se(e)});Jt.strictCreate=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strict",catchall:Ja.create(),typeName:J.ZodObject,...se(e)});Jt.lazycreate=(t,e)=>new Jt({shape:t,unknownKeys:"strip",catchall:Ja.create(),typeName:J.ZodObject,...se(e)});var ei=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return a.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new Qt(s.ctx.common.issues));return P(a,{code:O.invalid_union,unionErrors:i}),Q}if(a.common.async)return Promise.all(r.map(async o=>{let i={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:i}),ctx:i}})).then(n);{let o,i=[];for(let l of r){let u={...a,common:{...a.common,issues:[]},parent:null},c=l._parseSync({data:a.data,path:a.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new Qt(l));return P(a,{code:O.invalid_union,unionErrors:s}),Q}}get options(){return this._def.options}};ei.create=(t,e)=>new ei({options:t,typeName:J.ZodUnion,...se(e)});var Qr=t=>t instanceof ai?Qr(t.schema):t instanceof Fa?Qr(t.innerType()):t instanceof ri?[t.value]:t instanceof ni?t.options:t instanceof oi?de.objectValues(t.enum):t instanceof ii?Qr(t._def.innerType):t instanceof Qo?[void 0]:t instanceof Jo?[null]:t instanceof Oa?[void 0,...Qr(t.unwrap())]:t instanceof mr?[null,...Qr(t.unwrap())]:t instanceof Bu||t instanceof li?Qr(t.unwrap()):t instanceof si?Qr(t._def.innerType):[],gp=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==$.object)return P(a,{code:O.invalid_type,expected:$.object,received:a.parsedType}),Q;let r=this.discriminator,n=a.data[r],o=this.optionsMap.get(n);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(P(a,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let n=new Map;for(let o of a){let i=Qr(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...se(r)})}};function Ry(t,e){let a=pr(t),r=pr(e);if(t===e)return{valid:!0,data:t};if(a===$.object&&r===$.object){let n=de.objectKeys(e),o=de.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Ry(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===$.array&&r===$.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Ry(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===$.date&&r===$.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ti=class extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(hp(o)||hp(i))return Q;let s=Ry(o.value,i.value);return s.valid?((mp(o)||mp(i))&&a.dirty(),{status:a.value,value:s.data}):(P(r,{code:O.invalid_intersection_types}),Q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>n(o,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ti.create=(t,e,a)=>new ti({left:t,right:e,typeName:J.ZodIntersection,...se(a)});var hr=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==$.array)return P(r,{code:O.invalid_type,expected:$.array,received:r.parsedType}),Q;if(r.data.length<this._def.items.length)return P(r,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&r.data.length>this._def.items.length&&(P(r,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let o=[...r.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ba(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(a,i)):wt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};hr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hr({items:t,typeName:J.ZodTuple,rest:null,...se(e)})};var vp=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==$.object)return P(r,{code:O.invalid_type,expected:$.object,received:r.parsedType}),Q;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ba(r,s,r.path,s)),value:i._parse(new Ba(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?wt.mergeObjectAsync(a,n):wt.mergeObjectSync(a,n)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof le?new t({keyType:e,valueType:a,typeName:J.ZodRecord,...se(r)}):new t({keyType:eo.create(),valueType:e,typeName:J.ZodRecord,...se(a)})}},Ts=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==$.map)return P(r,{code:O.invalid_type,expected:$.map,received:r.parsedType}),Q;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new Ba(r,s,r.path,[u,"key"])),value:o._parse(new Ba(r,l,r.path,[u,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}})}else{let s=new Map;for(let l of i){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};Ts.create=(t,e,a)=>new Ts({valueType:e,keyType:t,typeName:J.ZodMap,...se(a)});var Rs=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==$.set)return P(r,{code:O.invalid_type,expected:$.set,received:r.parsedType}),Q;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(P(r,{code:O.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),a.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(P(r,{code:O.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),a.dirty());let o=this._def.valueType;function i(l){let u=new Set;for(let c of l){if(c.status==="aborted")return Q;c.status==="dirty"&&a.dirty(),u.add(c.value)}return{status:a.value,value:u}}let s=[...r.data.values()].map((l,u)=>o._parse(new Ba(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,a){return new t({...this._def,minSize:{value:e,message:Z.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:Z.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Rs.create=(t,e)=>new Rs({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...se(e)});var yp=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==$.function)return P(a,{code:O.invalid_type,expected:$.function,received:a.parsedType}),Q;function r(s,l){return Ou({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ls(),Kr].filter(u=>!!u),issueData:{code:O.invalid_arguments,argumentsError:l}})}function n(s,l){return Ou({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ls(),Kr].filter(u=>!!u),issueData:{code:O.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof ao){let s=this;return Mt(async function(...l){let u=new Qt([]),c=await s._def.args.parseAsync(l,o).catch(g=>{throw u.addIssue(r(l,g)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(g=>{throw u.addIssue(n(d,g)),u})})}else{let s=this;return Mt(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Qt([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Qt([n(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:hr.create(e).rest(Jr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,r){return new t({args:e||hr.create([]).rest(Jr.create()),returns:a||Jr.create(),typeName:J.ZodFunction,...se(r)})}},ai=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}};ai.create=(t,e)=>new ai({getter:t,typeName:J.ZodLazy,...se(e)});var ri=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return P(a,{received:a.data,code:O.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};ri.create=(t,e)=>new ri({value:t,typeName:J.ZodLiteral,...se(e)});function oA(t,e){return new ni({values:t,typeName:J.ZodEnum,...se(e)})}var ni=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return P(a,{expected:de.joinValues(r),received:a.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return P(a,{received:a.data,code:O.invalid_enum_value,options:r}),Q}return Mt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return t.create(e,{...this._def,...a})}exclude(e,a=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}};ni.create=oA;var oi=class extends le{_parse(e){let a=de.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==$.string&&r.parsedType!==$.number){let n=de.objectValues(a);return P(r,{expected:de.joinValues(n),received:r.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(de.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=de.objectValues(a);return P(r,{received:r.data,code:O.invalid_enum_value,options:n}),Q}return Mt(e.data)}get enum(){return this._def.values}};oi.create=(t,e)=>new oi({values:t,typeName:J.ZodNativeEnum,...se(e)});var ao=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==$.promise&&a.common.async===!1)return P(a,{code:O.invalid_type,expected:$.promise,received:a.parsedType}),Q;let r=a.parsedType===$.promise?a.data:Promise.resolve(a.data);return Mt(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};ao.create=(t,e)=>new ao({type:t,typeName:J.ZodPromise,...se(e)});var Fa=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:i=>{P(r,i),i.fatal?a.abort():a.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(a.value==="aborted")return Q;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?Q:l.status==="dirty"?Wo(l.value):a.value==="dirty"?Wo(l.value):l});{if(a.value==="aborted")return Q;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?Q:s.status==="dirty"?Wo(s.value):a.value==="dirty"?Wo(s.value):s}}if(n.type==="refinement"){let i=s=>{let l=n.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value),{status:a.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value).then(()=>({status:a.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Jn(i))return Q;let s=n.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Jn(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):Q);de.assertNever(n)}};Fa.create=(t,e,a)=>new Fa({schema:t,typeName:J.ZodEffects,effect:e,...se(a)});Fa.createWithPreprocess=(t,e,a)=>new Fa({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...se(a)});var Oa=class extends le{_parse(e){return this._getType(e)===$.undefined?Mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Oa.create=(t,e)=>new Oa({innerType:t,typeName:J.ZodOptional,...se(e)});var mr=class extends le{_parse(e){return this._getType(e)===$.null?Mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mr.create=(t,e)=>new mr({innerType:t,typeName:J.ZodNullable,...se(e)});var ii=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===$.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};ii.create=(t,e)=>new ii({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var si=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r={...a,common:{...a.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Is(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};si.create=(t,e)=>new si({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var Ms=class extends le{_parse(e){if(this._getType(e)!==$.nan){let r=this._getOrReturnCtx(e);return P(r,{code:O.invalid_type,expected:$.nan,received:r.parsedType}),Q}return{status:"valid",value:e.data}}};Ms.create=t=>new Ms({typeName:J.ZodNaN,...se(t)});var WB=Symbol("zod_brand"),Bu=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return this._def.type._parse({data:r,path:a.path,parent:a})}unwrap(){return this._def.type}},Fu=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Q:o.status==="dirty"?(a.dirty(),Wo(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?Q:n.status==="dirty"?(a.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,a){return new t({in:e,out:a,typeName:J.ZodPipeline})}},li=class extends le{_parse(e){let a=this._def.innerType._parse(e),r=n=>(Jn(n)&&(n.value=Object.freeze(n.value)),n);return Is(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};li.create=(t,e)=>new li({innerType:t,typeName:J.ZodReadonly,...se(e)});function tA(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function iA(t,e={},a){return t?to.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=tA(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=tA(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):to.create()}var ZB={object:Jt.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var XB=(t,e={message:`Input not instance of ${t.name}`})=>iA(a=>a instanceof t,e),sA=eo.create,lA=Zo.create,YB=Ms.create,KB=Xo.create,uA=Yo.create,QB=Ko.create,JB=ks.create,eF=Qo.create,tF=Jo.create,aF=to.create,rF=Jr.create,nF=Ja.create,oF=Es.create,iF=en.create,sF=Jt.create,lF=Jt.strictCreate,uF=ei.create,cF=gp.create,dF=ti.create,fF=hr.create,pF=vp.create,hF=Ts.create,mF=Rs.create,gF=yp.create,vF=ai.create,yF=ri.create,xF=ni.create,bF=oi.create,SF=ao.create,CF=Fa.create,_F=Oa.create,wF=mr.create,LF=Fa.createWithPreprocess,IF=Fu.create,AF=()=>sA().optional(),kF=()=>lA().optional(),EF=()=>uA().optional(),TF={string:(t=>eo.create({...t,coerce:!0})),number:(t=>Zo.create({...t,coerce:!0})),boolean:(t=>Yo.create({...t,coerce:!0})),bigint:(t=>Xo.create({...t,coerce:!0})),date:(t=>Ko.create({...t,coerce:!0}))};var RF=Q;var My=p.union([p.object({type:p.literal("data"),key:p.string(),value:p.string().optional()}),p.object({type:p.literal("css"),value:p.string()}),p.object({type:p.literal("aria"),role:p.string().optional(),label:p.string().optional()}),p.object({type:p.literal("shadow-css"),value:p.string()}),p.object({type:p.literal("ref"),el:p.any()})]),cA=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:My,content:p.object({title:p.string().optional(),body:p.string()}),placement:p.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:p.number().optional(),blocking:p.boolean().optional(),trigger:p.enum(["immediate","hover","click"]).optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),dA=p.object({kind:p.literal("highlight"),id:p.string(),anchor:My,copy:p.string().optional(),ring:p.object({paddingPx:p.number().optional(),radiusPx:p.number().optional()}).optional(),scrim:p.object({opacity:p.number().optional()}).optional(),ringColor:p.string().optional(),blocking:p.boolean().optional(),dismiss:p.object({onClickOutside:p.boolean().optional(),onEsc:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),xp=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([cA,dA]))});function MF(t){return xp.parse(t)}var DF=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=Tf({configUri:t,experiments:e,featureKey:a});if(!n)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(n,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let i=await o.json();return xp.parse(i)};var bp=K(We(),1),fA=K(ol(),1);function OF({element:t,children:e}){let[a,r]=(0,bp.useState)(null);return(0,bp.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,fA.createPortal)(e,a):null}function BF(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var Dy=class{constructor(){j(this,"sessionId");this.sessionId=BF(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,a){}trackAction(e,a,r){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,a,r){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,a){}};function Sp(){return new Dy}var E=typeof window<"u"?window:void 0,It=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(It.self=It),typeof File>"u"&&(It.File=function(){});var lk=Array.prototype,pA=lk.forEach,hA=lk.indexOf,va=It?.navigator,q=It?.document,ta=It?.location,Xy=It?.fetch,Yy=It!=null&&It.XMLHttpRequest&&"withCredentials"in new It.XMLHttpRequest?It.XMLHttpRequest:void 0,mA=It?.AbortController,ea=va?.userAgent,te=E??{},an={DEBUG:!1,LIB_VERSION:"1.302.2"};function gA(t,e,a,r,n,o,i){try{var s=t[o](i),l=s.value}catch(u){return void a(u)}s.done?e(l):Promise.resolve(l).then(r,n)}function vA(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){gA(o,r,n,i,s,"next",l)}function s(l){gA(o,r,n,i,s,"throw",l)}i(void 0)}))}}function W(){return W=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},W.apply(null,arguments)}function uk(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var FF=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],yA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return FF.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},NF=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function fe(t,e){return t.indexOf(e)!==-1}var Jp=function(t){return t.trim()},Ky=function(t){return t.replace(/^\$/,"")},PF=Array.isArray,ck=Object.prototype,dk=ck.hasOwnProperty,eh=ck.toString,Te=PF||function(t){return eh.call(t)==="[object Array]"},lo=t=>typeof t=="function",mt=t=>t===Object(t)&&!Te(t),Fs=t=>{if(mt(t)){for(var e in t)if(dk.call(t,e))return!1;return!0}return!1},U=t=>t===void 0,ut=t=>eh.call(t)=="[object String]",Qy=t=>ut(t)&&t.trim().length===0,sn=t=>t===null,Ie=t=>U(t)||sn(t),xr=t=>eh.call(t)=="[object Number]",uo=t=>eh.call(t)==="[object Boolean]",HF=t=>t instanceof FormData,UF=t=>fe(NF,t);function Jy(t){return t===null||typeof t!="object"}function Mp(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function fk(t){return!U(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var qF=[!0,"true",1,"1","yes"],Oy=t=>fe(qF,t),zF=[!1,"false",0,"0","no"];function gr(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),xr(t)?t>a?(r.warn(" cannot be greater than max: "+a+". Using max value instead."),a):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+a+", fallback: "+n),gr(n||a,e,a,r))}var ex=class{constructor(e){this.t={},this.i=e.i,this.o=gr(e.bucketSize,0,100,e.h),this.m=gr(e.refillRate,0,this.o,e.h),this.S=gr(e.refillInterval,0,864e5,e.h)}$(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.S);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.S}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[n]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},Cp,xA,By,VF=t=>t instanceof Error;function $F(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return By&&a.length===xA||(xA=a.length,By=a.reduce(((r,n)=>{Cp||(Cp={});var o=Cp[n];if(o)r[o[0]]=o[1];else for(var i=t(n),s=i.length-1;s>=0;s--){var l=i[s],u=l?.filename,c=e[n];if(u&&c){r[u]=c,Cp[n]=[u,c];break}}return r}),{})),By}}var tx=class{constructor(e,a,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=a,this.modifiers=r}buildFromUnknown(e,a){a===void 0&&(a={});var r=a&&a.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,a,0).apply(e),o=this.buildParsingContext(),i=this.parseStacktrace(n,o);return{$exception_list:this.convertToExceptionList(i,r),$exception_level:"error"}}modifyFrames(e){var a=this;return vA((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Te(r.stacktrace.frames)&&(r.stacktrace.frames=yield a.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var a;return{type:"Error",value:"Unknown error",stack:(a=e.syntheticException)==null?void 0:a.stack,synthetic:!0}}parseStacktrace(e,a){var r,n;return e.cause!=null&&(r=this.parseStacktrace(e.cause,a)),e.stack!=""&&e.stack!=null&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),a.chunkIdMap)),W({},e,{cause:r,stack:n})}applyChunkIds(e,a){return e.map((r=>(r.filename&&a&&(r.chunk_id=a[r.filename]),r)))}applyCoercers(e,a){for(var r of this.coercers)if(r.match(e))return r.coerce(e,a);return this.coerceFallback(a)}applyModifiers(e){var a=this;return vA((function*(){var r=e;for(var n of a.modifiers)r=yield n(r);return r}))()}convertToExceptionList(e,a){var r,n,o,i={type:e.type,value:e.value,mechanism:{type:(r=a.type)!==null&&r!==void 0?r:"generic",handled:(n=a.handled)===null||n===void 0||n,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var s=[i];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,W({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:$F(this.stackParser)}}buildCoercingContext(e,a,r){r===void 0&&(r=0);var n=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return W({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},Us="?";function ax(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?Us:a,in_app:!0};return U(r)||(o.lineno=r),U(n)||(o.colno=n),o}var pk=(t,e)=>{var a=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return a||r?[t.indexOf("@")!==-1?t.split("@")[0]:Us,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},jF=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,GF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,WF=/\((\S*)(?::(\d+))(?::(\d+))\)/,ZF=(t,e)=>{var a=jF.exec(t);if(a){var[,r,n,o]=a;return ax(e,r,Us,+n,+o)}var i=GF.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=WF.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=pk(i[1]||Us,i[2]);return ax(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},XF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,YF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,KF=(t,e)=>{var a=XF.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=YF.exec(a[3]);r&&(a[1]=a[1]||"eval",a[3]=r[1],a[4]=r[2],a[5]="")}var n=a[3],o=a[1]||Us;return[o,n]=pk(o,n),ax(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},bA=/\(error: (.*)\)/,SA=50;function QF(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
460
- `),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=bA.test(u)?u.replace(bA,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var h=d(c,t);if(h){i.push(h);break}}if(i.length>=SA)break}}}return(function(g){if(!g.length)return[];var S=Array.from(g);return S.reverse(),S.slice(0,SA).map((b=>{return W({},b,{filename:b.filename||(x=S,x[x.length-1]||{}).filename,function:b.function||Us});var x}))})(i)}}var rx=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=ut(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var a=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?a+": "+e.message:a}isDOMException(e){return Mp(e,"DOMException")}isDOMError(e){return Mp(e,"DOMError")}},nx=class{match(e){return(a=>a instanceof Error)(e)}coerce(e,a){return{type:this.getType(e),value:this.getMessage(e,a),stack:this.getStack(e),cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,a){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}},ox=class{constructor(){}match(e){return Mp(e,"ErrorEvent")&&e.error!=null}coerce(e,a){var r,n=a.apply(e.error);return n||{type:"ErrorEvent",value:e.message,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},JF=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,ix=class{match(e){return typeof e=="string"}coerce(e,a){var r,[n,o]=this.getInfos(e);return{type:n??"Error",value:o??e,stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var a="Error",r=e,n=e.match(JF);return n&&(a=n[1],r=n[2]),[a,r]}},eN=["fatal","error","warning","log","info","debug"];function hk(t,e){e===void 0&&(e=40);var a=Object.keys(t);if(a.sort(),!a.length)return"[object has no keys]";for(var r=a.length;r>0;r--){var n=a.slice(0,r).join(", ");if(!(n.length>e))return r===a.length||n.length<=e?n:n.slice(0,e)+"..."}return""}var sx=class{match(e){return typeof e=="object"&&e!==null}coerce(e,a){var r,n=this.getErrorPropertyFromObject(e);return n?a.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(r=a.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return fk(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var a="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(a+=" with message: '"+e.message+"'"),a}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+hk(e)}isSeverityLevel(e){return ut(e)&&!Qy(e)&&eN.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(VF(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},lx=class{match(e){return fk(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+hk(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},ux=class{match(e){return Jy(e)}coerce(e,a){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},cx=class{match(e){return Mp(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return Jy(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}:a.apply(n)}getUnhandledRejectionReason(e){if(Jy(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},mk=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(E&&(an.DEBUG||te.POSTHOG_DEBUG||a)&&!U(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[n])?E.console[n].__rrweb_original__:E.console[n],i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("log",...o)},warn:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("warn",...o)},error:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.k("error",...o)},critical:function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:n=>{r.error("You must initialize PostHog before calling "+n)},createLogger:(n,o)=>mk(t+" "+n,o)};return r},z=mk("[PostHog.js]"),ct=z.createLogger,tN=ct("[ExternalScriptsLoader]"),CA=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return tN.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=q?.querySelectorAll("script");if(r){for(var n,o=function(){if(r[i].src===e){var l=r[i];return l.__posthog_loading_callback_fired?{v:a()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,a(void 0,u)})),l.onerror=u=>a(u),{v:void 0})}},i=0;i<r.length;i++)if(n=o())return n.v}var s=()=>{if(!q)return a("document not found");var l=q.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,a(void 0,d)},l.onerror=d=>a(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return a("prepare_external_dependency_script returned null");var u,c=q.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):q.body.appendChild(l)};q!=null&&q.body?s():q?.addEventListener("DOMContentLoaded",s)};te.__PosthogExtensions__=te.__PosthogExtensions__||{},te.__PosthogExtensions__.loadExternalDependency=(t,e,a)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var o=t.requestRouter.endpointFor("assets",r);CA(t,o,a)},te.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);CA(t,r,a)};var Dp={};function co(t,e,a){if(Te(t)){if(pA&&t.forEach===pA)t.forEach(e,a);else if("length"in t&&t.length===+t.length){for(var r=0,n=t.length;r<n;r++)if(r in t&&e.call(a,t[r],r)===Dp)return}}}function De(t,e,a){if(!Ie(t)){if(Te(t))return co(t,e,a);if(HF(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Dp)return}else for(var n in t)if(dk.call(t,n)&&e.call(a,t[n],n)===Dp)return}}var Je=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return co(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},Vs=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return co(a,(function(n){co(n,(function(o){t.push(o)}))})),t};function Ep(t){for(var e=Object.keys(t),a=e.length,r=new Array(a);a--;)r[a]=[e[a],t[e[a]]];return r}var _A=function(t){try{return t()}catch{return}},aN=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return t.apply(this,a)}catch(n){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(n)}}},ob=function(t){var e={};return De(t,(function(a,r){(ut(a)&&a.length>0||xr(a))&&(e[r]=a)})),e};function rN(t,e){return a=t,r=o=>ut(o)&&!sn(e)?o.slice(0,e):o,n=new Set,(function o(i,s){return i!==Object(i)?r?r(i,s):i:n.has(i)?void 0:(n.add(i),Te(i)?(l=[],co(i,(u=>{l.push(o(u))}))):(l={},De(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var nN=["herokuapp.com","vercel.app","netlify.app"];function oN(t){var e=t?.hostname;if(!ut(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of nN)if(a===r)return!1;return!0}function gk(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function nt(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var vk="$people_distinct_id",Gu="__alias",Wu="__timers",wA="$autocapture_disabled_server_side",dx="$heatmaps_enabled_server_side",LA="$exception_capture_enabled_server_side",fx="$error_tracking_suppression_rules",IA="$error_tracking_capture_extension_exceptions",AA="$web_vitals_enabled_server_side",yk="$dead_clicks_enabled_server_side",kA="$web_vitals_allowed_metrics",Fy="$session_recording_remote_config",Op="$sesid",xk="$session_is_sampled",Ns="$enabled_feature_flags",Zu="$early_access_features",px="$feature_flag_details",Xu="$stored_person_properties",di="$stored_group_properties",hx="$surveys",_p="$surveys_activated",Bp="$flag_call_reported",rn="$user_state",mx="$client_session_props",gx="$capture_rate_limit",vx="$initial_campaign_params",yx="$initial_referrer_info",Fp="$initial_person_info",Np="$epp",bk="__POSTHOG_TOOLBAR__",Nu="$posthog_cookieless",iN=[vk,Gu,"__cmpns",Wu,"$session_recording_enabled_server_side",dx,Op,Ns,fx,rn,Zu,px,di,Xu,hx,Bp,mx,gx,vx,yx,Np,Fp];function EA(t){return t instanceof Element&&(t.id===bk||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function th(t){return!!t&&t.nodeType===1}function fo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Sk(t){return!!t&&t.nodeType===3}function Ck(t){return!!t&&t.nodeType===11}function ib(t){return t?Jp(t).split(/\s+/):[]}function TA(t){var e=E?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function Pp(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ib(e)}function _k(t){return Ie(t)?null:Jp(t).split(/(\s+)/).filter((e=>ac(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function lc(t){var e="";return xx(t)&&!kk(t)&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;Sk(a)&&a.textContent&&(e+=(r=_k(a.textContent))!==null&&r!==void 0?r:"")})),Jp(e)}function wk(t){return U(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var sb=["a","button","form","input","select","textarea","label"];function Lk(t,e){if(U(e))return!0;var a,r=function(o){if(e.some((i=>o.matches(i))))return{v:!0}};for(var n of t)if(a=r(n))return a.v;return!1}function Ik(t){var e=t.parentNode;return!(!e||!th(e))&&e}var sN=["next","previous","prev",">","<"],RA=10,MA=[".ph-no-rageclick",".ph-no-capture"];function lN(t,e){if(!E||lb(t))return!1;var a,r,n;if(uo(e)?(a=!!e&&MA,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:MA,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=Ak(t,!1);return!(function(i,s){if(i===!1||U(i))return!1;var l;if(i===!0)l=sN;else{if(!Te(i))return!1;if(i.length>RA)return z.error("[PostHog] content_ignorelist array cannot exceed "+RA+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((u=>u.toLowerCase()))}return s.some((u=>{var{safeText:c,ariaLabel:d}=u;return l.some((h=>c.includes(h)||d.includes(h)))}))})(r,o.map((i=>{var s;return{safeText:lc(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!Lk(o,a)}var lb=t=>!t||fo(t,"html")||!th(t),Ak=(t,e)=>{if(!E||lb(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!fo(n,"body");)if(Ck(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=Ik(n);if(!o)break;if(e||sb.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=E.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function uN(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!E||lb(t)||(o=a)!=null&&o.url_allowlist&&!TA(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&TA(a.url_ignorelist))return!1;if((s=a)!=null&&s.dom_event_allowlist){var u=a.dom_event_allowlist;if(u&&!u.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Ak(t,r);if(!(function(S,b){var x=b?.element_allowlist;if(U(x))return!0;var f,m=function(y){if(x.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(f=m(v))return f.v;return!1})(d,a)||!Lk(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var h=E.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return c?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(sb.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function xx(t){for(var e=t;e.parentNode&&!fo(e,"body");e=e.parentNode){var a=Pp(e);if(fe(a,"ph-sensitive")||fe(a,"ph-no-capture"))return!1}if(fe(Pp(t),"ph-include"))return!0;var r=t.type||"";if(ut(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(ut(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function kk(t){return!!(fo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||fo(t,"select")||fo(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Ek="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",cN=new RegExp("^(?:"+Ek+")$"),dN=new RegExp(Ek),Tk="\\d{3}-?\\d{2}-?\\d{4}",fN=new RegExp("^("+Tk+")$"),pN=new RegExp("("+Tk+")");function ac(t,e){return e===void 0&&(e=!0),!(Ie(t)||ut(t)&&(t=Jp(t),(e?cN:dN).test((t||"").replace(/[- ]/g,""))||(e?fN:pN).test(t)))}function Rk(t){var e=lc(t);return ac(e=(e+" "+Mk(t)).trim())?e:""}function Mk(t){var e="";return t&&t.childNodes&&t.childNodes.length&&De(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=lc(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+Mk(a)).trim())}catch(o){z.error("[AutoCapture]",o)}})),e}function hN(t){return(function(e){var a=e.map((r=>{var n,o,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var s of(r.attr_class.sort(),r.attr_class))i+="."+s.replace(/"/g,"");var l=W({},r.text?{text:r.text}:{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Ep(l).sort(((c,d)=>{var[h]=c,[g]=d;return h.localeCompare(g)})).forEach((c=>{var[d,h]=c;return u[DA(d.toString())]=DA(h.toString())})),i+=":",i+=Ep(u).map((c=>{var[d,h]=c;return d+'="'+h+'"'})).join("")}));return a.join(";")})((function(e){return e.map((a=>{var r,n,o={text:(r=a.$el_text)==null?void 0:r.slice(0,400),tag_name:a.tag_name,href:(n=a.attr__href)==null?void 0:n.slice(0,2048),attr_class:mN(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return Ep(a).filter((i=>{var[s]=i;return s.indexOf("attr__")===0})).forEach((i=>{var[s,l]=i;return o.attributes[s]=l})),o}))})(t))}function DA(t){return t.replace(/"|\\"/g,'\\"')}function mN(t){var e=t.attr__class;return e?Te(e)?e:ib(e):void 0}var Hp=class{constructor(e){this.disabled=e===!1;var a=mt(e)?e:{};this.thresholdPx=a.threshold_px||30,this.timeoutMs=a.timeout_ms||1e3,this.clickCount=a.click_count||3,this.clicks=[]}isRageClick(e,a,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(a-n.y)<this.thresholdPx&&r-n.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:r}];return!1}},Ny="$copy_autocapture",on=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Up=t=>{var e=q?.createElement("a");return U(e)?null:(e.href=t,e)},gN=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return De(t,(function(o,i){U(o)||U(i)||i==="undefined"||(a=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(i),n[n.length]=r+"="+a)})),n.join(e)},qp=function(t,e){for(var a,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===e){a=o;break}}if(!Te(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{z.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},uc=function(t,e,a){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[0]||"",o=r[1],i=n.split("?"),s=i[1],l=i[0],u=(s||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Te(h)&&(e.includes(h[0])?c.push(h[0]+"="+a):c.push(u[d]))}var g=l;return s!=null&&(g+="?"+c.join("&")),o!=null&&(g+="#"+o),g},zp=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},OA=ct("[AutoCapture]");function Py(t,e){return e.length>t?e.slice(0,t)+"...":e}function vN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!th(e));return e}function yN(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};sb.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=Py(1024,Rk(t)):o.$el_text=Py(1024,lc(t)));var i=Pp(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),De(t.attributes,(function(c){var d;if((!kk(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&ac(c.value)&&(d=c.name,!ut(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=c.value;c.name==="class"&&(h=ib(h).join(" ")),o["attr__"+c.name]=Py(1024,h)}}));for(var s=1,l=1,u=t;u=vN(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function xN(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!fo(c,"body");)Ck(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],g={},S=!1,b=!1;if(De(u,(y=>{var _=xx(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&ac(S)&&S),fe(Pp(y),"ph-no-capture")&&(b=!0),h.push(yN(y,o,i,s));var L=(function(C){if(!xx(C))return{};var k={};return De(C.attributes,(function(w){if(w.name&&w.name.indexOf("data-ph-capture-attribute")===0){var I=w.name.replace("data-ph-capture-attribute-",""),T=w.value;I&&T&&ac(T)&&(k[I]=T)}})),k})(y);Je(g,L)})),b)return{props:{},explicitNoCapture:b};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=Rk(t):h[0].$el_text=lc(t)),S){var x,f;h[0].attr__href=S;var m=(x=Up(S))==null?void 0:x.host,v=E==null||(f=E.location)==null?void 0:f.host;m&&v&&m!==v&&(d=S)}return{props:Je({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:hN(h)},(a=h[0])!=null&&a.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},g)}}var bx=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Hp(e.config.rageclick),this.I=null}get F(){var e,a,r=mt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((n=>new RegExp(n))),r.url_ignorelist=(a=r.url_ignorelist)==null?void 0:a.map((n=>new RegExp(n))),r}C(){if(this.isBrowserSupported()){if(E&&q){var e=r=>{r=r||E?.event;try{this.M(r)}catch(n){OA.error("Failed to capture event",n)}};if(nt(q,"submit",e,{capture:!0}),nt(q,"change",e,{capture:!0}),nt(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=r=>{r=r||E?.event,this.M(r,Ny)};nt(q,"copy",a,{capture:!0}),nt(q,"cut",a,{capture:!0})}}}else OA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[wA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,r=[];return(a=this.I)==null||a.forEach((n=>{var o=q?.querySelectorAll(n);o?.forEach((i=>{e===i&&r.push(n)}))})),r}get isEnabled(){var e,a,r=(e=this.instance.persistence)==null?void 0:e.props[wA],n=this.T;if(sn(n)&&!uo(r)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=wk(e);Sk(n)&&(n=n.parentNode||null),a==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&lN(n,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===Ny;if(n&&uN(n,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=xN(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(n);if(l&&l.length>0&&(i.$element_selectors=l),a===Ny){var u,c=_k(E==null||(u=E.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=d}return this.instance.capture(a,i),!0}}}isBrowserSupported(){return lo(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return xr(t)&&isFinite(t)&&Math.floor(t)===t});var BA="0123456789abcdef",Sx=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,a,r,n){if(!Number.isInteger(e)||!Number.isInteger(a)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||a<0||r<0||n<0||e>0xffffffffffff||a>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|a>>>8,o[7]=a,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new t(o)}toString(){for(var e="",a=0;a<this.bytes.length;a++)e=e+BA.charAt(this.bytes[a]>>>4)+BA.charAt(15&this.bytes[a]),a!==3&&a!==5&&a!==7&&a!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var a=0;a<16;a++){var r=this.bytes[a]-e.bytes[a];if(r!==0)return Math.sign(r)}return 0}},Cx=class{constructor(){this.A=0,this.D=0,this.j=new _x}generate(){var e=this.generateOrAbort();if(U(e)){this.A=0;var a=this.generateOrAbort();if(U(a))throw new Error("Could not generate UUID after timestamp reset");return a}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return Sx.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},FA,Dk=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};E&&!U(E.crypto)&&crypto.getRandomValues&&(Dk=t=>crypto.getRandomValues(t));var _x=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Dk(this.N),this.U=0),this.N[this.U++]}},so=()=>bN().toString(),bN=()=>(FA||(FA=new Cx)).generate(),Pu="",SN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function CN(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=q),Pu)return Pu;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+so();!Pu&&s--;){var u=i.slice(s).join("."),c=l+"=1;domain=."+u+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(l)&&(o.cookie=c+";max-age=0",Pu=u)}return Pu})(t);if(!a){var r=(n=>{var o=n.match(SN);return o?o[0]:""})(t);r!==a&&z.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var yr={H:()=>!!q,B:function(t){z.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),r=0;r<a.length;r++){for(var n=a[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(yr.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(q)try{var o="",i="",s=CN(q.location.hostname,r);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}n&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{yr.G(t,"",-1,e)}catch{return}}},Hy=null,Ge={H:function(){if(!sn(Hy))return Hy;var t=!0;if(U(E))t=!1;else try{var e="__mplssupport__";Ge.G(e,"xyz"),Ge.q(e)!=='"xyz"'&&(t=!1),Ge.V(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Hy=t,t},B:function(t){z.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){Ge.B(e)}return null},W:function(t){try{return JSON.parse(Ge.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(a){Ge.B(a)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){Ge.B(e)}}},_N=["distinct_id",Op,xk,Np,Fp],wp=W({},Ge,{W:function(t){try{var e={};try{e=yr.W(t)||{}}catch{}var a=Je(e,JSON.parse(Ge.q(t)||"{}"));return Ge.G(t,a),a}catch{}return null},G:function(t,e,a,r,n,o){try{Ge.G(t,e,void 0,void 0,o);var i={};_N.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&yr.G(t,i,a,r,n,o)}catch(s){Ge.B(s)}},V:function(t,e){try{E?.localStorage.removeItem(t),yr.V(t,e)}catch(a){Ge.B(a)}}}),Lp={},wN={H:function(){return!0},B:function(t){z.error("memoryStorage error: "+t)},q:function(t){return Lp[t]||null},W:function(t){return Lp[t]||null},G:function(t,e){Lp[t]=e},V:function(t){delete Lp[t]}},ui=null,Lt={H:function(){if(!sn(ui))return ui;if(ui=!0,U(E))ui=!1;else try{var t="__support__";Lt.G(t,"xyz"),Lt.q(t)!=='"xyz"'&&(ui=!1),Lt.V(t)}catch{ui=!1}return ui},B:function(t){z.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){Lt.B(e)}return null},W:function(t){try{return JSON.parse(Lt.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Lt.B(a)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){Lt.B(e)}}},nn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),wx=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?nn.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===nn.DENIED||this.consent===nn.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===nn.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:a,consent_persistence_name:r}=this._instance.config;return r||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Oy(e)?nn.GRANTED:fe(zF,e)?nn.DENIED:nn.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ge:yr;var a=e==="localStorage"?yr:Ge;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Oy(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!gk([va?.doNotTrack,va?.msDoNotTrack,te.doNotTrack],(e=>Oy(e)))}},Ip=ct("[Dead Clicks]"),LN=()=>!0,IN=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(yk)),r=t.instance.config.capture_dead_clicks;return uo(r)?r:!!mt(r)||a},Vp=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,a,r){this.instance=e,this.isEnabled=a,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[yk]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?Ip.error("failed to load script",n):e()}))}et(){var e;if(q){if(!this.tt&&(e=te.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=mt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=te.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(q),Ip.info("starting...")}}else Ip.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Ip.info("stopping..."))}},Hu=ct("[ExceptionAutocapture]"),Lx=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(E&&this.isEnabled&&(o=te.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=te.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=te.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=te.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){Hu.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[LA]),this.F=this.ht(),this.vt=new ex({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(n=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10,refillInterval:1e4,h:Hu}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return mt(e)?a=W({},a,e):(U(e)?this.ut:e)&&(a=W({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Hu.info("enabled"),this.it(this.rt))}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Hu.error("failed to load script",n);e()}))}lt(){var e,a,r;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var a=e.autocaptureExceptions;this.ut=!!a||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[LA]:this.ut}),this.startIfEnabled()}captureException(e){var a,r,n=(a=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(n)?Hu.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function NA(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return lo(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var Ix=class{constructor(e){var a;this._instance=e,this.dt=(E==null||(a=E.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(z.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,z.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(E&&E.history){var r=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||NA(E.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("pushState")})),(a=E.history.replaceState)!=null&&a.__posthog_wrapped__||NA(E.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("replaceState")})),this.gt()}}ft(e){try{var a,r=E==null||(a=E.location)==null?void 0:a.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(n){z.error("Error capturing "+e+" pageview",n)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};nt(E,"popstate",e),this.ct=()=>{E&&E.removeEventListener("popstate",e)}}}},Uy=ct("[SegmentIntegration]");function AN(t,e){var a=t.config.segment;if(!a)return e();(function(r,n){var o=r.config.segment;if(!o)return n();var i=l=>{var u=()=>l.anonymousId()||so();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(rn,"identified")),n()},s=o.user();"then"in s&&lo(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||Uy.warn("This browser does not have Promise support, and can not use the segment integration");var n=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(Uy.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Uy.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var s=r.calculateEventProperties(i,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>n(o,o.event.event),page:o=>n(o,"$pageview"),identify:o=>n(o,"$identify"),screen:o=>n(o,"$screen")}})(t)).then((()=>{e()}))}))}var Ok="posthog-js";function Bk(t,e){var{organization:a,projectId:r,prefix:n,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return s=>{var l,u,c,d,h;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],b=S.map((f=>W({},f,{stacktrace:f.stacktrace?W({},f.stacktrace,{type:"raw",frames:(f.stacktrace.frames||[]).map((m=>W({},m,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=S[0])==null?void 0:u.value)||s.message,$exception_type:(c=S[0])==null?void 0:c.type,$exception_level:s.level,$exception_list:b,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=S[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(h=S[0])==null?void 0:h.type,$sentry_tags:s.tags};return a&&r&&(x.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(x),s}}var Ax=class{constructor(e,a,r,n,o,i){this.name=Ok,this.setupOnce=function(s){s(Bk(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},kN=E!=null&&E.location?zp(E.location.hash,"__posthog")||zp(location.hash,"state"):null,PA="_postHogToolbarParams",HA=ct("[Toolbar]"),io=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(io||{}),kx=class{constructor(e){this.instance=e}_t(e){te.ph_toolbar_state=e}yt(){var e;return(e=te.ph_toolbar_state)!==null&&e!==void 0?e:io.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!E||!q)return!1;e=e??E.location,r=r??E.history;try{if(!a){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}a=E?.localStorage}var n,o=kN||zp(e.hash,"__posthog")||zp(e.hash,"state"),i=o?_A((()=>JSON.parse(atob(decodeURIComponent(o)))))||_A((()=>JSON.parse(decodeURIComponent(o)))):null;return i&&i.action==="ph_authorize"?((n=i).source="url",n&&Object.keys(n).length>0&&(i.desiredHash?e.hash=i.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(a.getItem(PA)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}bt(e){var a=te.ph_load_toolbar||te.ph_load_editor;!Ie(a)&&lo(a)?a(e,this.instance):HA.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(bk));if(!E||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=W({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(E.localStorage.setItem(PA,JSON.stringify(W({},n,{source:void 0}))),this.yt()===io.LOADED)this.bt(n);else if(this.yt()===io.UNINITIALIZED){var o;this._t(io.LOADING),(o=te.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return HA.error("[Toolbar] Failed to load",i),void this._t(io.UNINITIALIZED);this._t(io.LOADED),this.bt(n)})),nt(E,"turbolinks:load",(()=>{this._t(io.UNINITIALIZED),this.loadToolbar(n)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,r){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,a,r)}},EN=ct("[TracingHeaders]"),Ex=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,r;U(this.xt)&&((a=te.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),U(this.St)&&((r=te.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return EN.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(a=this.St)==null||a.call(this),this.xt=void 0,this.St=void 0)}},Na="Mobile",$p="iOS",vr="Android",rc="Tablet",Fk=vr+" "+rc,Nk="iPad",Pk="Apple",Hk=Pk+" Watch",nc="Safari",qs="BlackBerry",Uk="Samsung",qk=Uk+"Browser",zk=Uk+" Internet",fi="Chrome",TN=fi+" OS",Vk=fi+" "+$p,ub="Internet Explorer",$k=ub+" "+Na,cb="Opera",RN=cb+" Mini",db="Edge",jk="Microsoft "+db,Ps="Firefox",Gk=Ps+" "+$p,oc="Nintendo",ic="PlayStation",Hs="Xbox",Wk=vr+" "+Na,Zk=Na+" "+nc,Yu="Windows",Tx=Yu+" Phone",UA="Nokia",Rx="Ouya",Xk="Generic",MN=Xk+" "+Na.toLowerCase(),Yk=Xk+" "+rc.toLowerCase(),Mx="Konqueror",Ht="(\\d+(\\.\\d+)?)",qy=new RegExp("Version/"+Ht),DN=new RegExp(Hs,"i"),ON=new RegExp(ic+" \\w+","i"),BN=new RegExp(oc+" \\w+","i"),fb=new RegExp(qs+"|PlayBook|BB10","i"),FN={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},NN=(t,e)=>e&&fe(e,Pk)||(function(a){return fe(a,nc)&&!fe(a,fi)&&!fe(a,vr)})(t),Kk=function(t,e){return e=e||"",fe(t," OPR/")&&fe(t,"Mini")?RN:fe(t," OPR/")?cb:fb.test(t)?qs:fe(t,"IE"+Na)||fe(t,"WPDesktop")?$k:fe(t,qk)?zk:fe(t,db)||fe(t,"Edg/")?jk:fe(t,"FBIOS")?"Facebook "+Na:fe(t,"UCWEB")||fe(t,"UCBrowser")?"UC Browser":fe(t,"CriOS")?Vk:fe(t,"CrMo")||fe(t,fi)?fi:fe(t,vr)&&fe(t,nc)?Wk:fe(t,"FxiOS")?Gk:fe(t.toLowerCase(),Mx.toLowerCase())?Mx:NN(t,e)?fe(t,Na)?Zk:nc:fe(t,Ps)?Ps:fe(t,"MSIE")||fe(t,"Trident/")?ub:fe(t,"Gecko")?Ps:""},PN={[$k]:[new RegExp("rv:"+Ht)],[jk]:[new RegExp(db+"?\\/"+Ht)],[fi]:[new RegExp("("+fi+"|CrMo)\\/"+Ht)],[Vk]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[nc]:[qy],[Zk]:[qy],[cb]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Ps]:[new RegExp(Ps+"\\/"+Ht)],[Gk]:[new RegExp("FxiOS\\/"+Ht)],[Mx]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[qs]:[new RegExp(qs+" "+Ht),qy],[Wk]:[new RegExp("android\\s"+Ht,"i")],[zk]:[new RegExp(qk+"\\/"+Ht)],[ub]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},HN=function(t,e){var a=Kk(t,e),r=PN[a];if(U(r))return null;for(var n=0;n<r.length;n++){var o=r[n],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},qA=[[new RegExp(Hs+"; "+Hs+" (.*?)[);]","i"),t=>[Hs,t&&t[1]||""]],[new RegExp(oc,"i"),[oc,""]],[new RegExp(ic,"i"),[ic,""]],[fb,[qs,""]],[new RegExp(Yu,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Tx,""];if(new RegExp(Na).test(e)&&!/IEMobile\b/.test(e))return[Yu+" "+Na,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=FN[r]||"";return/arm/i.test(e)&&(n="RT"),[Yu,n]}return[Yu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[$p,e.join(".")]}return[$p,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=U(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+vr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+vr+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[vr,e.join(".")]}return[vr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var a=[t[1],t[2],t[3]||"0"];e[1]=a.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[TN,""]],[/Linux|debian/i,["Linux",""]]],zA=function(t){return BN.test(t)?oc:ON.test(t)?ic:DN.test(t)?Hs:new RegExp(Rx,"i").test(t)?Rx:new RegExp("("+Tx+"|WPDesktop)","i").test(t)?Tx:/iPad/.test(t)?Nk:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Hk:fb.test(t)?qs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(UA,"i").test(t)?UA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Na).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?vr:Fk:vr:new RegExp("(pda|"+Na+")","i").test(t)?MN:new RegExp(rc,"i").test(t)&&!new RegExp(rc+" pc","i").test(t)?Yk:""},Ap="https?://(.*)",$s=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],UN=Vs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],$s),cc="<masked>",qN=["li_fat_id"];function Qk(t,e,a){if(!q)return{};var r,n=e?Vs([],$s,a||[]):[],o=Jk(uc(q.URL,n,cc),t),i=(r={},De(qN,(function(s){var l=yr.q(s);r[s]=l||null})),r);return Je(i,o)}function Jk(t,e){var a=UN.concat(e||[]),r={};return De(a,(function(n){var o=qp(t,n);r[n]=o||null})),r}function eE(t){var e=(function(o){return o?o.search(Ap+"google.([^/?]*)")===0?"google":o.search(Ap+"bing.com")===0?"bing":o.search(Ap+"yahoo.com")===0?"yahoo":o.search(Ap+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!sn(e)){r.$search_engine=e;var n=q?qp(q.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function VA(){return navigator.language||navigator.userLanguage}function tE(){return q?.referrer||"$direct"}function aE(t,e){var a=t?Vs([],$s,e||[]):[],r=ta?.href.substring(0,1e3);return{r:tE().substring(0,1e3),u:r?uc(r,a,cc):void 0}}function rE(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=Up(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=Up(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=Jk(r);Je(n,i)}if(a){var s=eE(a);Je(n,s)}return n}function nE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function zN(){try{return new Date().getTimezoneOffset()}catch{return}}function VN(t,e){if(!ea)return{};var a,r,n,o=t?Vs([],$s,e||[]):[],[i,s]=(function(l){for(var u=0;u<qA.length;u++){var[c,d]=qA[u],h=c.exec(l),g=h&&(lo(d)?d(h,l):d);if(g)return g}return["",""]})(ea);return Je(ob({$os:i,$os_version:s,$browser:Kk(ea,navigator.vendor),$device:zA(ea),$device_type:(r=ea,n=zA(r),n===Nk||n===Fk||n==="Kobo"||n==="Kindle Fire"||n===Yk?rc:n===oc||n===Hs||n===ic||n===Rx?"Console":n===Hk?"Wearable":n?Na:"Desktop"),$timezone:nE(),$timezone_offset:zN()}),{$current_url:uc(ta?.href,o,cc),$host:ta?.host,$pathname:ta?.pathname,$raw_user_agent:ea.length>1e3?ea.substring(0,997)+"...":ea,$browser_version:HN(ea,navigator.vendor),$browser_language:VA(),$browser_language_prefix:(a=VA(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:an.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ro=ct("[Web Vitals]"),$A=9e5,Dx=class{constructor(e){var a;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,n)=>W({},r,{["$web_vitals_"+n.name+"_event"]:W({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(U(o))ro.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();U(i)||(Ie(r?.name)||Ie(r?.value)?ro.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?ro.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),U(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=U(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(W({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,n,o,i,s=te.__PosthogExtensions__;U(s)||U(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):ro.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[AA]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=mt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return U(r)?((a=this._instance.persistence)==null?void 0:a.props[kA])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=mt(this._instance.config.capture_performance)&&xr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:$A;return 0<e&&e<=6e4?$A:e}get isEnabled(){var e=ta?.protocol;if(e!=="http:"&&e!=="https:")return ro.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=mt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:uo(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return uo(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(ro.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=mt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=mt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[AA]:a}),this._instance.persistence.register({[kA]:r})),this.Et=a,this.startIfEnabled()}it(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(n=>{n?ro.error("failed to load script",n):e()}))}Tt(){var e=E?E.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,n=a?Vs([],$s,r||[]):[];return uc(e,n,cc)}ro.error("Could not determine current URL")}},$N=ct("[Heatmaps]");function jA(t){return mt(t)&&"clientX"in t&&"clientY"in t&&xr(t.clientX)&&xr(t.clientY)}var Ox=class{constructor(e){var a;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((a=this.instance.persistence)==null||!a.props[dx]),this.rageclicks=new Hp(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return mt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return U(this.instance.config.capture_heatmaps)?U(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;$N.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[dx]:a}),this.Et=a,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(q)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){E&&q&&(this.jt=this.Dt.bind(this),nt(E,"beforeunload",this.jt),this.Lt=e=>this.At(e||E?.event),nt(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||E?.event),nt(q,"mousemove",this.Nt,{capture:!0}),this.zt=new Vp(this.instance,LN,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),nt(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;E&&q&&(this.jt&&E.removeEventListener("beforeunload",this.jt),this.Lt&&q.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&q.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&q.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,a){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&th(c)&&!fo(c,"body");){if(c===u)return!1;if(fe(l,E?.getComputedStyle(c).position))return!0;c=Ik(c)}return!1})(wk(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}At(e,a){var r;if(a===void 0&&(a="click"),!EA(e.target)&&jA(e)){var n=this.qt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(W({},n,{type:"rageclick"})),this.Wt(n)}}Ut(e){!EA(e.target)&&jA(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(E){var a=E.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?Vs([],$s,n||[]):[],i=uc(a,o,cc);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Fs(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Bx=class{constructor(e){this._instance=e}doPageView(e,a){var r,n=this.Gt(e,a);return this.Vt={pathname:(r=E?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Gt(e,(a=this.Vt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,a){var r=this.Vt;if(!r)return{$pageview_id:a};var n={$pageview_id:a,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:s,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=o;if(!(U(i)||U(s)||U(l)||U(u)||U(c)||U(d))){i=Math.ceil(i),s=Math.ceil(s),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var h=i<=1?1:gr(s/i,0,1,z),g=i<=1?1:gr(l/i,0,1,z),S=u<=1?1:gr(c/u,0,1,z),b=u<=1?1:gr(d/u,0,1,z);n=Je(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},Pa=Uint8Array,Ut=Uint16Array,zs=Uint32Array,pb=new Pa([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hb=new Pa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),GA=new Pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oE=function(t,e){for(var a=new Ut(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new zs(a[30]);for(r=1;r<30;++r)for(var o=a[r];o<a[r+1];++o)n[o]=o-a[r]<<5|r;return[a,n]},iE=oE(pb,2),jN=iE[0],Fx=iE[1];jN[28]=258,Fx[258]=28;for(Nx=oE(hb,0)[1],jp=new Ut(32768),Oe=0;Oe<32768;++Oe)no=(43690&Oe)>>>1|(21845&Oe)<<1,no=(61680&(no=(52428&no)>>>2|(13107&no)<<2))>>>4|(3855&no)<<4,jp[Oe]=((65280&no)>>>8|(255&no)<<8)>>>1;var no,Nx,jp,Oe,Ju=function(t,e,a){for(var r=t.length,n=0,o=new Ut(e);n<r;++n)++o[t[n]-1];var i,s=new Ut(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Ut(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],c=e-t[n],d=s[t[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)i[jp[d]>>>l]=u}else for(i=new Ut(r),n=0;n<r;++n)i[n]=jp[s[t[n]-1]++]>>>15-t[n];return i},pi=new Pa(288);for(Oe=0;Oe<144;++Oe)pi[Oe]=8;for(Oe=144;Oe<256;++Oe)pi[Oe]=9;for(Oe=256;Oe<280;++Oe)pi[Oe]=7;for(Oe=280;Oe<288;++Oe)pi[Oe]=8;var Gp=new Pa(32);for(Oe=0;Oe<32;++Oe)Gp[Oe]=5;var GN=Ju(pi,9,0),WN=Ju(Gp,5,0),sE=function(t){return(t/8>>0)+(7&t&&1)},lE=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Ut?Ut:t instanceof zs?zs:Pa)(a-e);return r.set(t.subarray(e,a)),r},tn=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},Uu=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8,t[r+2]|=a>>>16},zy=function(t,e){for(var a=[],r=0;r<t.length;++r)t[r]&&a.push({s:r,f:t[r]});var n=a.length,o=a.slice();if(!n)return[new Pa(0),0];if(n==1){var i=new Pa(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,L){return _.f-L.f})),a.push({s:-1,f:25001});var s=a[0],l=a[1],u=0,c=1,d=2;for(a[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=n-1;)s=a[a[u].f<a[d].f?u++:d++],l=a[u!=c&&a[u].f<a[d].f?u++:d++],a[c++]={s:-1,f:s.f+l.f,l:s,r:l};var h=o[0].s;for(r=1;r<n;++r)o[r].s>h&&(h=o[r].s);var g=new Ut(h+1),S=Px(a[c-1],g,0);if(S>e){r=0;var b=0,x=S-e,f=1<<x;for(o.sort((function(_,L){return g[L.s]-g[_.s]||_.f-L.f}));r<n;++r){var m=o[r].s;if(!(g[m]>e))break;b+=f-(1<<S-g[m]),g[m]=e}for(b>>>=x;b>0;){var v=o[r].s;g[v]<e?b-=1<<e-g[v]++-1:++r}for(;r>=0&&b;--r){var y=o[r].s;g[y]==e&&(--g[y],++b)}S=e}return[new Pa(g),S]},Px=function(t,e,a){return t.s==-1?Math.max(Px(t.l,e,a+1),Px(t.r,e,a+1)):e[t.s]=a},WA=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Ut(++e),r=0,n=t[0],o=1,i=function(l){a[r++]=l},s=1;s<=e;++s)if(t[s]==n&&s!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=t[s]}return[a.subarray(0,r),e]},qu=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},Hx=function(t,e,a){var r=a.length,n=sE(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<r;++o)t[n+o+4]=a[o];return 8*(n+4+r)},ZA=function(t,e,a,r,n,o,i,s,l,u,c){tn(e,c++,a),++n[256];for(var d=zy(n,15),h=d[0],g=d[1],S=zy(o,15),b=S[0],x=S[1],f=WA(h),m=f[0],v=f[1],y=WA(b),_=y[0],L=y[1],C=new Ut(19),k=0;k<m.length;++k)C[31&m[k]]++;for(k=0;k<_.length;++k)C[31&_[k]]++;for(var w=zy(C,7),I=w[0],T=w[1],D=19;D>4&&!I[GA[D-1]];--D);var M,B,F,H,V=u+5<<3,N=qu(n,pi)+qu(o,Gp)+i,X=qu(n,h)+qu(o,b)+i+14+3*D+qu(C,I)+(2*C[16]+3*C[17]+7*C[18]);if(V<=N&&V<=X)return Hx(e,c,t.subarray(l,l+u));if(tn(e,c,1+(X<N)),c+=2,X<N){M=Ju(h,g,0),B=h,F=Ju(b,x,0),H=b;var ve=Ju(I,T,0);for(tn(e,c,v-257),tn(e,c+5,L-1),tn(e,c+10,D-4),c+=14,k=0;k<D;++k)tn(e,c+3*k,I[GA[k]]);c+=3*D;for(var Ha=[m,_],dt=0;dt<2;++dt){var qt=Ha[dt];for(k=0;k<qt.length;++k){var G=31&qt[k];tn(e,c,ve[G]),c+=I[G],G>15&&(tn(e,c,qt[k]>>>5&127),c+=qt[k]>>>12)}}}else M=GN,B=pi,F=WN,H=Gp;for(k=0;k<s;++k)if(r[k]>255){G=r[k]>>>18&31,Uu(e,c,M[G+257]),c+=B[G+257],G>7&&(tn(e,c,r[k]>>>23&31),c+=pb[G]);var re=31&r[k];Uu(e,c,F[re]),c+=H[re],re>3&&(Uu(e,c,r[k]>>>5&8191),c+=hb[re])}else Uu(e,c,M[r[k]]),c+=B[r[k]];return Uu(e,c,M[256]),c+B[256]},ZN=new zs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),XN=(function(){for(var t=new zs(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),YN=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,h=new Pa(l+d+5*(1+Math.floor(d/7e3))+u),g=h.subarray(l,h.length-u),S=0;if(!i||d<8)for(var b=0;b<=d;b+=65535){var x=b+65535;x<d?S=Hx(g,S,o.subarray(b,x)):(g[b]=c,S=Hx(g,S,o.subarray(b,d)))}else{for(var f=ZN[i-1],m=f>>>13,v=8191&f,y=(1<<s)-1,_=new Ut(32768),L=new Ut(y+1),C=Math.ceil(s/3),k=2*C,w=function(Uh){return(o[Uh]^o[Uh+1]<<C^o[Uh+2]<<k)&y},I=new zs(25e3),T=new Ut(288),D=new Ut(32),M=0,B=0,F=(b=0,0),H=0,V=0;b<d;++b){var N=w(b),X=32767&b,ve=L[N];if(_[X]=ve,L[N]=X,H<=b){var Ha=d-b;if((M>7e3||F>24576)&&Ha>423){S=ZA(o,g,0,I,T,D,B,F,V,b-V,S),F=M=B=0,V=b;for(var dt=0;dt<286;++dt)T[dt]=0;for(dt=0;dt<30;++dt)D[dt]=0}var qt=2,G=0,re=v,At=X-ve&32767;if(Ha>2&&N==w(b-At))for(var dn=Math.min(m,Ha)-1,Nh=Math.min(32767,b),Ph=Math.min(258,Ha);At<=Nh&&--re&&X!=ve;){if(o[b+qt]==o[b+qt-At]){for(var fn=0;fn<Ph&&o[b+fn]==o[b+fn-At];++fn);if(fn>qt){if(qt=fn,G=At,fn>dn)break;var YE=Math.min(At,fn-2),mS=0;for(dt=0;dt<YE;++dt){var Hh=b-At+dt+32768&32767,gS=Hh-_[Hh]+32768&32767;gS>mS&&(mS=gS,ve=Hh)}}}At+=(X=ve)-(ve=_[X])+32768&32767}if(G){I[F++]=268435456|Fx[qt]<<18|Nx[G];var vS=31&Fx[qt],yS=31&Nx[G];B+=pb[vS]+hb[yS],++T[257+vS],++D[yS],H=b+qt,++M}else I[F++]=o[b],++T[o[b]]}}S=ZA(o,g,c,I,T,D,B,F,V,b-V,S)}return lE(h,0,l+sE(S)+u)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,a,r,!0)},Vy=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function KN(t,e){e===void 0&&(e={});var a=(function(){var s=4294967295;return{p:function(l){for(var u=s,c=0;c<l.length;++c)u=XN[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=YN(t,e,10+((n=e).filename&&n.filename.length+1||0),8),i=o.length;return(function(s,l){var u=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&Vy(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){s[3]=8;for(var c=0;c<=u.length;++c)s[c+10]=u.charCodeAt(c)}})(o,e),Vy(o,i-8,a.d()),Vy(o,i-4,r),o}var QN=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
514
+ `,Pa,eo,to,er,tr,ao,ar,wp=class extends HTMLElement{constructor(){super();xr(this,Pa);xr(this,eo);xr(this,to);xr(this,er);xr(this,tr);xr(this,ao,null);xr(this,ar,null);on(this,Pa,this.attachShadow({mode:"open",delegatesFocus:!0})),on(this,eo,document.createElement("div")),ge(this,eo).setAttribute("part","mount"),ge(this,Pa).appendChild(ge(this,eo)),on(this,to,document.createElement("div")),ge(this,to).id="portalRoot",ge(this,Pa).appendChild(ge(this,to)),on(this,er,document.createElement("div")),ge(this,er).id="overlayContainer",Object.assign(ge(this,er).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ge(this,Pa).appendChild(ge(this,er)),on(this,tr,Ny()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ge(this,ao)?.unmount(),on(this,ao,null)}getMountNode(){return ge(this,eo)}getController(){return ge(this,tr)}getPortalRoot(){return ge(this,to)}getOverlayContainer(){return ge(this,er)}getShadowRoot(){return ge(this,Pa)}open(){ge(this,tr).setOpen(!0)}close(){ge(this,tr).setOpen(!1)}toggle(){ge(this,tr).toggle()}setOverrideFetcher(a){ge(this,ar)&&(on(this,ar,{...ge(this,ar),fetcher:a}),this.render())}mountReactApp(a){on(this,ar,a),this.render()}render(){!this.isConnected||!ge(this,ar)||(ge(this,ao)||on(this,ao,(0,_I.createRoot)(ge(this,eo))),ge(this,ao).render((0,ex.jsx)(Hy,{shadowRoot:ge(this,Pa),portalRoot:ge(this,to),overlayContainer:ge(this,er),children:(0,ex.jsx)(Jy,{...ge(this,ar),controller:ge(this,tr),canvasHost:this})})))}applyBaseStyles(){if(ge(this,Pa).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(CI),ge(this,Pa).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=CI,ge(this,Pa).appendChild(a)}}};Pa=new WeakMap,eo=new WeakMap,to=new WeakMap,er=new WeakMap,tr=new WeakMap,ao=new WeakMap,ar=new WeakMap;var tx=()=>{typeof window>"u"||customElements.get(SI)||customElements.define(SI,wp)};var Lp=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let b=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=qk(b)}let a=null,n=null,r=null,{runtime:o}=t;async function i(b){!o?.actions||b.length===0||(r?.isApplied()&&await r.revertAll(),r=await o.actions.applyBatch(b))}async function s(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{n=t.fetcher,console.log("[SmartCanvas] Fetching initial config...");let b=await t.fetcher();a=b,console.log("[SmartCanvas] Config fetched:",`tiles=${b.tiles?.length??0},`,`actions=${b.actions?.length??0},`,`theme=${b.theme?.mode??"default"}`),b.actions?.length&&console.log("[SmartCanvas] Actions to apply:",b.actions.map((m,g)=>`[${g}] ${m.kind}${m.anchorId?` anchor="${m.anchorId.selector}"`:""}${m.label?` "${m.label}"`:""}`).join(", ")),b.actions&&b.actions.length>0&&o?.actions&&(await i(b.actions),console.log("[SmartCanvas] Initial actions applied successfully")),b.tiles&&o?.accumulator&&Du(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=lp();tx();let u=document.createElement("smart-canvas");if(Qk(u.getOverlayContainer()),t.tokens)for(let[b,m]of Object.entries(t.tokens))u.style.setProperty(b,m);let c=()=>{let b=t.target??document.body;b&&b.appendChild(u)};document.body?c():document.addEventListener("DOMContentLoaded",c,{once:!0}),l&&(console.log(`[SmartCanvas] Loading editor SDK for ${l} mode`),Wk(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,f=t.integrations?.telemetry,h=t.fetcher??Qo({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});n||(n=h);let S={fetcher:h,pollIntervalMs:t.pollIntervalMs,experiments:d,telemetry:f,runtime:o,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,initialBatchHandle:r,workspaceTheme:t.workspaceTheme};u.mountReactApp(S),t.defaultOpen&&u.open();let x={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{s(),u.remove()},setTokens:b=>{for(let[m,g]of Object.entries(b))u.style.setProperty(m,g)},getConfig:async()=>{if(n)try{let b=await n();return a=b,b}catch(b){console.error("[SmartCanvas] Error fetching config:",b)}return a??{tiles:[],actions:[],fetchedAt:""}},setEnabled:async b=>{b?a&&await i(a.actions):await s()},setOverrideFetcher:b=>{n=b,u.setOverrideFetcher(b),o?.accumulator&&b().then(m=>{m?.tiles&&Du(m.tiles,o.accumulator,m.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{f?.register?.(b)},getSessionId:()=>f?.getSessionId?.(),startSessionRecording:()=>{f?.startSessionRecording?.()},track:(b,m)=>f?.track?(f.track(b,m),!0):!1,runtime:o};if(typeof window<"u"){let b=window.SynOS;b&&(b.handle=x)}return x};typeof window<"u"&&(window.SmartCanvas={async create(t){return Lp(t)}});var ro=Y(Ye(),1);var no=Y(Ae(),1);function CP({tiles:t,intervalMs:e=7e3,telemetry:a}){let[n,r]=(0,ro.useState)(0),o=(0,ro.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,ro.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,ro.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{r(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,ro.useEffect)(()=>{let i=o[n];i&&a?.trackRectangleViewed(i.id,"wheel")},[n,o,a]),o.length?(0,no.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:"var(--sc-tile-border)",background:"var(--sc-tile-background)",padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,no.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${n*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,no.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,no.jsx)(ks,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,no.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,no.jsx)("button",{type:"button",style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:s===n?"var(--sc-color-primary)":"var(--sc-tile-text-color)",border:"none",cursor:"pointer",padding:0},onClick:()=>r(s)},i.id))})]}):null}function As(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function _P(t){let e=[],a=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let n=t;if(n.tiles||a.push("Config missing required field: tiles"),n.actions||a.push("Config missing required field: actions"),n.fetchedAt||a.push("Config missing required field: fetchedAt"),a.length>0)return{valid:!1,errors:a,warnings:e};let r=n.schemaVersion||"1.0",o=As(r),i=As(Qn);return o.major>i.major&&e.push(`Config schema v${r} is newer than SDK v${Qn}. Some features may not work. Update SDK to latest version.`),o.major<i.major||!n.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${Qn}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:wP(n,r)}):{valid:!0,warnings:e,errors:a}}function wP(t,e){let a={...t};return As(e).major===1&&(a=LP(a)),a.schemaVersion=Qn,a}function LP(t){let e={schemaVersion:"2.0",tiles:[],actions:t.actions||[],fetchedAt:t.fetchedAt||new Date().toISOString()};return t.tiles&&Array.isArray(t.tiles)&&(e.tiles=t.tiles.map(a=>{let n={...a};return a.experiment&&delete n.experiment,n})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),e}function kP(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",n=As(a),r=As(Qn);return n.major<r.major||!e.schemaVersion}var LI={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function kI(){return LI}function ax(t){let e=2166136261,a=t.length;for(let n=0;n<a;n++)e^=t.charCodeAt(n),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Yu(t,e,a){return a===2?ax(ax(t+e)+"")%1e4/1e4:a===1?ax(e+t)%1e3/1e3:null}function IP(t){return t<=0?[]:new Array(t).fill(1/t)}function kp(t,e){return t>=e[0]&&t<e[1]}function II(t,e){let a=Yu("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function AI(t,e){for(let a=0;a<e.length;a++)if(kp(t,e[a]))return a;return-1}function rx(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Ip(t,e){if(!e.length)return!1;let a=!1,n=!1;for(let r=0;r<e.length;r++){let o=TP(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(o)return!1}else a=!0,o&&(n=!0)}return n||!a}function AP(t,e,a){try{let n=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return a&&(n="\\/?"+n.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+n+"$","i").test(t)}catch{return!1}}function EP(t,e){try{let a=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),n=[[t.host,a.host,!1],[t.pathname,a.pathname,!0]];return a.hash&&n.push([t.hash,a.hash,!1]),a.searchParams.forEach((r,o)=>{n.push([t.searchParams.get(o)||"",r,!1])}),!n.some(r=>!AP(r[0],r[1],r[2]))}catch{return!1}}function TP(t,e,a){try{let n=new URL(t,"https://_");if(e==="regex"){let r=rx(a);return r?r.test(n.href)||r.test(n.href.substring(n.origin.length)):!1}else if(e==="simple")return EP(n,a);return!1}catch{return!1}}function EI(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let n=IP(t);a=a||n,a.length!==t&&(a=n);let r=a.reduce((i,s)=>s+i,0);(r<.99||r>1.01)&&(a=n);let o=0;return a.map(i=>{let s=o;return o+=i,[s,s+e*i]})}function TI(t,e,a){if(!e)return null;let n=e.split("?")[1];if(!n)return null;let r=n.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return r.length>0&&r[0]>=0&&r[0]<a?r[0]:null}function RI(t){try{return t()}catch(e){return console.error(e),!1}}var nx=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function ti(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||LI.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let n=await a.importKey("raw",nx(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:nx(r)},n,nx(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function Ku(t){return typeof t=="string"?t:JSON.stringify(t)}function ba(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(a=>a.match(/^[0-9]+$/)?a.padStart(5," "):a).join("-")}function MI(){let t;try{t="1.6.4"}catch{t=""}return t}function DI(t,e){let a,n;try{a=new URL(t),n=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return a.searchParams.forEach((r,o)=>{n.searchParams.has(o)||n.searchParams.set(o,r)}),n.toString()}function wI(t){return typeof t=="object"&&t!==null}function Ap(t){return t.urlPatterns&&t.variations.some(e=>wI(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>wI(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Ep(t,e){return new Promise(a=>{let n=!1,r,o=i=>{n||(n=!0,r&&clearTimeout(r),a(i||null))};e&&(r=setTimeout(()=>o(),e)),t.then(i=>o(i)).catch(()=>o())})}var Dt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},vn=kI(),Es={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>vn.fetch(`${t}/api/features/${e}`,{headers:a}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:a,headers:n})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(a)};return vn.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new vn.EventSource(`${t}/sub/${e}`,{headers:a}):new vn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),DP()):document.visibilityState==="hidden"&&(t=window.setTimeout(MP,Dt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(vn.localStorage=globalThis.localStorage)}catch{}var Ts=new Map,OI=!1,nr=new Map,Tp=new Map,Rs=new Map,Ms=new Set;function PI(t){Object.assign(Dt,t),Dt.backgroundSync||cx()}async function FI({instance:t,timeout:e,skipCache:a,allowStale:n,backgroundSync:r}){return r||(Dt.backgroundSync=!1),OP({instance:t,allowStale:n,timeout:e,skipCache:a})}function RP(t){let e=Qu(t),a=Ts.get(e)||new Set;a.add(t),Ts.set(e,a)}function NI(t){Ts.forEach(e=>e.delete(t))}function MP(){Rs.forEach(t=>{t&&(t.state="idle",lx(t))})}function DP(){Rs.forEach(t=>{t&&t.state==="idle"&&ux(t)})}async function BI(){try{if(!vn.localStorage)return;await vn.localStorage.setItem(Dt.cacheKey,JSON.stringify(Array.from(nr.entries())))}catch{}}async function OP({instance:t,allowStale:e,timeout:a,skipCache:n}){let r=Qu(t),o=ix(t),i=new Date,s=new Date(i.getTime()-Dt.maxAge+Dt.staleTTL);await BP();let l=!Dt.disableCache&&!n?nr.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&Ms.add(r),l.staleAt<i?ox(t):sx(t),{data:l.data,success:!0,source:"cache"}):await Ep(ox(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Qu(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function ix(t){let e=Qu(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let a=t.getAttributes(),n=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};n.forEach(s=>{r[s]=a[s]});let o=t.getForcedVariations(),i=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:o,url:i})}`}async function BP(){if(!OI){OI=!0;try{if(vn.localStorage){let t=await vn.localStorage.getItem(Dt.cacheKey);if(!Dt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,n])=>{nr.set(a,{...n,staleAt:new Date(n.staleAt)})}),HI()}}}catch{}if(!Dt.disableIdleStreams){let t=Es.startIdleListener();t&&(Es.stopIdleListener=t)}}}function HI(){let t=Array.from(nr.entries()).map(([a,n])=>({key:a,staleAt:n.staleAt.getTime()})).sort((a,n)=>a.staleAt-n.staleAt),e=Math.min(Math.max(0,nr.size-Dt.maxEntries),nr.size);for(let a=0;a<e;a++)nr.delete(t[a].key)}function UI(t,e,a){let n=a.dateUpdated||"",r=new Date(Date.now()+Dt.staleTTL),o=Dt.disableCache?void 0:nr.get(e);if(o&&n&&o.version===n){o.staleAt=r,BI();return}Dt.disableCache||(nr.set(e,{data:a,version:n,staleAt:r,sse:Ms.has(t)}),HI()),BI();let i=Ts.get(t);i&&i.forEach(s=>PP(s,a))}async function PP(t,e){await t.setPayload(e||t.getPayload())}async function ox(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),n=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),o=Qu(t),i=ix(t),s=Tp.get(i);return s||(s=(r?Es.fetchRemoteEvalCall({host:e,clientKey:n,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):Es.fetchFeaturesCall({host:e,clientKey:n,headers:a})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&Ms.add(o),u.json()}).then(u=>(UI(o,i,u),sx(t),Tp.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(Tp.delete(i),{data:null,source:"error",success:!1,error:u})),Tp.set(i,s)),s}function sx(t,e=!1){let a=Qu(t),n=ix(t),{streamingHost:r,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&Ms.add(a),Dt.backgroundSync&&Ms.has(a)&&vn.EventSource){if(Rs.has(a))return;let s={src:null,host:r,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=Ts.get(a);u&&u.forEach(c=>{ox(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);UI(a,n,u)}s.errors=0}catch{zI(s)}},errors:0,state:"active"};Rs.set(a,s),ux(s)}}function zI(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);lx(t),setTimeout(()=>{["idle","active"].includes(t.state)||ux(t)},Math.min(e,3e5))}}function lx(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function ux(t){t.src=Es.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>zI(t),t.src.onopen=()=>{t.errors=0}}function FP(t,e){lx(t),Rs.delete(e)}function cx(){Ms.clear(),Rs.forEach(FP),Ts.clear(),Es.stopIdleListener()}function Rp(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&sx(t,!0),RP(t)}}var NP=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,px={revert:function(){}},Bp=new Map,hx=new Set;function HP(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Pp(t){var e=Bp.get(t);return e||(e={element:t,attributes:{}},Bp.set(t,e)),e}function Fp(t,e,a,n,r){var o=a(t),i={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&i._positionTimeout)){e==="position"&&(i._positionTimeout=setTimeout(function(){i._positionTimeout=null},1e3));var s=a(t);e==="position"&&s.parentNode===i.virtualValue.parentNode&&s.insertBeforeNode===i.virtualValue.insertBeforeNode||s!==i.virtualValue&&(i.originalValue=s,r(i))}}),mutationRunner:r,setValue:n,getCurrentValue:a};return e==="position"&&t.parentNode?i.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):i.observer.observe(t,HP(e)),i}function Np(t,e){var a=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!a||t.parentNode!==a.parentNode||t.insertBeforeNode!==a.insertBeforeNode)&&(e.isDirty=!0,qI()):t!==a&&(e.isDirty=!0,qI())}function UP(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Np(eF(e),t)}function zP(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),Np(Array.from(e).filter(Boolean).join(" "),t)}function qP(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),Np(e,t)}function $P(t){var e=t.parentSelector,a=t.insertBeforeSelector,n=document.querySelector(e);if(!n)return null;var r=a?document.querySelector(a):null;return a&&!r?null:{parentNode:n,insertBeforeNode:r}}function VP(t){var e=t.originalValue;t.mutations.forEach(function(a){var n=a.mutate(),r=$P(n);e=r||e}),Np(e,t)}var jP=function(e){return e.innerHTML},GP=function(e,a){return e.innerHTML=a};function VI(t){var e=Pp(t);return e.html||(e.html=Fp(t,"html",jP,GP,UP)),e.html}var ZP=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},WP=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function jI(t){var e=Pp(t);return e.position||(e.position=Fp(t,"position",ZP,WP,VP)),e.position}var XP=function(e,a){return a?e.className=a:e.removeAttribute("class")},YP=function(e){return e.className};function GI(t){var e=Pp(t);return e.classes||(e.classes=Fp(t,"class",YP,XP,zP)),e.classes}var KP=function(e){return function(a){var n;return(n=a.getAttribute(e))!=null?n:null}},QP=function(e){return function(a,n){return n!==null?a.setAttribute(e,n):a.removeAttribute(e)}};function ZI(t,e){var a=Pp(t);return a.attributes[e]||(a.attributes[e]=Fp(t,e,KP(e),QP(e),qP)),a.attributes[e]}function JP(t,e){var a=Bp.get(t);if(a)if(e==="html"){var n,r;(n=a.html)==null||(r=n.observer)==null||r.disconnect(),delete a.html}else if(e==="class"){var o,i;(o=a.classes)==null||(i=o.observer)==null||i.disconnect(),delete a.classes}else if(e==="position"){var s,l;(s=a.position)==null||(l=s.observer)==null||l.disconnect(),delete a.position}else{var u,c,d;(u=a.attributes)==null||(c=u[e])==null||(d=c.observer)==null||d.disconnect(),delete a.attributes[e]}}var Mp;function eF(t){return Mp||(Mp=document.createElement("div")),Mp.innerHTML=t,Mp.innerHTML}function Dp(t,e,a){if(a.isDirty){a.isDirty=!1;var n=a.virtualValue;a.mutations.length||JP(t,e),a.setValue(t,n)}}function tF(t,e){t.html&&Dp(e,"html",t.html),t.classes&&Dp(e,"class",t.classes),t.position&&Dp(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){Dp(e,a,t.attributes[a])})}function qI(){Bp.forEach(tF)}function aF(t,e){var a=null;t.kind==="html"?a=VI(e):t.kind==="class"?a=GI(e):t.kind==="attribute"?a=ZI(e,t.attribute):t.kind==="position"&&(a=jI(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function nF(t,e){var a=null;if(t.kind==="html"?a=VI(e):t.kind==="class"?a=GI(e):t.kind==="attribute"?a=ZI(e,t.attribute):t.kind==="position"&&(a=jI(e)),!!a){var n=a.mutations.indexOf(t);n!==-1&&a.mutations.splice(n,1),a.mutationRunner(a)}}function WI(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),a=document.querySelectorAll(t.selector);a.forEach(function(n){e.has(n)||(t.elements.add(n),aF(t,n))})}}function rF(t){t.elements.forEach(function(e){return nF(t,e)}),t.elements.clear(),hx.delete(t)}function $I(){hx.forEach(WI)}var dx;function oF(){typeof document>"u"||(dx||(dx=new MutationObserver(function(){$I()})),$I(),dx.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}oF();function Hp(t){return typeof document>"u"?px:(hx.add(t),WI(t),{revert:function(){rF(t)}})}function fx(t,e){return Hp({kind:"html",elements:new Set,mutate:e,selector:t})}function XI(t,e){return Hp({kind:"position",elements:new Set,mutate:e,selector:t})}function Ju(t,e){return Hp({kind:"class",elements:new Set,mutate:e,selector:t})}function Op(t,e,a){return NP.test(e)?e==="class"||e==="className"?Ju(t,function(n){var r=a(Array.from(n).join(" "));n.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(o){return n.add(o)})}):Hp({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):px}function iF(t){var e=t.selector,a=t.action,n=t.value,r=t.attribute,o=t.parentSelector,i=t.insertBeforeSelector;if(r==="html"){if(a==="append")return fx(e,function(s){return s+(n??"")});if(a==="set")return fx(e,function(){return n??""})}else if(r==="class"){if(a==="append")return Ju(e,function(s){n&&s.add(n)});if(a==="remove")return Ju(e,function(s){n&&s.delete(n)});if(a==="set")return Ju(e,function(s){s.clear(),n&&s.add(n)})}else if(r==="position"){if(a==="set"&&o)return XI(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return Op(e,r,function(s){return s!==null?s+(n??""):n??""});if(a==="set")return Op(e,r,function(){return n??""});if(a==="remove")return Op(e,r,function(){return null})}return px}var sF={html:fx,classes:Ju,attribute:Op,position:XI,declarative:iF},YI=sF;var mx={};function oo(t,e,a){a=a||{};for(let[n,r]of Object.entries(e))switch(n){case"$or":if(!JI(t,r,a))return!1;break;case"$nor":if(JI(t,r,a))return!1;break;case"$and":if(!fF(t,r,a))return!1;break;case"$not":if(oo(t,r,a))return!1;break;default:if(!ec(r,lF(t,n),a))return!1}return!0}function lF(t,e){let a=e.split("."),n=t;for(let r=0;r<a.length;r++)if(n&&typeof n=="object"&&a[r]in n)n=n[a[r]];else return null;return n}function KI(t,e=!1){let a=`${t}${e?"/i":""}`;return mx[a]||(mx[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),mx[a]}function ec(t,e,a,n=!1){if(typeof t=="string")return n?String(e).toLowerCase()===t.toLowerCase():e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!eA(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!dF(r,e,t[r],a))return!1;return!0}function eA(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function uF(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function cF(t,e,a){if(!Array.isArray(t))return!1;let n=eA(e)?r=>ec(e,r,a):r=>oo(r,e,a);for(let r=0;r<t.length;r++)if(t[r]&&n(t[r]))return!0;return!1}function Ds(t,e,a=!1){if(a){let n=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(o=>n(r)===n(o))):e.some(r=>n(t)===n(r))}return Array.isArray(t)?t.some(n=>e.includes(n)):e.includes(t)}function QI(t,e,a,n=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let o=!1;for(let i=0;i<t.length;i++)if(ec(e[r],t[i],a,n)){o=!0;break}if(!o)return!1}return!0}function dF(t,e,a,n){switch(t){case"$veq":return ba(e)===ba(a);case"$vne":return ba(e)!==ba(a);case"$vgt":return ba(e)>ba(a);case"$vgte":return ba(e)>=ba(a);case"$vlt":return ba(e)<ba(a);case"$vlte":return ba(e)<=ba(a);case"$eq":return e===a;case"$ne":return e!==a;case"$lt":return e<a;case"$lte":return e<=a;case"$gt":return e>a;case"$gte":return e>=a;case"$exists":return a?e!=null:e==null;case"$in":return Array.isArray(a)?Ds(e,a):!1;case"$ini":return Array.isArray(a)?Ds(e,a,!0):!1;case"$inGroup":return Ds(e,n[a]||[]);case"$notInGroup":return!Ds(e,n[a]||[]);case"$nin":return Array.isArray(a)?!Ds(e,a):!1;case"$nini":return Array.isArray(a)?!Ds(e,a,!0):!1;case"$not":return!ec(a,e,n);case"$size":return Array.isArray(e)?ec(a,e.length,n):!1;case"$elemMatch":return cF(e,a,n);case"$all":return Array.isArray(a)?QI(e,a,n):!1;case"$alli":return Array.isArray(a)?QI(e,a,n,!0):!1;case"$regex":try{return KI(a).test(e)}catch{return!1}case"$regexi":try{return KI(a,!0).test(e)}catch{return!1}case"$type":return uF(e)===a;default:return console.error("Unknown operator: "+t),!1}}function JI(t,e,a){if(!e.length)return!0;for(let n=0;n<e.length;n++)if(oo(t,e[n],a))return!0;return!1}function fF(t,e,a){for(let n=0;n<e.length;n++)if(!oo(t,e[n],a))return!1;return!0}var pF="Feature Evaluated",hF="Experiment Viewed";function mF(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((a,n)=>e.set(n,a)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((a,n)=>e.set(n,a)),e}function gF(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function Os(t){try{await t()}catch{}}function tA(t,e,a){if(t.user.trackedExperiments){let r=qp(e,a);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:a,timestamp:Date.now().toString(),logType:"experiment"});let n=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;n.push(Os(()=>r(e,a,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;n.push(Os(()=>r(e,a)))}if(t.global.eventLogger){let r=t.global.eventLogger;n.push(Os(()=>r(hF,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return n}function vF(t,e,a){if(t.user.trackedFeatureUsage){let n=JSON.stringify(a.value);if(t.user.trackedFeatureUsage[e]===n)return;t.user.trackedFeatureUsage[e]=n,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:a,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let n=t.global.onFeatureUsage;Os(()=>n(e,a,t.user))}if(t.user.onFeatureUsage){let n=t.user.onFeatureUsage;Os(()=>n(e,a))}if(t.global.eventLogger){let n=t.global.eventLogger;Os(()=>n(pF,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function Up(t,e){if(e.stack.evaluatedFeatures.has(t))return io(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=mF(e);if(a.has(t))return io(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return io(e,t,null,"unknownFeature");let n=e.global.features[t];if(n.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let o of n.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(r);let u=Up(l.id,e);if(u.source==="cyclicPrerequisite")return io(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!oo(c,l.condition||{})){if(l.gate)return io(e,t,null,"prerequisite");continue e}}if(o.filters&&rA(o.filters,e))continue;if("force"in o){if(o.condition&&!nA(o.condition,e)||!yF(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!tA(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),io(e,t,o.force,"force",o.id)}if(!o.variations)continue;let i={variations:o.variations,key:o.key||t};"coverage"in o&&(i.coverage=o.coverage),o.weights&&(i.weights=o.weights),o.hashAttribute&&(i.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(i.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(i.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(i.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(i.minBucketVersion=o.minBucketVersion),o.namespace&&(i.namespace=o.namespace),o.meta&&(i.meta=o.meta),o.ranges&&(i.ranges=o.ranges),o.name&&(i.name=o.name),o.phase&&(i.phase=o.phase),o.seed&&(i.seed=o.seed),o.hashVersion&&(i.hashVersion=o.hashVersion),o.filters&&(i.filters=o.filters),o.condition&&(i.condition=o.condition);let{result:s}=zp(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return io(e,t,s.value,"experiment",o.id,i,s)}}return io(e,t,n.defaultValue===void 0?null:n.defaultValue,"defaultValue")}function zp(t,e,a){let n=t.key,r=t.variations.length;if(r<2)return{result:Ze(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:Ze(a,t,-1,!1,e)};if(t=xF(t,a),t.urlPatterns&&!Ip(a.user.url||"",t.urlPatterns))return{result:Ze(a,t,-1,!1,e)};let o=TI(n,a.user.url||"",r);if(o!==null)return{result:Ze(a,t,o,!1,e)};let i=gF(a);if(n in i){let b=i[n];return{result:Ze(a,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Ze(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=ai(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Ze(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:m}=CF({ctx:a,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=b>=0,u=b,d=!!m}if(!c){if(t.filters){if(rA(t.filters,a))return{result:Ze(a,t,-1,!1,e)}}else if(t.namespace&&!II(l,t.namespace))return{result:Ze(a,t,-1,!1,e)};if(t.include&&!RI(t.include))return{result:Ze(a,t,-1,!1,e)};if(t.condition&&!nA(t.condition,a))return{result:Ze(a,t,-1,!1,e)};if(t.parentConditions){let b=new Set(a.stack.evaluatedFeatures);for(let m of t.parentConditions){a.stack.evaluatedFeatures=new Set(b);let g=Up(m.id,a);if(g.source==="cyclicPrerequisite")return{result:Ze(a,t,-1,!1,e)};let v={value:g.value};if(!oo(v,m.condition||{}))return{result:Ze(a,t,-1,!1,e)}}}if(t.groups&&!SF(t.groups,a))return{result:Ze(a,t,-1,!1,e)}}if(t.url&&!bF(t.url,a))return{result:Ze(a,t,-1,!1,e)};let f=Yu(t.seed||n,l,t.hashVersion||1);if(f===null)return{result:Ze(a,t,-1,!1,e)};if(!c){let b=t.ranges||EI(r,t.coverage===void 0?1:t.coverage,t.weights);u=AI(f,b)}if(d)return{result:Ze(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:Ze(a,t,-1,!1,e)};if("force"in t)return{result:Ze(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:Ze(a,t,-1,!1,e)};if(t.status==="stopped")return{result:Ze(a,t,-1,!1,e)};let h=Ze(a,t,u,!0,e,f,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:m,doc:g}=wF(a,s,Ku(l),{[gx(t.key,t.bucketVersion)]:h.key});b&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[m]=g,a.user.saveStickyBucketAssignmentDoc(g))}let S=tA(a,t,h);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:h});let x=S.length?S.length===1?S[0]:Promise.all(S).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&a.global.recordChangeId&&a.global.recordChangeId(t.changeId),{result:h,trackingCall:x}}function io(t,e,a,n,r,o,i){let s={value:a,on:!!a,off:!a,source:n,ruleId:r||""};return o&&(s.experiment=o),i&&(s.experimentResult=i),n!=="override"&&vF(t,e,s),s}function aA(t){return{...t.user.attributes,...t.user.attributeOverrides}}function nA(t,e){return oo(aA(e),t,e.global.savedGroups||{})}function rA(t,e){return t.some(a=>{let{hashValue:n}=ai(e,a.attribute);if(!n)return!0;let r=Yu(a.seed,n,a.hashVersion||2);return r===null?!0:!a.ranges.some(o=>kp(r,o))})}function yF(t,e,a,n,r,o,i){if(!r&&o===void 0)return!0;if(!r&&o===0)return!1;let{hashValue:s}=ai(t,a,n);if(!s)return!1;let l=Yu(e,s,i||1);return l===null?!1:r?kp(l,r):o!==void 0?l<=o:!0}function Ze(t,e,a,n,r,o,i){let s=!0;(a<0||a>=e.variations.length)&&(a=0,s=!1);let{hashAttribute:l,hashValue:u}=ai(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[a]:{},d={key:c.key||""+a,featureId:r,inExperiment:s,hashUsed:n,variationId:a,value:e.variations[a],hashAttribute:l,hashValue:u,stickyBucketUsed:!!i};return c.name&&(d.name=c.name),o!==void 0&&(d.bucket=o),c.passthrough&&(d.passthrough=c.passthrough),d}function xF(t,e){let a=t.key,n=e.global.overrides;return n&&n[a]&&(t=Object.assign({},t,n[a]),typeof t.url=="string"&&(t.url=rx(t.url))),t}function ai(t,e,a){let n=e||"id",r="",o=aA(t);return o[n]&&(r=o[n]),!r&&a&&(o[a]&&(r=o[a]),r&&(n=a)),{hashAttribute:n,hashValue:r}}function bF(t,e){let a=e.user.url;if(!a)return!1;let n=a.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(a)||t.test(n))}function SF(t,e){let a=e.global.groups||{};for(let n=0;n<t.length;n++)if(a[t[n]])return!0;return!1}function CF({ctx:t,expKey:e,expBucketVersion:a,expHashAttribute:n,expFallbackAttribute:r,expMinBucketVersion:o,expMeta:i}){a=a||0,o=o||0,n=n||"id",i=i||[];let s=gx(e,a),l=_F(t,n,r);if(o>0)for(let d=0;d<o;d++){let f=gx(e,d);if(l[f]!==void 0)return{variation:-1,versionIsBlocked:!0}}let u=l[s];if(u===void 0)return{variation:-1};let c=i.findIndex(d=>d.key===u);return c<0?{variation:-1}:{variation:c}}function gx(t,e){return e=e||0,`${t}__${e}`}function vx(t,e){return`${t}||${e}`}function _F(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:n,hashValue:r}=ai(t,e),o=vx(n,Ku(r)),{hashAttribute:i,hashValue:s}=ai(t,a),l=s?vx(i,Ku(s)):null,u={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(u,t.user.stickyBucketAssignmentDocs[o].assignments||{}),u}function wF(t,e,a,n){let r=vx(e,a),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},i={...o,...n},s=JSON.stringify(o)!==JSON.stringify(i);return{key:r,doc:{attributeName:e,attributeValue:a,assignments:i},changed:s}}function LF(t,e){let a=new Set,n=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(n).forEach(o=>{let i=n[o];if(i.rules)for(let s of i.rules)s.variations&&(a.add(s.hashAttribute||"id"),s.fallbackAttribute&&a.add(s.fallbackAttribute))}),r.map(o=>{a.add(o.hashAttribute||"id"),o.fallbackAttribute&&a.add(o.fallbackAttribute)}),Array.from(a)}async function oA(t,e,a){let n=yx(t,a);return e.getAllAssignments(n)}function yx(t,e){let a={};return LF(t,e).forEach(r=>{let{hashValue:o}=ai(t,r);a[r]=Ku(o)}),a}async function iA(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await ti(t.encryptedFeatures,e,a))}catch(n){console.error(n)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await ti(t.encryptedExperiments,e,a))}catch(n){console.error(n)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await ti(t.encryptedSavedGroups,e,a))}catch(n){console.error(n)}delete t.encryptedSavedGroups}return t}function sA(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function qp(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var Bs=typeof window<"u"&&typeof document<"u",kF=MI(),tc=class{constructor(e){if(e=e||{},this.version=kF,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let a=!1;try{a=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(a)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let a=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=n=>a.saveAssignments(n)}if(e.plugins)for(let a of e.plugins)a(this);if(e.features&&(this.ready=!0),Bs&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let a in this._options.stickyBucketAssignmentDocs){let n=this._options.stickyBucketAssignmentDocs[a];n&&this._options.stickyBucketService.saveAssignments(n).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let a=await iA(e,this._options.decryptionKey);this._decryptedPayload=a,await this.refreshStickyBuckets(a),a.features&&(this._options.features=a.features),a.savedGroups&&(this._options.savedGroups=a.savedGroups),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let a=e.payload;if(a.encryptedExperiments||a.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,a)),this._payload=a,this._decryptedPayload=a,a.features&&(this._options.features=a.features),a.experiments&&(this._options.experiments=a.experiments,this._updateAllAutoExperiments()),this.ready=!0,Rp(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&PI(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Rp(this,e),{success:!0,source:"init"};{let{data:a,...n}=await this._refresh({...e,allowStale:!0});return Rp(this,e),await this.setPayload(a||{}),n}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let a=await this._refresh({...e||{},allowStale:!1});a.data&&await this.setPayload(a.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return sA(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:a,allowStale:n,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return FI({instance:this,timeout:e,skipCache:a||this._options.disableCache,allowStale:n,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,a,n){let r=await ti(e,a||this._options.decryptionKey,n);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,a,n){let r=await ti(e,a||this._options.decryptionKey,n);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(a=>{try{a()}catch(n){console.error(n)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,NI(this),e.destroyAllStreams&&cx(),this.logs=[],Bs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(a=>{a.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,a){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=a,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:a}=zp(e,null,this._getEvalContext());return this._onExperimentEval(e,a),a}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(n=>n.key===e).map(n=>this._runAutoExperiment(n)).filter(n=>n!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,a){let n=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!n)return null;let r=this._isAutoExperimentBlockedByContext(e),o,i;r?o=Ze(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=zp(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let s=JSON.stringify(o.value);if(!a&&o.inExperiment&&n&&n.valueHash===s)return o;if(n&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Ap(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?DI(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Ip(u,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=u;let{navigate:c,delay:d}=this._getNavigateFunction();if(c)if(Bs)Promise.all([...i?[Ep(i,this._options.maxNavigateDelay??1e3)]:[],new Promise(f=>window.setTimeout(f,this._options.navigateDelay??d))]).then(()=>{try{c(u)}catch(f){console.error(f)}});else try{c(u)}catch(f){console.error(f)}}else if(l==="visual"){let u=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);u&&this._activeAutoExperiments.set(e,{undo:u,valueHash:s})}}return o}_undoActiveAutoExperiment(e){let a=this._activeAutoExperiments.get(e);a&&(a.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let a=this._options.experiments||[],n=new Set(a);this._activeAutoExperiments.forEach((r,o)=>{n.has(o)||(r.undo(),this._activeAutoExperiments.delete(o))});for(let r of a){let o=this._runAutoExperiment(r,e);if(o&&o.inExperiment&&Ap(r)==="redirect")break}}_onExperimentEval(e,a){let n=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:a}),this._subscriptions.size>0&&this._fireSubscriptions(e,a,n)}_fireSubscriptions(e,a,n){(!n||n.result.inExperiment!==a.inExperiment||n.result.variationId!==a.variationId)&&this._subscriptions.forEach(r=>{try{r(e,a)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,a){let n=this.evalFeature(e).value;return n===null?a:n}feature(e){return this.evalFeature(e)}evalFeature(e){return Up(e,this._getEvalContext())}log(e,a){this.debug&&(this._options.log?this._options.log(e,a):console.log(e,a))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(a=>a&&a.experiment&&a.result).map(a=>[qp(a.experiment,a.result),a]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(a=>{!a||!a.experiment||!a.result?console.error("Invalid deferred tracking call",{call:a}):e.push(this._options.trackingCallback(a.experiment,a.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,a){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:a,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,a||{},this._getUserContext())}catch(n){console.error(n)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(qp(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(Bs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=Ap(e);if(a==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(n=>n.js))return!0}else if(a==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let n=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let o=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==n.protocol||o.host!==n.host))return!0}}catch(n){return this.log("Error parsing current or redirect URL",{id:e.key,error:n}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:Bs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!Bs)return;let a=[];if(e.css){let n=document.createElement("style");n.innerHTML=e.css,document.head.appendChild(n),a.push(()=>n.remove())}if(e.js){let n=document.createElement("script");n.innerHTML=e.js,this._options.jsInjectionNonce&&(n.nonce=this._options.jsInjectionNonce),document.head.appendChild(n),a.push(()=>n.remove())}return e.domMutations&&e.domMutations.forEach(n=>{a.push(YI.declarative(n).revert)}),()=>{a.forEach(n=>n())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),n=await oA(a,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=n}}generateStickyBucketAssignmentDocsSync(e,a){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let n=this._getEvalContext(),r=yx(n,a);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var IF="https://experiment.syntrologie.com",xx=class{constructor(e={}){B(this,"gb");B(this,"featureListeners",new Set);if(e.client)this.gb=e.client;else{let a=e.onExperimentViewed?(n,r)=>{e.onExperimentViewed(n.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new tc({...e,apiHost:e.apiHost??IF,enableDevMode:e.enableDevMode??!0,trackingCallback:a}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes({...this.gb.getAttributes(),...e})}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,a){return this.gb.getFeatureValue(e,a)}getAllFeatures(){let e=this.gb.getFeatures(),a={};for(let n of Object.keys(e))a[n]=this.gb.getFeatureValue(n,null);return a}shouldRenderRectangle(e){return!0}onFeaturesChanged(e){return this.featureListeners.add(e),this.featureListeners.size===1&&this.gb.setRenderer(()=>{for(let a of this.featureListeners)a()}),()=>{this.featureListeners.delete(e),this.featureListeners.size===0&&this.gb.setRenderer(null)}}};function $p(t={}){return new xx(t)}var lA="syntro_session_metrics",ac=class{constructor(e={}){B(this,"metrics",new Map);B(this,"experiments");B(this,"attributePrefix");B(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,a=1){let r=(this.metrics.get(e)??0)+a;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,a){this.metrics.set(e,a),this.saveToStorage(),this.updateExperimentAttributes(e,a),this.onMetricChange?.(e,a)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,a){return this.get(e)>=a}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let a={};for(let n of e)a[`${this.attributePrefix}${n}`]=0,this.onMetricChange?.(n,0);this.experiments?.setAttributes?.(a)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,a){if(!this.experiments?.setAttributes)return;let n=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[n]:a})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[a,n]of this.metrics)e[`${this.attributePrefix}${a}`]=n;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(lA);if(e){let a=JSON.parse(e);for(let[n,r]of Object.entries(a))this.metrics.set(n,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[a,n]of this.metrics)e[a]={count:n,lastUpdated:Date.now()};sessionStorage.setItem(lA,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Vp(t={}){return new ac(t)}var p={};dS(p,{BRAND:()=>JF,DIRTY:()=>ni,EMPTY_PATH:()=>RF,INVALID:()=>Q,NEVER:()=>FN,OK:()=>Ot,ParseStatus:()=>It,Schema:()=>le,ZodAny:()=>uo,ZodArray:()=>sr,ZodBigInt:()=>oi,ZodBoolean:()=>ii,ZodBranded:()=>rc,ZodCatch:()=>vi,ZodDate:()=>si,ZodDefault:()=>gi,ZodDiscriminatedUnion:()=>Zp,ZodEffects:()=>Ha,ZodEnum:()=>hi,ZodError:()=>ta,ZodFirstPartyTypeKind:()=>J,ZodFunction:()=>Xp,ZodIntersection:()=>di,ZodIssueCode:()=>O,ZodLazy:()=>fi,ZodLiteral:()=>pi,ZodMap:()=>zs,ZodNaN:()=>$s,ZodNativeEnum:()=>mi,ZodNever:()=>an,ZodNull:()=>ui,ZodNullable:()=>bn,ZodNumber:()=>ri,ZodObject:()=>aa,ZodOptional:()=>Fa,ZodParsedType:()=>V,ZodPipeline:()=>oc,ZodPromise:()=>co,ZodReadonly:()=>yi,ZodRecord:()=>Wp,ZodSchema:()=>le,ZodSet:()=>qs,ZodString:()=>lo,ZodSymbol:()=>Hs,ZodTransformer:()=>Ha,ZodTuple:()=>xn,ZodType:()=>le,ZodUndefined:()=>li,ZodUnion:()=>ci,ZodUnknown:()=>ir,ZodVoid:()=>Us,addIssueToContext:()=>H,any:()=>lN,array:()=>fN,bigint:()=>nN,boolean:()=>xA,coerce:()=>PN,custom:()=>gA,date:()=>rN,datetimeRegex:()=>hA,defaultErrorMap:()=>rr,discriminatedUnion:()=>gN,effect:()=>AN,enum:()=>LN,function:()=>CN,getErrorMap:()=>Ps,getParsedType:()=>yn,instanceof:()=>tN,intersection:()=>vN,isAborted:()=>jp,isAsync:()=>Fs,isDirty:()=>Gp,isValid:()=>so,late:()=>eN,lazy:()=>_N,literal:()=>wN,makeIssue:()=>nc,map:()=>bN,nan:()=>aN,nativeEnum:()=>kN,never:()=>cN,null:()=>sN,nullable:()=>TN,number:()=>yA,object:()=>pN,objectUtil:()=>bx,oboolean:()=>BN,onumber:()=>ON,optional:()=>EN,ostring:()=>DN,pipeline:()=>MN,preprocess:()=>RN,promise:()=>IN,quotelessJson:()=>AF,record:()=>xN,set:()=>SN,setErrorMap:()=>TF,strictObject:()=>hN,string:()=>vA,symbol:()=>oN,transformer:()=>AN,tuple:()=>yN,undefined:()=>iN,union:()=>mN,unknown:()=>uN,util:()=>fe,void:()=>dN});var fe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{let o={};for(let i of r)o[i]=i;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),i={};for(let s of o)i[s]=r[s];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(i);return o},t.find=(r,o)=>{for(let i of r)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(fe||(fe={}));var bx;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(bx||(bx={}));var V=fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),yn=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}};var O=fe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),AF=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ta=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(o){return o.message},n={_errors:[]},r=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)n._errors.push(a(i));else{let s=n,l=0;for(;l<i.path.length;){let u=i.path[l];l===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(a(i))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return r(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];a[o]=a[o]||[],a[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:a}}get formErrors(){return this.flatten()}};ta.create=t=>new ta(t);var EF=(t,e)=>{let a;switch(t.code){case O.invalid_type:t.received===V.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,fe.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:a=`Unrecognized key(s) in object: ${fe.joinValues(t.keys,", ")}`;break;case O.invalid_union:a="Invalid input";break;case O.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${fe.joinValues(t.options)}`;break;case O.invalid_enum_value:a=`Invalid enum value. Expected ${fe.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:a="Invalid function arguments";break;case O.invalid_return_type:a="Invalid function return type";break;case O.invalid_date:a="Invalid date";break;case O.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:fe.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case O.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case O.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case O.custom:a="Invalid input";break;case O.invalid_intersection_types:a="Intersection results could not be merged";break;case O.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:a="Number must be finite";break;default:a=e.defaultError,fe.assertNever(t)}return{message:a}},rr=EF;var uA=rr;function TF(t){uA=t}function Ps(){return uA}var nc=t=>{let{data:e,path:a,errorMaps:n,issueData:r}=t,o=[...a,...r.path||[]],i={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)s=u(i,{data:e,defaultError:s}).message;return{...r,path:o,message:s}},RF=[];function H(t,e){let a=Ps(),n=nc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===rr?void 0:rr].filter(r=>!!r)});t.common.issues.push(n)}var It=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let n=[];for(let r of a){if(r.status==="aborted")return Q;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,a){let n=[];for(let r of a){let o=await r.key,i=await r.value;n.push({key:o,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,a){let n={};for(let r of a){let{key:o,value:i}=r;if(o.status==="aborted"||i.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(n[o.value]=i.value)}return{status:e.value,value:n}}},Q=Object.freeze({status:"aborted"}),ni=t=>({status:"dirty",value:t}),Ot=t=>({status:"valid",value:t}),jp=t=>t.status==="aborted",Gp=t=>t.status==="dirty",so=t=>t.status==="valid",Fs=t=>typeof Promise<"u"&&t instanceof Promise;var W;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(W||(W={}));var Na=class{constructor(e,a,n,r){this._cachedPath=[],this.parent=e,this.data=a,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},cA=(t,e)=>{if(so(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let a=new ta(t.common.issues);return this._error=a,this._error}}};function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:n,description:r}=t;if(e&&(a||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,s)=>{let{message:l}=t;return i.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:l??a??s.defaultError}},description:r}}var le=class{get description(){return this._def.description}_getType(e){return yn(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new It,ctx:{common:e.parent.common,data:e.data,parsedType:yn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(Fs(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){let a=this._parse(e);return Promise.resolve(a)}parse(e,a){let n=this.safeParse(e,a);if(n.success)return n.data;throw n.error}safeParse(e,a){let n={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yn(e)},r=this._parseSync({data:e,path:n.path,parent:n});return cA(n,r)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yn(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:a});return so(n)?{value:n.value}:{issues:a.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(n=>so(n)?{value:n.value}:{issues:a.common.issues})}async parseAsync(e,a){let n=await this.safeParseAsync(e,a);if(n.success)return n.data;throw n.error}async safeParseAsync(e,a){let n={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yn(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(Fs(r)?r:Promise.resolve(r));return cA(n,o)}refine(e,a){let n=r=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(r):a;return this._refinement((r,o)=>{let i=e(r),s=()=>o.addIssue({code:O.custom,...n(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,a){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof a=="function"?a(n,r):a),!1))}_refinement(e){return new Ha({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return Fa.create(this,this._def)}nullable(){return bn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sr.create(this)}promise(){return co.create(this,this._def)}or(e){return ci.create([this,e],this._def)}and(e){return di.create(this,e,this._def)}transform(e){return new Ha({...se(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new gi({...se(this._def),innerType:this,defaultValue:a,typeName:J.ZodDefault})}brand(){return new rc({typeName:J.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new vi({...se(this._def),innerType:this,catchValue:a,typeName:J.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return oc.create(this,e)}readonly(){return yi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},MF=/^c[^\s-]{8,}$/i,DF=/^[0-9a-z]+$/,OF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,PF=/^[a-z0-9_-]{21}$/i,FF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,NF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Sx,zF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$F=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,VF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ZF=new RegExp(`^${fA}$`);function pA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function WF(t){return new RegExp(`^${pA(t)}$`)}function hA(t){let e=`${fA}T${pA(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,new RegExp(`^${e}$`)}function XF(t,e){return!!((e==="v4"||!e)&&zF.test(t)||(e==="v6"||!e)&&$F.test(t))}function YF(t,e){if(!FF.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let n=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function KF(t,e){return!!((e==="v4"||!e)&&qF.test(t)||(e==="v6"||!e)&&VF.test(t))}var lo=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_type,expected:V.string,received:o.parsedType}),Q}let n=new It,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(r=this._getOrReturnCtx(e,r),i?H(r,{code:O.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&H(r,{code:O.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")HF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"email",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Sx||(Sx=new RegExp(UF,"u")),Sx.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"emoji",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")BF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"uuid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")PF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"nanoid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")MF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")DF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cuid2",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")OF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ulid",code:O.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),H(r,{validation:"url",code:O.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"regex",code:O.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?hA(o).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?ZF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?WF(o).test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:O.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?NF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"duration",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?XF(e.data,o.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"ip",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?YF(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"jwt",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?KF(e.data,o.version)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"cidr",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?jF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64",code:O.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?GF.test(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{validation:"base64url",code:O.invalid_string,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,a,n){return this.refinement(r=>e.test(r),{validation:a,code:O.invalid_string,...W.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...W.errToObj(e)})}url(e){return this._addCheck({kind:"url",...W.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...W.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...W.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...W.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...W.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...W.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...W.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...W.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...W.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...W.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...W.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...W.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...W.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...W.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...W.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...W.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...W.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...W.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...W.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...W.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...W.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...W.errToObj(a)})}nonempty(e){return this.min(1,W.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};lo.create=t=>new lo({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...se(t)});function QF(t,e){let a=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=a>n?a:n,o=Number.parseInt(t.toFixed(r).replace(".","")),i=Number.parseInt(e.toFixed(r).replace(".",""));return o%i/10**r}var ri=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_type,expected:V.number,received:o.parsedType}),Q}let n,r=new It;for(let o of this._def.checks)o.kind==="int"?fe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?QF(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:O.not_finite,message:o.message}),r.dirty()):fe.assertNever(o);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,W.toString(a))}gt(e,a){return this.setLimit("min",e,!1,W.toString(a))}lte(e,a){return this.setLimit("max",e,!0,W.toString(a))}lt(e,a){return this.setLimit("max",e,!1,W.toString(a))}setLimit(e,a,n,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:n,message:W.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:W.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:W.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fe.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(a===null||n.value>a)&&(a=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(a)&&Number.isFinite(e)}};ri.create=t=>new ri({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...se(t)});var oi=class t extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let n,r=new It;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),H(n,{code:O.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):fe.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:V.bigint,received:a.parsedType}),Q}gte(e,a){return this.setLimit("min",e,!0,W.toString(a))}gt(e,a){return this.setLimit("min",e,!1,W.toString(a))}lte(e,a){return this.setLimit("max",e,!0,W.toString(a))}lt(e,a){return this.setLimit("max",e,!1,W.toString(a))}setLimit(e,a,n,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:n,message:W.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};oi.create=t=>new oi({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var ii=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:V.boolean,received:n.parsedType}),Q}return Ot(e.data)}};ii.create=t=>new ii({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var si=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_type,expected:V.date,received:o.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:O.invalid_date}),Q}let n=new It,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),H(r,{code:O.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):fe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:W.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:W.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}};si.create=t=>new si({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...se(t)});var Hs=class extends le{_parse(e){if(this._getType(e)!==V.symbol){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:V.symbol,received:n.parsedType}),Q}return Ot(e.data)}};Hs.create=t=>new Hs({typeName:J.ZodSymbol,...se(t)});var li=class extends le{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:V.undefined,received:n.parsedType}),Q}return Ot(e.data)}};li.create=t=>new li({typeName:J.ZodUndefined,...se(t)});var ui=class extends le{_parse(e){if(this._getType(e)!==V.null){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:V.null,received:n.parsedType}),Q}return Ot(e.data)}};ui.create=t=>new ui({typeName:J.ZodNull,...se(t)});var uo=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Ot(e.data)}};uo.create=t=>new uo({typeName:J.ZodAny,...se(t)});var ir=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ot(e.data)}};ir.create=t=>new ir({typeName:J.ZodUnknown,...se(t)});var an=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return H(a,{code:O.invalid_type,expected:V.never,received:a.parsedType}),Q}};an.create=t=>new an({typeName:J.ZodNever,...se(t)});var Us=class extends le{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:V.void,received:n.parsedType}),Q}return Ot(e.data)}};Us.create=t=>new Us({typeName:J.ZodVoid,...se(t)});var sr=class t extends le{_parse(e){let{ctx:a,status:n}=this._processInputParams(e),r=this._def;if(a.parsedType!==V.array)return H(a,{code:O.invalid_type,expected:V.array,received:a.parsedType}),Q;if(r.exactLength!==null){let i=a.data.length>r.exactLength.value,s=a.data.length<r.exactLength.value;(i||s)&&(H(a,{code:i?O.too_big:O.too_small,minimum:s?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&a.data.length<r.minLength.value&&(H(a,{code:O.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&a.data.length>r.maxLength.value&&(H(a,{code:O.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),a.common.async)return Promise.all([...a.data].map((i,s)=>r.type._parseAsync(new Na(a,i,a.path,s)))).then(i=>It.mergeArray(n,i));let o=[...a.data].map((i,s)=>r.type._parseSync(new Na(a,i,a.path,s)));return It.mergeArray(n,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:W.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:W.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:W.toString(a)}})}nonempty(e){return this.min(1,e)}};sr.create=(t,e)=>new sr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...se(e)});function Ns(t){if(t instanceof aa){let e={};for(let a in t.shape){let n=t.shape[a];e[a]=Fa.create(Ns(n))}return new aa({...t._def,shape:()=>e})}else return t instanceof sr?new sr({...t._def,type:Ns(t.element)}):t instanceof Fa?Fa.create(Ns(t.unwrap())):t instanceof bn?bn.create(Ns(t.unwrap())):t instanceof xn?xn.create(t.items.map(e=>Ns(e))):t}var aa=class t extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),a=fe.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==V.object){let u=this._getOrReturnCtx(e);return H(u,{code:O.invalid_type,expected:V.object,received:u.parsedType}),Q}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof an&&this._def.unknownKeys==="strip"))for(let u in r.data)i.includes(u)||s.push(u);let l=[];for(let u of i){let c=o[u],d=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Na(r,d,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof an){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(u==="strict")s.length>0&&(H(r,{code:O.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of s){let d=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Na(r,d,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>It.mergeObjectSync(n,u)):It.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return W.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,n)=>{let r=this._def.errorMap?.(a,n).message??n.defaultError;return a.code==="unrecognized_keys"?{message:W.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let a={};for(let n of fe.objectKeys(e))e[n]&&this.shape[n]&&(a[n]=this.shape[n]);return new t({...this._def,shape:()=>a})}omit(e){let a={};for(let n of fe.objectKeys(this.shape))e[n]||(a[n]=this.shape[n]);return new t({...this._def,shape:()=>a})}deepPartial(){return Ns(this)}partial(e){let a={};for(let n of fe.objectKeys(this.shape)){let r=this.shape[n];e&&!e[n]?a[n]=r:a[n]=r.optional()}return new t({...this._def,shape:()=>a})}required(e){let a={};for(let n of fe.objectKeys(this.shape))if(e&&!e[n])a[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Fa;)o=o._def.innerType;a[n]=o}return new t({...this._def,shape:()=>a})}keyof(){return mA(fe.objectKeys(this.shape))}};aa.create=(t,e)=>new aa({shape:()=>t,unknownKeys:"strip",catchall:an.create(),typeName:J.ZodObject,...se(e)});aa.strictCreate=(t,e)=>new aa({shape:()=>t,unknownKeys:"strict",catchall:an.create(),typeName:J.ZodObject,...se(e)});aa.lazycreate=(t,e)=>new aa({shape:t,unknownKeys:"strip",catchall:an.create(),typeName:J.ZodObject,...se(e)});var ci=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n=this._def.options;function r(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return a.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new ta(s.ctx.common.issues));return H(a,{code:O.invalid_union,unionErrors:i}),Q}if(a.common.async)return Promise.all(n.map(async o=>{let i={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:i}),ctx:i}})).then(r);{let o,i=[];for(let l of n){let u={...a,common:{...a.common,issues:[]},parent:null},c=l._parseSync({data:a.data,path:a.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new ta(l));return H(a,{code:O.invalid_union,unionErrors:s}),Q}}get options(){return this._def.options}};ci.create=(t,e)=>new ci({options:t,typeName:J.ZodUnion,...se(e)});var or=t=>t instanceof fi?or(t.schema):t instanceof Ha?or(t.innerType()):t instanceof pi?[t.value]:t instanceof hi?t.options:t instanceof mi?fe.objectValues(t.enum):t instanceof gi?or(t._def.innerType):t instanceof li?[void 0]:t instanceof ui?[null]:t instanceof Fa?[void 0,...or(t.unwrap())]:t instanceof bn?[null,...or(t.unwrap())]:t instanceof rc||t instanceof yi?or(t.unwrap()):t instanceof vi?or(t._def.innerType):[],Zp=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.object)return H(a,{code:O.invalid_type,expected:V.object,received:a.parsedType}),Q;let n=this.discriminator,r=a.data[n],o=this.optionsMap.get(r);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(H(a,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,n){let r=new Map;for(let o of a){let i=or(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:r,...se(n)})}};function Cx(t,e){let a=yn(t),n=yn(e);if(t===e)return{valid:!0,data:t};if(a===V.object&&n===V.object){let r=fe.objectKeys(e),o=fe.objectKeys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=Cx(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===V.array&&n===V.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Cx(i,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return a===V.date&&n===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var di=class extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e),r=(o,i)=>{if(jp(o)||jp(i))return Q;let s=Cx(o.value,i.value);return s.valid?((Gp(o)||Gp(i))&&a.dirty(),{status:a.value,value:s.data}):(H(n,{code:O.invalid_intersection_types}),Q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>r(o,i)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};di.create=(t,e,a)=>new di({left:t,right:e,typeName:J.ZodIntersection,...se(a)});var xn=class t extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return H(n,{code:O.invalid_type,expected:V.array,received:n.parsedType}),Q;if(n.data.length<this._def.items.length)return H(n,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&n.data.length>this._def.items.length&&(H(n,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let o=[...n.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Na(n,i,n.path,s)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>It.mergeArray(a,i)):It.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xn({items:t,typeName:J.ZodTuple,rest:null,...se(e)})};var Wp=class t extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return H(n,{code:O.invalid_type,expected:V.object,received:n.parsedType}),Q;let r=[],o=this._def.keyType,i=this._def.valueType;for(let s in n.data)r.push({key:o._parse(new Na(n,s,n.path,s)),value:i._parse(new Na(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?It.mergeObjectAsync(a,r):It.mergeObjectSync(a,r)}get element(){return this._def.valueType}static create(e,a,n){return a instanceof le?new t({keyType:e,valueType:a,typeName:J.ZodRecord,...se(n)}):new t({keyType:lo.create(),valueType:e,typeName:J.ZodRecord,...se(a)})}},zs=class extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return H(n,{code:O.invalid_type,expected:V.map,received:n.parsedType}),Q;let r=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([s,l],u)=>({key:r._parse(new Na(n,s,n.path,[u,"key"])),value:o._parse(new Na(n,l,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}})}else{let s=new Map;for(let l of i){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};zs.create=(t,e,a)=>new zs({valueType:e,keyType:t,typeName:J.ZodMap,...se(a)});var qs=class t extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return H(n,{code:O.invalid_type,expected:V.set,received:n.parsedType}),Q;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(H(n,{code:O.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),a.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(H(n,{code:O.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),a.dirty());let o=this._def.valueType;function i(l){let u=new Set;for(let c of l){if(c.status==="aborted")return Q;c.status==="dirty"&&a.dirty(),u.add(c.value)}return{status:a.value,value:u}}let s=[...n.data.values()].map((l,u)=>o._parse(new Na(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,a){return new t({...this._def,minSize:{value:e,message:W.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:W.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};qs.create=(t,e)=>new qs({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...se(e)});var Xp=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.function)return H(a,{code:O.invalid_type,expected:V.function,received:a.parsedType}),Q;function n(s,l){return nc({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ps(),rr].filter(u=>!!u),issueData:{code:O.invalid_arguments,argumentsError:l}})}function r(s,l){return nc({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Ps(),rr].filter(u=>!!u),issueData:{code:O.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof co){let s=this;return Ot(async function(...l){let u=new ta([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(n(l,h)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(r(d,h)),u})})}else{let s=this;return Ot(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new ta([n(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new ta([r(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xn.create(e).rest(ir.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,n){return new t({args:e||xn.create([]).rest(ir.create()),returns:a||ir.create(),typeName:J.ZodFunction,...se(n)})}},fi=class extends le{get schema(){return this._def.getter()}_parse(e){let{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}};fi.create=(t,e)=>new fi({getter:t,typeName:J.ZodLazy,...se(e)});var pi=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return H(a,{received:a.data,code:O.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};pi.create=(t,e)=>new pi({value:t,typeName:J.ZodLiteral,...se(e)});function mA(t,e){return new hi({values:t,typeName:J.ZodEnum,...se(e)})}var hi=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),n=this._def.values;return H(a,{expected:fe.joinValues(n),received:a.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),n=this._def.values;return H(a,{received:a.data,code:O.invalid_enum_value,options:n}),Q}return Ot(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return t.create(e,{...this._def,...a})}exclude(e,a=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...a})}};hi.create=mA;var mi=class extends le{_parse(e){let a=fe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let r=fe.objectValues(a);return H(n,{expected:fe.joinValues(r),received:n.parsedType,code:O.invalid_type}),Q}if(this._cache||(this._cache=new Set(fe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=fe.objectValues(a);return H(n,{received:n.data,code:O.invalid_enum_value,options:r}),Q}return Ot(e.data)}get enum(){return this._def.values}};mi.create=(t,e)=>new mi({values:t,typeName:J.ZodNativeEnum,...se(e)});var co=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==V.promise&&a.common.async===!1)return H(a,{code:O.invalid_type,expected:V.promise,received:a.parsedType}),Q;let n=a.parsedType===V.promise?a.data:Promise.resolve(a.data);return Ot(n.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}};co.create=(t,e)=>new co({type:t,typeName:J.ZodPromise,...se(e)});var Ha=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:a,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:i=>{H(n,i),i.fatal?a.abort():a.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let i=r.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async s=>{if(a.value==="aborted")return Q;let l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?Q:l.status==="dirty"?ni(l.value):a.value==="dirty"?ni(l.value):l});{if(a.value==="aborted")return Q;let s=this._def.schema._parseSync({data:i,path:n.path,parent:n});return s.status==="aborted"?Q:s.status==="dirty"?ni(s.value):a.value==="dirty"?ni(s.value):s}}if(r.type==="refinement"){let i=s=>{let l=r.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value),{status:a.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Q:(s.status==="dirty"&&a.dirty(),i(s.value).then(()=>({status:a.value,value:s.value}))))}if(r.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!so(i))return Q;let s=r.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>so(i)?Promise.resolve(r.transform(i.value,o)).then(s=>({status:a.value,value:s})):Q);fe.assertNever(r)}};Ha.create=(t,e,a)=>new Ha({schema:t,typeName:J.ZodEffects,effect:e,...se(a)});Ha.createWithPreprocess=(t,e,a)=>new Ha({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...se(a)});var Fa=class extends le{_parse(e){return this._getType(e)===V.undefined?Ot(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Fa.create=(t,e)=>new Fa({innerType:t,typeName:J.ZodOptional,...se(e)});var bn=class extends le{_parse(e){return this._getType(e)===V.null?Ot(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};bn.create=(t,e)=>new bn({innerType:t,typeName:J.ZodNullable,...se(e)});var gi=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n=a.data;return a.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};gi.create=(t,e)=>new gi({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var vi=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n={...a,common:{...a.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Fs(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ta(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ta(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};vi.create=(t,e)=>new vi({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var $s=class extends le{_parse(e){if(this._getType(e)!==V.nan){let n=this._getOrReturnCtx(e);return H(n,{code:O.invalid_type,expected:V.nan,received:n.parsedType}),Q}return{status:"valid",value:e.data}}};$s.create=t=>new $s({typeName:J.ZodNaN,...se(t)});var JF=Symbol("zod_brand"),rc=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),n=a.data;return this._def.type._parse({data:n,path:a.path,parent:a})}unwrap(){return this._def.type}},oc=class t extends le{_parse(e){let{status:a,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Q:o.status==="dirty"?(a.dirty(),ni(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?Q:r.status==="dirty"?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,a){return new t({in:e,out:a,typeName:J.ZodPipeline})}},yi=class extends le{_parse(e){let a=this._def.innerType._parse(e),n=r=>(so(r)&&(r.value=Object.freeze(r.value)),r);return Fs(a)?a.then(r=>n(r)):n(a)}unwrap(){return this._def.innerType}};yi.create=(t,e)=>new yi({innerType:t,typeName:J.ZodReadonly,...se(e)});function dA(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function gA(t,e={},a){return t?uo.create().superRefine((n,r)=>{let o=t(n);if(o instanceof Promise)return o.then(i=>{if(!i){let s=dA(e,n),l=s.fatal??a??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=dA(e,n),s=i.fatal??a??!0;r.addIssue({code:"custom",...i,fatal:s})}}):uo.create()}var eN={object:aa.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var tN=(t,e={message:`Input not instance of ${t.name}`})=>gA(a=>a instanceof t,e),vA=lo.create,yA=ri.create,aN=$s.create,nN=oi.create,xA=ii.create,rN=si.create,oN=Hs.create,iN=li.create,sN=ui.create,lN=uo.create,uN=ir.create,cN=an.create,dN=Us.create,fN=sr.create,pN=aa.create,hN=aa.strictCreate,mN=ci.create,gN=Zp.create,vN=di.create,yN=xn.create,xN=Wp.create,bN=zs.create,SN=qs.create,CN=Xp.create,_N=fi.create,wN=pi.create,LN=hi.create,kN=mi.create,IN=co.create,AN=Ha.create,EN=Fa.create,TN=bn.create,RN=Ha.createWithPreprocess,MN=oc.create,DN=()=>vA().optional(),ON=()=>yA().optional(),BN=()=>xA().optional(),PN={string:(t=>lo.create({...t,coerce:!0})),number:(t=>ri.create({...t,coerce:!0})),boolean:(t=>ii.create({...t,coerce:!0})),bigint:(t=>oi.create({...t,coerce:!0})),date:(t=>si.create({...t,coerce:!0}))};var FN=Q;var _x=p.union([p.object({type:p.literal("data"),key:p.string(),value:p.string().optional()}),p.object({type:p.literal("css"),value:p.string()}),p.object({type:p.literal("aria"),role:p.string().optional(),label:p.string().optional()}),p.object({type:p.literal("shadow-css"),value:p.string()}),p.object({type:p.literal("ref"),el:p.any()})]),bA=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:_x,content:p.object({title:p.string().optional(),body:p.string()}),placement:p.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:p.number().optional(),blocking:p.boolean().optional(),trigger:p.enum(["immediate","hover","click"]).optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),SA=p.object({kind:p.literal("highlight"),id:p.string(),anchor:_x,copy:p.string().optional(),ring:p.object({paddingPx:p.number().optional(),radiusPx:p.number().optional()}).optional(),scrim:p.object({opacity:p.number().optional()}).optional(),ringColor:p.string().optional(),blocking:p.boolean().optional(),dismiss:p.object({onClickOutside:p.boolean().optional(),onEsc:p.boolean().optional(),timeoutMs:p.number().optional()}).optional()}),Yp=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([bA,SA]))});function NN(t){return Yp.parse(t)}var HN=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:n="include"}={})=>async()=>{let r=ip({configUri:t,experiments:e,featureKey:a});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(r,{credentials:n});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let i=await o.json();return Yp.parse(i)};var Kp=Y(Ye(),1),CA=Y(gl(),1);function UN({element:t,children:e}){let[a,n]=(0,Kp.useState)(null);return(0,Kp.useLayoutEffect)(()=>{if(!t){n(null);return}return n(t.getMountNode()),()=>n(null)},[t]),a?(0,CA.createPortal)(e,a):null}function zN(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var wx=class{constructor(){B(this,"sessionId");this.sessionId=zN(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,a){}trackAction(e,a,n){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,a,n){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}track(e,a){}};function Qp(){return new wx}var E=typeof window<"u"?window:void 0,Et=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(Et.self=Et),typeof File>"u"&&(Et.File=function(){});var yE=Array.prototype,_A=yE.forEach,wA=yE.indexOf,Sa=Et?.navigator,q=Et?.document,ra=Et?.location,Ux=Et?.fetch,zx=Et!=null&&Et.XMLHttpRequest&&"withCredentials"in new Et.XMLHttpRequest?Et.XMLHttpRequest:void 0,LA=Et?.AbortController,na=Sa?.userAgent,te=E??{},ur={DEBUG:!1,LIB_VERSION:"1.302.2"};function kA(t,e,a,n,r,o,i){try{var s=t[o](i),l=s.value}catch(u){return void a(u)}s.done?e(l):Promise.resolve(l).then(n,r)}function IA(t){return function(){var e=this,a=arguments;return new Promise((function(n,r){var o=t.apply(e,a);function i(l){kA(o,n,r,i,s,"next",l)}function s(l){kA(o,n,r,i,s,"throw",l)}i(void 0)}))}}function Z(){return Z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)({}).hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},Z.apply(null,arguments)}function xE(t,e){if(t==null)return{};var a={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;a[n]=t[n]}return a}var qN=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],AA=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return qN.concat(e).some((n=>{var r=n.toLowerCase();return a.indexOf(r)!==-1}))},$N=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function pe(t,e){return t.indexOf(e)!==-1}var Th=function(t){return t.trim()},qx=function(t){return t.replace(/^\$/,"")},VN=Array.isArray,bE=Object.prototype,SE=bE.hasOwnProperty,Rh=bE.toString,Oe=VN||function(t){return Rh.call(t)==="[object Array]"},vo=t=>typeof t=="function",yt=t=>t===Object(t)&&!Oe(t),Zs=t=>{if(yt(t)){for(var e in t)if(SE.call(t,e))return!1;return!0}return!1},z=t=>t===void 0,ft=t=>Rh.call(t)=="[object String]",$x=t=>ft(t)&&t.trim().length===0,pr=t=>t===null,Te=t=>z(t)||pr(t),wn=t=>Rh.call(t)=="[object Number]",yo=t=>Rh.call(t)==="[object Boolean]",jN=t=>t instanceof FormData,GN=t=>pe($N,t);function Vx(t){return t===null||typeof t!="object"}function uh(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function CE(t){return!z(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var ZN=[!0,"true",1,"1","yes"],Lx=t=>pe(ZN,t),WN=[!1,"false",0,"0","no"];function Sn(t,e,a,n,r){return e>a&&(n.warn("min cannot be greater than max."),e=a),wn(t)?t>a?(n.warn(" cannot be greater than max: "+a+". Using max value instead."),a):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+a+", fallback: "+r),Sn(r||a,e,a,n))}var jx=class{constructor(e){this.t={},this.i=e.i,this.o=Sn(e.bucketSize,0,100,e.h),this.m=Sn(e.refillRate,0,this.o,e.h),this.S=Sn(e.refillInterval,0,864e5,e.h)}$(e,a){var n=a-e.lastAccess,r=Math.floor(n/this.S);if(r>0){var o=r*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var a,n=Date.now(),r=String(e),o=this.t[r];return o?this.$(o,n):(o={tokens:this.o,lastAccess:n},this.t[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((a=this.i)==null||a.call(this,e)),o.tokens===0)}stop(){this.t={}}},Jp,EA,kx,XN=t=>t instanceof Error;function YN(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return kx&&a.length===EA||(EA=a.length,kx=a.reduce(((n,r)=>{Jp||(Jp={});var o=Jp[r];if(o)n[o[0]]=o[1];else for(var i=t(r),s=i.length-1;s>=0;s--){var l=i[s],u=l?.filename,c=e[r];if(u&&c){n[u]=c,Jp[r]=[u,c];break}}return n}),{})),kx}}var Gx=class{constructor(e,a,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=a,this.modifiers=n}buildFromUnknown(e,a){a===void 0&&(a={});var n=a&&a.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,a,0).apply(e),o=this.buildParsingContext(),i=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(e){var a=this;return IA((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&Oe(n.stacktrace.frames)&&(n.stacktrace.frames=yield a.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){var a;return{type:"Error",value:"Unknown error",stack:(a=e.syntheticException)==null?void 0:a.stack,synthetic:!0}}parseStacktrace(e,a){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,a)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),a.chunkIdMap)),Z({},e,{cause:n,stack:r})}applyChunkIds(e,a){return e.map((n=>(n.filename&&a&&(n.chunk_id=a[n.filename]),n)))}applyCoercers(e,a){for(var n of this.coercers)if(n.match(e))return n.coerce(e,a);return this.coerceFallback(a)}applyModifiers(e){var a=this;return IA((function*(){var n=e;for(var r of a.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,a){var n,r,o,i={type:e.type,value:e.value,mechanism:{type:(n=a.type)!==null&&n!==void 0?n:"generic",handled:(r=a.handled)===null||r===void 0||r,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var s=[i];return e.cause!=null&&s.push(...this.convertToExceptionList(e.cause,Z({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:YN(this.stackParser)}}buildCoercingContext(e,a,n){n===void 0&&(n=0);var r=(o,i)=>{if(i<=4){var s=this.buildCoercingContext(e,a,i);return this.applyCoercers(o,s)}};return Z({},a,{syntheticException:n==0?a.syntheticException:void 0,mechanism:e,apply:o=>r(o,n),next:o=>r(o,n+1)})}},Ks="?";function Zx(t,e,a,n,r){var o={platform:t,filename:e,function:a==="<anonymous>"?Ks:a,in_app:!0};return z(n)||(o.lineno=n),z(r)||(o.colno=r),o}var _E=(t,e)=>{var a=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return a||n?[t.indexOf("@")!==-1?t.split("@")[0]:Ks,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},KN=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,QN=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,JN=/\((\S*)(?::(\d+))(?::(\d+))\)/,e4=(t,e)=>{var a=KN.exec(t);if(a){var[,n,r,o]=a;return Zx(e,n,Ks,+r,+o)}var i=QN.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=JN.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=_E(i[1]||Ks,i[2]);return Zx(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},t4=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,a4=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,n4=(t,e)=>{var a=t4.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var n=a4.exec(a[3]);n&&(a[1]=a[1]||"eval",a[3]=n[1],a[4]=n[2],a[5]="")}var r=a[3],o=a[1]||Ks;return[o,r]=_E(o,r),Zx(e,r,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},TA=/\(error: (.*)\)/,RA=50;function r4(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];return function(r,o){o===void 0&&(o=0);for(var i=[],s=r.split(`
515
+ `),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=TA.test(u)?u.replace(TA,"$1"):u;if(!c.match(/\S*Error: /)){for(var d of a){var f=d(c,t);if(f){i.push(f);break}}if(i.length>=RA)break}}}return(function(h){if(!h.length)return[];var S=Array.from(h);return S.reverse(),S.slice(0,RA).map((x=>{return Z({},x,{filename:x.filename||(b=S,b[b.length-1]||{}).filename,function:x.function||Ks});var b}))})(i)}}var Wx=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var n=ft(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var a=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?a+": "+e.message:a}isDOMException(e){return uh(e,"DOMException")}isDOMError(e){return uh(e,"DOMError")}},Xx=class{match(e){return(a=>a instanceof Error)(e)}coerce(e,a){return{type:this.getType(e),value:this.getMessage(e,a),stack:this.getStack(e),cause:e.cause?a.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,a){var n=e.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(e){return e.stacktrace||e.stack||void 0}},Yx=class{constructor(){}match(e){return uh(e,"ErrorEvent")&&e.error!=null}coerce(e,a){var n,r=a.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}},o4=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Kx=class{match(e){return typeof e=="string"}coerce(e,a){var n,[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}getInfos(e){var a="Error",n=e,r=e.match(o4);return r&&(a=r[1],n=r[2]),[a,n]}},i4=["fatal","error","warning","log","info","debug"];function wE(t,e){e===void 0&&(e=40);var a=Object.keys(t);if(a.sort(),!a.length)return"[object has no keys]";for(var n=a.length;n>0;n--){var r=a.slice(0,n).join(", ");if(!(r.length>e))return n===a.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var Qx=class{match(e){return typeof e=="object"&&e!==null}coerce(e,a){var n,r=this.getErrorPropertyFromObject(e);return r?a.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(n=a.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return CE(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var a="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(a+=" with message: '"+e.message+"'"),a}if("message"in e&&typeof e.message=="string")return e.message;var n=this.getObjectClassName(e);return(n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+wE(e)}isSeverityLevel(e){return ft(e)&&!$x(e)&&i4.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=e[a];if(XN(n))return n}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},Jx=class{match(e){return CE(e)}coerce(e,a){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+wE(e),stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}},eb=class{match(e){return Vx(e)}coerce(e,a){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}}},tb=class{match(e){return uh(e,"PromiseRejectionEvent")}coerce(e,a){var n,r=this.getUnhandledRejectionReason(e);return Vx(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(n=a.syntheticException)==null?void 0:n.stack,synthetic:!0}:a.apply(r)}getUnhandledRejectionReason(e){if(Vx(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},LE=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,n={k:function(r){if(E&&(ur.DEBUG||te.POSTHOG_DEBUG||a)&&!z(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[r])?E.console[r].__rrweb_original__:E.console[r],i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];o(t,...s)}},info:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n.k("log",...o)},warn:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n.k("warn",...o)},error:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n.k("error",...o)},critical:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:r=>{n.error("You must initialize PostHog before calling "+r)},createLogger:(r,o)=>LE(t+" "+r,o)};return n},$=LE("[PostHog.js]"),pt=$.createLogger,s4=pt("[ExternalScriptsLoader]"),MA=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return s4.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var n=q?.querySelectorAll("script");if(n){for(var r,o=function(){if(n[i].src===e){var l=n[i];return l.__posthog_loading_callback_fired?{v:a()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,a(void 0,u)})),l.onerror=u=>a(u),{v:void 0})}},i=0;i<n.length;i++)if(r=o())return r.v}var s=()=>{if(!q)return a("document not found");var l=q.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,a(void 0,d)},l.onerror=d=>a(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return a("prepare_external_dependency_script returned null");var u,c=q.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):q.body.appendChild(l)};q!=null&&q.body?s():q?.addEventListener("DOMContentLoaded",s)};te.__PosthogExtensions__=te.__PosthogExtensions__||{},te.__PosthogExtensions__.loadExternalDependency=(t,e,a)=>{var n="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(n="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}var o=t.requestRouter.endpointFor("assets",n);MA(t,o,a)},te.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var n=t.requestRouter.endpointFor("api",e);MA(t,n,a)};var ch={};function xo(t,e,a){if(Oe(t)){if(_A&&t.forEach===_A)t.forEach(e,a);else if("length"in t&&t.length===+t.length){for(var n=0,r=t.length;n<r;n++)if(n in t&&e.call(a,t[n],n)===ch)return}}}function Pe(t,e,a){if(!Te(t)){if(Oe(t))return xo(t,e,a);if(jN(t)){for(var n of t.entries())if(e.call(a,n[1],n[0])===ch)return}else for(var r in t)if(SE.call(t,r)&&e.call(a,t[r],r)===ch)return}}var at=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];return xo(a,(function(r){for(var o in r)r[o]!==void 0&&(t[o]=r[o])})),t},el=function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];return xo(a,(function(r){xo(r,(function(o){t.push(o)}))})),t};function ih(t){for(var e=Object.keys(t),a=e.length,n=new Array(a);a--;)n[a]=[e[a],t[e[a]]];return n}var DA=function(t){try{return t()}catch{return}},l4=function(t){return function(){try{for(var e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return t.apply(this,a)}catch(r){$.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$.critical(r)}}},Yb=function(t){var e={};return Pe(t,(function(a,n){(ft(a)&&a.length>0||wn(a))&&(e[n]=a)})),e};function u4(t,e){return a=t,n=o=>ft(o)&&!pr(e)?o.slice(0,e):o,r=new Set,(function o(i,s){return i!==Object(i)?n?n(i,s):i:r.has(i)?void 0:(r.add(i),Oe(i)?(l=[],xo(i,(u=>{l.push(o(u))}))):(l={},Pe(i,((u,c)=>{r.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,n,r}var c4=["herokuapp.com","vercel.app","netlify.app"];function d4(t){var e=t?.hostname;if(!ft(e))return!1;var a=e.split(".").slice(-2).join(".");for(var n of c4)if(a===n)return!1;return!0}function kE(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function lt(t,e,a,n){var{capture:r=!1,passive:o=!0}=n??{};t?.addEventListener(e,a,{capture:r,passive:o})}var IE="$people_distinct_id",mc="__alias",gc="__timers",OA="$autocapture_disabled_server_side",ab="$heatmaps_enabled_server_side",BA="$exception_capture_enabled_server_side",nb="$error_tracking_suppression_rules",PA="$error_tracking_capture_extension_exceptions",FA="$web_vitals_enabled_server_side",AE="$dead_clicks_enabled_server_side",NA="$web_vitals_allowed_metrics",Ix="$session_recording_remote_config",dh="$sesid",EE="$session_is_sampled",Ws="$enabled_feature_flags",vc="$early_access_features",rb="$feature_flag_details",yc="$stored_person_properties",Si="$stored_group_properties",ob="$surveys",eh="$surveys_activated",fh="$flag_call_reported",cr="$user_state",ib="$client_session_props",sb="$capture_rate_limit",lb="$initial_campaign_params",ub="$initial_referrer_info",ph="$initial_person_info",hh="$epp",TE="__POSTHOG_TOOLBAR__",ic="$posthog_cookieless",f4=[IE,mc,"__cmpns",gc,"$session_recording_enabled_server_side",ab,dh,Ws,nb,cr,vc,rb,Si,yc,ob,fh,ib,sb,lb,ub,hh,ph];function HA(t){return t instanceof Element&&(t.id===TE||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Mh(t){return!!t&&t.nodeType===1}function bo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function RE(t){return!!t&&t.nodeType===3}function ME(t){return!!t&&t.nodeType===11}function Kb(t){return t?Th(t).split(/\s+/):[]}function UA(t){var e=E?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function mh(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Kb(e)}function DE(t){return Te(t)?null:Th(t).split(/(\s+)/).filter((e=>Lc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Rc(t){var e="";return cb(t)&&!NE(t)&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,(function(a){var n;RE(a)&&a.textContent&&(e+=(n=DE(a.textContent))!==null&&n!==void 0?n:"")})),Th(e)}function OE(t){return z(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Qb=["a","button","form","input","select","textarea","label"];function BE(t,e){if(z(e))return!0;var a,n=function(o){if(e.some((i=>o.matches(i))))return{v:!0}};for(var r of t)if(a=n(r))return a.v;return!1}function PE(t){var e=t.parentNode;return!(!e||!Mh(e))&&e}var p4=["next","previous","prev",">","<"],zA=10,qA=[".ph-no-rageclick",".ph-no-capture"];function h4(t,e){if(!E||Jb(t))return!1;var a,n,r;if(yo(e)?(a=!!e&&qA,n=void 0):(a=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:qA,n=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=FE(t,!1);return!(function(i,s){if(i===!1||z(i))return!1;var l;if(i===!0)l=p4;else{if(!Oe(i))return!1;if(i.length>zA)return $.error("[PostHog] content_ignorelist array cannot exceed "+zA+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map((u=>u.toLowerCase()))}return s.some((u=>{var{safeText:c,ariaLabel:d}=u;return l.some((f=>c.includes(f)||d.includes(f)))}))})(n,o.map((i=>{var s;return{safeText:Rc(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!BE(o,a)}var Jb=t=>!t||bo(t,"html")||!Mh(t),FE=(t,e)=>{if(!E||Jb(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,n=[t],r=t;r.parentNode&&!bo(r,"body");)if(ME(r.parentNode))n.push(r.parentNode.host),r=r.parentNode.host;else{var o=PE(r);if(!o)break;if(e||Qb.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=E.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}n.push(o),r=o}return{parentIsUsefulElement:a,targetElementList:n}};function m4(t,e,a,n,r){var o,i,s,l;if(a===void 0&&(a=void 0),!E||Jb(t)||(o=a)!=null&&o.url_allowlist&&!UA(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&UA(a.url_ignorelist))return!1;if((s=a)!=null&&s.dom_event_allowlist){var u=a.dom_event_allowlist;if(u&&!u.some((S=>e.type===S)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=FE(t,n);if(!(function(S,x){var b=x?.element_allowlist;if(z(b))return!0;var m,g=function(y){if(b.some((_=>y.tagName.toLowerCase()===_)))return{v:!0}};for(var v of S)if(m=g(v))return m.v;return!1})(d,a)||!BE(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var f=E.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var h=t.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return c?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Qb.indexOf(h)>-1||t.getAttribute("contenteditable")==="true")}}function cb(t){for(var e=t;e.parentNode&&!bo(e,"body");e=e.parentNode){var a=mh(e);if(pe(a,"ph-sensitive")||pe(a,"ph-no-capture"))return!1}if(pe(mh(t),"ph-include"))return!0;var n=t.type||"";if(ft(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(ft(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function NE(t){return!!(bo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||bo(t,"select")||bo(t,"textarea")||t.getAttribute("contenteditable")==="true")}var HE="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",g4=new RegExp("^(?:"+HE+")$"),v4=new RegExp(HE),UE="\\d{3}-?\\d{2}-?\\d{4}",y4=new RegExp("^("+UE+")$"),x4=new RegExp("("+UE+")");function Lc(t,e){return e===void 0&&(e=!0),!(Te(t)||ft(t)&&(t=Th(t),(e?g4:v4).test((t||"").replace(/[- ]/g,""))||(e?y4:x4).test(t)))}function zE(t){var e=Rc(t);return Lc(e=(e+" "+qE(t)).trim())?e:""}function qE(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,(function(a){var n;if(a&&((n=a.tagName)==null?void 0:n.toLowerCase())==="span")try{var r=Rc(a);e=(e+" "+r).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+qE(a)).trim())}catch(o){$.error("[AutoCapture]",o)}})),e}function b4(t){return(function(e){var a=e.map((n=>{var r,o,i="";if(n.tag_name&&(i+=n.tag_name),n.attr_class)for(var s of(n.attr_class.sort(),n.attr_class))i+="."+s.replace(/"/g,"");var l=Z({},n.text?{text:n.text}:{},{"nth-child":(r=n.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=n.nth_of_type)!==null&&o!==void 0?o:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),u={};return ih(l).sort(((c,d)=>{var[f]=c,[h]=d;return f.localeCompare(h)})).forEach((c=>{var[d,f]=c;return u[$A(d.toString())]=$A(f.toString())})),i+=":",i+=ih(u).map((c=>{var[d,f]=c;return d+'="'+f+'"'})).join("")}));return a.join(";")})((function(e){return e.map((a=>{var n,r,o={text:(n=a.$el_text)==null?void 0:n.slice(0,400),tag_name:a.tag_name,href:(r=a.attr__href)==null?void 0:r.slice(0,2048),attr_class:S4(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return ih(a).filter((i=>{var[s]=i;return s.indexOf("attr__")===0})).forEach((i=>{var[s,l]=i;return o.attributes[s]=l})),o}))})(t))}function $A(t){return t.replace(/"|\\"/g,'\\"')}function S4(t){var e=t.attr__class;return e?Oe(e)?e:Kb(e):void 0}var gh=class{constructor(e){this.disabled=e===!1;var a=yt(e)?e:{};this.thresholdPx=a.threshold_px||30,this.timeoutMs=a.timeout_ms||1e3,this.clickCount=a.click_count||3,this.clicks=[]}isRageClick(e,a,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(a-r.y)<this.thresholdPx&&n-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:a,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:a,timestamp:n}];return!1}},Ax="$copy_autocapture",fr=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var vh=t=>{var e=q?.createElement("a");return z(e)?null:(e.href=t,e)},C4=function(t,e){var a,n;e===void 0&&(e="&");var r=[];return Pe(t,(function(o,i){z(o)||z(i)||i==="undefined"||(a=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+a)})),r.join(e)},yh=function(t,e){for(var a,n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<n.length;r++){var o=n[r].split("=");if(o[0]===e){a=o;break}}if(!Oe(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{$.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Mc=function(t,e,a){if(!t||!e||!e.length)return t;for(var n=t.split("#"),r=n[0]||"",o=n[1],i=r.split("?"),s=i[1],l=i[0],u=(s||"").split("&"),c=[],d=0;d<u.length;d++){var f=u[d].split("=");Oe(f)&&(e.includes(f[0])?c.push(f[0]+"="+a):c.push(u[d]))}var h=l;return s!=null&&(h+="?"+c.join("&")),o!=null&&(h+="#"+o),h},xh=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},VA=pt("[AutoCapture]");function Ex(t,e){return e.length>t?e.slice(0,t)+"...":e}function _4(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Mh(e));return e}function w4(t,e,a,n){var r=t.tagName.toLowerCase(),o={tag_name:r};Qb.indexOf(r)>-1&&!a&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=Ex(1024,zE(t)):o.$el_text=Ex(1024,Rc(t)));var i=mh(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),Pe(t.attributes,(function(c){var d;if((!NE(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(n==null||!n.includes(c.name))&&!e&&Lc(c.value)&&(d=c.name,!ft(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=Kb(f).join(" ")),o["attr__"+c.name]=Ex(1024,f)}}));for(var s=1,l=1,u=t;u=_4(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function L4(t,e){for(var a,n,{e:r,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!bo(c,"body");)ME(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,f=[],h={},S=!1,x=!1;if(Pe(u,(y=>{var _=cb(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=_&&S&&Lc(S)&&S),pe(mh(y),"ph-no-capture")&&(x=!0),f.push(w4(y,o,i,s));var L=(function(C){if(!cb(C))return{};var I={};return Pe(C.attributes,(function(w){if(w.name&&w.name.indexOf("data-ph-capture-attribute")===0){var k=w.name.replace("data-ph-capture-attribute-",""),T=w.value;k&&T&&Lc(T)&&(I[k]=T)}})),I})(y);at(h,L)})),x)return{props:{},explicitNoCapture:x};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=zE(t):f[0].$el_text=Rc(t)),S){var b,m;f[0].attr__href=S;var g=(b=vh(S))==null?void 0:b.host,v=E==null||(m=E.location)==null?void 0:m.host;g&&v&&g!==v&&(d=S)}return{props:at({$event_type:r.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:b4(f)},(a=f[0])!=null&&a.$el_text?{$el_text:(n=f[0])==null?void 0:n.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},h)}}var db=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new gh(e.config.rageclick),this.I=null}get F(){var e,a,n=yt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(a=n.url_ignorelist)==null?void 0:a.map((r=>new RegExp(r))),n}C(){if(this.isBrowserSupported()){if(E&&q){var e=n=>{n=n||E?.event;try{this.M(n)}catch(r){VA.error("Failed to capture event",r)}};if(lt(q,"submit",e,{capture:!0}),lt(q,"change",e,{capture:!0}),lt(q,"click",e,{capture:!0}),this.F.capture_copied_text){var a=n=>{n=n||E?.event,this.M(n,Ax)};lt(q,"copy",a,{capture:!0}),lt(q,"cut",a,{capture:!0})}}}else VA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[OA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var a,n=[];return(a=this.I)==null||a.forEach((r=>{var o=q?.querySelectorAll(r);o?.forEach((i=>{e===i&&n.push(r)}))})),n}get isEnabled(){var e,a,n=(e=this.instance.persistence)==null?void 0:e.props[OA],r=this.T;if(pr(r)&&!yo(n)&&!this.instance.O())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!n;return!!this.instance.config.autocapture&&!o}M(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var n,r=OE(e);RE(r)&&(r=r.parentNode||null),a==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&h4(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===Ax;if(r&&m4(r,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=L4(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(i.$element_selectors=l),a===Ax){var u,c=DE(E==null||(u=E.getSelection())==null?void 0:u.toString()),d=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=d}return this.instance.capture(a,i),!0}}}isBrowserSupported(){return vo(q?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return wn(t)&&isFinite(t)&&Math.floor(t)===t});var jA="0123456789abcdef",fb=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,a,n,r){if(!Number.isInteger(e)||!Number.isInteger(a)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||a<0||n<0||r<0||e>0xffffffffffff||a>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|a>>>8,o[7]=a,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){for(var e="",a=0;a<this.bytes.length;a++)e=e+jA.charAt(this.bytes[a]>>>4)+jA.charAt(15&this.bytes[a]),a!==3&&a!==5&&a!==7&&a!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var a=0;a<16;a++){var n=this.bytes[a]-e.bytes[a];if(n!==0)return Math.sign(n)}return 0}},pb=class{constructor(){this.A=0,this.D=0,this.j=new hb}generate(){var e=this.generateOrAbort();if(z(e)){this.A=0;var a=this.generateOrAbort();if(z(a))throw new Error("Could not generate UUID after timestamp reset");return a}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return fb.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},GA,$E=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};E&&!z(E.crypto)&&crypto.getRandomValues&&($E=t=>crypto.getRandomValues(t));var hb=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&($E(this.N),this.U=0),this.N[this.U++]}},go=()=>k4().toString(),k4=()=>(GA||(GA=new pb)).generate(),sc="",I4=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function A4(t,e){if(e){var a=(function(r,o){if(o===void 0&&(o=q),sc)return sc;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var i=r.split("."),s=Math.min(i.length,8),l="dmn_chk_"+go();!sc&&s--;){var u=i.slice(s).join("."),c=l+"=1;domain=."+u+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(l)&&(o.cookie=c+";max-age=0",sc=u)}return sc})(t);if(!a){var n=(r=>{var o=r.match(I4);return o?o[0]:""})(t);n!==a&&$.info("Warning: cookie subdomain discovery mismatch",n,a),a=n}return a?"; domain=."+a:""}return""}var _n={H:()=>!!q,B:function(t){$.error("cookieStore error: "+t)},q:function(t){if(q){try{for(var e=t+"=",a=q.cookie.split(";").filter((o=>o.length)),n=0;n<a.length;n++){for(var r=a[n];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(_n.q(t))||{}}catch{}return e},G:function(t,e,a,n,r){if(q)try{var o="",i="",s=A4(q.location.hostname,n);if(a){var l=new Date;l.setTime(l.getTime()+24*a*60*60*1e3),o="; expires="+l.toUTCString()}r&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+i;return u.length>3686.4&&$.warn("cookieStore warning: large cookie, len="+u.length),q.cookie=u,u}catch{return}},V:function(t,e){if(q!=null&&q.cookie)try{_n.G(t,"",-1,e)}catch{return}}},Tx=null,Xe={H:function(){if(!pr(Tx))return Tx;var t=!0;if(z(E))t=!1;else try{var e="__mplssupport__";Xe.G(e,"xyz"),Xe.q(e)!=='"xyz"'&&(t=!1),Xe.V(e)}catch{t=!1}return t||$.error("localStorage unsupported; falling back to cookie store"),Tx=t,t},B:function(t){$.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){Xe.B(e)}return null},W:function(t){try{return JSON.parse(Xe.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(a){Xe.B(a)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){Xe.B(e)}}},E4=["distinct_id",dh,EE,hh,ph],th=Z({},Xe,{W:function(t){try{var e={};try{e=_n.W(t)||{}}catch{}var a=at(e,JSON.parse(Xe.q(t)||"{}"));return Xe.G(t,a),a}catch{}return null},G:function(t,e,a,n,r,o){try{Xe.G(t,e,void 0,void 0,o);var i={};E4.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&_n.G(t,i,a,n,r,o)}catch(s){Xe.B(s)}},V:function(t,e){try{E?.localStorage.removeItem(t),_n.V(t,e)}catch(a){Xe.B(a)}}}),ah={},T4={H:function(){return!0},B:function(t){$.error("memoryStorage error: "+t)},q:function(t){return ah[t]||null},W:function(t){return ah[t]||null},G:function(t,e){ah[t]=e},V:function(t){delete ah[t]}},xi=null,At={H:function(){if(!pr(xi))return xi;if(xi=!0,z(E))xi=!1;else try{var t="__support__";At.G(t,"xyz"),At.q(t)!=='"xyz"'&&(xi=!1),At.V(t)}catch{xi=!1}return xi},B:function(t){$.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){At.B(e)}return null},W:function(t){try{return JSON.parse(At.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){At.B(a)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){At.B(e)}}},dr=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),mb=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?dr.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===dr.DENIED||this.consent===dr.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===dr.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:a,consent_persistence_name:n}=this._instance.config;return n||(a?a+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Lx(e)?dr.GRANTED:pe(WN,e)?dr.DENIED:dr.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Xe:_n;var a=e==="localStorage"?_n:Xe;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Lx(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!kE([Sa?.doNotTrack,Sa?.msDoNotTrack,te.doNotTrack],(e=>Lx(e)))}},nh=pt("[Dead Clicks]"),R4=()=>!0,M4=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(AE)),n=t.instance.config.capture_dead_clicks;return yo(n)?n:!!yt(n)||a},bh=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,a,n){this.instance=e,this.isEnabled=a,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[AE]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?nh.error("failed to load script",r):e()}))}et(){var e;if(q){if(!this.tt&&(e=te.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=yt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=te.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(q),nh.info("starting...")}}else nh.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,nh.info("stopping..."))}},lc=pt("[ExceptionAutocapture]"),gb=class{constructor(e){var a,n,r;this.rt=()=>{var o;if(E&&this.isEnabled&&(o=te.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=te.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=te.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=te.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){lc.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[BA]),this.F=this.ht(),this.vt=new jx({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:lc}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return yt(e)?a=Z({},a,e):(z(e)?this.ut:e)&&(a=Z({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(lc.info("enabled"),this.it(this.rt))}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return lc.error("failed to load script",r);e()}))}lt(){var e,a,n;(e=this.st)==null||e.call(this),this.st=void 0,(a=this.nt)==null||a.call(this),this.nt=void 0,(n=this.ot)==null||n.call(this),this.ot=void 0}onRemoteConfig(e){var a=e.autocaptureExceptions;this.ut=!!a||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[BA]:this.ut}),this.startIfEnabled()}captureException(e){var a,n,r=(a=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&a!==void 0?a:"Exception";this.vt.consumeRateLimit(r)?lc.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function ZA(t,e,a){try{if(!(e in t))return()=>{};var n=t[e],r=a(n);return vo(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=n}}catch{return()=>{}}}var vb=class{constructor(e){var a;this._instance=e,this.dt=(E==null||(a=E.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,$.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(E&&E.history){var n=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||ZA(E.history,"pushState",(r=>function(o,i,s){r.call(this,o,i,s),n.ft("pushState")})),(a=E.history.replaceState)!=null&&a.__posthog_wrapped__||ZA(E.history,"replaceState",(r=>function(o,i,s){r.call(this,o,i,s),n.ft("replaceState")})),this.gt()}}ft(e){try{var a,n=E==null||(a=E.location)==null?void 0:a.pathname;if(!n)return;n!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=n}catch(r){$.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};lt(E,"popstate",e),this.ct=()=>{E&&E.removeEventListener("popstate",e)}}}},Rx=pt("[SegmentIntegration]");function D4(t,e){var a=t.config.segment;if(!a)return e();(function(n,r){var o=n.config.segment;if(!o)return r();var i=l=>{var u=()=>l.anonymousId()||go();n.config.get_device_id=u,l.id()&&(n.register({distinct_id:l.id(),$device_id:u()}),n.persistence.set_property(cr,"identified")),r()},s=o.user();"then"in s&&vo(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((n=>{Promise&&Promise.resolve||Rx.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===n.get_distinct_id()||(Rx.info("No userId set, resetting PostHog"),n.reset()),o.event.userId&&o.event.userId!==n.get_distinct_id()&&(Rx.info("UserId set, identifying with PostHog"),n.identify(o.event.userId));var s=n.calculateEventProperties(i,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(t)).then((()=>{e()}))}))}var VE="posthog-js";function jE(t,e){var{organization:a,projectId:n,prefix:r,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return s=>{var l,u,c,d,f;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var h=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=h,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S=((l=s.exception)==null?void 0:l.values)||[],x=S.map((m=>Z({},m,{stacktrace:m.stacktrace?Z({},m.stacktrace,{type:"raw",frames:(m.stacktrace.frames||[]).map((g=>Z({},g,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((u=S[0])==null?void 0:u.value)||s.message,$exception_type:(c=S[0])==null?void 0:c.type,$exception_level:s.level,$exception_list:x,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((d=S[0])==null?void 0:d.value)||s.message,$sentry_exception_type:(f=S[0])==null?void 0:f.type,$sentry_tags:s.tags};return a&&n&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+a+"/issues/?project="+n+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(b),s}}var yb=class{constructor(e,a,n,r,o,i){this.name=VE,this.setupOnce=function(s){s(jE(e,{organization:a,projectId:n,prefix:r,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},O4=E!=null&&E.location?xh(E.location.hash,"__posthog")||xh(location.hash,"state"):null,WA="_postHogToolbarParams",XA=pt("[Toolbar]"),mo=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(mo||{}),xb=class{constructor(e){this.instance=e}_t(e){te.ph_toolbar_state=e}yt(){var e;return(e=te.ph_toolbar_state)!==null&&e!==void 0?e:mo.UNINITIALIZED}maybeLoadToolbar(e,a,n){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),n===void 0&&(n=void 0),!E||!q)return!1;e=e??E.location,n=n??E.history;try{if(!a){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}a=E?.localStorage}var r,o=O4||xh(e.hash,"__posthog")||xh(e.hash,"state"),i=o?DA((()=>JSON.parse(atob(decodeURIComponent(o)))))||DA((()=>JSON.parse(decodeURIComponent(o)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(a.getItem(WA)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var a=te.ph_load_toolbar||te.ph_load_editor;!Te(a)&&vo(a)?a(e,this.instance):XA.warn("No toolbar load function found")}loadToolbar(e){var a=!(q==null||!q.getElementById(TE));if(!E||a)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Z({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(E.localStorage.setItem(WA,JSON.stringify(Z({},r,{source:void 0}))),this.yt()===mo.LOADED)this.bt(r);else if(this.yt()===mo.UNINITIALIZED){var o;this._t(mo.LOADING),(o=te.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return XA.error("[Toolbar] Failed to load",i),void this._t(mo.UNINITIALIZED);this._t(mo.LOADED),this.bt(r)})),lt(E,"turbolinks:load",(()=>{this._t(mo.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,a,n){return e===void 0&&(e=void 0),a===void 0&&(a=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,a,n)}},B4=pt("[TracingHeaders]"),bb=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,n;z(this.xt)&&((a=te.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),z(this.St)&&((n=te.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return B4.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(a=this.St)==null||a.call(this),this.xt=void 0,this.St=void 0)}},Ua="Mobile",Sh="iOS",Cn="Android",kc="Tablet",GE=Cn+" "+kc,ZE="iPad",WE="Apple",XE=WE+" Watch",Ic="Safari",Qs="BlackBerry",YE="Samsung",KE=YE+"Browser",QE=YE+" Internet",Ci="Chrome",P4=Ci+" OS",JE=Ci+" "+Sh,e0="Internet Explorer",eT=e0+" "+Ua,t0="Opera",F4=t0+" Mini",a0="Edge",tT="Microsoft "+a0,Xs="Firefox",aT=Xs+" "+Sh,Ac="Nintendo",Ec="PlayStation",Ys="Xbox",nT=Cn+" "+Ua,rT=Ua+" "+Ic,xc="Windows",Sb=xc+" Phone",YA="Nokia",Cb="Ouya",oT="Generic",N4=oT+" "+Ua.toLowerCase(),iT=oT+" "+kc.toLowerCase(),_b="Konqueror",qt="(\\d+(\\.\\d+)?)",Mx=new RegExp("Version/"+qt),H4=new RegExp(Ys,"i"),U4=new RegExp(Ec+" \\w+","i"),z4=new RegExp(Ac+" \\w+","i"),n0=new RegExp(Qs+"|PlayBook|BB10","i"),q4={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},$4=(t,e)=>e&&pe(e,WE)||(function(a){return pe(a,Ic)&&!pe(a,Ci)&&!pe(a,Cn)})(t),sT=function(t,e){return e=e||"",pe(t," OPR/")&&pe(t,"Mini")?F4:pe(t," OPR/")?t0:n0.test(t)?Qs:pe(t,"IE"+Ua)||pe(t,"WPDesktop")?eT:pe(t,KE)?QE:pe(t,a0)||pe(t,"Edg/")?tT:pe(t,"FBIOS")?"Facebook "+Ua:pe(t,"UCWEB")||pe(t,"UCBrowser")?"UC Browser":pe(t,"CriOS")?JE:pe(t,"CrMo")||pe(t,Ci)?Ci:pe(t,Cn)&&pe(t,Ic)?nT:pe(t,"FxiOS")?aT:pe(t.toLowerCase(),_b.toLowerCase())?_b:$4(t,e)?pe(t,Ua)?rT:Ic:pe(t,Xs)?Xs:pe(t,"MSIE")||pe(t,"Trident/")?e0:pe(t,"Gecko")?Xs:""},V4={[eT]:[new RegExp("rv:"+qt)],[tT]:[new RegExp(a0+"?\\/"+qt)],[Ci]:[new RegExp("("+Ci+"|CrMo)\\/"+qt)],[JE]:[new RegExp("CriOS\\/"+qt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qt)],[Ic]:[Mx],[rT]:[Mx],[t0]:[new RegExp("(Opera|OPR)\\/"+qt)],[Xs]:[new RegExp(Xs+"\\/"+qt)],[aT]:[new RegExp("FxiOS\\/"+qt)],[_b]:[new RegExp("Konqueror[:/]?"+qt,"i")],[Qs]:[new RegExp(Qs+" "+qt),Mx],[nT]:[new RegExp("android\\s"+qt,"i")],[QE]:[new RegExp(KE+"\\/"+qt)],[e0]:[new RegExp("(rv:|MSIE )"+qt)],Mozilla:[new RegExp("rv:"+qt)]},j4=function(t,e){var a=sT(t,e),n=V4[a];if(z(n))return null;for(var r=0;r<n.length;r++){var o=n[r],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},KA=[[new RegExp(Ys+"; "+Ys+" (.*?)[);]","i"),t=>[Ys,t&&t[1]||""]],[new RegExp(Ac,"i"),[Ac,""]],[new RegExp(Ec,"i"),[Ec,""]],[n0,[Qs,""]],[new RegExp(xc,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Sb,""];if(new RegExp(Ua).test(e)&&!/IEMobile\b/.test(e))return[xc+" "+Ua,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var n=a[1],r=q4[n]||"";return/arm/i.test(e)&&(r="RT"),[xc,r]}return[xc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Sh,e.join(".")]}return[Sh,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=z(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Cn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Cn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Cn,e.join(".")]}return[Cn,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var a=[t[1],t[2],t[3]||"0"];e[1]=a.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[P4,""]],[/Linux|debian/i,["Linux",""]]],QA=function(t){return z4.test(t)?Ac:U4.test(t)?Ec:H4.test(t)?Ys:new RegExp(Cb,"i").test(t)?Cb:new RegExp("("+Sb+"|WPDesktop)","i").test(t)?Sb:/iPad/.test(t)?ZE:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?XE:n0.test(t)?Qs:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(YA,"i").test(t)?YA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Ua).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Cn:GE:Cn:new RegExp("(pda|"+Ua+")","i").test(t)?N4:new RegExp(kc,"i").test(t)&&!new RegExp(kc+" pc","i").test(t)?iT:""},rh="https?://(.*)",tl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],G4=el(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],tl),Dc="<masked>",Z4=["li_fat_id"];function lT(t,e,a){if(!q)return{};var n,r=e?el([],tl,a||[]):[],o=uT(Mc(q.URL,r,Dc),t),i=(n={},Pe(Z4,(function(s){var l=_n.q(s);n[s]=l||null})),n);return at(i,o)}function uT(t,e){var a=G4.concat(e||[]),n={};return Pe(a,(function(r){var o=yh(t,r);n[r]=o||null})),n}function cT(t){var e=(function(o){return o?o.search(rh+"google.([^/?]*)")===0?"google":o.search(rh+"bing.com")===0?"bing":o.search(rh+"yahoo.com")===0?"yahoo":o.search(rh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",n={};if(!pr(e)){n.$search_engine=e;var r=q?yh(q.referrer,a):"";r.length&&(n.ph_keyword=r)}return n}function JA(){return navigator.language||navigator.userLanguage}function dT(){return q?.referrer||"$direct"}function fT(t,e){var a=t?el([],tl,e||[]):[],n=ra?.href.substring(0,1e3);return{r:dT().substring(0,1e3),u:n?Mc(n,a,Dc):void 0}}function pT(t){var e,{r:a,u:n}=t,r={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=vh(a))==null?void 0:e.host};if(n){r.$current_url=n;var o=vh(n);r.$host=o?.host,r.$pathname=o?.pathname;var i=uT(n);at(r,i)}if(a){var s=cT(a);at(r,s)}return r}function hT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function W4(){try{return new Date().getTimezoneOffset()}catch{return}}function X4(t,e){if(!na)return{};var a,n,r,o=t?el([],tl,e||[]):[],[i,s]=(function(l){for(var u=0;u<KA.length;u++){var[c,d]=KA[u],f=c.exec(l),h=f&&(vo(d)?d(f,l):d);if(h)return h}return["",""]})(na);return at(Yb({$os:i,$os_version:s,$browser:sT(na,navigator.vendor),$device:QA(na),$device_type:(n=na,r=QA(n),r===ZE||r===GE||r==="Kobo"||r==="Kindle Fire"||r===iT?kc:r===Ac||r===Ys||r===Ec||r===Cb?"Console":r===XE?"Wearable":r?Ua:"Desktop"),$timezone:hT(),$timezone_offset:W4()}),{$current_url:Mc(ra?.href,o,Dc),$host:ra?.host,$pathname:ra?.pathname,$raw_user_agent:na.length>1e3?na.substring(0,997)+"...":na,$browser_version:j4(na,navigator.vendor),$browser_language:JA(),$browser_language_prefix:(a=JA(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:ur.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var fo=pt("[Web Vitals]"),eE=9e5,wb=class{constructor(e){var a;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((n,r)=>Z({},n,{["$web_vitals_"+r.name+"_event"]:Z({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(z(o))fo.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();z(i)||(Te(n?.name)||Te(n?.value)?fo.error("Invalid metric received",n):this.Rt&&n.value>=this.Rt?fo.error("Ignoring metric with value >= "+this.Rt,n):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),z(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=z(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.N.metrics.push(Z({},n,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var n,r,o,i,s=te.__PosthogExtensions__;z(s)||z(s.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),n&&r&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Pt.bind(this)),this.P=!0):fo.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[FA]),this.startIfEnabled()}get allowedMetrics(){var e,a,n=yt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return z(n)?((a=this._instance.persistence)==null?void 0:a.props[NA])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(yt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=yt(this._instance.config.capture_performance)&&wn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:eE;return 0<e&&e<=6e4?eE:e}get isEnabled(){var e=ra?.protocol;if(e!=="http:"&&e!=="https:")return fo.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=yt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:yo(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return yo(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(fo.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=yt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=yt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[FA]:a}),this._instance.persistence.register({[NA]:n})),this.Et=a,this.startIfEnabled()}it(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",(r=>{r?fo.error("failed to load script",r):e()}))}Tt(){var e=E?E.location.href:void 0;if(e){var a=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=a?el([],tl,n||[]):[];return Mc(e,r,Dc)}fo.error("Could not determine current URL")}},Y4=pt("[Heatmaps]");function tE(t){return yt(t)&&"clientX"in t&&"clientY"in t&&wn(t.clientX)&&wn(t.clientY)}var Lb=class{constructor(e){var a;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((a=this.instance.persistence)==null||!a.props[ab]),this.rageclicks=new gh(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return yt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return z(this.instance.config.capture_heatmaps)?z(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;Y4.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ab]:a}),this.Et=a,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(q)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){E&&q&&(this.jt=this.Dt.bind(this),lt(E,"beforeunload",this.jt),this.Lt=e=>this.At(e||E?.event),lt(q,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||E?.event),lt(q,"mousemove",this.Nt,{capture:!0}),this.zt=new bh(this.instance,R4,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),lt(q,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;E&&q&&(this.jt&&E.removeEventListener("beforeunload",this.jt),this.Lt&&q.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&q.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&q.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,a){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=(function(s,l,u){for(var c=s;c&&Mh(c)&&!bo(c,"body");){if(c===u)return!1;if(pe(l,E?.getComputedStyle(c).position))return!0;c=PE(c)}return!1})(OE(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:a}}At(e,a){var n;if(a===void 0&&(a="click"),!HA(e.target)&&tE(e)){var r=this.qt(e,a);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(Z({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!HA(e.target)&&tE(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(E){var a=E.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,o=n?el([],tl,r||[]):[],i=Mc(a,o,Dc);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Zs(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},kb=class{constructor(e){this._instance=e}doPageView(e,a){var n,r=this.Gt(e,a);return this.Vt={pathname:(n=E?.location.pathname)!==null&&n!==void 0?n:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var a;return this.Gt(e,(a=this.Vt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,a){var n=this.Vt;if(!n)return{$pageview_id:a};var r={$pageview_id:a,$prev_pageview_id:n.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:s,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:d}=o;if(!(z(i)||z(s)||z(l)||z(u)||z(c)||z(d))){i=Math.ceil(i),s=Math.ceil(s),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var f=i<=1?1:Sn(s/i,0,1,$),h=i<=1?1:Sn(l/i,0,1,$),S=u<=1?1:Sn(c/u,0,1,$),x=u<=1?1:Sn(d/u,0,1,$);r=at(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:x})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},za=Uint8Array,$t=Uint16Array,Js=Uint32Array,r0=new za([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),o0=new za([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),aE=new za([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),mT=function(t,e){for(var a=new $t(31),n=0;n<31;++n)a[n]=e+=1<<t[n-1];var r=new Js(a[30]);for(n=1;n<30;++n)for(var o=a[n];o<a[n+1];++o)r[o]=o-a[n]<<5|n;return[a,r]},gT=mT(r0,2),K4=gT[0],Ib=gT[1];K4[28]=258,Ib[258]=28;for(Ab=mT(o0,0)[1],Ch=new $t(32768),Fe=0;Fe<32768;++Fe)po=(43690&Fe)>>>1|(21845&Fe)<<1,po=(61680&(po=(52428&po)>>>2|(13107&po)<<2))>>>4|(3855&po)<<4,Ch[Fe]=((65280&po)>>>8|(255&po)<<8)>>>1;var po,Ab,Ch,Fe,Cc=function(t,e,a){for(var n=t.length,r=0,o=new $t(e);r<n;++r)++o[t[r]-1];var i,s=new $t(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;if(a){i=new $t(1<<e);var l=15-e;for(r=0;r<n;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],d=s[t[r]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)i[Ch[d]>>>l]=u}else for(i=new $t(n),r=0;r<n;++r)i[r]=Ch[s[t[r]-1]++]>>>15-t[r];return i},_i=new za(288);for(Fe=0;Fe<144;++Fe)_i[Fe]=8;for(Fe=144;Fe<256;++Fe)_i[Fe]=9;for(Fe=256;Fe<280;++Fe)_i[Fe]=7;for(Fe=280;Fe<288;++Fe)_i[Fe]=8;var _h=new za(32);for(Fe=0;Fe<32;++Fe)_h[Fe]=5;var Q4=Cc(_i,9,0),J4=Cc(_h,5,0),vT=function(t){return(t/8>>0)+(7&t&&1)},yT=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var n=new(t instanceof $t?$t:t instanceof Js?Js:za)(a-e);return n.set(t.subarray(e,a)),n},lr=function(t,e,a){a<<=7&e;var n=e/8>>0;t[n]|=a,t[n+1]|=a>>>8},uc=function(t,e,a){a<<=7&e;var n=e/8>>0;t[n]|=a,t[n+1]|=a>>>8,t[n+2]|=a>>>16},Dx=function(t,e){for(var a=[],n=0;n<t.length;++n)t[n]&&a.push({s:n,f:t[n]});var r=a.length,o=a.slice();if(!r)return[new za(0),0];if(r==1){var i=new za(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(_,L){return _.f-L.f})),a.push({s:-1,f:25001});var s=a[0],l=a[1],u=0,c=1,d=2;for(a[0]={s:-1,f:s.f+l.f,l:s,r:l};c!=r-1;)s=a[a[u].f<a[d].f?u++:d++],l=a[u!=c&&a[u].f<a[d].f?u++:d++],a[c++]={s:-1,f:s.f+l.f,l:s,r:l};var f=o[0].s;for(n=1;n<r;++n)o[n].s>f&&(f=o[n].s);var h=new $t(f+1),S=Eb(a[c-1],h,0);if(S>e){n=0;var x=0,b=S-e,m=1<<b;for(o.sort((function(_,L){return h[L.s]-h[_.s]||_.f-L.f}));n<r;++n){var g=o[n].s;if(!(h[g]>e))break;x+=m-(1<<S-h[g]),h[g]=e}for(x>>>=b;x>0;){var v=o[n].s;h[v]<e?x-=1<<e-h[v]++-1:++n}for(;n>=0&&x;--n){var y=o[n].s;h[y]==e&&(--h[y],++x)}S=e}return[new za(h),S]},Eb=function(t,e,a){return t.s==-1?Math.max(Eb(t.l,e,a+1),Eb(t.r,e,a+1)):e[t.s]=a},nE=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new $t(++e),n=0,r=t[0],o=1,i=function(l){a[n++]=l},s=1;s<=e;++s)if(t[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(r),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(r);o=1,r=t[s]}return[a.subarray(0,n),e]},cc=function(t,e){for(var a=0,n=0;n<e.length;++n)a+=t[n]*e[n];return a},Tb=function(t,e,a){var n=a.length,r=vT(e+2);t[r]=255&n,t[r+1]=n>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<n;++o)t[r+o+4]=a[o];return 8*(r+4+n)},rE=function(t,e,a,n,r,o,i,s,l,u,c){lr(e,c++,a),++r[256];for(var d=Dx(r,15),f=d[0],h=d[1],S=Dx(o,15),x=S[0],b=S[1],m=nE(f),g=m[0],v=m[1],y=nE(x),_=y[0],L=y[1],C=new $t(19),I=0;I<g.length;++I)C[31&g[I]]++;for(I=0;I<_.length;++I)C[31&_[I]]++;for(var w=Dx(C,7),k=w[0],T=w[1],D=19;D>4&&!k[aE[D-1]];--D);var M,P,F,U,j=u+5<<3,N=cc(r,_i)+cc(o,_h)+i,X=cc(r,f)+cc(o,x)+i+14+3*D+cc(C,k)+(2*C[16]+3*C[17]+7*C[18]);if(j<=N&&j<=X)return Tb(e,c,t.subarray(l,l+u));if(lr(e,c,1+(X<N)),c+=2,X<N){M=Cc(f,h,0),P=f,F=Cc(x,b,0),U=x;var ye=Cc(k,T,0);for(lr(e,c,v-257),lr(e,c+5,L-1),lr(e,c+10,D-4),c+=14,I=0;I<D;++I)lr(e,c+3*I,k[aE[I]]);c+=3*D;for(var qa=[g,_],ht=0;ht<2;++ht){var Vt=qa[ht];for(I=0;I<Vt.length;++I){var G=31&Vt[I];lr(e,c,ye[G]),c+=k[G],G>15&&(lr(e,c,Vt[I]>>>5&127),c+=Vt[I]>>>12)}}}else M=Q4,P=_i,F=J4,U=_h;for(I=0;I<s;++I)if(n[I]>255){G=n[I]>>>18&31,uc(e,c,M[G+257]),c+=P[G+257],G>7&&(lr(e,c,n[I]>>>23&31),c+=r0[G]);var ne=31&n[I];uc(e,c,F[ne]),c+=U[ne],ne>3&&(uc(e,c,n[I]>>>5&8191),c+=o0[ne])}else uc(e,c,M[n[I]]),c+=P[n[I]];return uc(e,c,M[256]),c+P[256]},e3=new Js([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),t3=(function(){for(var t=new Js(256),e=0;e<256;++e){for(var a=e,n=9;--n;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),a3=function(t,e,a,n,r){return(function(o,i,s,l,u,c){var d=o.length,f=new za(l+d+5*(1+Math.floor(d/7e3))+u),h=f.subarray(l,f.length-u),S=0;if(!i||d<8)for(var x=0;x<=d;x+=65535){var b=x+65535;b<d?S=Tb(h,S,o.subarray(x,b)):(h[x]=c,S=Tb(h,S,o.subarray(x,d)))}else{for(var m=e3[i-1],g=m>>>13,v=8191&m,y=(1<<s)-1,_=new $t(32768),L=new $t(y+1),C=Math.ceil(s/3),I=2*C,w=function(vm){return(o[vm]^o[vm+1]<<C^o[vm+2]<<I)&y},k=new Js(25e3),T=new $t(288),D=new $t(32),M=0,P=0,F=(x=0,0),U=0,j=0;x<d;++x){var N=w(x),X=32767&x,ye=L[N];if(_[X]=ye,L[N]=X,U<=x){var qa=d-x;if((M>7e3||F>24576)&&qa>423){S=rE(o,h,0,k,T,D,P,F,j,x-j,S),F=M=P=0,j=x;for(var ht=0;ht<286;++ht)T[ht]=0;for(ht=0;ht<30;++ht)D[ht]=0}var Vt=2,G=0,ne=v,Tt=X-ye&32767;if(qa>2&&N==w(x-Tt))for(var vr=Math.min(g,qa)-1,hm=Math.min(32767,x),mm=Math.min(258,qa);Tt<=hm&&--ne&&X!=ye;){if(o[x+Vt]==o[x+Vt-Tt]){for(var yr=0;yr<mm&&o[x+yr]==o[x+yr-Tt];++yr);if(yr>Vt){if(Vt=yr,G=Tt,yr>vr)break;var sR=Math.min(Tt,yr-2),iS=0;for(ht=0;ht<sR;++ht){var gm=x-Tt+ht+32768&32767,sS=gm-_[gm]+32768&32767;sS>iS&&(iS=sS,ye=gm)}}}Tt+=(X=ye)-(ye=_[X])+32768&32767}if(G){k[F++]=268435456|Ib[Vt]<<18|Ab[G];var lS=31&Ib[Vt],uS=31&Ab[G];P+=r0[lS]+o0[uS],++T[257+lS],++D[uS],U=x+Vt,++M}else k[F++]=o[x],++T[o[x]]}}S=rE(o,h,c,k,T,D,P,F,j,x-j,S)}return yT(f,0,l+vT(S)+u)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,a,n,!0)},Ox=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function n3(t,e){e===void 0&&(e={});var a=(function(){var s=4294967295;return{p:function(l){for(var u=s,c=0;c<l.length;++c)u=t3[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),n=t.length;a.p(t);var r,o=a3(t,e,10+((r=e).filename&&r.filename.length+1||0),8),i=o.length;return(function(s,l){var u=l.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=l.level<2?4:l.level==9?2:0,s[9]=3,l.mtime!=0&&Ox(s,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){s[3]=8;for(var c=0;c<=u.length;++c)s[c+10]=u.charCodeAt(c)}})(o,e),Ox(o,i-8,a.d()),Ox(o,i-4,n),o}var r3=function(t){var e,a,n,r,o="";for(e=a=0,n=(t=(t+"").replace(/\r\n/g,`
461
516
  `).replace(/\r/g,`
462
- `)).length,n=0;n<r;n++){var i=t.charCodeAt(n),s=null;i<128?a++:s=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),sn(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},JN=!!Yy||!!Xy,XA="text/plain",Wp=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=W({},e),s=(r=o?.split("&").map((u=>{var c,[d,h]=u.split("="),g=a&&(c=i[d])!==null&&c!==void 0?c:h;return delete i[d],d+"="+g})))!==null&&r!==void 0?r:[],l=gN(i);return l&&s.push(l),n+"?"+s.join("&")},Ku=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),$y=t=>{var{data:e,compression:a}=t;if(e){if(a===on.GZipJS){var r=KN((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Pa(l.length+(l.length>>>1)),h=0,g=function(f){d[h++]=f},S=0;S<c;++S){if(h+5>d.length){var b=new Pa(h+8+(c-S<<1));b.set(d),d=b}var x=l.charCodeAt(S);x<128||u?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++S))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return lE(d,0,h)})(Ku(e)),{mtime:0}),n=new Blob([r],{type:XA});return{contentType:XA,body:n,estimatedSize:n.size}}if(a===on.Base64){var o=(function(l){var u,c,d,h,g,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b=0,x=0,f="",m=[];if(!l)return l;l=QN(l);do u=(g=l.charCodeAt(b++)<<16|l.charCodeAt(b++)<<8|l.charCodeAt(b++))>>18&63,c=g>>12&63,d=g>>6&63,h=63&g,m[x++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(h);while(b<l.length);switch(f=m.join(""),l.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f})(Ku(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ku(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Ku(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Tp=[];Xy&&Tp.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=$y(t))!==null&&e!==void 0?e:{},i=new Headers;De(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(mA){var u=new mA;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}Xy(s,W({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:n,signal:(a=l)==null?void 0:a.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var h={statusCode:c.status,text:d};if(c.status===200)try{h.json=JSON.parse(d)}catch(g){z.error(g)}t.callback==null||t.callback(h)})))).catch((c=>{z.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Yy&&Tp.push({transport:"XHR",method:t=>{var e,a=new Yy;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=$y(t))!==null&&e!==void 0?e:{};De(t.headers,(function(o,i){a.setRequestHeader(i,o)})),r&&a.setRequestHeader("Content-Type",r),t.timeout&&(a.timeout=t.timeout),t.disableXHRCredentials||(a.withCredentials=!0),a.onreadystatechange=()=>{if(a.readyState===4){var o={statusCode:a.status,text:a.responseText};if(a.status===200)try{o.json=JSON.parse(a.responseText)}catch{}t.callback==null||t.callback(o)}},a.send(n)}}),va!=null&&va.sendBeacon&&Tp.push({transport:"sendBeacon",method:t=>{var e=Wp(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=$y(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;va.sendBeacon(e,o)}catch{}}});var Zp=function(t,e){if(!(function(a){try{new RegExp(a)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function YA(t,e,a){return Ku({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var uE={exact:(t,e)=>e.some((a=>t.some((r=>a===r)))),is_not:(t,e)=>e.every((a=>t.every((r=>a!==r)))),regex:(t,e)=>e.some((a=>t.some((r=>Zp(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!Zp(a,r))))),icontains:(t,e)=>e.map(kp).some((a=>t.map(kp).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(kp).every((a=>t.map(kp).every((r=>!a.includes(r)))))},kp=t=>t.toLowerCase();function cE(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(U(o)||sn(o))return!1;var i=[String(o)],s=uE[n.operator];return!!s&&s(n.values,i)}))}var jy=ct("[Error tracking]"),Ux=class{constructor(e){var a,r;this.Jt=[],this.Kt=new tx([new rx,new cx,new ox,new nx,new lx,new sx,new ix,new ux],QF("web:javascript",ZF,KF)),this._instance=e,this.Jt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(fx))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,r,n,o=(a=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&a!==void 0?a:[],i=(n=e.errorTracking)==null?void 0:n.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[fx]:this.Jt,[IA]:i})}get Yt(){var e,a=!!this._instance.get_property(IA),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.Kt.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.Xt(a)){if(this.Qt(a))return void jy.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void jy.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void jy.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return ut(o)&&o.length>0&&r.$exception_types.push(o),ut(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var n=r.values.map((o=>{var i,s=uE[o.operator],l=Te(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var r,n;return(r=(n=a.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,r,n,o,i=(a=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(n=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}Xt(e){return!Ie(e)&&Te(e)}},er=ct("[FeatureFlags]"),zu=ct("[FeatureFlags]",{debugEnabled:!0}),Gy="$active_feature_flags",Ds="$override_feature_flags",KA="$feature_flag_payloads",Vu="$override_feature_flag_payloads",QA="$feature_flag_request_id",JA="$feature_flag_evaluated_at",ek=t=>{var e={};for(var[a,r]of Ep(t||{}))r&&(e[a]=r);return e},eP=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((a=>{var r;return[a,(r=e[a].variant)!==null&&r!==void 0?r:e[a].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((a=>e[a].enabled)).filter((a=>{var r;return(r=e[a].metadata)==null?void 0:r.payload})).map((a=>{var r;return[a,(r=e[a].metadata)==null?void 0:r.payload]})))):er.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},tP=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),qx=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((a=>{var r=a&&typeof a=="string"&&a.trim().length>0;return r||er.error("Invalid evaluation environment found:",a,"Expected non-empty string"),r})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(px),a=this._instance.get_property(Ds),r=this._instance.get_property(Vu);if(!r&&!a)return e||{};var n=Je({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(a||{})])];for(var i of o){var s,l,u=n[i],c=a?.[i],d=U(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,h=U(c)?u.variant:typeof c=="string"?c:void 0,g=r?.[i],S=W({},u,{enabled:d,variant:d?h??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),h!==u?.variant&&(S.original_variant=u?.variant),g&&(S.metadata=W({},u?.metadata,{payload:g,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.ii||(er.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.ii=!0),n}getFlagVariants(){var e=this._instance.get_property(Ns),a=this._instance.get_property(Ds);if(!a)return e||{};for(var r=Je({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(KA),a=this._instance.get_property(Vu);if(!a)return e||{};for(var r=Je({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(er.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var a;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:W({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Xu)||{}),group_properties:this._instance.get_property(di)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var n=this._instance.config.__preview_remote_config,o=n?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+i);n&&(r.timezone=nE()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:r,compression:this._instance.config.disable_compression?void 0:on.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((c=l.json)!==null&&c!==void 0?c:{})),!r.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(tP.FeatureFlags))er.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],n=""+r,o=this._instance.get_property(QA)||void 0,i=this._instance.get_property(JA)||void 0,s=this._instance.get_property(Bp)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(n))){var l,u,c,d,h,g,S,b,x;Te(s[e])?s[e].push(n):s[e]=[n],(l=this._instance.persistence)==null||l.register({[Bp]:s});var f=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};U(f==null||(d=f.metadata)==null?void 0:d.version)||(m.$feature_flag_version=f.metadata.version);var v,y=(h=f==null||(g=f.reason)==null?void 0:g.description)!==null&&h!==void 0?h:f==null||(S=f.reason)==null?void 0:S.code;y&&(m.$feature_flag_reason=y),f!=null&&(b=f.metadata)!=null&&b.id&&(m.$feature_flag_id=f.metadata.id),U(f?.original_variant)&&U(f?.original_enabled)||(m.$feature_flag_original_response=U(f.original_variant)?f.original_enabled:f.original_variant),f!=null&&(x=f.metadata)!=null&&x.original_payload&&(m.$feature_flag_original_payload=f==null||(v=f.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",m)}return r}er.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(n.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:on.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,s=(i=o.json)==null?void 0:i.featureFlagPayloads;a(s?.[e]||void 0)}})}isFeatureEnabled(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return U(r)?void 0:!!r}er.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((a=>a!==e))}receivedFeatureFlags(e,a){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,s,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=eP(i),h=d.flags,g=d.featureFlags,S=d.featureFlagPayloads;if(g){var b=i.requestId,x=i.evaluatedAt;if(Te(g)){er.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(g)for(var m=0;m<g.length;m++)f[g[m]]=!0;s&&s.register({[Gy]:g,[Ns]:f})}else{var v=g,y=S,_=h;i.errorsWhileComputingFlags&&(v=W({},l,v),y=W({},u,y),_=W({},c,_)),s&&s.register(W({[Gy]:Object.keys(ek(v)),[Ns]:v||{},[KA]:y||{},[px]:_||{}},b?{[QA]:b}:{},x?{[JA]:x}:{}))}}})(e,this._instance.persistence,r,n,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),er.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return er.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Ds),this._instance.persistence.unregister(Vu),this.pi(),zu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.ii=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Ds),zu.info("Flag overrides cleared");else if(r.flags){if(Te(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Ds]:n})}else this._instance.persistence.register({[Ds]:r.flags});zu.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Vu),zu.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Vu]:r.payloads}),zu.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:r}=this.gi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(Zu)||[]).find((u=>u.flagKey===e)),i={["$feature_enrollment/"+e]:a},s={$feature_flag:e,$feature_enrollment:a,$set:i};o&&(s.$early_access_feature_name=o.name),r&&(s.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(i,!1);var l=W({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[Gy]:Object.keys(ek(l)),[Ns]:l}),this.pi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Zu),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var s,l;if(i.json){var u=i.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(Zu),(l=this._instance.persistence)==null||l.register({[Zu]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((r=>a[r])),flagVariants:Object.keys(a).filter((r=>a[r])).reduce(((r,n)=>(r[n]=a[n],r)),{})}}pi(e){var{flags:a,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(Xu)||{};this._instance.register({[Xu]:W({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Xu)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(di)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=W({},r[n],e[n]),delete e[n]})),this._instance.register({[di]:W({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(di)||{};this._instance.register({[di]:W({},a,{[e]:{}})})}else this._instance.unregister(di)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},aP=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ec=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&z.info("Persistence loaded",e.persistence,W({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){aP.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&Ge.H()?Ge:a==="localstorage+cookie"&&wp.H()?wp:a==="sessionstorage"&&Lt.H()?Lt:a==="memory"?wN:a==="cookie"?yr:wp.H()?wp:yr}properties(){var e={};return De(this.props,(function(a,r){if(r===Ns&&mt(a))for(var n=Object.keys(a),o=0;o<n.length;o++)e["$feature/"+n[o]]=a[n[o]];else s=r,l=!1,(sn(i=iN)?l:hA&&i.indexOf===hA?i.indexOf(s)!=-1:(De(i,(function(u){if(l||(l=u===s))return Dp})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Je({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,a,r){if(mt(e)){U(a)&&(a="None"),this.xi=U(r)?this.$i:r;var n=!1;if(De(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,n=!0)})),n)return this.save(),!0}return!1}register(e,a){if(mt(e)){this.xi=U(a)?this.$i:a;var r=!1;if(De(e,((n,o)=>{e.hasOwnProperty(o)&&this.props[o]!==n&&(this.props[o]=n,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=Qk(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Fs(ob(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?eE(e):{})}update_referrer_info(){var e;this.register_once({$referrer:tE(),$referring_domain:q!=null&&q.referrer&&((e=Up(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[vx]||this.props[yx]||this.register_once({[Fp]:aE(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};De([yx,vx],(i=>{var s=this.props[i];s&&De(s,(function(l,u){e["$initial_"+Ky(u)]=l}))}));var a,r,n=this.props[Fp];if(n){var o=(a=rE(n),r={},De(a,(function(i,s){r["$initial_"+Ky(s)]=i})),r);Je(e,o)}return e}safe_merge(e){return De(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var n=this.bi(e),o=this.props;this.clear(),this.Y=n,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,a){var r=this.props[Wu]||{};r[e]=a,this.props[Wu]=r,this.save()}remove_event_timer(e){var a=(this.props[Wu]||{})[e];return U(a)||(delete this.props[Wu][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},$u=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),nz=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),oz=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),iz=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Wy=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),sz=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),lz=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),uz=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Rp=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),tk=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),dE=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),sc=class{constructor(){this.ki={},this.ki={}}on(e,a){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(a),()=>{this.ki[e]=this.ki[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.ki[e]||[])r(a);for(var n of this.ki["*"]||[])n(e,a)}};function Os(t,e,a){if(Ie(t))return!1;switch(a){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var zx=class{constructor(e){this.Pi=new sc,this.Ti=(a,r)=>this.Ri(a,r)&&this.Ii(a,r)&&this.Fi(a,r)&&this.Ci(a,r),this.Ri=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!U((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!U((a=this._instance)==null?void 0:a.Ai)&&(e.forEach((i=>{var s,l;(s=this.Oi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var n,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(o)}}on(e,a){var r;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((n=>{this.Di(a,n)&&this.Pi.emit("actionCaptured",n.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var r,n=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!n||typeof n!="string"||!Os(n,a.url,a.url_matching||"contains"))return!1}return!0}Fi(e,a){return!!this.Li(e,a)&&!!this.Ni(e,a)&&!!this.Ui(e,a)}Li(e,a){var r;if(a==null||!a.href)return!0;var n=this.zi(e);if(n.length>0)return n.some((s=>Os(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Os((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var r;if(a==null||!a.text)return!0;var n=this.zi(e);if(n.length>0)return n.some((u=>Os(u.text,a.text,a.text_matching||"exact")||Os(u.$el_text,a.text,a.text_matching||"exact")));var o,i,s,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,d=[],h=/(?::|")text="(.*?)"/g;!Ie(c=h.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>Os(u,i,s))))}Ui(e,a){var r,n;if(a==null||!a.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";if(a.selector_regex&&i)try{return new RegExp(a.selector_regex).test(i)}catch{return!1}return!1}zi(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ci(e,a){return a==null||!a.properties||a.properties.length===0||cE(a.properties.reduce(((r,n)=>{var o=Te(n.value)?n.value.map(String):n.value!=null?[String(n.value)]:[];return r[n.key]={values:o,operator:n.operator||"exact"},r}),{}),e?.properties)}},_e=ct("[Surveys]"),Vx="seenSurvey_",rP=(t,e)=>{var a="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(a="$survey_"+e+"/"+t.id+"/"+t.current_iteration),a},ak=t=>{var e=""+Vx+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Vx+t.id+"_"+t.current_iteration),e},nP=[Wy.Popover,Wy.Widget,Wy.API],oP={ignoreConditions:!1,ignoreDelay:!1,displayType:dE.Popover},$x=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&cE(e.propertyFilters,a?.properties)}Gi(e,a){var r=new Map;return e.forEach((n=>{var o;(o=n.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=r.get(i.name)||[];s.push(n.id),r.set(i.name,s)}}))})),r}Vi(e,a,r){var n,o=(r===$u.Activation?this.Hi:this.Bi).get(e),i=[];return(n=this._instance)==null||n.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;U((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((r=>{var n,o;return((n=r.conditions)==null?void 0:n.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new zx(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),a.forEach((r=>{var n,o,i,s,l;r.conditions&&(n=r.conditions)!=null&&n.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.qi.get(u.name);c&&c.push(r.id),this.qi.set(u.name,c||[r.id])}})))})))}Ji(e){var a,r=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),n=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(r.length!==0||n.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,$u.Activation),this.Bi=this.Gi(e,$u.Cancellation))}onEvent(e,a){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[_p])||[];if(Rp.SHOWN===e&&a&&n.length>0){var o;_e.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:n});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=n.indexOf(i);s>=0&&(n.splice(s,1),this.Xi(n))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,$u.Cancellation);l.length>0&&(_e.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,h=n.indexOf(c.id);h>=0&&n.splice(h,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(n))}if(this.Hi.has(e)){_e.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,$u.Activation);this.Xi(n.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,r=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[_p])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var a;_e.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[_p]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[_p];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},jx=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var a=e.surveys;if(Ie(a))return _e.warn("Flags not loaded yet. Not loading surveys.");var r=Te(a);this.Zi=r?a.length>0:a,_e.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(Vx)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)_e.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)_e.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())_e.info("Not loading surveys in cookieless mode without consent.");else{var e=te?.__PosthogExtensions__;if(e){if(!U(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,a);var n=e.loadExternalDependency;if(!n)return void this.se("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,a)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else _e.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new $x(this._instance),_e.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){_e.error(e,a),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return _e.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(hx);if(r&&!a)return e(r,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:n=>{var o;this.te=!1;var i=n.statusCode;if(i!==200||!n.json){var s="Surveys API could not be loaded, status: "+i;return _e.error(s),e([],{isLoaded:!1,error:s})}var l,u=n.json.surveys||[],c=u.filter((d=>(function(h){return!(!h.start_date||h.end_date)})(d)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(d)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[hx]:u}),e(u,{isLoaded:!0})}})}catch(n){throw this.te=!1,n}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){_e.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Ie(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);_e.warn("init was not called")}oe(e){var a=null;return this.getSurveys((r=>{var n;a=(n=r.find((o=>o.id===e)))!==null&&n!==void 0?n:null})),a}ae(e){if(Ie(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.oe(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ie(this._surveyManager))return _e.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ae(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return Ie(this._surveyManager)?(_e.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((n=>{var o,i=(o=n.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=typeof e=="string"?this.oe(e):e;if(n!=null&&n.id)if(nP.includes(n.type)){var o=q?.querySelector(a);if(o)return(r=n.appearance)!=null&&r.surveyPopupDelaySeconds?(_e.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;_e.info("Rendering survey "+n.id+" with delay of "+((i=n.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(n,o),_e.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o);_e.warn("Survey element not found")}else _e.warn("Surveys of type "+n.type+" cannot be rendered in the app");else _e.warn("Survey not found")}}displaySurvey(e,a){var r;if(Ie(this._surveyManager))_e.warn("init was not called");else{var n=this.oe(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=W({},n,{appearance:W({},n.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void _e.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==dE.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else _e.warn("Survey not found")}}cancelPendingSurvey(e){Ie(this._surveyManager)?_e.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},rk=ct("[RateLimiter]"),Gx=class{constructor(e){var a,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{rk.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void rk.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((a=e.config.rate_limiting)==null?void 0:a.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(r=this.instance.persistence)==null?void 0:r.get_property(gx))!==null&&a!==void 0?a:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var s=i.tokens<1;return s||e||(i.tokens=Math.max(0,i.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(n=this.instance.persistence)==null||n.set_property(gx,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},ci=ct("[RemoteConfig]"),Wx=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,r;(a=te.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(ci.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:a=>{e(a.json)}})}load(){try{if(this.remoteConfig)return ci.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void ci.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return ci.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((a=>{this.fi(a)}));this.fi(e)}))}catch(e){ci.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):ci.info("__preview_remote_config is disabled. Logging config instead",e):ci.error("Failed to fetch remote config from PostHog.")}},Zx=3e3,Xx=class{constructor(e,a){this.he=!0,this.ve=[],this.de=gr(a?.flush_interval_ms||Zx,250,5e3,z.createLogger("flush interval"),Zx),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(W({},r,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var a=this._e(),r=function(){var o=a[n],i=new Date().getTime();o.data&&Te(o.data)&&De(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var n in a)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return De(this.ve,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;U(e[o])&&(e[o]=W({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.ve=[],e}},iP=["retriesPerformedSoFar"],Yx=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!U(E)&&"onLine"in E.navigator&&(this.be=E.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},nt(E,"online",this.we),nt(E,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=uk(e,iP);xr(a)&&a>0&&(r.url=Wp(r.url,{retry_count:a})),this._instance.ci(W({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Se(W({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var r=(function(i){var s=3e3*Math.pow(2,i),l=s/2,u=Math.min(18e5,s),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(a),n=Date.now()+r;this.ve.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),z.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),a=[],r=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,U(E)||(this.we&&(E.removeEventListener("online",this.we),this.we=void 0),this.xe&&(E.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(W({},e,{transport:"sendBeacon"}))}catch(a){z.error(a)}this.ve=[]}},Kx=class{constructor(e){this.ke=()=>{var a,r,n,o;this.Pe||(this.Pe={});var i=this.scrollElement(),s=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=s+(i?.clientHeight||0),c=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(a=this.Pe.maxScrollY)!==null&&a!==void 0?a:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(n=this.Pe.maxContentY)!==null&&n!==void 0?n:0),this.Pe.maxContentHeight=Math.max(c,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){nt(E,"scroll",this.ke,{capture:!0}),nt(E,"scrollend",this.ke,{capture:!0}),nt(E,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.document.documentElement;var e=Te(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var a of e){var r=E?.document.querySelector(a);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},sP=t=>aE(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Xp=class{constructor(e,a,r,n){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[mx]:s})}},this._instance=e,this.Ce=a,this.Fe=r,this.Ie=n||sP,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[mx]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?rE(a):{$referring_domain:a.referringDomain,$pathname:a.initialPathName,utm_source:a.utm_source,utm_campaign:a.utm_campaign,utm_medium:a.utm_medium,utm_content:a.utm_content,utm_term:a.utm_term}:{}}getSessionProps(){var e={};return De(ob(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Ky(r)]=a})),e}},Zy=ct("[SessionId]"),Yp=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,r){var n;if(this.Oe=[],this.Ae=void 0,this.Me=new sc,this.De=(c,d)=>Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=a||so,this.Ue=r||so;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*gr(i,60,36e3,Zy.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=Lt.W(this.He),l=Lt.W(this.Be);s&&!l?this.je=s:Lt.V(this.He),Lt.G(this.Be,!0)}if((n=this.F.bootstrap)!=null&&n.sessionID)try{var u=(c=>{var d=c.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),u)}catch(c){Zy.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((a=>a!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Lt.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Lt.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Lt.W(this.He):null}We(e,a,r){e===this.Le&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[Op]:[a,e,r]}))}Ke(){var e=this.Fe.props[Op];return Te(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&E&&(E.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Lt.V(this.Be)},nt(E,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=a||new Date().getTime(),[n,o,i]=this.Ke(),s=this.Je(),l=xr(i)&&i>0&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(r,n);c||d||l?(o=this.Ne(),s=this.Ue(),Zy.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.Ue(),u=!0);var h=n===0||!e||l?r:n,g=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,h,g),e||this.ze(),u&&this.Oe.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:g,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:n}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},lP=["$set_once","$set"],oo=ct("[SiteApps]"),Qx=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,a){if(a){var r=this.globalsForEvent(a);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var a,r,n,o,i,s,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(d))u[h]={id:c[h],type:h,properties:g};var{$set_once:S,$set:b}=e;return{event:W({},uk(e,lP),{properties:W({},e.properties,b?{$set:W({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},b)}:{},S?{$set_once:W({},(n=(o=e.properties)==null?void 0:o.$set_once)!==null&&n!==void 0?n:{},S)}:{}),elements_chain:(i=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var a=this.apps[e.id],r=()=>{var s;!a.errored&&this.Xe.length&&(oo.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>a.processEvent==null?void 0:a.processEvent(l))),a.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,oo.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),n&&r()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:s=>{o(s)}});i&&(a.processEvent=i),n=!0}catch(s){oo.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){oo.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var a of e)this.apps[a.id]={id:a.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(a)}catch(n){oo.error("Error while processing event "+e.event+" for site app "+r.id,n)}}}onRemoteConfig(e){var a,r,n,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void oo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;te["__$$ph_site_app_"+u]=o._instance,(c=te.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return oo.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else oo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},fE=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&yA(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>yA(n?.brand,e))))return!0}catch{}return!!t.webdriver},Qu=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),nk="i.posthog.com",Jx=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,a=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return a||(a=this.apiHost.replace("."+nk,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Qu.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Qu.EU:this.er[this.apiHost]=Qu.CUSTOM),this.er[this.apiHost]}endpointFor(e,a){if(a===void 0&&(a=""),a&&(a=a[0]==="/"?a:"/"+a),e==="ui")return this.uiHost+a;if(e==="flags")return this.flagsApiHost+a;if(this.region===Qu.CUSTOM)return this.apiHost+a;var r=nk+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},uP={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&Zp(e.href,t),not_regex:(t,e)=>!!E&&!Zp(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},eb=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.sr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);ut(s)&&o.variants[s]&&a.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&a.nr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Ie(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.sr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.nr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=qp(e?.search,"__experiment_id"),r=qp(e?.search,"__experiment_variant");a&&r&&(t.rr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.lr(parseInt(a),r,n)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var n=this._instance.get_property("$web_experiments");if(n&&!a)return e(n);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var i=o.json.experiments||[];return e(i)}})}lr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.rr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.nr(n[0].name,a,n[0].variants[a].transforms))}static ar(e){return!Ie(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.url))return!0;var r,n,o,i=t.getWindowLocation();return!!i&&((r=e.conditions)==null||!r.url||uP[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return E?.location}static hr(e){var a;if(Ie(e.conditions)||Ie((a=e.conditions)==null?void 0:a.utm))return!0;var r=Qk();if(r.utm_source){var n,o,i,s,l,u,c,d,h=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==r.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,b=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return h&&S&&b&&g}return!1}static rr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];z.info("[WebExperiments] "+e,r)}nr(e,a,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",n);var i=(o=document)==null?void 0:o.querySelectorAll(n.selector);i?.forEach((s=>{var l=s;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return va&&this._instance?fE(va,this._instance.config.custom_blocked_useragents):void 0}},cP=ct("[PostHog ExternalIntegrations]"),dP={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},tb=class{constructor(e){this._instance=e}it(e,a){var r;(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return cP.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=te.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(dP[i],(()=>{var c;(c=te.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=te.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=te.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,n]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(r)}}},ab="[SessionRecording]",ju=ct(ab),Kp=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw ju.error("started without valid sessionManager"),new Error(ab+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(ab+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(Fy))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var r=!U(Object.assign)&&!U(Array.from);this.cr&&r?(this.gr(e),ju.info("starting")):this.stopRecording()}}gr(e){var a,r,n;this.cr&&(te!=null&&(a=te.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=te.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return ju.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,a;(e=this.pr)==null||e.call(this),this.pr=void 0,(a=this.vr)==null||a.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(xk)}br(e){if(this._instance.persistence){var a,r,n=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Ie(s)?null:parseFloat(s);Ie(l)&&this.yr();var u=i?.minimumDurationMilliseconds;n.register({[Fy]:W({enabled:!!i},i,{networkPayloadCapture:W({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:U(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.pr)==null||a.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:ju.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,a):ju.warn("log called before recorder was ready")}get mr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Fy);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,r;if((a=te.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=te.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var a;(a=this.vr)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.vr)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,a))}},tc={},rb=()=>{},Bs="posthog",pE=!JN&&ea?.indexOf("MSIE")===-1&&ea?.indexOf("Mozilla")===-1,ok=t=>{var e;return W({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:oN(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:rb,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:ta&&ut(ta?.search)&&ta.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(E==null||(e=E.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:a=>{var r="Bad HTTP status: "+a.statusCode+" "+a.text;z.error(r)},get_device_id:a=>a,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Zx},error_tracking:{},_onCapture:rb,__preview_eager_load_replay:!1},(a=>({rageclick:!(a&&a>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(a&&a>="2025-05-24")||"history_change",session_recording:a&&a>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},ik=t=>{var e={};U(t.process_person)||(e.person_profiles=t.process_person),U(t.xhr_headers)||(e.request_headers=t.xhr_headers),U(t.cookie_name)||(e.persistence_name=t.cookie_name),U(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),U(t.store_google)||(e.save_campaign_params=t.store_google),U(t.verbose)||(e.debug=t.verbose);var a=Je({},e,t);return Te(t.property_blacklist)&&(U(t.property_denylist)?a.property_denylist=t.property_blacklist:Te(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:z.error("Invalid value for property_denylist config: "+t.property_denylist)),a},nb=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Qp=class t{get decideEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new nb,this.Sr=!1,this.version=an.LIB_VERSION,this.Er=new sc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ok(),this.SentryIntegration=Ax,this.sentryIntegration=e=>(function(a,r){var n=Bk(a,r);return{name:Ok,processEvent:o=>n(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new qx(this),this.toolbar=new kx(this),this.scrollManager=new Kx(this),this.pageViewManager=new Bx(this),this.surveys=new jx(this),this.experiments=new eb(this),this.exceptions=new Ux(this),this.rateLimiter=new Gx(this),this.requestRouter=new Jx(this),this.consent=new wx(this),this.externalIntegrations=new tb(this),this.people={set:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=ut(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>z.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Bs){var n,o=(n=tc[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),tc[r]=o,tc[Bs][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),U(e)||Qy(e))return z.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(Je({},ok(a.defaults),ik(a),{name:r,token:e})),this.config.on_xhr_error&&z.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:on.GZipJS;var o=this.Cr();this.persistence=new ec(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ec(W({},this.config,{persistence:"sessionStorage"}),o);var i=W({},this.persistence.props),s=W({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Xx((m=>this.Or(m)),this.config.request_queue_config),this.Ar=new Yx(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Yp(this),this.sessionPropsManager=new Xp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(z.info("Initializing extensions synchronously"),this.Dr(l)),an.DEBUG=an.DEBUG||this.config.debug,an.DEBUG&&z.info("Starting in debug mode",{this:this,config:a,thisC:W({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(so()),h=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(rn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,S,b=Object.keys(((g=a.bootstrap)==null?void 0:g.featureFlags)||{}).filter((m=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[m])})).reduce(((m,v)=>{var y;return m[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,m}),{}),x=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((m=>b[m])).reduce(((m,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(m[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),m}),{});this.featureFlags.receivedFeatureFlags({featureFlags:b,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:Nu,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(so());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(rn,"anonymous")}return nt(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?AN(this,(()=>this.Lr())):this.Lr(),lo(this.config._onCapture)&&this.config._onCapture!==rb&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&z.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var a=performance.now();this.historyAutocapture=new Ix(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Ex(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new Qx(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new Kp(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new bx(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Ox(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Dx(this)})),r.push((()=>{this.exceptionObserver=new Lx(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new Vp(this,IN),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var n=this.Nr;this.Nr=void 0,this.fi(n)}})),this.Ur(r,a)}Ur(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){z.error("Error initializing extension:",o)}}var n=Math.round(performance.now()-a);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:n}),this.config.__preview_deferred_init_extensions&&z.info("PostHog extensions initialized ("+n+"ms)")}fi(e){var a,r,n,o,i,s,l,u;if(!q||!q.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=fe(e.supportedCompression,on.GZipJS)?on.GZipJS:fe(e.supportedCompression,on.Base64)?on.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(n=this.sessionRecording)==null||n.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Wx(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&co(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,a;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(a=this.Ar)==null||a.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(pE?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Wp(e.url,{ip:this.config.ip?1:0}),e.headers=W({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(a=>{var r,n,o,i=W({},a);i.timeout=i.timeout||6e4,i.url=Wp(i.url,{_:new Date().getTime().toString(),ver:an.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Tp.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=gk(l,(c=>c.transport===s)))==null?void 0:o.method)!==null&&n!==void 0?n:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(W({},e,{callback:a=>{var r,n;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((r=(n=this.config).on_request_error)==null||r.call(n,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,r=[],n=[],o=[];co(e,(s=>{s&&(a=s[0],Te(a)?o.push(s):lo(s)?s.call(this):Te(s)&&a==="alias"?r.push(s):Te(s)&&a.indexOf("capture")!==-1&&lo(this[a])?o.push(s):n.push(s))}));var i=function(s,l){co(s,(function(u){if(Te(u[0])){var c=l;De(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(r,this),i(n,this),i(o,this)}jr(){var e,a;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((a=this.config.bootstrap)==null?void 0:a.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,a,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!U(e)&&ut(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!ut(a?.$current_url)&&(z.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),a==null||delete a.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=r?.timestamp||s,u=so(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,a||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),i&&(c.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(c.$set=r?.$set);var d,h=this.qr(r?.$set_once);if(h&&(c.$set_once=h),(c=rN(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,U(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Rp.DISMISSED||e===Rp.SENT){var g=a?.[tk.SURVEY_ID],S=a?.[tk.SURVEY_ITERATION];d={id:g,current_iteration:S},localStorage.getItem(ak(d))||localStorage.setItem(ak(d),"true"),c.$set=W({},c.$set,{[rP({id:g,current_iteration:S},e===Rp.SENT?"responded":"dismissed")]:!0})}var b=W({},c.properties.$set,c.$set);if(Fs(b)||this.setPersonPropertiesForFlags(b),!Ie(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var f={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(f):this.Mr.enqueue(f),c}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}else z.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(a=>e(a.event,a)))}calculateEventProperties(e,a,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=W({},a);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=W({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ut(s.distinct_id)&&!xr(s.distinct_id)||Qy(s.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=VN(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=h}this.sessionPropsManager&&Je(s,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Je(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(f){s.$sdk_debug_error_capturing_properties=String(f)}if(this.requestRouter.region===Qu.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),s=Je(s,u),e==="$pageview"&&q&&(s.title=q.title),!U(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ea&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Je({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Te(this.config.property_denylist)?De(this.config.property_denylist,(function(f){delete s[f]})):z.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(z.error("sanitize_properties is deprecated. Use before_send instead"),s=b(s,e));var x=this.Gr();return s.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var a;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),n=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=Je({},r,n||{},e||{}),i=this.config.sanitize_properties;return i&&(z.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Fs(o)?void 0:o}register(e,a){var r;(r=this.persistence)==null||r.register(e,a)}register_once(e,a,r){var n;(n=this.persistence)==null||n.register_once(e,a,r)}register_for_session(e){var a;(a=this.sessionPersistence)==null||a.register(e)}unregister(e){var a;(a=this.persistence)==null||a.unregister(e)}unregister_for_session(e){var a;(a=this.sessionPersistence)==null||a.unregister(e)}Jr(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){var a=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(a)}catch{return a}}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,a,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,r)}getEarlyAccessFeatures(e,a,r){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,r)}on(e,a){return this.Er.on(e,a)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var a,r;return(a=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&a!==void 0?a:()=>{}}getSurveys(e,a){a===void 0&&(a=!1),this.surveys.getSurveys(e,a)}getActiveMatchingSurveys(e,a){a===void 0&&(a=!1),this.surveys.getActiveMatchingSurveys(e,a)}renderSurvey(e,a){this.surveys.renderSurvey(e,a)}displaySurvey(e,a){a===void 0&&(a=oP),this.surveys.displaySurvey(e,a)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,a){return a===void 0&&(a=!1),this.surveys.canRenderSurveyAsync(e,a)}identify(e,a,r){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(xr(e)&&(e=e.toString(),z.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))z.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Nu){if(this.Vr("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==n&&e!==this.get_property(Gu)&&(this.unregister(Gu),this.register({distinct_id:e}));var i=(this.persistence.get_property(rn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(rn,"identified"),this.setPersonPropertiesForFlags(W({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Tr=YA(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Bp))}}else z.critical('The string "'+Nu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else z.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var r=YA(this.get_distinct_id(),e,a);this.Tr!==r?(this.setPersonPropertiesForFlags(W({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=r):z.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){if(this.Vr("posthog.group")){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:W({},n,{[e]:a})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===a||r||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0),this.featureFlags.setPersonPropertiesForFlags(e,a)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,o;if(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(n=this.persistence)==null||n.set_property(rn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Nu,$device_id:null},"");else{var s=this.config.get_device_id(so());this.register_once({distinct_id:s,$device_id:e?s:i},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,a;return(e=(a=this.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:a,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+a);if(e!=null&&e.withTimestamp&&r){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return n;n+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return n}alias(e,a){return e===this.get_property(vk)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(U(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(Gu,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=W({},this.config);if(mt(e)){var r,n,o,i,s;Je(this.config,ik(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ec(W({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);uo(u)&&(this.config.debug=u),uo(this.config.debug)&&(this.config.debug?(an.DEBUG=!0,Ge.H()&&Ge.G("ph_debug","true"),z.info("set_config",{config:e,oldConfig:a,newConfig:W({},this.config)})):(an.DEBUG=!1,Ge.H()&&Ge.V("ph_debug"))),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var a=e===!0,r={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,o,i,s,l;(n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,a){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(W({},n,a))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var a;return(a=this.persistence)==null?void 0:a.props[e]}getSessionProperty(e){var a;return(a=this.sessionPersistence)==null?void 0:a.props[e]}toString(){var e,a=(e=this.config.name)!==null&&e!==void 0?e:Bs;return a!==Bs&&(a=Bs+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(rn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(rn))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Fs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Gu])&&((a=this.persistence)==null||(a=a.props)==null||!a[Np]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Np,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!a}Kr(){var e,a,r,n,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((n=this.sessionPersistence)==null||n.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var r,n;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new Yp(this),this.persistence&&(this.sessionPropsManager=new Xp(this,this.sessionManager,this.persistence)),this.sessionRecording=new Kp(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(U(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((n=e?.captureEventName)!==null&&n!==void 0?n:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Nu,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(a=this.sessionRecording)==null||a.stopRecording(),this.sessionRecording=void 0,this.Hr())):z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===nn.GRANTED?"granted":e===nn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return va?fE(va,this.config.custom_blocked_useragents):void 0}Hr(){q&&(q.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:q.title},{send_instantly:!0}),this.kr&&(q.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),nt(q,"visibilitychange",this.kr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,a,r,n,o,i,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(z.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",n=!1,o=z,i=(a="advanced_disable_flags")in(e=l)&&!U(e[a]),s=r in e&&!U(e[r]),i?e[a]:s?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[r]):n)}Wr(e){if(Ie(this.config.before_send))return e;var a=Te(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),Ie(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return UF(e.event)?z.warn(o+". This can cause unexpected behavior."):z.info(o),null}r.properties&&!Fs(r.properties)||z.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,a){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:a})}captureTraceMetric(e,a,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(r)})}Rr(e){var a=uo(e)&&!e,r=Ge.H()&&Ge.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=aN(t.prototype[e[a]])})(Qp,["identify"]);var sk,hE=(sk=tc[Bs]=new Qp,(function(){function t(){t.done||(t.done=!0,pE=!1,De(tc,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():nt(q,"DOMContentLoaded",t,{capture:!1}):E&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),sk);var mb=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");j(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=a.subscribe(n=>{n==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():n==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let a=e.enableFeatureFlags??!0,r=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=hE.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:n=>{if(a&&this.featureFlagsCallback){n.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&n.on("eventCaptured",o=>{let i=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof i=="string"&&this.captureCallback?.(i,s)})}},r)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[r,n]of Object.entries(e))r.startsWith("in_segment_")&&(a[r]=n===!0);return a}identify(e,a){this.client?.identify(e,a)}alias(e,a){this.client?.alias(e,a)}track(e,a){this.client?.capture(e,a)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,a){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:a})}trackAction(e,a,r){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,r){let n=`$experiment_${e}`;this.register({[n]:r??`variation_${a}`,[`${n}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:r??`variation_${a}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function ah(t={}){return new mb(t)}var gb=async(t,e)=>{let a=[];if(e.applyAction)for(let r of t.actions){let n=await e.applyAction(r);a.push(n)}return{cleanup:async()=>{for(let r=a.length-1;r>=0;r--)try{await a[r].revert()}catch{}}}},vb=async(t,e)=>{let a=[];if(e.applyAction){let r=t.actions.map(n=>e.applyAction(n));if(t.waitFor==="any"){let n=await Promise.race(r);a.push(n);let o=await Promise.allSettled(r);for(let i of o)i.status==="fulfilled"&&i.value!==n&&a.push(i.value)}else{let n=await Promise.all(r);a.push(...n)}}return{cleanup:async()=>{for(let r of a)try{await r.revert()}catch{}}}},yb=async(t,e)=>{let a,r,n=!1,o={cleanup:()=>{n=!0,r&&clearTimeout(r),a&&a()}};return t.event&&e.subscribeEvent?await new Promise(i=>{a=e.subscribeEvent(t.event,()=>{n||i()}),t.durationMs!==void 0&&(r=setTimeout(()=>{n||i()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(i=>{r=setTimeout(()=>{n||i()},t.durationMs)}),o};var dc=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:a}of Av)this.registerCore(e,a);for(let{kind:e,executor:a}of Pv)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",gb),this.registerCore("core:parallel",vb),this.registerCore("core:wait",yb)}registerCore(e,a,r){this.executors.set(e,{kind:e,executor:a,schema:r,source:"core",isBuiltIn:!0})}register(e,a,r,n="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${n})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${n})`),this.executors.set(e,{kind:e,executor:a,schema:r,source:n,isBuiltIn:o})}unregister(e){let a=this.executors.get(e);return a?a.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[a,r]of this.executors.entries())r.source===e&&this.executors.delete(a)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let a=[];if(!e||typeof e!="object")return a.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:a,warnings:[]};let{kind:r}=e;if(!r||typeof r!="string")return a.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:a,warnings:[]};let n=this.executors.get(r);if(!n)return a.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:a,warnings:[]};if(n.schema){let o=n.schema.safeParse(e);if(!o.success){for(let i of o.error.issues)a.push({code:"SCHEMA_VALIDATION_ERROR",message:i.message,field:i.path.join(".")});return{valid:!1,errors:a,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},br=new dc;function mE(t){return br.get(t)}function rh(t){return br.has(t)}var fP=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),gE=5e4,vE=50;function ln(t){let e=[],a=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:a};let{kind:r}=t;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:a};if(!rh(r)&&r!=="core:mountWidget"){let n=br.list();return console.error(`[ActionValidation] Unknown action kind: "${r}". Registered kinds (${n.length}): [${n.join(", ")}]. This usually means the app that provides "${r}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:a}}switch(r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":po(t,e,a);break;case"overlays:badge":po(t,e,a),pP(t,e,a);break;case"overlays:tooltip":po(t,e,a),hP(t,e,a);break;case"overlays:modal":LP(t,e,a);break;case"content:insertHtml":po(t,e,a),mP(t,e,a);break;case"content:setText":po(t,e,a),gP(t,e,a);break;case"content:setAttr":po(t,e,a),vP(t,e,a);break;case"content:addClass":case"content:removeClass":po(t,e,a),yP(t,e,a);break;case"content:setStyle":po(t,e,a),xP(t,e,a);break;case"core:mountWidget":bP(t,e,a);break;case"core:wait":SP(t,e,a);break;case"core:sequence":CP(t,e,a);break;case"core:parallel":_P(t,e,a);break;case"core:tour":IP(t,e,a);break;case"navigation:navigate":wP(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function po(t,e,a){let r=t.anchorId;if(!r||typeof r!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!r.selector||typeof r.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):r.selector.length>200&&a.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),r.route===void 0||r.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let n=Array.isArray(r.route)?r.route:[r.route];for(let o of n)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function pP(t,e,a){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&a.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function hP(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function mP(t,e,a){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>gE&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${gE}`,field:"html"});let r=["before","after","prepend","append","replace"];(!t.position||!r.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${r.join(", ")}`,field:"position"})}function gP(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function vP(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(fP.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function yP(t,e,a){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||a.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function xP(t,e,a){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let r=Object.keys(t.styles).length;r>vE&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${vE}`,field:"styles"});for(let[n,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${n}`,field:`styles.${n}`})}}function bP(t,e,a){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function SP(t,e,a){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function CP(t,e,a){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&a.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let r=0;r<t.actions.length;r++){let n=ln(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function _P(t,e,a){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&a.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let r=0;r<t.actions.length;r++){let n=ln(t.actions[r]);for(let o of n.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of n.warnings)a.push(o)}}function wP(t,e,a){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&a.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function LP(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let r=0;r<t.ctaButtons.length;r++){let n=t.ctaButtons[r];(!n.label||typeof n.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!n.actionId||typeof n.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function IP(t,e,a){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let r=new Set;for(let n=0;n<t.steps.length;n++){let o=t.steps[n];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${n} requires 'id' property`,field:`steps[${n}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${n}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${n} requires 'action' property`,field:`steps[${n}].action`});else{let i=ln(o.action);for(let s of i.errors)e.push({...s,field:`steps[${n}].action${s.field?`.${s.field}`:""}`});for(let s of i.warnings)a.push(s)}if(o.onAction)for(let[i,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&a.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function nh(t){let e=[],a=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:a};for(let r=0;r<t.length;r++){let n=ln(t[r]);if(!n.valid){let o=t[r];console.error(`[ActionValidation] Action [${r}] failed validation:`,`kind="${o?.kind??"undefined"}"`,n.errors.map(i=>`${i.code}: ${i.message}`).join("; "),o)}for(let o of n.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of n.warnings)a.push({...o,suggestion:o.suggestion?`Action ${r}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(r=>`${r.field??"?"}: ${r.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:a}}var AP=0;function oh(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=br,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function h(){return`action-${++AP}`}function g(C,k){a&&a.publish(C,k)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:h,publishEvent:g,adaptiveId:i,applyAction:m,subscribeEvent:a?(C,k)=>a.subscribe({names:[C]},w=>k(w.props)):void 0,subscribeNavigation:l}}async function b(C,k){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let w=r.mount(C.slot,{type:"widget",widgetId:C.widget.widgetId,config:C.widget.props},{priority:C.widget.priority});return k.publishEvent("action.applied",{id:k.generateId(),kind:"core:mountWidget",slot:C.slot,widgetId:C.widget.widgetId}),{cleanup:()=>{w.unmount()},updateFn:I=>{if("widget"in I&&I.widget){let T=I.widget;T.props&&w.update({type:"widget",widgetId:C.widget.widgetId,config:T.props})}}}}async function x(C,k){if(C.kind==="core:mountWidget")return b(C,k);let w=s.get(C.kind);if(!w){let I="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${I}]`),new Error(`No executor for action kind: ${C.kind}`)}return w(C,k)}function f(C,k,w,I){if(!u)return;let T=[],D=async()=>{let M=c.get(C);if(!M)return;let F=u.evaluateSync(w).value;if(M.state==="applied"&&!F){try{await M.cleanup()}catch(H){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,H)}M.state="deferred",M.cleanup=()=>{},M.updateFn=void 0,g("action.deferred",{id:C,kind:k.kind})}else if(M.state==="deferred"&&F)try{let H=S(),V=await x(k,H);M.state="applied",M.cleanup=V.cleanup,M.updateFn=V.updateFn,M.appliedTs=Date.now(),g("action.applied",{id:C,kind:k.kind,anchorId:"anchorId"in k?k.anchorId:void 0})}catch(H){console.error(`[ActionEngine] Error applying deferred action ${C}:`,H),M.state="failed"}};u.context&&T.push(u.context.subscribe(D)),u.accumulator&&T.push(u.accumulator.subscribe(D)),d.set(C,T)}async function m(C){let k=ln(C);if(!k.valid){let F=k.errors.map(H=>H.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,F,C),new Error(`Action validation failed: ${F}`)}let w=h(),I=C.triggerWhen;if(I&&u&&!u.evaluateSync(I).value){let H={id:w,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(w,H);let V={id:w,action:C,async revert(){let N=c.get(w);if(!N)return;let X=d.get(w);if(X){for(let ve of X)ve();d.delete(w)}N.state="reverted",c.delete(w)},isApplied(){return c.get(w)?.state==="applied"},async update(N){let X=c.get(w);if(!X||X.state!=="applied")throw new Error("Cannot update action that is not applied");if(X.updateFn)await X.updateFn(N);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(w)?.state??"reverted"}};return f(w,C,I,V),V}let T=S(),D=await x(C,T),M={id:w,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:D.cleanup,updateFn:D.updateFn};c.set(w,M),g("action.applied",{id:w,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let B={id:w,action:C,async revert(){let F=c.get(w);if(!F||F.state!=="applied")return;let H=d.get(w);if(H){for(let V of H)V();d.delete(w)}try{await F.cleanup(),F.state="reverted",g("action.reverted",{id:w,kind:C.kind})}catch(V){throw F.state="failed",g("action.failed",{id:w,kind:C.kind,error:String(V)}),V}finally{c.delete(w)}},isApplied(){return c.get(w)?.state==="applied"},async update(F){let H=c.get(w);if(!H||H.state!=="applied")throw new Error("Cannot update action that is not applied");if(H.updateFn)await H.updateFn(F);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(w)?.state??"reverted"}};return I&&u&&f(w,C,I,B),B}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(M=>M.kind).join(", "));let k=nh(C);if(!k.valid){let M=k.errors.map(B=>B.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,M,`
463
- Actions:`,C.map((B,F)=>` [${F}] ${B.kind} ${B.anchorId?`anchor="${typeof B.anchorId=="string"?B.anchorId:B.anchorId.selector}"`:""} ${B.label?`label="${B.label}"`:""}`).join(`
464
- `)),new Error(`Batch validation failed: ${M}`)}let w=h(),I=[],T=[];try{for(let M of C){let B=await m(M);I.push(B),T.push(B)}}catch(M){console.error(`[ActionEngine] Batch apply FAILED at action ${T.length+1}/${C.length}.`,`Successfully applied: ${T.length}. Rolling back...`,M);for(let B of T)try{await B.revert()}catch{}throw M}return{id:w,handles:I,async revertAll(){for(let M=I.length-1;M>=0;M--)try{await I[M].revert()}catch(B){console.error(`[ActionEngine] Error reverting action ${I[M].id}:`,B)}},isApplied(){return I.every(M=>M.isApplied())}}}function y(C){return ln(C)}function _(){return Array.from(c.values()).map(C=>({id:C.id,action:C.action,adaptiveId:C.adaptiveId,appliedTs:C.appliedTs,state:C.state}))}function L(){for(let C of d.values())for(let k of C)try{k()}catch{}d.clear();for(let C of c.values())if(C.state==="applied")try{C.cleanup()}catch(k){console.error("[ActionEngine] Error during cleanup:",k)}c.clear()}return{apply:m,applyBatch:v,validate:y,getActive:_,destroy:L}}var kP=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),ih=p.object({type:p.literal("page_url"),url:p.string()}),sh=p.object({type:p.literal("route"),routeId:p.string()}),lh=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),uh=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),ch=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),dh=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),fh=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),ph=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),hh=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),mh=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),js=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),Gs=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),js).optional()}),gh=p.object({type:p.literal("event_count"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),count:p.number().int().min(0),withinMs:p.number().positive().optional(),counter:Gs.optional()}),un=p.discriminatedUnion("type",[ih,sh,lh,uh,ch,dh,fh,ph,hh,mh,gh]),Ws=p.object({conditions:p.array(un),value:p.unknown()}),Zs=p.object({type:p.literal("rules"),rules:p.array(Ws),default:p.unknown()}),Xs=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),Ys=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),Ks=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),Qs=p.discriminatedUnion("type",[Zs,Xs,Ys,Ks]),fc=Qs.nullable().optional(),EP=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),TP=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var xb=p.object({include:p.array(p.string()).optional().describe("URL patterns where this tile appears. Supports *, **, :param wildcards. Use sparingly \u2014 mostly to isolate to specific webapp functionality. Omit to appear on all routes."),exclude:p.array(p.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),pc=p.object({routes:xb,onlyIfPopulated:p.boolean().optional().describe("When true, tile is hidden if none of its props.actions[] have an active triggerWhen. Useful for tiles with all-deferred FAQ questions or nav tips. Default: false.")});function RP(t){return un.safeParse(t)}function MP(t){return Qs.safeParse(t)}function DP(t){return pc.safeParse(t)}var OP=[{defName:"matchOp",schema:js},{defName:"counterDef",schema:Gs},{defName:"activationConfig",schema:pc},{defName:"routeFilter",schema:xb},{defName:"ruleStrategy",schema:Zs},{defName:"scoreStrategy",schema:Xs},{defName:"modelStrategy",schema:Ys},{defName:"externalStrategy",schema:Ks},{defName:"rule",schema:Ws},{defName:"condition",schema:un}];var bb=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),BP=p.object({on:p.string(),title:p.string(),body:p.string().optional(),icon:p.string().optional(),ttl:p.number().optional(),cooldown:p.number().optional(),deepLink:bb.optional()}).strict(),FP=p.object({id:p.string(),title:p.string().optional(),subtitle:p.string().optional(),icon:p.string().optional(),priority:p.number().optional(),widget:p.string(),props:p.record(p.unknown()).optional(),activation:pc.optional(),notifications:p.array(BP).optional()}).strict(),NP=p.object({position:p.enum(["left","right"]).optional(),layout:p.enum(["overlay","push"]).optional(),background:p.string().optional(),blur:p.string().optional(),border:p.string().optional(),width:p.string().optional(),transitionDuration:p.string().optional(),transitionEasing:p.string().optional(),transitionFade:p.string().optional()}),PP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),color:p.string().optional(),size:p.string().optional(),shadow:p.string().optional(),borderRadius:p.string().optional()}),HP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),shadow:p.string().optional(),titleColor:p.string().optional(),textColor:p.string().optional(),iconBackground:p.string().optional(),iconShadow:p.string().optional(),headerPadding:p.string().optional(),bodyPadding:p.string().optional(),gap:p.string().optional()}),UP=p.object({background:p.string().optional(),textColor:p.string().optional(),titleColor:p.string().optional(),arrowColor:p.string().optional(),arrowSize:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),scrimOpacity:p.string().optional(),highlightRing:p.string().optional()}),qP=p.object({background:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),successColor:p.string().optional(),warningColor:p.string().optional(),errorColor:p.string().optional(),iconBackground:p.string().optional(),progressGradient:p.string().optional()}),zP=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),itemDivider:p.string().optional(),itemGap:p.string().optional(),itemPadding:p.string().optional(),itemFontSize:p.string().optional(),bodyPadding:p.string().optional(),bodyFontSize:p.string().optional(),categoryPadding:p.string().optional(),categoryGap:p.string().optional(),categoryFontSize:p.string().optional(),searchBackground:p.string().optional(),searchColor:p.string().optional(),chevronColor:p.string().optional()}),VP=p.object({mode:p.enum(["dark","light"]).optional(),fontFamily:p.string().optional(),colorPrimary:p.string().optional(),colorPrimaryHover:p.string().optional(),borderRadius:p.string().optional(),canvas:NP.optional(),launcher:PP.optional(),tile:HP.optional(),overlay:UP.optional(),notification:qP.optional(),content:zP.optional()}).strict(),$P=p.object({enabled:p.boolean().optional(),label:p.string().optional(),icon:p.string().optional(),position:p.string().optional(),animate:p.boolean().optional(),animationStyle:p.enum(["pulse","bounce","glow"]).optional(),notificationCount:p.number().optional()}).strict(),qz=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(FP),actions:p.array(p.any()),theme:VP.optional(),launcher:$P.optional(),meta:p.object({verificationSteps:p.array(p.union([p.string(),p.object({text:p.string(),check:un.optional()})])).optional()}).passthrough().optional()}).strict();var gt={triggerWhen:fc},ya=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Sb=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),Cb=p.enum(["top-left","top-right","bottom-left","bottom-right"]),_b=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),yh=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),wb=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(yh).optional()}).strict(),Lb=p.object({title:p.string().optional(),body:p.string()}).strict(),Ib=p.enum(["before","after","prepend","append","replace"]),Ab=p.enum(["immediate","hover","click"]),kb=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),Eb=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),Tb=p.enum(["auto","smooth","instant"]),vh=p.enum(["start","center","end","nearest"]),Rb=p.object({kind:p.literal("content:setText"),anchorId:ya,text:p.string(),label:p.string().optional()}).extend(gt).strict(),Mb=p.object({kind:p.literal("content:setAttr"),anchorId:ya,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(gt).strict(),Db=p.object({kind:p.literal("content:addClass"),anchorId:ya,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Ob=p.object({kind:p.literal("content:removeClass"),anchorId:ya,className:p.string(),label:p.string().optional()}).extend(gt).strict(),Bb=p.object({kind:p.literal("content:setStyle"),anchorId:ya,styles:p.record(p.string()),label:p.string().optional()}).extend(gt).strict(),Fb=p.object({kind:p.literal("content:insertHtml"),anchorId:ya,html:p.string(),position:Ib,deepLink:bb.optional(),label:p.string().optional()}).extend(gt).strict(),Nb=p.object({kind:p.literal("overlays:highlight"),anchorId:ya,style:Sb.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Pb=p.object({kind:p.literal("overlays:pulse"),anchorId:ya,duration:p.number().optional(),label:p.string().optional()}).extend(gt).strict(),Hb=p.object({kind:p.literal("overlays:badge"),anchorId:ya,content:p.string(),position:Cb.optional(),label:p.string().optional()}).extend(gt).strict(),Ub=p.object({kind:p.literal("overlays:tooltip"),anchorId:ya,content:wb,trigger:Ab.optional(),placement:_b.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),qb=p.object({kind:p.literal("overlays:modal"),content:Lb,size:p.enum(["sm","md","lg"]).optional(),blocking:p.boolean().optional(),scrim:p.object({opacity:p.number().min(0).max(1).optional()}).strict().optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().min(0).optional()}).strict().optional(),ctaButtons:p.array(yh).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),zb=p.object({kind:p.literal("navigation:scrollTo"),anchorId:ya,behavior:Tb.optional(),block:vh.optional(),inline:vh.optional(),label:p.string().optional()}).extend(gt).strict(),Vb=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(gt).strict(),$b=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:kb,label:p.string().optional()}).extend(gt).strict(),jb=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(gt).strict(),Gb=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(gt).strict(),Wb=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(gt).strict(),Zb=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(Eb).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(gt).passthrough(),yE=[{defName:"setText",schema:Rb},{defName:"setAttr",schema:Mb},{defName:"addClass",schema:Db},{defName:"removeClass",schema:Ob},{defName:"setStyle",schema:Bb},{defName:"insertHtml",schema:Fb},{defName:"highlight",schema:Nb},{defName:"pulse",schema:Pb},{defName:"badge",schema:Hb},{defName:"tooltip",schema:Ub},{defName:"modal",schema:qb},{defName:"scrollTo",schema:zb},{defName:"navigate",schema:Vb},{defName:"mountWidget",schema:$b},{defName:"wait",schema:jb},{defName:"sequence",schema:Gb},{defName:"parallel",schema:Wb},{defName:"tour",schema:Zb}];function xh(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,r=new Map,n=new Map,o=null,i=!1;function s(x){if(!e)return null;try{return e.querySelector(x)}catch{return null}}function l(){for(let[x,f]of r){let m=s(x);if(m){for(let v of f)clearTimeout(v.timer),v.resolve(m);r.delete(x)}}for(let[x,f]of n){let m=s(x);if(m){for(let v of f)v.cancelled||v.cb(m);n.delete(x)}}r.size===0&&n.size===0&&c()}function u(){o||i||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function c(){o&&(o.disconnect(),o=null)}function d(x,f){let m=r.get(x);m&&(m.delete(f),m.size===0&&r.delete(x)),r.size===0&&n.size===0&&c()}function h(x,f){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let m=s(x);if(m)return Promise.resolve(m);let v=f??a;return new Promise((y,_)=>{let L={resolve:y,reject:_,timer:setTimeout(()=>{d(x,L),_(new Error(`waitFor("${x}") timed out after ${v}ms`))},v)},C=r.get(x);C||(C=new Set,r.set(x,C)),C.add(L),u()})}function g(x,f){if(i)return()=>{};let m=s(x);if(m)return f(m),()=>{};let v={cb:f,cancelled:!1},y=n.get(x);return y||(y=new Set,n.set(x,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=n.get(x);_&&(_.delete(v),_.size===0&&n.delete(x)),r.size===0&&n.size===0&&c()}}function S(){let x=0;for(let f of r.values())x+=f.size;return x}function b(){i=!0,c();let x=new Error("AnchorResolver destroyed");for(let f of r.values())for(let m of f)clearTimeout(m.timer),m.reject(x);r.clear(),n.clear()}return{resolve:s,waitFor:h,onAppear:g,pendingCount:S,destroy:b}}function jP(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function Xb(t,e){if(!e)return;let a;try{a=new URL(t).pathname}catch{a=t}if(e.exclude){for(let r of e.exclude)if(xE(a,r))return}if(e.include){for(let r of e.include)if(xE(a,r))return r;return}return a}function xE(t,e){let a=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(a===r)return!0;let n=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${n}$`).test(a)}var hc=class{constructor(e){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"navigation");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=jP(),this.previousContext={...this.context},e.telemetry?.getSessionId){let a=e.telemetry.getSessionId();a&&(this.context.session.sessionId=a)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Xb(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let a=Xb(this.context.page.url,this.routes);a!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:a}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,a=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a));let r=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(r)}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:a}=document,r=Xb(e,this.routes),n={url:e,title:a,routeId:r};(n.url!==this.context.page.url||n.title!==this.context.page.title||n.routeId!==this.context.page.routeId)&&(n.url!==this.context.page.url&&this.addPageToHistory(n.url),this.updateContext({page:n}))}addPageToHistory(e){let a={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],a];r.length>50&&r.shift(),this.context.session.pageHistory=r}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(a){console.error("[ContextManager] Listener error:",a)}}};function bh(t){return new hc(t)}var bE=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),SE=p.object({url:p.string(),ts:p.number()}),CE=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(SE).optional()}),_E=p.object({width:p.number(),height:p.number()}),wE=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),LE=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:wE.optional()}),IE=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),AE=p.object({page:bE,session:CE,viewport:_E,anchors:p.array(LE).optional(),augmented:IE.optional()});function GP(t){return AE.safeParse(t)}function Yb(t,e){let{context:a,state:r,events:n}=e;switch(t.type){case"page_url":{let{url:o}=t,i=a.page.url.split("?")[0].split("#")[0],s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(i)}case"route":return a.page.routeId===t.routeId;case"anchor_visible":{let o=typeof t.anchorId=="string"?t.anchorId:t.anchorId?.selector??"",i=a.anchors?.find(s=>s.anchorId===o);switch(t.state){case"visible":return i?.visible===!0;case"present":return i?.present===!0;case"absent":return!i?.present;default:return!1}}case"event_occurred":{if(!n)return!1;let o=t.withinMs??6e4;return n.hasRecentEvent(t.eventName,o)}case"state_equals":return r?.getValue?r.getValue(t.key)===t.value:!1;case"viewport":{let{width:o,height:i}=a.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&i<t.minHeight||t.maxHeight!==void 0&&i>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:i,threshold:s}=t;switch(i){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let i=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!i:i}case"event_count":{if(!e.accumulator)return!1;let o=t,i=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return i>=o.count;case"lte":return i<=o.count;case"eq":return i===o.count;case"gt":return i>o.count;case"lt":return i<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Kb(t,e){let a=[];for(let r of t.conditions){let n=Yb(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function mc(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=Kb(r,e);if(n)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:a,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function gc(t,e){let{context:a}=e,r=a.augmented?.[t.field];return r===void 0||typeof r!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:r>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function kE(t,e){let{state:a,events:r,sessionMetrics:n,accumulator:o}=e;return{context:t,state:a?{isDismissed:i=>a.dismissals.isDismissed(i),isCooldownActive:i=>a.cooldowns.isActive(i),getFrequencyCount:i=>a.frequency.count(i),getSessionMetric:i=>n?.get(i)??0,getValue:i=>a.session.get(i)??a.user.get(i)}:void 0,events:r?{hasRecentEvent:(i,s)=>r.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function Qb(t,e,a={}){let r=kE(e,a);switch(t.type){case"rules":return mc(t,r);case"score":return gc(t,r);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Jb(t,e,a={}){let r=kE(e,a);switch(t.type){case"rules":return mc(t,r);case"score":return gc(t,r);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Sh(t){return{evaluate:(e,a)=>Qb(e,a,t),evaluateSync:(e,a)=>Jb(e,a,t)}}function Ch(t){let{eventBus:e,stateStore:a}=t,r=new Map,n=new Set,o=null,i=a.ns("accumulator");function s(u){let c=!1;for(let d of r.values()){if(!d.predicate(u))continue;let h=i.get(d.stateKey)||{count:0};h.count++,d.needsTimestamps&&(h.timestamps||(h.timestamps=[]),h.timestamps.push(u.ts),h.timestamps.length>200&&(h.timestamps=h.timestamps.slice(-200))),i.set(d.stateKey,h),c=!0}if(c)for(let d of n)try{d()}catch(h){console.error("[EventAccumulator] Subscriber error:",h)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let h=`ev:${u}`,g=r.get(h);if(g){d&&!g.needsTimestamps&&(g.needsTimestamps=!0);return}r.set(h,{stateKey:h,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,h=i.get(d);if(!h)return 0;if(c===void 0||!h.timestamps)return h.count;let g=Date.now()-c;return h.timestamps.filter(S=>S>=g).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}function eS(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(r=>{try{return new RegExp(r).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var vc=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let r,n;typeof e=="function"?(r=void 0,n=e):(r=e,n=a);let o={filter:r,callback:n};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,r="canvas"){let n={ts:Date.now(),name:e,source:r,props:a,schemaVersion:$o};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(eS(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>eS(n,e))),a&&a>0&&(r=r.slice(-a)),r}hasRecentEvent(e,a,r){let n=Date.now()-a;return this.history.some(o=>o.name===e&&o.ts>=n&&(r===void 0||o.source===r))}countRecentEvents(e,a){let r=this.history.filter(n=>eS(n,e));if(a!==void 0){let n=Date.now()-a;r=r.filter(o=>o.ts>=n)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function Js(t={}){return new vc(t)}var EE={$autocapture:"ui.click",$click:be.UI_CLICK,$scroll:be.UI_SCROLL,$input:be.UI_INPUT,$change:be.UI_CHANGE,$submit:be.UI_SUBMIT,$pageview:be.NAV_PAGE_VIEW,$pageleave:be.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function WP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(EE[e])return EE[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?be.UI_SUBMIT:r==="change"?be.UI_CHANGE:a==="input"||a==="textarea"?be.UI_INPUT:be.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function ZP(t){let e={},a=t.properties||{},r=a.$elements;return a.$tag_name?e.tagName=a.$tag_name:r?.[0]?.tag_name&&(e.tagName=r[0].tag_name),a.$el_text&&(e.elementText=a.$el_text),r&&(e.elements=r),a.$current_url&&(e.url=a.$current_url),a.$pathname&&(e.pathname=a.$pathname),a.$host&&(e.host=a.$host),a.$viewport_width&&(e.viewportWidth=a.$viewport_width),a.$viewport_height&&(e.viewportHeight=a.$viewport_height),a.$session_id&&(e.sessionId=a.$session_id),a.$scroll_depth&&(e.scrollDepth=a.$scroll_depth),a.$scroll_percentage&&(e.scrollPercentage=a.$scroll_percentage),e.originalEvent=t.event,e}function tS(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:WP(t),source:"posthog",props:ZP(t),schemaVersion:$o}}function aS(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function _h(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(aS(r)){let n=tS(r);t(n)}}}var rS=p.enum(["posthog","canvas","derived"]),TE=p.object({ts:p.number(),name:p.string(),source:rS,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),RE=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(rS).optional()});function XP(t){return TE.safeParse(t)}function YP(t){return RE.safeParse(t)}var el=class{constructor(){j(this,"listeners",new Set);j(this,"capturedPushState");j(this,"capturedReplaceState");j(this,"wasNative");j(this,"destroyed",!1);j(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,a){if(!this.destroyed)for(let r of this.listeners)try{r(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var nS="cooldown:";function ME(t){return{set(e,a){let r=nS+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=nS+e,r=t.get(a);if(r===void 0)return 0;let n=r-Date.now();return n<=0?(t.remove(a),0):n},clear(e){let a=nS+e;t.remove(a)}}}var yc="dismissed:";function DE(t,e){return{mark(a,r=!1){let n=yc+a;(r?e:t).set(n,!0)},isDismissed(a){let r=yc+a;return t.has(r)||e.has(r)},clear(a){let r=yc+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(yc)&&t.remove(a);for(let a of e.keys())a.startsWith(yc)&&e.remove(a)}}}var oS="freq:";function OE(t){function e(a){let r=oS+a,n=t.get(r);if(n){if(n.resetAt&&Date.now()>=n.resetAt){t.remove(r);return}return n}}return{increment(a,r){let n=oS+a,o=e(a),i=(o?.count??0)+1,s={count:i,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(n,s),i},count(a){return e(a)?.count??0},reset(a){let r=oS+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var KP="syntro";function iS(t,e){let a=`${e}:`;return{get(r){if(t)try{let n=t.getItem(a+r);if(!n)return;let o=JSON.parse(n);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(a+r);return}return o.value}catch{return}},set(r,n,o){if(t)try{let i={value:n,expiresAt:o?Date.now()+o:void 0};t.setItem(a+r,JSON.stringify(i))}catch(i){console.warn("[StateStore] Failed to save:",i)}},remove(r){t&&t.removeItem(a+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let n=0;n<t.length;n++){let o=t.key(n);o?.startsWith(a)&&r.push(o.slice(a.length))}return r},clear(){if(!t)return;let r=this.keys();for(let n of r)t.removeItem(a+n)}}}function xc(t){let e=new Map,a=`${t}:`;return{get(r){let n=e.get(a+r);if(n){if(n.expiresAt&&Date.now()>=n.expiresAt){e.delete(a+r);return}return n.value}},set(r,n,o){e.set(a+r,{value:n,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(a+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let n of e.keys())n.startsWith(a)&&r.push(n.slice(a.length));return r},clear(){for(let r of e.keys())r.startsWith(a)&&e.delete(r)}}}var bc=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??KP;let a=r=>typeof r=="object"&&r!==null&&typeof r.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?iS(window.sessionStorage,this.namespace):xc(this.namespace),this.user=a(window.localStorage)?iS(window.localStorage,this.namespace):xc(this.namespace)):(this.session=xc(this.namespace),this.user=xc(this.namespace)),this.dismissals=DE(this.session,this.user),this.cooldowns=ME(this.user),this.frequency=OE(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?iS(sessionStorage,a):xc(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function wh(t={}){return new bc(t)}function tl(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Sc(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var sS={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},al={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},BE={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function Lh(t,e,a){let r=sS[e];Object.assign(t.style,r),a&&(a.maxWidth&&(t.style.maxWidth=a.maxWidth),a.maxHeight&&(t.style.maxHeight=a.maxHeight),a.minWidth&&(t.style.minWidth=a.minWidth),a.minHeight&&(t.style.minHeight=a.minHeight))}function Ih(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[mf(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(vf()),a.shift!==!1&&n.push(gf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",hf(e,t,async()=>{let{x:i,y:s,strategy:l}=await yf(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function Ah(t,e,a="append"){return t.style.position="relative",t.style.display="inline-block",a==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function kh(t,e){return e==="none"||al[e].length===0?null:t.animate(al[e],BE)}function Eh(t,e){if(e==="none"||al[e].length===0)return Promise.resolve();let a=[...al[e]].reverse(),r=t.animate(a,BE);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function Th(t,e){let a=document.createElement("div");return a.setAttribute("data-syntro-surface",t),a.setAttribute("data-syntro-mount-id",e),a.className="syntro-surface",Object.assign(a.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),a}function Rh(t){switch(tl(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}function FE(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),u=document.createElement("div");return u.append(l),u.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let r=a.content,n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),i=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){i.push(s);continue}for(let u of Array.from(s.attributes)){let c=u.name.toLowerCase(),d=u.value.trim().toLowerCase(),h=c.startsWith("on"),g=(c==="href"||c==="src")&&d.startsWith("javascript:");(h||g)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(r.firstChild,a.innerHTML)}var QP=0;function Mh(t){let{overlayRoot:e,eventBus:a,anchorResolver:r,defaultAnimation:n="fade",widgetRegistry:o}=t,i=new Map,s=new Map,l=new Map;function u(){return`mount-${++QP}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let L=x(y);for(let C of _)try{C(L)}catch(k){console.error("[Surfaces] State callback error:",k)}}}let h=new Map;function g(y,_,L){switch(_.type){case"html":y.innerHTML=FE(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return L&&h.set(L,C),()=>{C.unmount(),L&&h.delete(L)}}console.warn(`[Surfaces] Widget not found: ${_.widgetId}`),y.innerHTML=`<div data-widget-id="${_.widgetId}" data-widget-missing="true">Widget: ${_.widgetId}</div>`;return}case"custom":return _.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,_,L){let C=u(),k=tl(y),w=L?.priority??0,I=L?.animation??n,T=L?.exclusive??!0,D=i.get(y);if(D&&T){if(D.options.priority>w)throw new Error(`Slot ${y} is occupied by higher priority content (${D.options.priority} > ${w})`);b(D)}let M=Th(y,C);M.style.zIndex=String(Rh(y));let B;if(k==="static")Lh(M,y,L?.constraints),e.appendChild(M);else if(k==="inline"){let N=Sc(y);if(!N)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let X=r({selector:N,route:"**"});if(!X)throw new Error(`Anchor not found for inline slot: ${N}`);B=Ah(M,X)}else if(k==="adjacent"){let N=Sc(y);if(!N)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let X=r({selector:N,route:"**"});if(!X)throw new Error(`Anchor not found for adjacent slot: ${N}`);e.appendChild(M),B=Ih(M,X,L?.position??{placement:"bottom"})}let F=g(M,_,C);kh(M,I);let H={id:C,slot:y,content:_,options:{priority:w,exclusive:T,animation:I,position:L?.position??{placement:"auto"},constraints:L?.constraints??{},adaptiveId:L?.adaptiveId,autoUnmountOnRouteChange:L?.autoUnmountOnRouteChange??!0},container:M,cleanup:()=>{B?.(),F?.()},mountedAt:Date.now()};return i.set(y,H),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:L?.adaptiveId}),d(y),{id:C,update(N){let X=i.get(y);if(!X||X.id!==C)throw new Error("Mount no longer active");let ve=h.get(C);if(ve){if(N.type==="widget"){ve.update(N.config),X.content=N;return}ve.unmount(),h.delete(C)}X.container.innerHTML="";let Ha=g(X.container,N,C);if(X.content=N,Ha){let dt=X.cleanup;X.cleanup=()=>{dt?.(),Ha()}}},setOptions(N){let X=i.get(y);if(!X||X.id!==C)throw new Error("Mount no longer active");N.priority!==void 0&&(X.options.priority=N.priority),N.animation!==void 0&&(X.options.animation=N.animation),N.constraints&&k==="static"&&(N.constraints.maxWidth&&(X.container.style.maxWidth=N.constraints.maxWidth),N.constraints.maxHeight&&(X.container.style.maxHeight=N.constraints.maxHeight),N.constraints.minWidth&&(X.container.style.minWidth=N.constraints.minWidth),N.constraints.minHeight&&(X.container.style.minHeight=N.constraints.minHeight)),d(y)},async unmount(){let N=i.get(y);!N||N.id!==C||await b(N)},isMounted(){return i.get(y)?.id===C},getContainer(){let N=i.get(y);return N?.id===C?N.container:null}}}async function b(y){await Eh(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),i.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function x(y){let _=i.get(y);return{slot:y,occupied:!!_,currentPriority:_?.options.priority,currentAdaptiveId:_?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:_?.id}}function f(y,_){let L=l.get(y);return L||(L=new Set,l.set(y,L)),L.add(_),()=>{L?.delete(_),L?.size===0&&l.delete(y)}}function m(y,_){let L=i.get(y);return L?_!==void 0?_>=L.options.priority:!1:!0}function v(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(_){console.error("[Surfaces] Error during cleanup:",_)}i.clear(),l.clear()}return{mount:S,getState:x,onStateChange:f,canMount:m,destroy:v}}var Cc=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0);j(this,"runtimeRef");j(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,r="custom",n){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:a,source:r,metadata:n}),this.notify({type:"registered",widgetId:e})}unregister(e){let a=this.widgets.get(e);return a?a.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[a,r]of this.widgets.entries())r.source===e&&this.widgets.delete(a)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,a,r){let n=this.widgets.get(e);if(!n)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;a.setAttribute("data-widget-mount-id",o),a.setAttribute("data-widget-id",e);let i={...r,runtime:this.runtimeRef},s=n.widget.mount(a,i);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:a}),{widgetId:e,container:a,unmount:()=>{let u=this.mountedWidgets.get(o);u&&(u.cleanup?.(),this.mountedWidgets.delete(o),a.removeAttribute("data-widget-mount-id"),a.removeAttribute("data-widget-id"),a.innerHTML="")},update:u=>{if(n.widget.update)n.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},h=n.widget.mount(a,d);c.cleanup=h??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(a=>a.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let a of this.listeners)try{a(e)}catch(r){console.error("[WidgetRegistry] Listener error:",r)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},Dh=new Cc;var uS="2.0.0";function JP(t,e){if(!e)return!0;let a;try{a=new URL(t).pathname}catch{a=t}let r=a.replace(/\/$/,"")||"/";if(e.exclude){for(let n of e.exclude)if(lS(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(lS(r,n))return!0;return!1}return!0}function lS(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let r=a.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function NE(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>lS(a,n))}function Oh(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??Dh,s=t.executors??br,l=t.apps??cs,u=new el,c=bh({telemetry:e,routes:r,navigation:u}),d=t.events??Js(),h=wh({namespace:o}),g=Ch({eventBus:d,stateStore:h}),S=Sh({state:h,events:d,sessionMetrics:a,accumulator:g}),b=$I(),x=xh(),f=C=>NE(C)?x.resolve(C.selector):null,m=async(C,k)=>{if(!NE(C))return null;try{return await x.waitFor(C.selector,k)}catch{return null}},v=Mh({overlayRoot:b,eventBus:d,anchorResolver:f,widgetRegistry:i}),y=oh({overlayRoot:b,eventBus:d,surfaces:v,anchorResolver:f,waitForAnchor:m,executorRegistry:s,subscribeNavigation:C=>u.subscribe(C),runtime:{evaluateSync:C=>S.evaluateSync(C,c.get()),context:c,accumulator:g}}),_;if(a){a.increment("page_views");let C=typeof window<"u"?window.location.pathname:"/";_=u.subscribe((k,w)=>{if(w!=="replaceState")try{let I=new URL(k).pathname;I!==C&&(C=I,a.increment("page_views"))}catch{}})}let L={telemetry:e,context:c,events:d,state:h,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:g,anchorResolver:x,navigation:u,version:uS,mode:n,async evaluate(C){return S.evaluate(C,c.get())},evaluateSync(C){return S.evaluateSync(C,c.get())},async filterTiles(C){let k=c.get().page.url,w=[];for(let I of C){let T=I.activation;if(!T){w.push(I);continue}if(JP(k,T.routes)){if(T.onlyIfPopulated){let D=I.props?.actions??[];if(D.length>0&&!D.some(B=>B.triggerWhen?S.evaluateSync(B.triggerWhen,c.get()).value:!0))continue}w.push(I)}}return w},setRoutes(C){c.setRoutes(C)},destroy(){l.unbind().catch(C=>{console.error("[Runtime] Error unbinding apps registry:",C)}),_?.(),x.destroy(),g.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(L),i.bindRuntime(L),L}var PE=p.object({value:p.unknown(),expiresAt:p.number().optional()}),HE=p.object({count:p.number(),resetAt:p.number().optional()});function eH(t){return PE.safeParse(t)}function tH(t){return HE.safeParse(t)}var UE={growthbook:t=>fp({...t,autoInit:!0})};function qE(t,e){let a=UE[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(UE).join(", ")}`);return a(e)}var aH=["cdn.syntrologie.com","localhost","127.0.0.1"];function rH(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):aH.some(n=>e.hostname===n)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var cS=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!rH(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),a=await fetch(this.url,{credentials:"omit",cache:"default"});if(!a.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${a.status})`);let r=await a.text();if(this.integrity){let l=await nH(r),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let n=JSON.parse(r),o=performance.now()-e,i=a.headers.get("cache-control"),s=a.headers.get("age");return{config:n,meta:{source:"cdn",fetchTimeMs:o,cached:i?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function nH(t){let a=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",a),n=new Uint8Array(r);return btoa(String.fromCharCode(...n))}function zE(t){return new cS(t)}var oH="syntro_exp",iH="syntro_var",dS=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");j(this,"manifestKey");j(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let n=new URLSearchParams(window.location.search),o=n.get(oH),i=n.get(iH);if(o&&i!==null&&this.client.setForcedVariations){let s=parseInt(i,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix||this.client.getAllFeatures){let n=this.fetchMultiFlag();if(n){let o=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let a=this.client.getFeatureValue?.(this.featureKey,null);if(!a||typeof a!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:Af(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let a=e.variant_flags;if(a&&a.length>0)return a}}if(this.client.getAllFeatures){let e=this.client.getAllFeatures();return this.variantFlagPrefix?Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix)):Object.keys(e)}return[]}};function VE(t){return new dS(t)}var sH="https://cdn.syntrologie.com/configs",$E={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return zE({baseUrl:t.baseUrl??sH,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return VE({featureKey:t.featureKey})}};function jE(t,e={}){let a=$E[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys($E).join(", ")}`);return a(e)}var GE={posthog:t=>ah(t),noop:()=>Sp()};function WE(t,e){let a=GE[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(GE).join(", ")}`);return a(e)}var fS="syn_";function _c(t){if(!t.startsWith(fS))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(fS.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(a),n=JSON.parse(r);if(n.v!==1)throw new Error(`Unsupported token version: ${n.v}`);return n}function Bh(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return fS+a}function cn(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}var ZE="syntro_segment_attributes";function lH(){if(typeof window>"u")return{};try{let t=localStorage.getItem(ZE);if(t){let e=JSON.parse(t);return Y("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ma("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function uH(t){if(!(typeof window>"u"))try{localStorage.setItem(ZE,JSON.stringify(t)),Y("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ma("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function cH(t){if(!t)return{};let e={};for(let[a,r]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=r===!0);return e}function dH(){if(typeof window>"u")return{};let t={};try{let e=new URLSearchParams(window.location.search);for(let a of["utm_source","utm_medium","utm_campaign","utm_content","utm_term"]){let r=e.get(a);r&&(t[a]=r)}}catch{}try{navigator.language&&(t.browser_language=navigator.language),navigator.languages?.length&&(t.browser_languages=[...navigator.languages])}catch{}try{let e=window.innerWidth;t.device_type=e<768?"mobile":e<1024?"tablet":"desktop"}catch{}try{if(document.referrer){t.referrer=document.referrer;try{t.referrer_hostname=new URL(document.referrer).hostname}catch{}}}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname}catch{}return t}async function fH(t){Gv(),Y("Syntro Bootstrap","====== INIT ======"),Y("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=Mf();if(console.log(`[DIAG] Mode detection: sdkMode=${e}`),console.log("[DIAG] editorSource:",vu()),console.log("[DIAG] editorConf:",Rf()),Y("Syntro Bootstrap","SDK mode:",e??"normal"),!e&&typeof window<"u"){let w=!!window.__SYNTRO_EDITOR_PARAMS__,I=!!window.__SYNTRO_AUDIT_LEGEND__,T=!!window.__SYNTRO_REVIEW_DATA__;if(w||I||T){let D=[w&&"__SYNTRO_EDITOR_PARAMS__",I&&"__SYNTRO_AUDIT_LEGEND__",T&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${D.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let a=t.token;if(!a&&e){let I=Rf()?.syntro_token;I?.startsWith("syn_")&&(a=I,Y("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${e} mode)`))}let r;if(a)if(a.startsWith("syn_"))Y("Syntro Bootstrap","Token starts with syn_, decoding..."),r=_c(a),Gv(r.d);else if(e)Y("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${e} mode)`);else throw kf("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),kf("Syntro Bootstrap","Token received:",a),new Error("Invalid Syntro token: must start with 'syn_'");else if(e)Y("Syntro Bootstrap",`\u2713 No token, but ${e} mode - proceeding`);else throw kf("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let n=cn("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||cn("VITE_SYNTRO_EXPERIMENT_HOST")||r?.eh,o=cn("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||cn("VITE_SYNTRO_TELEMETRY_HOST")||r?.th,i=cn("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||cn("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,s=lH(),l=dH(),u={...l,...s};Y("Syntro Bootstrap","Phase 1: Browser metadata:",l),Y("Syntro Bootstrap","Phase 1: Cached segment attributes:",s);let c,d=Js();console.log("[Syntro Bootstrap] EventBus created");let h=_h(w=>{d.publishEvent(w)}),g=w=>{Y("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let I=cH(w);if(Y("Syntro Bootstrap","Segment flags from PostHog:",I),uH(I),c){let T=b?.getAll?.()??{},D={...l,...T,...I};Y("Syntro Bootstrap","Updating GrowthBook with attributes:",D),c.setAttributes?.(D)}},S;if(r?.t){let w=r.t==="noop"?"noop":"posthog";S=WE(w,{apiKey:r.t,apiHost:o,enableFeatureFlags:!0,onFeatureFlagsLoaded:g,onCapture:h}),console.log(`[Syntro Bootstrap] Telemetry client created (${w}) with EventBus wiring`)}let b;r?.e&&(c=qE("growthbook",{clientKey:r.e,apiHost:n,attributes:u,onExperimentViewed:S?.trackExperiment?(w,I,T)=>{S.trackExperiment(w,I,T)}:void 0})),b=pp({experiments:c,onMetricChange:(w,I)=>{Y("Syntro Bootstrap",`Session metric changed: ${w} = ${I}`)}}),Y("Syntro Bootstrap","SessionMetricTracker created");let x="production";e==="editor"?x="editor":e==="audit"?x="audit":cn("NODE_ENV")==="development"&&(x="development");let f=Oh({telemetry:S,sessionMetrics:b,mode:x,events:d});Y("Syntro Bootstrap","Runtime created:",{version:f.version,mode:f.mode,hasContext:!!f.context,hasEvents:!!f.events,hasState:!!f.state}),Y("Syntro Bootstrap","Core app executors already registered");let m=t.cdnBase||cn("NEXT_PUBLIC_SYNTRO_CDN_BASE")||cn("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",v=wf({cdnBase:m,registry:f.apps,onLoadStart:w=>{Y("Syntro Bootstrap",`Loading app from CDN: ${w}`)},onLoadEnd:(w,I,T)=>{I?Y("Syntro Bootstrap",`App loaded successfully: ${w}`):ma("Syntro Bootstrap",`Failed to load app: ${w}`,T)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:f.apps,runtime:f,version:f.version},Y("Syntro Bootstrap","Global SynOS object exposed"));let y=f.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${y.length} apps in registry:`,y.map(w=>`${w.manifest.id}(${w.state})`).join(", "));for(let w of y)if(w.state==="registered")try{await f.apps.activate(w.manifest.id),console.log(`[DIAG] Activated: ${w.manifest.id} \u2192 widgets: [${f.widgets.list().join(", ")}]`)}catch(I){console.error(`[DIAG] FAILED to activate: ${w.manifest.id}`,I),ma("Syntro Bootstrap",`Failed to auto-activate built-in app: ${w.manifest.id}`,I)}if(console.log(`[DIAG] Activation complete. Total widgets: [${f.widgets.list().join(", ")}]`),c?.refreshFeatures)try{await c.refreshFeatures(),Y("Syntro Bootstrap","GrowthBook features loaded")}catch(w){ma("Syntro Bootstrap","Failed to load GrowthBook features:",w)}let _;if(t.fetcher)_=t.fetcher;else if(r?.f){let w=jE(r.f,r.o??{});_=async()=>{let I=await w.fetch();return{...I.config,tiles:I.config.tiles??[]}}}else c&&(_=zo({experiments:c}));let L=new Set,C=_?async()=>{let w=await _();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${w.tiles?.length??0},`,`actions=${w.actions?.length??0},`,`theme=${w.theme?.name??"none"}`),w.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",w.actions.map((D,M)=>`[${M}] ${D.kind}${D.anchorId?` anchor="${typeof D.anchorId=="string"?D.anchorId:D.anchorId.selector}"`:""}${D.label?` "${D.label}"`:""}`).join(", "));let I=w,T=v.getRequiredApps(I);return T.length>0?console.log("[Syntro Bootstrap] Required external apps:",T.join(", ")):Y("Syntro Bootstrap","No external apps required (all executors are built-in)"),T.length>0&&await v.loadAppsForConfig(I).then(async M=>{let B=M.filter(V=>V.success),F=M.filter(V=>!V.success);B.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${B.map(V=>V.appId).join(", ")}`);let H=F.filter(V=>!L.has(V.appId));H.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",H.map(V=>`${V.appId} (${V.error})`).join(", ")),H.forEach(V=>L.add(V.appId)));for(let V of T)if(f.apps.has(V))try{await f.apps.activate(V),console.log(`[Syntro Bootstrap] App activated: ${V}`)}catch(N){console.error(`[Syntro Bootstrap] Failed to activate app: ${V}`,N)}else console.error(`[Syntro Bootstrap] App "${V}" required by config but NOT registered.`,`Available apps: [${Array.from(f.apps.list?.()??[]).join(", ")}]`)}),w}:void 0;return{canvas:await Zf({...t.canvas,fetcher:C,integrations:{experiments:c,telemetry:S},editorUrl:i,runtime:f}),runtime:f,experiments:c,telemetry:S,sessionMetrics:b,appLoader:v}}var pS={init:fH,encodeToken:Bh,decodeToken:_c};typeof window<"u"&&(window.Syntro=pS);var hS="2026-03-08T22:29:47.958Z (c824504ba1)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${hS}`);let t=window.SynOS,e=t?.appRegistry||cs;window.SynOS={...t,appRegistry:e,_runtimeBuild:hS,React:XE.default,ReactDOM:{...pH,createPortal:Fh.createPortal,flushSync:Fh.flushSync}},RI(e)}return rT(hH);})();
517
+ `)).length,r=0;r<n;r++){var i=t.charCodeAt(r),s=null;i<128?a++:s=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),pr(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=r+1)}return a>e&&(o+=t.substring(e,t.length)),o},o3=!!zx||!!Ux,oE="text/plain",wh=function(t,e,a){var n;a===void 0&&(a=!0);var[r,o]=t.split("?"),i=Z({},e),s=(n=o?.split("&").map((u=>{var c,[d,f]=u.split("="),h=a&&(c=i[d])!==null&&c!==void 0?c:f;return delete i[d],d+"="+h})))!==null&&n!==void 0?n:[],l=C4(i);return l&&s.push(l),r+"?"+s.join("&")},bc=(t,e)=>JSON.stringify(t,((a,n)=>typeof n=="bigint"?n.toString():n),e),Bx=t=>{var{data:e,compression:a}=t;if(e){if(a===fr.GZipJS){var n=n3((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new za(l.length+(l.length>>>1)),f=0,h=function(m){d[f++]=m},S=0;S<c;++S){if(f+5>d.length){var x=new za(f+8+(c-S<<1));x.set(d),d=x}var b=l.charCodeAt(S);b<128||u?h(b):b<2048?(h(192|b>>>6),h(128|63&b)):b>55295&&b<57344?(h(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++S))>>>18),h(128|b>>>12&63),h(128|b>>>6&63),h(128|63&b)):(h(224|b>>>12),h(128|b>>>6&63),h(128|63&b))}return yT(d,0,f)})(bc(e)),{mtime:0}),r=new Blob([n],{type:oE});return{contentType:oE,body:r,estimatedSize:r.size}}if(a===fr.Base64){var o=(function(l){var u,c,d,f,h,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,b=0,m="",g=[];if(!l)return l;l=r3(l);do u=(h=l.charCodeAt(x++)<<16|l.charCodeAt(x++)<<8|l.charCodeAt(x++))>>18&63,c=h>>12&63,d=h>>6&63,f=63&h,g[b++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(f);while(x<l.length);switch(m=g.join(""),l.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"="}return m})(bc(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:bc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=bc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},sh=[];Ux&&sh.push({transport:"fetch",method:t=>{var e,a,{contentType:n,body:r,estimatedSize:o}=(e=Bx(t))!==null&&e!==void 0?e:{},i=new Headers;Pe(t.headers,(function(c,d){i.append(d,c)})),n&&i.append("Content-Type",n);var s=t.url,l=null;if(LA){var u=new LA;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}Ux(s,Z({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:r,signal:(a=l)==null?void 0:a.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var f={statusCode:c.status,text:d};if(c.status===200)try{f.json=JSON.parse(d)}catch(h){$.error(h)}t.callback==null||t.callback(f)})))).catch((c=>{$.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),zx&&sh.push({transport:"XHR",method:t=>{var e,a=new zx;a.open(t.method||"GET",t.url,!0);var{contentType:n,body:r}=(e=Bx(t))!==null&&e!==void 0?e:{};Pe(t.headers,(function(o,i){a.setRequestHeader(i,o)})),n&&a.setRequestHeader("Content-Type",n),t.timeout&&(a.timeout=t.timeout),t.disableXHRCredentials||(a.withCredentials=!0),a.onreadystatechange=()=>{if(a.readyState===4){var o={statusCode:a.status,text:a.responseText};if(a.status===200)try{o.json=JSON.parse(a.responseText)}catch{}t.callback==null||t.callback(o)}},a.send(r)}}),Sa!=null&&Sa.sendBeacon&&sh.push({transport:"sendBeacon",method:t=>{var e=wh(t.url,{beacon:"1"});try{var a,{contentType:n,body:r}=(a=Bx(t))!==null&&a!==void 0?a:{},o=typeof r=="string"?new Blob([r],{type:n}):r;Sa.sendBeacon(e,o)}catch{}}});var Lh=function(t,e){if(!(function(a){try{new RegExp(a)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function iE(t,e,a){return bc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var xT={exact:(t,e)=>e.some((a=>t.some((n=>a===n)))),is_not:(t,e)=>e.every((a=>t.every((n=>a!==n)))),regex:(t,e)=>e.some((a=>t.some((n=>Lh(a,n))))),not_regex:(t,e)=>e.every((a=>t.every((n=>!Lh(a,n))))),icontains:(t,e)=>e.map(oh).some((a=>t.map(oh).some((n=>a.includes(n))))),not_icontains:(t,e)=>e.map(oh).every((a=>t.map(oh).every((n=>!a.includes(n)))))},oh=t=>t.toLowerCase();function bT(t,e){return!t||Object.entries(t).every((a=>{var[n,r]=a,o=e?.[n];if(z(o)||pr(o))return!1;var i=[String(o)],s=xT[r.operator];return!!s&&s(r.values,i)}))}var Px=pt("[Error tracking]"),Rb=class{constructor(e){var a,n;this.Jt=[],this.Kt=new Gx([new Wx,new tb,new Yx,new Xx,new Jx,new Qx,new Kx,new eb],r4("web:javascript",e4,n4)),this._instance=e,this.Jt=(a=(n=this._instance.persistence)==null?void 0:n.get_property(nb))!==null&&a!==void 0?a:[]}onRemoteConfig(e){var a,n,r,o=(a=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&a!==void 0?a:[],i=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[nb]:this.Jt,[PA]:i})}get Yt(){var e,a=!!this._instance.get_property(PA),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.Kt.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.Xt(a)){if(this.Qt(a))return void Px.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void Px.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void Px.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var a=e.reduce(((n,r)=>{var{type:o,value:i}=r;return ft(o)&&o.length>0&&n.$exception_types.push(o),ft(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Jt.some((n=>{var r=n.values.map((o=>{var i,s=xT[o.operator],l=Oe(o.value)?o.value:[o.value],u=(i=a[o.key])!==null&&i!==void 0?i:[];return l.length>0&&s(l,u)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((a=>{var n,r;return(n=(r=a.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((a=>a.filename&&a.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var a,n,r,o,i=(a=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&a!==void 0?a:[],s=i[i.length-1];return(r=s==null||(o=s.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!Te(e)&&Oe(e)}},nn=pt("[FeatureFlags]"),dc=pt("[FeatureFlags]",{debugEnabled:!0}),Fx="$active_feature_flags",Vs="$override_feature_flags",sE="$feature_flag_payloads",fc="$override_feature_flag_payloads",lE="$feature_flag_request_id",uE="$feature_flag_evaluated_at",cE=t=>{var e={};for(var[a,n]of ih(t||{}))n&&(e[a]=n);return e},i3=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((a=>{var n;return[a,(n=e[a].variant)!==null&&n!==void 0?n:e[a].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((a=>e[a].enabled)).filter((a=>{var n;return(n=e[a].metadata)==null?void 0:n.payload})).map((a=>{var n;return[a,(n=e[a].metadata)==null?void 0:n.payload]})))):nn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},s3=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Mb=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((a=>{var n=a&&typeof a=="string"&&a.trim().length>0;return n||nn.error("Invalid evaluation environment found:",a,"Expected non-empty string"),n})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(rb),a=this._instance.get_property(Vs),n=this._instance.get_property(fc);if(!n&&!a)return e||{};var r=at({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(a||{})])];for(var i of o){var s,l,u=r[i],c=a?.[i],d=z(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,f=z(c)?u.variant:typeof c=="string"?c:void 0,h=n?.[i],S=Z({},u,{enabled:d,variant:d?f??u?.variant:void 0});d!==u?.enabled&&(S.original_enabled=u?.enabled),f!==u?.variant&&(S.original_variant=u?.variant),h&&(S.metadata=Z({},u?.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),r[i]=S}return this.ii||(nn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(Ws),a=this._instance.get_property(Vs);if(!a)return e||{};for(var n=at({},e),r=Object.keys(a),o=0;o<r.length;o++)n[r[o]]=a[r[o]];return this.ii||(nn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:n}),this.ii=!0),n}getFlagPayloads(){var e=this._instance.get_property(sE),a=this._instance.get_property(fc);if(!a)return e||{};for(var n=at({},e||{}),r=Object.keys(a),o=0;o<r.length;o++)n[r[o]]=a[r[o]];return this.ii||(nn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:n}),this.ii=!0),n}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var a;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Z({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(yc)||{}),group_properties:this._instance.get_property(Si)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0),this.ui()&&(n.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("flags",o+i);r&&(n.timezone=hT()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:n,compression:this._instance.config.disable_compression?void 0:fr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((c=l.json)!==null&&c!==void 0?c:{})),!n.disable_flags||this.ni)if(this.ai=!d,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(s3.FeatureFlags))nn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var f;n.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},d),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(lE)||void 0,i=this._instance.get_property(uE)||void 0,s=this._instance.get_property(fh)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(r))){var l,u,c,d,f,h,S,x,b;Oe(s[e])?s[e].push(r):s[e]=[r],(l=this._instance.persistence)==null||l.register({[fh]:s});var m=this.getFeatureFlagDetails(e),g={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:i,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};z(m==null||(d=m.metadata)==null?void 0:d.version)||(g.$feature_flag_version=m.metadata.version);var v,y=(f=m==null||(h=m.reason)==null?void 0:h.description)!==null&&f!==void 0?f:m==null||(S=m.reason)==null?void 0:S.code;y&&(g.$feature_flag_reason=y),m!=null&&(x=m.metadata)!=null&&x.id&&(g.$feature_flag_id=m.metadata.id),z(m?.original_variant)&&z(m?.original_enabled)||(g.$feature_flag_original_response=z(m.original_variant)?m.original_enabled:m.original_variant),m!=null&&(b=m.metadata)!=null&&b.original_payload&&(g.$feature_flag_original_payload=m==null||(v=m.metadata)==null?void 0:v.original_payload),this._instance.capture("$feature_flag_called",g)}return n}nn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,a){var n=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:fr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,s=(i=o.json)==null?void 0:i.featureFlagPayloads;a(s?.[e]||void 0)}})}isFeatureEnabled(e,a){if(a===void 0&&(a={}),this.ei||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,a);return z(n)?void 0:!!n}nn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((a=>a!==e))}receivedFeatureFlags(e,a){if(this._instance.persistence){this.ei=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,s,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=i3(i),f=d.flags,h=d.featureFlags,S=d.featureFlagPayloads;if(h){var x=i.requestId,b=i.evaluatedAt;if(Oe(h)){nn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var m={};if(h)for(var g=0;g<h.length;g++)m[h[g]]=!0;s&&s.register({[Fx]:h,[Ws]:m})}else{var v=h,y=S,_=f;i.errorsWhileComputingFlags&&(v=Z({},l,v),y=Z({},u,y),_=Z({},c,_)),s&&s.register(Z({[Fx]:Object.keys(cE(v)),[Ws]:v||{},[sE]:y||{},[rb]:_||{}},x?{[lE]:x}:{},b?{[uE]:b}:{}))}}})(e,this._instance.persistence,n,r,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),nn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return nn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Vs),this._instance.persistence.unregister(fc),this.pi(),dc.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,n=e;if(this.ii=!!((a=n.suppressWarning)!==null&&a!==void 0&&a),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(Vs),dc.info("Flag overrides cleared");else if(n.flags){if(Oe(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[Vs]:r})}else this._instance.persistence.register({[Vs]:n.flags});dc.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(fc),dc.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[fc]:n.payloads}),dc.info("Payload overrides set",{payloads:n.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:a,flagVariants:n}=this.gi();e(a,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,n){var r,o=(this._instance.get_property(vc)||[]).find((u=>u.flagKey===e)),i={["$feature_enrollment/"+e]:a},s={$feature_flag:e,$feature_enrollment:a,$set:i};o&&(s.$early_access_feature_name=o.name),n&&(s.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(i,!1);var l=Z({},this.getFlagVariants(),{[e]:a});(r=this._instance.persistence)==null||r.register({[Fx]:Object.keys(cE(l)),[Ws]:l}),this.pi()}getEarlyAccessFeatures(e,a,n){a===void 0&&(a=!1);var r=this._instance.get_property(vc),o=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!a)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var s,l;if(i.json){var u=i.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.unregister(vc),(l=this._instance.persistence)==null||l.register({[vc]:u}),e(u)}}})}gi(){var e=this.getFlags(),a=this.getFlagVariants();return{flags:e.filter((n=>a[n])),flagVariants:Object.keys(a).filter((n=>a[n])).reduce(((n,r)=>(n[r]=a[r],n)),{})}}pi(e){var{flags:a,flagVariants:n}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(a,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var n=this._instance.get_property(yc)||{};this._instance.register({[yc]:Z({},n,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(yc)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var n=this._instance.get_property(Si)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Z({},n[r],e[r]),delete e[r]})),this._instance.register({[Si]:Z({},n,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(Si)||{};this._instance.register({[Si]:Z({},a,{[e]:{}})})}else this._instance.unregister(Si)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},l3=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],_c=class{constructor(e,a){this.F=e,this.props={},this.mi=!1,this.yi=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&$.info("Persistence loaded",e.persistence,Z({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){l3.indexOf(e.persistence.toLowerCase())===-1&&($.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&Xe.H()?Xe:a==="localstorage+cookie"&&th.H()?th:a==="sessionstorage"&&At.H()?At:a==="memory"?T4:a==="cookie"?_n:th.H()?th:_n}properties(){var e={};return Pe(this.props,(function(a,n){if(n===Ws&&yt(a))for(var r=Object.keys(a),o=0;o<r.length;o++)e["$feature/"+r[o]]=a[r[o]];else s=n,l=!1,(pr(i=f4)?l:wA&&i.indexOf===wA?i.indexOf(s)!=-1:(Pe(i,(function(u){if(l||(l=u===s))return ch})),l))||(e[n]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=at({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,a,n){if(yt(e)){z(a)&&(a="None"),this.xi=z(n)?this.$i:n;var r=!1;if(Pe(e,((o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==a||(this.props[i]=o,r=!0)})),r)return this.save(),!0}return!1}register(e,a){if(yt(e)){this.xi=z(a)?this.$i:a;var n=!1;if(Pe(e,((r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=lT(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Zs(Yb(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=q?.referrer)?cT(e):{})}update_referrer_info(){var e;this.register_once({$referrer:dT(),$referring_domain:q!=null&&q.referrer&&((e=vh(q.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[lb]||this.props[ub]||this.register_once({[ph]:fT(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Pe([ub,lb],(i=>{var s=this.props[i];s&&Pe(s,(function(l,u){e["$initial_"+qx(u)]=l}))}));var a,n,r=this.props[ph];if(r){var o=(a=pT(r),n={},Pe(a,(function(i,s){n["$initial_"+qx(s)]=i})),n);at(e,o)}return e}safe_merge(e){return Pe(this.props,(function(a,n){n in e||(e[n]=a)})),e}update_config(e,a,n){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==a.persistence){var r=this.bi(e),o=this.props;this.clear(),this.Y=r,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,a){var n=this.props[gc]||{};n[e]=a,this.props[gc]=n,this.save()}remove_event_timer(e){var a=(this.props[gc]||{})[e];return z(a)||(delete this.props[gc][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},pc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),lV=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),uV=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),cV=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Nx=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),dV=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),fV=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),pV=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),lh=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),dE=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),ST=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Tc=class{constructor(){this.ki={},this.ki={}}on(e,a){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(a),()=>{this.ki[e]=this.ki[e].filter((n=>n!==a))}}emit(e,a){for(var n of this.ki[e]||[])n(a);for(var r of this.ki["*"]||[])r(e,a)}};function js(t,e,a){if(Te(t))return!1;switch(a){case"exact":return t===e;case"contains":var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Db=class{constructor(e){this.Pi=new Tc,this.Ti=(a,n)=>this.Ri(a,n)&&this.Ii(a,n)&&this.Fi(a,n)&&this.Ci(a,n),this.Ri=(a,n)=>n==null||!n.event||a?.event===n?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!z((e=this._instance)==null?void 0:e.Ai)){var a;(a=this._instance)==null||a.Ai(((n,r)=>{this.on(n,r)}))}}register(e){var a,n;if(!z((a=this._instance)==null?void 0:a.Ai)&&(e.forEach((i=>{var s,l;(s=this.Oi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach((i=>{var s;(s=i.steps)==null||s.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,a){var n;a!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(a?.event))&&this.Oi&&((n=this.Oi)==null?void 0:n.size)>0&&this.Oi.forEach((r=>{this.Di(a,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(a=>e(a)))}Di(e,a){if(a?.steps==null)return!1;for(var n of a.steps)if(this.Ti(e,n))return!0;return!1}onAction(e,a){return this.Pi.on(e,a)}Ii(e,a){if(a!=null&&a.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!js(r,a.url,a.url_matching||"contains"))return!1}return!0}Fi(e,a){return!!this.Li(e,a)&&!!this.Ni(e,a)&&!!this.Ui(e,a)}Li(e,a){var n;if(a==null||!a.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((s=>js(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!i&&js((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Ni(e,a){var n;if(a==null||!a.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((u=>js(u.text,a.text,a.text_matching||"exact")||js(u.$el_text,a.text,a.text_matching||"exact")));var o,i,s,l=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,d=[],f=/(?::|")text="(.*?)"/g;!Te(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d})(l),i=a.text,s=a.text_matching||"exact",o.some((u=>js(u,i,s))))}Ui(e,a){var n,r;if(a==null||!a.selector)return!0;var o=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(o!=null&&o.includes(a.selector))return!0;var i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(a.selector_regex&&i)try{return new RegExp(a.selector_regex).test(i)}catch{return!1}return!1}zi(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ci(e,a){return a==null||!a.properties||a.properties.length===0||bT(a.properties.reduce(((n,r)=>{var o=Oe(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:o,operator:r.operator||"exact"},n}),{}),e?.properties)}},Le=pt("[Surveys]"),Ob="seenSurvey_",u3=(t,e)=>{var a="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(a="$survey_"+e+"/"+t.id+"/"+t.current_iteration),a},fE=t=>{var e=""+Ob+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ob+t.id+"_"+t.current_iteration),e},c3=[Nx.Popover,Nx.Widget,Nx.API],d3={ignoreConditions:!1,ignoreDelay:!1,displayType:ST.Popover},Bb=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&bT(e.propertyFilters,a?.properties)}Gi(e,a){var n=new Map;return e.forEach((r=>{var o;(o=r.conditions)==null||(o=o[a])==null||(o=o.values)==null||o.forEach((i=>{if(i!=null&&i.name){var s=n.get(i.name)||[];s.push(r.id),n.set(i.name,s)}}))})),n}Vi(e,a,n){var r,o=(n===pc.Activation?this.Hi:this.Bi).get(e),i=[];return(r=this._instance)==null||r.getSurveys((s=>{i=s.filter((l=>o?.includes(l.id)))})),i.filter((s=>{var l,u=(l=s.conditions)==null||(l=l[n])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,a)}))}register(e){var a;z((a=this._instance)==null?void 0:a.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var a=e.filter((n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));a.length!==0&&(this.Yi==null&&(this.Yi=new Db(this._instance),this.Yi.init(),this.Yi.ji((n=>{this.onAction(n)}))),a.forEach((n=>{var r,o,i,s,l;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=n.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((s=this.Yi)==null||s.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.qi.get(u.name);c&&c.push(n.id),this.qi.set(u.name,c||[n.id])}})))})))}Ji(e){var a,n=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.events)&&((s=o.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0})),r=e.filter((o=>{var i,s;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((s=o.conditions)==null||(s=s.cancelEvents)==null||(s=s.values)==null?void 0:s.length)>0}));(n.length!==0||r.length!==0)&&((a=this._instance)==null||a.Ai(((o,i)=>{this.onEvent(o,i)})),this.Hi=this.Gi(e,pc.Activation),this.Bi=this.Gi(e,pc.Cancellation))}onEvent(e,a){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[eh])||[];if(lh.SHOWN===e&&a&&r.length>0){var o;Le.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:a,existingActivatedSurveys:r});var i=a==null||(o=a.properties)==null?void 0:o.$survey_id;if(i){var s=r.indexOf(i);s>=0&&(r.splice(s,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,a,pc.Cancellation);l.length>0&&(Le.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,f=r.indexOf(c.id);f>=0&&r.splice(f,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(r))}if(this.Hi.has(e)){Le.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,pc.Activation);this.Xi(r.concat(u.map((c=>c.id))||[]))}}}onAction(e){var a,n=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[eh])||[];this.qi.has(e)&&this.Xi(n.concat(this.qi.get(e)||[]))}Xi(e){var a;Le.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[eh]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[eh];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Pb=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var a=e.surveys;if(Te(a))return Le.warn("Flags not loaded yet. Not loading surveys.");var n=Oe(a);this.Zi=n?a.length>0:a,Le.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var n=localStorage.key(a);(n!=null&&n.startsWith(Ob)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Le.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Le.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Le.info("Not loading surveys in cookieless mode without consent.");else{var e=te?.__PosthogExtensions__;if(e){if(!z(this.Zi)||this._instance.config.advanced_enable_surveys){var a=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var n=e.generateSurveys;if(n)return void this.re(n,a);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,a)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else Le.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new Bb(this._instance),Le.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){Le.error(e,a),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return Le.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(ob);if(n&&!a)return e(n,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.te=!1;var i=r.statusCode;if(i!==200||!r.json){var s="Surveys API could not be loaded, status: "+i;return Le.error(s),e([],{isLoaded:!1,error:s})}var l,u=r.json.surveys||[],c=u.filter((d=>(function(f){return!(!f.start_date||f.end_date)})(d)&&((function(f){var h;return!((h=f.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)})(d)||(function(f){var h;return!((h=f.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[ob]:u}),e(u,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var a of this.ee)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(n){Le.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Te(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);Le.warn("init was not called")}oe(e){var a=null;return this.getSurveys((n=>{var r;a=(r=n.find((o=>o.id===e)))!==null&&r!==void 0?r:null})),a}ae(e){if(Te(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.oe(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Te(this._surveyManager))return Le.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ae(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return Te(this._surveyManager)?(Le.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((n=>{this.getSurveys((r=>{var o,i=(o=r.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(i){var s=this.ae(i);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a){var n;if(Te(this._surveyManager))Le.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(c3.includes(r.type)){var o=q?.querySelector(a);if(o)return(n=r.appearance)!=null&&n.surveyPopupDelaySeconds?(Le.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;Le.info("Rendering survey "+r.id+" with delay of "+((i=r.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(s=this._surveyManager)==null||s.renderSurvey(r,o),Le.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,o);Le.warn("Survey element not found")}else Le.warn("Surveys of type "+r.type+" cannot be rendered in the app");else Le.warn("Survey not found")}}displaySurvey(e,a){var n;if(Te(this._surveyManager))Le.warn("init was not called");else{var r=this.oe(e);if(r){var o=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=Z({},r,{appearance:Z({},r.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void Le.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==ST.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else Le.warn("Survey not found")}}cancelPendingSurvey(e){Te(this._surveyManager)?Le.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},pE=pt("[RateLimiter]"),Fb=class{constructor(e){var a,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((i=>{pE.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void pE.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((a=e.config.rate_limiting)==null?void 0:a.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var a,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),i=(a=(n=this.instance.persistence)==null?void 0:n.get_property(sb))!==null&&a!==void 0?a:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var s=i.tokens<1;return s||e||(i.tokens=Math.max(0,i.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(sb,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},bi=pt("[RemoteConfig]"),Nb=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,n;(a=te.__PosthogExtensions__)!=null&&a.loadExternalDependency?(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(bi.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:a=>{e(a.json)}})}load(){try{if(this.remoteConfig)return bi.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void bi.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return bi.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((a=>{this.fi(a)}));this.fi(e)}))}catch(e){bi.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):bi.info("__preview_remote_config is disabled. Logging config instead",e):bi.error("Failed to fetch remote config from PostHog.")}},Hb=3e3,Ub=class{constructor(e,a){this.he=!0,this.ve=[],this.de=Sn(a?.flush_interval_ms||Hb,250,5e3,$.createLogger("flush interval"),Hb),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},a=Object.values(e);[...a.filter((n=>n.url.indexOf("/e")===0)),...a.filter((n=>n.url.indexOf("/e")!==0))].map((n=>{this.ce(Z({},n,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var a=this._e(),n=function(){var o=a[r],i=new Date().getTime();o.data&&Oe(o.data)&&Pe(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.ce(o)};for(var r in a)n()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return Pe(this.ve,(a=>{var n,r=a,o=(r?r.batchKey:null)||r.url;z(e[o])&&(e[o]=Z({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)})),this.ve=[],e}},f3=["retriesPerformedSoFar"],zb=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!z(E)&&"onLine"in E.navigator&&(this.be=E.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},lt(E,"online",this.we),lt(E,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,n=xE(e,f3);wn(a)&&a>0&&(n.url=wh(n.url,{retry_count:a})),this._instance.ci(Z({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(a??0)<10?this.Se(Z({retriesPerformedSoFar:a},n)):n.callback==null||n.callback(r)}}))}Se(e){var a=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=a+1;var n=(function(i){var s=3e3*Math.pow(2,i),l=s/2,u=Math.min(18e5,s),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(a),r=Date.now()+n;this.ve.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),$.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),a=[],n=this.ve.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.ve=a,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,z(E)||(this.we&&(E.removeEventListener("online",this.we),this.we=void 0),this.xe&&(E.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(Z({},e,{transport:"sendBeacon"}))}catch(a){$.error(a)}this.ve=[]}},qb=class{constructor(e){this.ke=()=>{var a,n,r,o;this.Pe||(this.Pe={});var i=this.scrollElement(),s=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=s+(i?.clientHeight||0),c=i?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(s),this.Pe.maxScrollY=Math.max(s,(a=this.Pe.maxScrollY)!==null&&a!==void 0?a:0),this.Pe.maxScrollHeight=Math.max(l,(n=this.Pe.maxScrollHeight)!==null&&n!==void 0?n:0),this.Pe.lastContentY=u,this.Pe.maxContentY=Math.max(u,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(c,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){lt(E,"scroll",this.ke,{capture:!0}),lt(E,"scrollend",this.ke,{capture:!0}),lt(E,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.document.documentElement;var e=Oe(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var a of e){var n=E?.document.querySelector(a);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},p3=t=>fT(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),kh=class{constructor(e,a,n,r){this.Te=o=>{var i=this.Re();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[ib]:s})}},this._instance=e,this.Ce=a,this.Fe=n,this.Ie=r||p3,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[ib]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?pT(a):{$referring_domain:a.referringDomain,$pathname:a.initialPathName,utm_source:a.utm_source,utm_campaign:a.utm_campaign,utm_medium:a.utm_medium,utm_content:a.utm_content,utm_term:a.utm_term}:{}}getSessionProps(){var e={};return Pe(Yb(this.getSetOnceProps()),((a,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+qx(n)]=a})),e}},Hx=pt("[SessionId]"),Ih=class{on(e,a){return this.Me.on(e,a)}constructor(e,a,n){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Tc,this.De=(c,d)=>Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=a||go,this.Ue=n||go;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Sn(i,60,36e3,Hx.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var s=At.W(this.He),l=At.W(this.Be);s&&!l?this.je=s:At.V(this.He),At.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var u=(c=>{var d=c.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),u)}catch(c){Hx.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return z(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((a=>a!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&At.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&At.G(this.He,e))}Je(){return this.je?this.je:this.qe()?At.W(this.He):null}We(e,a,n){e===this.Le&&a===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=a,this.Le=e,this.Fe.register({[dh]:[a,e,n]}))}Ke(){var e=this.Fe.props[dh];return Oe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&E&&(E.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&At.V(this.Be)},lt(E,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=a||new Date().getTime(),[r,o,i]=this.Ke(),s=this.Je(),l=wn(i)&&i>0&&Math.abs(n-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.De(n,r);c||d||l?(o=this.Ne(),s=this.Ue(),Hx.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=n,u=!0):s||(s=this.Ue(),u=!0);var f=r===0||!e||l?n:r,h=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,f,h),e||this.ze(),u&&this.Oe.forEach((S=>S(o,s,u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:s,sessionStartTimestamp:h,changeReason:u?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var a=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},h3=["$set_once","$set"],ho=pt("[SiteApps]"),$b=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,a){if(a){var n=this.globalsForEvent(a);this.Xe.push(n),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=te._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var a,n,r,o,i,s,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,h]of Object.entries(d))u[f]={id:c[f],type:f,properties:h};var{$set_once:S,$set:x}=e;return{event:Z({},xE(e,h3),{properties:Z({},e.properties,x?{$set:Z({},(a=(n=e.properties)==null?void 0:n.$set)!==null&&a!==void 0?a:{},x)}:{},S?{$set_once:Z({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},S)}:{}),elements_chain:(i=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var a=this.apps[e.id],n=()=>{var s;!a.errored&&this.Xe.length&&(ho.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>a.processEvent==null?void 0:a.processEvent(l))),a.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((s=this.Ze)==null||s.call(this))},r=!1,o=s=>{a.errored=!s,a.loaded=!0,ho.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:s=>{o(s)}});i&&(a.processEvent=i),r=!0}catch(s){ho.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&a.loaded)try{n()}catch(s){ho.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var a of e)this.apps[a.id]={id:a.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ir(e){if(Object.keys(this.apps).length!==0){var a=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(a)}catch(r){ho.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var a,n,r,o=this;if((a=this.siteAppLoaders)!=null&&a.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void ho.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Ze)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(u){var c;te["__$$ph_site_app_"+u]=o._instance,(c=te.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return ho.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else ho.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},CT=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&AA(a,e))return!0;try{var n=t?.userAgentData;if(n!=null&&n.brands&&n.brands.some((r=>AA(r?.brand,e))))return!0}catch{}return!!t.webdriver},Sc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),hE="i.posthog.com",Vb=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,a=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return a||(a=this.apiHost.replace("."+hE,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Sc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Sc.EU:this.er[this.apiHost]=Sc.CUSTOM),this.er[this.apiHost]}endpointFor(e,a){if(a===void 0&&(a=""),a&&(a=a[0]==="/"?a:"/"+a),e==="ui")return this.uiHost+a;if(e==="flags")return this.flagsApiHost+a;if(this.region===Sc.CUSTOM)return this.apiHost+a;var n=hE+a;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}},m3={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&Lh(e.href,t),not_regex:(t,e)=>!!E&&!Lh(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},jb=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),a.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),a.sr=new Map,r.forEach((o=>{if(o.feature_flag_key){var i;a.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.sr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);ft(s)&&o.variants[s]&&a.nr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&a.nr(o.name,l,u.transforms)}}))}),n)},this._instance=e,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Te(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((a=>{var n;if(this.sr&&(n=this.sr)!=null&&n.has(a)){var r,o=this._instance.getFeatureFlag(a),i=(r=this.sr)==null?void 0:r.get(a);o&&i!=null&&i.variants[o]&&this.nr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=yh(e?.search,"__experiment_id"),n=yh(e?.search,"__experiment_variant");a&&n&&(t.rr("previewing web experiments "+a+" && "+n),this.getWebExperiments((r=>{this.lr(parseInt(a),n,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,a,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!a)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var i=o.json.experiments||[];return e(i)}})}lr(e,a,n){var r=n.filter((o=>o.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+a+"]"),this.nr(r[0].name,a,r[0].variants[a].transforms))}static ar(e){return!Te(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Te(e.conditions)||Te((a=e.conditions)==null?void 0:a.url))return!0;var n,r,o,i=t.getWindowLocation();return!!i&&((n=e.conditions)==null||!n.url||m3[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,i))}static getWindowLocation(){return E?.location}static hr(e){var a;if(Te(e.conditions)||Te((a=e.conditions)==null?void 0:a.utm))return!0;var n=lT();if(n.utm_source){var r,o,i,s,l,u,c,d,f=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,h=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==n.utm_source,S=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==n.utm_medium,x=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return f&&S&&x&&h}return!1}static rr(e){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r<a;r++)n[r-1]=arguments[r];$.info("[WebExperiments] "+e,n)}nr(e,a,n){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?n.forEach((r=>{if(r.selector){var o;t.rr("applying transform of variant "+a+" for experiment "+e+" ",r);var i=(o=document)==null?void 0:o.querySelectorAll(r.selector);i?.forEach((s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return Sa&&this._instance?CT(Sa,this._instance.config.custom_blocked_useragents):void 0}},g3=pt("[PostHog ExternalIntegrations]"),v3={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Gb=class{constructor(e){this._instance=e}it(e,a){var n;(n=te.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(r=>{if(r)return g3.error("failed to load script",r);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!r||(s=te.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(v3[i],(()=>{var c;(c=te.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!r&&(l=te.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=te.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;a(n)}}},Zb="[SessionRecording]",hc=pt(Zb),Ah=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw hc.error("started without valid sessionManager"),new Error(Zb+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Zb+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(Ix))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&a&&n&&!r}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var n=!z(Object.assign)&&!z(Array.from);this.cr&&n?(this.gr(e),hc.info("starting")):this.stopRecording()}}gr(e){var a,n,r;this.cr&&(te!=null&&(a=te.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(n=te.__PosthogExtensions__)!=null&&n.initSessionRecording?this._r(e):(r=te.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return hc.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,a;(e=this.pr)==null||e.call(this),this.pr=void 0,(a=this.vr)==null||a.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(EE)}br(e){if(this._instance.persistence){var a,n,r=this._instance.persistence,o=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,s=i?.sampleRate,l=Te(s)?null:parseFloat(s);Te(l)&&this.yr();var u=i?.minimumDurationMilliseconds;r.register({[Ix]:Z({enabled:!!i},i,{networkPayloadCapture:Z({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:z(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.pr)==null||a.call(this),this.pr=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:hc.info("skipping remote config with no sessionRecording",e)}log(e,a){var n;a===void 0&&(a="log"),(n=this.vr)!=null&&n.log?this.vr.log(e,a):hc.warn("log called before recorder was ready")}get mr(){var e,a,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ix);return(n==null||(a=n.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,n;if((a=te.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(n=te.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var a;(a=this.vr)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.vr||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var a,n;this.vr||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.vr)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var n;return!((n=this.vr)==null||!n.tryAddCustomEvent(e,a))}},wc={},Wb=()=>{},Gs="posthog",_T=!o3&&na?.indexOf("MSIE")===-1&&na?.indexOf("Mozilla")===-1,mE=t=>{var e;return Z({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:d4(q?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Wb,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:ra&&ft(ra?.search)&&ra.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(E==null||(e=E.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:a=>{var n="Bad HTTP status: "+a.statusCode+" "+a.text;$.error(n)},get_device_id:a=>a,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Hb},error_tracking:{},_onCapture:Wb,__preview_eager_load_replay:!1},(a=>({rageclick:!(a&&a>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(a&&a>="2025-05-24")||"history_change",session_recording:a&&a>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},gE=t=>{var e={};z(t.process_person)||(e.person_profiles=t.process_person),z(t.xhr_headers)||(e.request_headers=t.xhr_headers),z(t.cookie_name)||(e.persistence_name=t.cookie_name),z(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),z(t.store_google)||(e.save_campaign_params=t.store_google),z(t.verbose)||(e.debug=t.verbose);var a=at({},e,t);return Oe(t.property_blacklist)&&(z(t.property_denylist)?a.property_denylist=t.property_blacklist:Oe(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:$.error("Invalid value for property_denylist config: "+t.property_denylist)),a},Xb=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){$.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Eh=class t{get decideEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,a;return(e=(a=this.featureFlags)==null?void 0:a.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Xb,this.Sr=!1,this.version=ur.LIB_VERSION,this.Er=new Tc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=mE(),this.SentryIntegration=yb,this.sentryIntegration=e=>(function(a,n){var r=jE(a,n);return{name:VE,processEvent:o=>r(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new Mb(this),this.toolbar=new xb(this),this.scrollManager=new qb(this),this.pageViewManager=new kb(this),this.surveys=new Pb(this),this.experiments=new jb(this),this.exceptions=new Rb(this),this.rateLimiter=new Fb(this),this.requestRouter=new Vb(this),this.consent=new mb(this),this.externalIntegrations=new Gb(this),this.people={set:(e,a,n)=>{var r=ft(e)?{[e]:a}:e;this.setPersonProperties(r),n?.({})},set_once:(e,a,n)=>{var r=ft(e)?{[e]:a}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on("eventCaptured",(e=>$.info('send "'+e?.event+'"',e)))}init(e,a,n){if(n&&n!==Gs){var r,o=(r=wc[n])!==null&&r!==void 0?r:new t;return o._init(e,a,n),wc[n]=o,wc[Gs][n]=o,o}return this._init(e,a,n)}_init(e,a,n){var r;if(a===void 0&&(a={}),z(e)||$x(e))return $.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},a.debug=this.Rr(a.debug),this.Ir=a,this.Fr=[],a.person_profiles&&(this.Pr=a.person_profiles),this.set_config(at({},mE(a.defaults),gE(a),{name:n,token:e})),this.config.on_xhr_error&&$.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:fr.GZipJS;var o=this.Cr();this.persistence=new _c(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new _c(Z({},this.config,{persistence:"sessionStorage"}),o);var i=Z({},this.persistence.props),s=Z({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Ub((g=>this.Or(g)),this.config.request_queue_config),this.Ar=new zb(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Ih(this),this.sessionPropsManager=new kh(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):($.info("Initializing extensions synchronously"),this.Dr(l)),ur.DEBUG=ur.DEBUG||this.config.debug,ur.DEBUG&&$.info("Starting in debug mode",{this:this,config:a,thisC:Z({},this.config),p:i,s}),((r=a.bootstrap)==null?void 0:r.distinctID)!==void 0){var u,c,d=this.config.get_device_id(go()),f=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(cr,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this.jr()){var h,S,x=Object.keys(((h=a.bootstrap)==null?void 0:h.featureFlags)||{}).filter((g=>{var v;return!((v=a.bootstrap)==null||(v=v.featureFlags)==null||!v[g])})).reduce(((g,v)=>{var y;return g[v]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[v])||!1,g}),{}),b=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((g=>x[g])).reduce(((g,v)=>{var y,_;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[v]&&(g[v]=(_=a.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[v]),g}),{});this.featureFlags.receivedFeatureFlags({featureFlags:x,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:ic,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(go());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(cr,"anonymous")}return lt(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?D4(this,(()=>this.Lr())):this.Lr(),vo(this.config._onCapture)&&this.config._onCapture!==Wb&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),this.config.ip&&$.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var a=performance.now();this.historyAutocapture=new vb(this),this.historyAutocapture.startIfEnabled();var n=[];n.push((()=>{new bb(this).startIfEnabledOrStop()})),n.push((()=>{var r;this.siteApps=new $b(this),(r=this.siteApps)==null||r.init()})),e||n.push((()=>{this.sessionRecording=new Ah(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||n.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),n.push((()=>{this.autocapture=new db(this),this.autocapture.startIfEnabled()})),n.push((()=>{this.surveys.loadIfEnabled()})),n.push((()=>{this.heatmaps=new Lb(this),this.heatmaps.startIfEnabled()})),n.push((()=>{this.webVitalsAutocapture=new wb(this)})),n.push((()=>{this.exceptionObserver=new gb(this),this.exceptionObserver.startIfEnabled()})),n.push((()=>{this.deadClicksAutocapture=new bh(this,M4),this.deadClicksAutocapture.startIfEnabled()})),n.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(n,a)}Ur(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,a)}),0);var n=e.shift();if(n)try{n()}catch(o){$.error("Error initializing extension:",o)}}var r=Math.round(performance.now()-a);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&$.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var a,n,r,o,i,s,l,u;if(!q||!q.body)return $.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=pe(e.supportedCompression,fr.GZipJS)?fr.GZipJS:pe(e.supportedCompression,fr.Base64)?fr.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){$.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Nb(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&xo(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,a;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(a=this.Ar)==null||a.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(_T?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=wh(e.url,{ip:this.config.ip?1:0}),e.headers=Z({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(a=>{var n,r,o,i=Z({},a);i.timeout=i.timeout||6e4,i.url=wh(i.url,{_:new Date().getTime().toString(),ver:ur.LIB_VERSION,compression:i.compression});var s=(n=i.transport)!==null&&n!==void 0?n:"fetch",l=sh.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(r=(o=kE(l,(c=>c.transport===s)))==null?void 0:o.method)!==null&&r!==void 0?r:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(Z({},e,{callback:a=>{var n,r;this.rateLimiter.checkForLimiting(a),a.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,a)),e.callback==null||e.callback(a)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var a,n=[],r=[],o=[];xo(e,(s=>{s&&(a=s[0],Oe(a)?o.push(s):vo(s)?s.call(this):Oe(s)&&a==="alias"?n.push(s):Oe(s)&&a.indexOf("capture")!==-1&&vo(this[a])?o.push(s):r.push(s))}));var i=function(s,l){xo(s,(function(u){if(Oe(u[0])){var c=l;Pe(u,(function(d){c=c[d[0]].apply(c,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};i(n,this),i(r,this),i(o,this)}jr(){var e,a;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((a=this.config.bootstrap)==null?void 0:a.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,a,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!z(e)&&ft(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){a!=null&&a.$current_url&&!ft(a?.$current_url)&&($.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),a==null||delete a.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,l=n?.timestamp||s,u=go(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,a||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),i&&(c.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),n?.$set&&(c.$set=n?.$set);var d,f=this.qr(n?.$set_once);if(f&&(c.$set_once=f),(c=u4(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,z(n?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===lh.DISMISSED||e===lh.SENT){var h=a?.[dE.SURVEY_ID],S=a?.[dE.SURVEY_ITERATION];d={id:h,current_iteration:S},localStorage.getItem(fE(d))||localStorage.setItem(fE(d),"true"),c.$set=Z({},c.$set,{[u3({id:h,current_iteration:S},e===lh.SENT?"responded":"dismissed")]:!0})}var x=Z({},c.properties.$set,c.$set);if(Zs(x)||this.setPersonPropertiesForFlags(x),!Te(this.config.before_send)){var b=this.Wr(c);if(!b)return;c=b}this.Er.emit("eventCaptured",c);var m={method:"POST",url:(r=n?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Or(m):this.Mr.enqueue(m),c}$.critical("This capture call is ignored due to client rate limiting.")}}else $.error("No event name provided to posthog.capture")}else $.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(a=>e(a.event,a)))}calculateEventProperties(e,a,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return a;var i=o?void 0:this.persistence.remove_event_timer(e),s=Z({},a);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=Z({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!ft(s.distinct_id)&&!wn(s.distinct_id)||$x(s.distinct_id))&&$.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=X4(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&at(s,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&at(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(h=this.Ar)==null?void 0:h.length}catch(m){s.$sdk_debug_error_capturing_properties=String(m)}if(this.requestRouter.region===Sc.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=at(s,u),e==="$pageview"&&q&&(s.title=q.title),!z(i)){var S=n.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}na&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=at({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Oe(this.config.property_denylist)?Pe(this.config.property_denylist,(function(m){delete s[m]})):$.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&($.error("sanitize_properties is deprecated. Use before_send instead"),s=x(s,e));var b=this.Gr();return s.$process_person_profile=b,b&&!o&&this.Vr("_calculate_event_properties"),s}qr(e){var a;if(!this.persistence||!this.Gr()||this.Sr)return e;var n=this.persistence.get_initial_props(),r=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=at({},n,r||{},e||{}),i=this.config.sanitize_properties;return i&&($.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Zs(o)?void 0:o}register(e,a){var n;(n=this.persistence)==null||n.register(e,a)}register_once(e,a,n){var r;(r=this.persistence)==null||r.register_once(e,a,n)}register_for_session(e){var a;(a=this.sessionPersistence)==null||a.register(e)}unregister(e){var a;(a=this.persistence)==null||a.unregister(e)}unregister_for_session(e){var a;(a=this.sessionPersistence)==null||a.unregister(e)}Jr(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){var a=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(a)}catch{return a}}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,a,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,a,n)}getEarlyAccessFeatures(e,a,n){return a===void 0&&(a=!1),this.featureFlags.getEarlyAccessFeatures(e,a,n)}on(e,a){return this.Er.on(e,a)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var a,n;return(a=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&a!==void 0?a:()=>{}}getSurveys(e,a){a===void 0&&(a=!1),this.surveys.getSurveys(e,a)}getActiveMatchingSurveys(e,a){a===void 0&&(a=!1),this.surveys.getActiveMatchingSurveys(e,a)}renderSurvey(e,a){this.surveys.renderSurvey(e,a)}displaySurvey(e,a){a===void 0&&(a=d3),this.surveys.displaySurvey(e,a)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,a){return a===void 0&&(a=!1),this.surveys.canRenderSurveyAsync(e,a)}identify(e,a,n){if(!this.__loaded||!this.persistence)return $.uninitializedWarning("posthog.identify");if(wn(e)&&(e=e.toString(),$.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))$.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==ic){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(mc)&&(this.unregister(mc),this.register({distinct_id:e}));var i=(this.persistence.get_property(cr)||"anonymous")==="anonymous";e!==r&&i?(this.persistence.set_property(cr,"identified"),this.setPersonPropertiesForFlags(Z({},n||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:a||{},$set_once:n||{}}),this.Tr=iE(e,a,n),this.featureFlags.setAnonymousDistinctId(r)):(a||n)&&this.setPersonProperties(a,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(fh))}}else $.critical('The string "'+ic+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else $.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var n=iE(this.get_distinct_id(),e,a);this.Tr!==n?(this.setPersonPropertiesForFlags(Z({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=n):$.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,n){if(e&&a){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Z({},r,{[e]:a})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:a,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===a||n||this.reloadFeatureFlags()}}else $.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0),this.featureFlags.setPersonPropertiesForFlags(e,a)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,n,r,o;if($.info("reset"),!this.__loaded)return $.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(a=this.persistence)==null||a.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(cr,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ic,$device_id:null},"");else{var s=this.config.get_device_id(go());this.register_once({distinct_id:s,$device_id:e?s:i},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,a;return(e=(a=this.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:a,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+a);if(e!=null&&e.withTimestamp&&n){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,a){return e===this.get_property(IE)?($.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(z(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(mc,e),this.capture("$create_alias",{alias:e,distinct_id:a})):($.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=Z({},this.config);if(yt(e)){var n,r,o,i,s;at(this.config,gE(e));var l=this.Cr();(n=this.persistence)==null||n.update_config(this.config,a,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new _c(Z({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);yo(u)&&(this.config.debug=u),yo(this.config.debug)&&(this.config.debug?(ur.DEBUG=!0,Xe.H()&&Xe.G("ph_debug","true"),$.info("set_config",{config:e,oldConfig:a,newConfig:Z({},this.config)})):(ur.DEBUG=!1,Xe.H()&&Xe.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var a=e===!0,n={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,i,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),n.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),n.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,a){var n=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(Z({},r,a))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var a;return(a=this.persistence)==null?void 0:a.props[e]}getSessionProperty(e){var a;return(a=this.sessionPersistence)==null?void 0:a.props[e]}toString(){var e,a=(e=this.config.name)!==null&&e!==void 0?e:Gs;return a!==Gs&&(a=Gs+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(cr))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(cr))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Zs(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[mc])&&((a=this.persistence)==null||(a=a.props)==null||!a[hh]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?($.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(hh,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!a}Kr(){var e,a,n,r,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.wi)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var a;if(this.config.cookieless_mode!=="always"){var n,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(n=this.sessionManager)==null||n.destroy(),this.sessionManager=new Ih(this),this.persistence&&(this.sessionPropsManager=new kh(this,this.sessionManager,this.persistence)),this.sessionRecording=new Ah(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(z(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else $.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:ic,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(a=this.sessionRecording)==null||a.stopRecording(),this.sessionRecording=void 0,this.Hr())):$.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===dr.GRANTED?"granted":e===dr.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return Sa?CT(Sa,this.config.custom_blocked_useragents):void 0}Hr(){q&&(q.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:q.title},{send_instantly:!0}),this.kr&&(q.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),lt(q,"visibilitychange",this.kr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,a,n,r,o,i,s,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",r=!1,o=$,i=(a="advanced_disable_flags")in(e=l)&&!z(e[a]),s=n in e&&!z(e[n]),i?e[a]:s?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+a+"' instead. The old field will be removed in a future major version."),e[n]):r)}Wr(e){if(Te(this.config.before_send))return e;var a=Oe(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of a){if(n=r(n),Te(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return GN(e.event)?$.warn(o+". This can cause unexpected behavior."):$.info(o),null}n.properties&&!Zs(n.properties)||$.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,a){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:a})}captureTraceMetric(e,a,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:a,$ai_metric_value:String(n)})}Rr(e){var a=yo(e)&&!e,n=Xe.H()&&Xe.q("ph_debug")==="true";return!a&&(!!n||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=l4(t.prototype[e[a]])})(Eh,["identify"]);var vE,wT=(vE=wc[Gs]=new Eh,(function(){function t(){t.done||(t.done=!0,_T=!1,Pe(wc,(function(e){e._dom_loaded()})))}q!=null&&q.addEventListener?q.readyState==="complete"?t():lt(q,"DOMContentLoaded",t,{capture:!1}):E&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),vE);var i0=class{constructor(e={}){this.options=e;B(this,"client");B(this,"featureFlagsCallback");B(this,"captureCallback");B(this,"consentUnsub");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),this.consentUnsub=a.subscribe(r=>{r==="granted"?this.client?this.client.opt_in_capturing():this.initPostHog():r==="denied"&&this.client&&this.client.opt_out_capturing()});return}!this.client&&typeof window<"u"&&e.apiKey&&this.initPostHog()}initPostHog(){let e=this.options;if(!e.apiKey)return;let a=e.enableFeatureFlags??!0,n=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=wT.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!a,advanced_disable_feature_flags_on_first_load:!a,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(a&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&r.on("eventCaptured",o=>{let i=typeof o=="string"?o:o?.event,s=typeof o=="string"?void 0:o?.properties;typeof i=="string"&&this.captureCallback?.(i,s)})}},n)}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let a={};for(let[n,r]of Object.entries(e))n.startsWith("in_segment_")&&(a[n]=r===!0);return a}identify(e,a){this.client?.identify(e,a)}alias(e,a){this.client?.alias(e,a)}track(e,a){this.client?.capture(e,a)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,a){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:a})}trackAction(e,a,n){this.track("shadow_canvas_action",{action:e,rectangleId:a,surface:n})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,a,n){let r=`$experiment_${e}`;this.register({[r]:n??`variation_${a}`,[`${r}_id`]:a}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:a,$experiment_variation_name:n??`variation_${a}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function Dh(t={}){return new i0(t)}var s0=async(t,e)=>{let a=[];if(e.applyAction)for(let n of t.actions){let r=await e.applyAction(n);a.push(r)}return{cleanup:async()=>{for(let n=a.length-1;n>=0;n--)try{await a[n].revert()}catch{}}}},l0=async(t,e)=>{let a=[];if(e.applyAction){let n=t.actions.map(r=>e.applyAction(r));if(t.waitFor==="any"){let r=await Promise.race(n);a.push(r);let o=await Promise.allSettled(n);for(let i of o)i.status==="fulfilled"&&i.value!==r&&a.push(i.value)}else{let r=await Promise.all(n);a.push(...r)}}return{cleanup:async()=>{for(let n of a)try{await n.revert()}catch{}}}},u0=async(t,e)=>{let a,n,r=!1,o={cleanup:()=>{r=!0,n&&clearTimeout(n),a&&a()}};return t.event&&e.subscribeEvent?await new Promise(i=>{a=e.subscribeEvent(t.event,()=>{r||i()}),t.durationMs!==void 0&&(n=setTimeout(()=>{r||i()},t.durationMs))}):t.durationMs!==void 0&&await new Promise(i=>{n=setTimeout(()=>{r||i()},t.durationMs)}),o};var Oc=class{constructor(){B(this,"executors",new Map);for(let{kind:e,executor:a}of ry)this.registerCore(e,a);for(let{kind:e,executor:a}of my)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",s0),this.registerCore("core:parallel",l0),this.registerCore("core:wait",u0)}registerCore(e,a,n){this.executors.set(e,{kind:e,executor:a,schema:n,source:"core",isBuiltIn:!0})}register(e,a,n,r="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)return;console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e} (source: ${r})`)}console.log(`[ExecutorRegistry] Registered executor: ${e} (source: ${r})`),this.executors.set(e,{kind:e,executor:a,schema:n,source:r,isBuiltIn:o})}unregister(e){let a=this.executors.get(e);return a?a.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[a,n]of this.executors.entries())n.source===e&&this.executors.delete(a)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let a=[];if(!e||typeof e!="object")return a.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:a,warnings:[]};let{kind:n}=e;if(!n||typeof n!="string")return a.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:a,warnings:[]};let r=this.executors.get(n);if(!r)return a.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${n}`,field:"kind"}),{valid:!1,errors:a,warnings:[]};if(r.schema){let o=r.schema.safeParse(e);if(!o.success){for(let i of o.error.issues)a.push({code:"SCHEMA_VALIDATION_ERROR",message:i.message,field:i.path.join(".")});return{valid:!1,errors:a,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},Ln=new Oc;function LT(t){return Ln.get(t)}function Oh(t){return Ln.has(t)}var y3=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),kT=5e4,IT=50;function hr(t){let e=[],a=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:a};let{kind:n}=t;if(!n||typeof n!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:a};if(!Oh(n)&&n!=="core:mountWidget"){let r=Ln.list();return console.error(`[ActionValidation] Unknown action kind: "${n}". Registered kinds (${r.length}): [${r.join(", ")}]. This usually means the app that provides "${n}" hasn't been activated yet, or the executor was never registered in ExecutorRegistry.`),e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${n}`,field:"kind"}),{valid:!1,errors:e,warnings:a}}switch(n){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":So(t,e,a);break;case"overlays:badge":So(t,e,a),x3(t,e,a);break;case"overlays:tooltip":So(t,e,a),b3(t,e,a);break;case"overlays:modal":R3(t,e,a);break;case"content:insertHtml":So(t,e,a),S3(t,e,a);break;case"content:setText":So(t,e,a),C3(t,e,a);break;case"content:setAttr":So(t,e,a),_3(t,e,a);break;case"content:addClass":case"content:removeClass":So(t,e,a),w3(t,e,a);break;case"content:setStyle":So(t,e,a),L3(t,e,a);break;case"core:mountWidget":k3(t,e,a);break;case"core:wait":I3(t,e,a);break;case"core:sequence":A3(t,e,a);break;case"core:parallel":E3(t,e,a);break;case"core:tour":M3(t,e,a);break;case"navigation:navigate":T3(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function So(t,e,a){let n=t.anchorId;if(!n||typeof n!="object"){e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' object with a 'selector' string",field:"anchorId"});return}if(!n.selector||typeof n.selector!="string"?e.push({code:"MISSING_ANCHOR_SELECTOR",message:"anchorId requires a 'selector' string",field:"anchorId.selector"}):n.selector.length>200&&a.push({code:"LONG_ANCHOR_ID",message:"Anchor selector is unusually long",suggestion:"Consider using a shorter, more descriptive selector"}),n.route===void 0||n.route===null)e.push({code:"MISSING_ANCHOR_ROUTE",message:`anchorId requires a 'route' (string or array of strings). Use "**" for all routes.`,field:"anchorId.route"});else{let r=Array.isArray(n.route)?n.route:[n.route];for(let o of r)if(typeof o!="string"){e.push({code:"INVALID_ANCHOR_ROUTE",message:"anchorId.route must be a string or array of strings",field:"anchorId.route"});break}}}function x3(t,e,a){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&a.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function b3(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function S3(t,e,a){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>kT&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${kT}`,field:"html"});let n=["before","after","prepend","append","replace"];(!t.position||!n.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${n.join(", ")}`,field:"position"})}function C3(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function _3(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(y3.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function w3(t,e,a){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||a.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function L3(t,e,a){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let n=Object.keys(t.styles).length;n>IT&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${n}). Maximum is ${IT}`,field:"styles"});for(let[r,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function k3(t,e,a){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function I3(t,e,a){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function A3(t,e,a){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&a.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let n=0;n<t.actions.length;n++){let r=hr(t.actions[n]);for(let o of r.errors)e.push({...o,field:`actions[${n}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)a.push(o)}}function E3(t,e,a){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&a.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let n=0;n<t.actions.length;n++){let r=hr(t.actions[n]);for(let o of r.errors)e.push({...o,field:`actions[${n}]${o.field?`.${o.field}`:""}`});for(let o of r.warnings)a.push(o)}}function T3(t,e,a){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let n=t.url.trim().toLowerCase();n.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),n.startsWith("data:")&&a.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function R3(t,e,a){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let n=0;n<t.ctaButtons.length;n++){let r=t.ctaButtons[n];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${n} requires 'label' property`,field:`ctaButtons[${n}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${n} requires 'actionId' property`,field:`ctaButtons[${n}].actionId`})}}function M3(t,e,a){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let n=new Set;for(let r=0;r<t.steps.length;r++){let o=t.steps[r];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(n.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${r}].id`}),n.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let i=hr(o.action);for(let s of i.errors)e.push({...s,field:`steps[${r}].action${s.field?`.${s.field}`:""}`});for(let s of i.warnings)a.push(s)}if(o.onAction)for(let[i,s]of Object.entries(o.onAction))s!=="end"&&!t.steps.some(l=>l.id===s)&&a.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${s}`,suggestion:`Make sure step "${s}" exists in the tour`})}}function Bh(t){let e=[],a=[];if(!Array.isArray(t))return console.error("[ActionValidation] validateActions called with non-array:",typeof t),e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:a};for(let n=0;n<t.length;n++){let r=hr(t[n]);if(!r.valid){let o=t[n];console.error(`[ActionValidation] Action [${n}] failed validation:`,`kind="${o?.kind??"undefined"}"`,r.errors.map(i=>`${i.code}: ${i.message}`).join("; "),o)}for(let o of r.errors)e.push({...o,field:o.field?`[${n}].${o.field}`:`[${n}]`});for(let o of r.warnings)a.push({...o,suggestion:o.suggestion?`Action ${n}: ${o.suggestion}`:void 0})}return e.length>0&&console.error(`[ActionValidation] Batch validation failed: ${e.length} error(s) in ${t.length} action(s).`,e.map(n=>`${n.field??"?"}: ${n.message}`).join(" | ")),{valid:e.length===0,errors:e,warnings:a}}var D3=0;function Ph(t){let{overlayRoot:e,eventBus:a,surfaces:n,anchorResolver:r,waitForAnchor:o,adaptiveId:i,executorRegistry:s=Ln,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function f(){return`action-${++D3}`}function h(C,I){a&&a.publish(C,I)}function S(){return{overlayRoot:e,resolveAnchor:r,waitForAnchor:o,generateId:f,publishEvent:h,adaptiveId:i,applyAction:g,subscribeEvent:a?(C,I)=>a.subscribe({names:[C]},w=>I(w.props)):void 0,subscribeNavigation:l}}async function x(C,I){if(!n)throw new Error("Surfaces provider required for core:mountWidget actions");let w=n.mount(C.slot,{type:"widget",widgetId:C.widget.widgetId,config:C.widget.props},{priority:C.widget.priority});return I.publishEvent("action.applied",{id:I.generateId(),kind:"core:mountWidget",slot:C.slot,widgetId:C.widget.widgetId}),{cleanup:()=>{w.unmount()},updateFn:k=>{if("widget"in k&&k.widget){let T=k.widget;T.props&&w.update({type:"widget",widgetId:C.widget.widgetId,config:T.props})}}}}async function b(C,I){if(C.kind==="core:mountWidget")return x(C,I);let w=s.get(C.kind);if(!w){let k="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${C.kind}".`,`Registered: [${k}]`),new Error(`No executor for action kind: ${C.kind}`)}return w(C,I)}function m(C,I,w,k){if(!u)return;let T=[],D=async()=>{let M=c.get(C);if(!M)return;let F=u.evaluateSync(w).value;if(M.state==="applied"&&!F){try{await M.cleanup()}catch(U){console.error(`[ActionEngine] Error reverting conditional action ${C}:`,U)}M.state="deferred",M.cleanup=()=>{},M.updateFn=void 0,h("action.deferred",{id:C,kind:I.kind})}else if(M.state==="deferred"&&F)try{let U=S(),j=await b(I,U);M.state="applied",M.cleanup=j.cleanup,M.updateFn=j.updateFn,M.appliedTs=Date.now(),h("action.applied",{id:C,kind:I.kind,anchorId:"anchorId"in I?I.anchorId:void 0})}catch(U){console.error(`[ActionEngine] Error applying deferred action ${C}:`,U),M.state="failed"}};u.context&&T.push(u.context.subscribe(D)),u.accumulator&&T.push(u.accumulator.subscribe(D)),d.set(C,T)}async function g(C){let I=hr(C);if(!I.valid){let F=I.errors.map(U=>U.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${C?.kind}":`,F,C),new Error(`Action validation failed: ${F}`)}let w=f(),k=C.triggerWhen;if(k&&u&&!u.evaluateSync(k).value){let U={id:w,action:C,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(w,U);let j={id:w,action:C,async revert(){let N=c.get(w);if(!N)return;let X=d.get(w);if(X){for(let ye of X)ye();d.delete(w)}N.state="reverted",c.delete(w)},isApplied(){return c.get(w)?.state==="applied"},async update(N){let X=c.get(w);if(!X||X.state!=="applied")throw new Error("Cannot update action that is not applied");if(X.updateFn)await X.updateFn(N);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(w)?.state??"reverted"}};return m(w,C,k,j),j}let T=S(),D=await b(C,T),M={id:w,action:C,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:D.cleanup,updateFn:D.updateFn};c.set(w,M),h("action.applied",{id:w,kind:C.kind,anchorId:"anchorId"in C?C.anchorId:void 0});let P={id:w,action:C,async revert(){let F=c.get(w);if(!F||F.state!=="applied")return;let U=d.get(w);if(U){for(let j of U)j();d.delete(w)}try{await F.cleanup(),F.state="reverted",h("action.reverted",{id:w,kind:C.kind})}catch(j){console.warn(`[ActionEngine] Cleanup error for ${C.kind} (${w}), ignoring:`,j),F.state="reverted",h("action.reverted",{id:w,kind:C.kind})}finally{c.delete(w)}},isApplied(){return c.get(w)?.state==="applied"},async update(F){let U=c.get(w);if(!U||U.state!=="applied")throw new Error("Cannot update action that is not applied");if(U.updateFn)await U.updateFn(F);else throw new Error(`Action kind ${C.kind} does not support updates`)},getState(){return c.get(w)?.state??"reverted"}};return k&&u&&m(w,C,k,P),P}async function v(C){console.log(`[ActionEngine] applyBatch: ${C.length} action(s)`,C.map(M=>M.kind).join(", "));let I=Bh(C);if(!I.valid){let M=I.errors.map(P=>P.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${C.length} action(s):`,M,`
518
+ Actions:`,C.map((P,F)=>` [${F}] ${P.kind} ${P.anchorId?`anchor="${P.anchorId.selector}"`:""} ${P.label?`label="${P.label}"`:""}`).join(`
519
+ `)),new Error(`Batch validation failed: ${M}`)}let w=f(),k=[],T=[];try{for(let M of C){let P=await g(M);k.push(P),T.push(P)}}catch(M){console.error(`[ActionEngine] Batch apply FAILED at action ${T.length+1}/${C.length}.`,`Successfully applied: ${T.length}. Rolling back...`,M);for(let P of T)try{await P.revert()}catch{}throw M}return{id:w,handles:k,async revertAll(){for(let M=k.length-1;M>=0;M--)try{await k[M].revert()}catch(P){console.error(`[ActionEngine] Error reverting action ${k[M].id}:`,P)}},isApplied(){return k.every(M=>M.isApplied())}}}function y(C){return hr(C)}function _(){return Array.from(c.values()).map(C=>({id:C.id,action:C.action,adaptiveId:C.adaptiveId,appliedTs:C.appliedTs,state:C.state}))}function L(){for(let C of d.values())for(let I of C)try{I()}catch{}d.clear();for(let C of c.values())if(C.state==="applied")try{C.cleanup()}catch(I){console.error("[ActionEngine] Error during cleanup:",I)}c.clear()}return{apply:g,applyBatch:v,validate:y,getActive:_,destroy:L}}var O3=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),Fh=p.object({type:p.literal("page_url"),url:p.string()}),Nh=p.object({type:p.literal("route"),routeId:p.string()}),Hh=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),Uh=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),zh=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),qh=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),$h=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),Vh=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),jh=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),Gh=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),al=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),nl=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),al).optional()}),Zh=p.object({type:p.literal("event_count"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),count:p.number().int().min(0),withinMs:p.number().positive().optional(),counter:nl.optional()}),mr=p.discriminatedUnion("type",[Fh,Nh,Hh,Uh,zh,qh,$h,Vh,jh,Gh,Zh]),rl=p.object({conditions:p.array(mr),value:p.unknown()}),ol=p.object({type:p.literal("rules"),rules:p.array(rl),default:p.unknown()}),il=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),sl=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),ll=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),ul=p.discriminatedUnion("type",[ol,il,sl,ll]),Bc=ul.nullable().optional(),B3=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),P3=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var c0=p.object({include:p.array(p.string()).optional().describe("URL patterns where this tile appears. Supports *, **, :param wildcards. Use sparingly \u2014 mostly to isolate to specific webapp functionality. Omit to appear on all routes."),exclude:p.array(p.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),Pc=p.object({routes:c0,onlyIfPopulated:p.boolean().optional().describe("When true, tile is hidden if none of its props.actions[] have an active triggerWhen. Useful for tiles with all-deferred FAQ questions or nav tips. Default: false.")});function F3(t){return mr.safeParse(t)}function N3(t){return ul.safeParse(t)}function H3(t){return Pc.safeParse(t)}var U3=[{defName:"matchOp",schema:al},{defName:"counterDef",schema:nl},{defName:"activationConfig",schema:Pc},{defName:"routeFilter",schema:c0},{defName:"ruleStrategy",schema:ol},{defName:"scoreStrategy",schema:il},{defName:"modelStrategy",schema:sl},{defName:"externalStrategy",schema:ll},{defName:"rule",schema:rl},{defName:"condition",schema:mr}];var d0=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),z3=p.object({on:p.string(),title:p.string(),body:p.string().optional(),icon:p.string().optional(),ttl:p.number().optional(),cooldown:p.number().optional(),deepLink:d0.optional()}).strict(),q3=p.object({id:p.string(),title:p.string().optional(),subtitle:p.string().optional(),icon:p.string().optional(),priority:p.number().optional(),widget:p.string(),props:p.record(p.unknown()).optional(),activation:Pc.optional(),notifications:p.array(z3).optional()}).strict(),$3=p.object({position:p.enum(["left","right"]).optional(),layout:p.enum(["overlay","push"]).optional(),background:p.string().optional(),blur:p.string().optional(),border:p.string().optional(),width:p.string().optional(),transitionDuration:p.string().optional(),transitionEasing:p.string().optional(),transitionFade:p.string().optional()}),V3=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),color:p.string().optional(),size:p.string().optional(),shadow:p.string().optional(),borderRadius:p.string().optional()}),j3=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),shadow:p.string().optional(),titleColor:p.string().optional(),textColor:p.string().optional(),iconBackground:p.string().optional(),iconShadow:p.string().optional(),headerPadding:p.string().optional(),bodyPadding:p.string().optional(),gap:p.string().optional()}),G3=p.object({background:p.string().optional(),textColor:p.string().optional(),titleColor:p.string().optional(),arrowColor:p.string().optional(),arrowSize:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),scrimOpacity:p.string().optional(),highlightRing:p.string().optional()}),Z3=p.object({background:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),successColor:p.string().optional(),warningColor:p.string().optional(),errorColor:p.string().optional(),iconBackground:p.string().optional(),progressGradient:p.string().optional()}),W3=p.object({background:p.string().optional(),backgroundHover:p.string().optional(),border:p.string().optional(),borderRadius:p.string().optional(),textColor:p.string().optional(),textSecondaryColor:p.string().optional(),itemDivider:p.string().optional(),itemGap:p.string().optional(),itemPadding:p.string().optional(),itemFontSize:p.string().optional(),bodyPadding:p.string().optional(),bodyFontSize:p.string().optional(),categoryPadding:p.string().optional(),categoryGap:p.string().optional(),categoryFontSize:p.string().optional(),searchBackground:p.string().optional(),searchColor:p.string().optional(),chevronColor:p.string().optional()}),X3=p.object({mode:p.enum(["dark","light"]).optional(),fontFamily:p.string().optional(),colorPrimary:p.string().optional(),colorPrimaryHover:p.string().optional(),borderRadius:p.string().optional(),canvas:$3.optional(),launcher:V3.optional(),tile:j3.optional(),overlay:G3.optional(),notification:Z3.optional(),content:W3.optional()}).strict(),Y3=p.object({enabled:p.boolean().optional(),label:p.string().optional(),icon:p.string().optional(),position:p.string().optional(),animate:p.boolean().optional(),animationStyle:p.enum(["pulse","bounce","glow"]).optional(),notificationCount:p.number().optional()}).strict(),jV=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(q3),actions:p.array(p.any()),theme:X3.optional(),launcher:Y3.optional(),meta:p.object({verificationSteps:p.array(p.union([p.string(),p.object({text:p.string(),check:mr.optional()})])).optional()}).passthrough().optional()}).strict();var xt={triggerWhen:Bc},Ca=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),f0=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),p0=p.enum(["top-left","top-right","bottom-left","bottom-right"]),h0=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),Xh=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),m0=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(Xh).optional()}).strict(),g0=p.object({title:p.string().optional(),body:p.string()}).strict(),v0=p.enum(["before","after","prepend","append","replace"]),y0=p.enum(["immediate","hover","click"]),x0=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),b0=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),S0=p.enum(["auto","smooth","instant"]),Wh=p.enum(["start","center","end","nearest"]),C0=p.object({kind:p.literal("content:setText"),anchorId:Ca,text:p.string(),label:p.string().optional()}).extend(xt).strict(),_0=p.object({kind:p.literal("content:setAttr"),anchorId:Ca,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(xt).strict(),w0=p.object({kind:p.literal("content:addClass"),anchorId:Ca,className:p.string(),label:p.string().optional()}).extend(xt).strict(),L0=p.object({kind:p.literal("content:removeClass"),anchorId:Ca,className:p.string(),label:p.string().optional()}).extend(xt).strict(),k0=p.object({kind:p.literal("content:setStyle"),anchorId:Ca,styles:p.record(p.string()),label:p.string().optional()}).extend(xt).strict(),I0=p.object({kind:p.literal("content:insertHtml"),anchorId:Ca,html:p.string(),position:v0,deepLink:d0.optional(),label:p.string().optional()}).extend(xt).strict(),A0=p.object({kind:p.literal("overlays:highlight"),anchorId:Ca,style:f0.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(xt).strict(),E0=p.object({kind:p.literal("overlays:pulse"),anchorId:Ca,duration:p.number().optional(),label:p.string().optional()}).extend(xt).strict(),T0=p.object({kind:p.literal("overlays:badge"),anchorId:Ca,content:p.string(),position:p0.optional(),label:p.string().optional()}).extend(xt).strict(),R0=p.object({kind:p.literal("overlays:tooltip"),anchorId:Ca,content:m0,trigger:y0.optional(),placement:h0.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(xt).strict(),M0=p.object({kind:p.literal("overlays:modal"),content:g0,size:p.enum(["sm","md","lg"]).optional(),blocking:p.boolean().optional(),scrim:p.object({opacity:p.number().min(0).max(1).optional()}).strict().optional(),dismiss:p.object({onEsc:p.boolean().optional(),closeButton:p.boolean().optional(),timeoutMs:p.number().min(0).optional()}).strict().optional(),ctaButtons:p.array(Xh).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(xt).strict(),D0=p.object({kind:p.literal("navigation:scrollTo"),anchorId:Ca,behavior:S0.optional(),block:Wh.optional(),inline:Wh.optional(),label:p.string().optional()}).extend(xt).strict(),O0=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(xt).strict(),B0=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:x0,label:p.string().optional()}).extend(xt).strict(),P0=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(xt).strict(),F0=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(xt).strict(),N0=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(xt).strict(),H0=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(b0).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(xt).passthrough(),AT=[{defName:"setText",schema:C0},{defName:"setAttr",schema:_0},{defName:"addClass",schema:w0},{defName:"removeClass",schema:L0},{defName:"setStyle",schema:k0},{defName:"insertHtml",schema:I0},{defName:"highlight",schema:A0},{defName:"pulse",schema:E0},{defName:"badge",schema:T0},{defName:"tooltip",schema:R0},{defName:"modal",schema:M0},{defName:"scrollTo",schema:D0},{defName:"navigate",schema:O0},{defName:"mountWidget",schema:B0},{defName:"wait",schema:P0},{defName:"sequence",schema:F0},{defName:"parallel",schema:N0},{defName:"tour",schema:H0}];function Yh(t){let e=t?.root??(typeof document<"u"?document.body:null),a=t?.defaultTimeoutMs??5e3,n=new Map,r=new Map,o=null,i=!1;function s(b){if(!e)return null;try{return e.matches(b)?e:e.querySelector(b)}catch{return null}}function l(){for(let[b,m]of n){let g=s(b);if(g){for(let v of m)clearTimeout(v.timer),v.resolve(g);n.delete(b)}}for(let[b,m]of r){let g=s(b);if(g){for(let v of m)v.cancelled||v.cb(g);r.delete(b)}}n.size===0&&r.size===0&&c()}function u(){o||i||typeof MutationObserver>"u"||!e||(o=new MutationObserver(()=>{l()}),o.observe(e,{childList:!0,subtree:!0}))}function c(){o&&(o.disconnect(),o=null)}function d(b,m){let g=n.get(b);g&&(g.delete(m),g.size===0&&n.delete(b)),n.size===0&&r.size===0&&c()}function f(b,m){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let g=s(b);if(g)return Promise.resolve(g);let v=m??a;return new Promise((y,_)=>{let L={resolve:y,reject:_,timer:setTimeout(()=>{d(b,L),_(new Error(`waitFor("${b}") timed out after ${v}ms`))},v)},C=n.get(b);C||(C=new Set,n.set(b,C)),C.add(L),u()})}function h(b,m){if(i)return()=>{};let g=s(b);if(g)return m(g),()=>{};let v={cb:m,cancelled:!1},y=r.get(b);return y||(y=new Set,r.set(b,y)),y.add(v),u(),()=>{v.cancelled=!0;let _=r.get(b);_&&(_.delete(v),_.size===0&&r.delete(b)),n.size===0&&r.size===0&&c()}}function S(){let b=0;for(let m of n.values())b+=m.size;return b}function x(){i=!0,c();let b=new Error("AnchorResolver destroyed");for(let m of n.values())for(let g of m)clearTimeout(g.timer),g.reject(b);n.clear(),r.clear()}return{resolve:s,waitFor:f,onAppear:h,pendingCount:S,destroy:x}}function K3(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function U0(t,e){if(!e)return;let a;try{a=new URL(t).pathname}catch{a=t}if(e.exclude){for(let n of e.exclude)if(ET(a,n))return}if(e.include){for(let n of e.include)if(ET(a,n))return n;return}return a}function ET(t,e){let a=t.replace(/\/$/,"")||"/",n=e.replace(/\/$/,"")||"/";if(a===n)return!0;let r=n.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(a)}var Fc=class{constructor(e){B(this,"context");B(this,"previousContext");B(this,"listeners",new Set);B(this,"telemetry");B(this,"routes");B(this,"navigation");B(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.navigation=e.navigation,this.context=K3(),this.previousContext={...this.context},e.telemetry?.getSessionId){let a=e.telemetry.getSessionId();a&&(this.context.session.sessionId=a)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=U0(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let a=U0(this.context.page.url,this.routes);a!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:a}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,a=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",a),this.cleanupFns.push(()=>window.removeEventListener("resize",a));let n=this.navigation.subscribe(()=>this.updatePage());this.cleanupFns.push(n)}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,{title:a}=document,n=U0(e,this.routes),r={url:e,title:a,routeId:n};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let a={url:e,ts:Date.now()},n=[...this.context.session.pageHistory||[],a];n.length>50&&n.shift(),this.context.session.pageHistory=n}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(a){console.error("[ContextManager] Listener error:",a)}}};function Kh(t){return new Fc(t)}var TT=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),RT=p.object({url:p.string(),ts:p.number()}),MT=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(RT).optional()}),DT=p.object({width:p.number(),height:p.number()}),OT=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),BT=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:OT.optional()}),PT=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),FT=p.object({page:TT,session:MT,viewport:DT,anchors:p.array(BT).optional(),augmented:PT.optional()});function Q3(t){return FT.safeParse(t)}function z0(t,e){let{context:a,state:n,events:r}=e;switch(t.type){case"page_url":{let{url:o}=t,i=a.page.url.split("?")[0].split("#")[0],s=o.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");return new RegExp(`^${s}$`).test(i)}case"route":return a.page.routeId===t.routeId;case"anchor_visible":{let o=a.anchors?.find(i=>i.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let o=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,o)}case"state_equals":return n?.getValue?n.getValue(t.key)===t.value:!1;case"viewport":{let{width:o,height:i}=a.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&i<t.minHeight||t.maxHeight!==void 0&&i>t.maxHeight)}case"session_metric":{if(!n)return!1;let o=n.getSessionMetric(t.key),{operator:i,threshold:s}=t;switch(i){case"gte":return o>=s;case"lte":return o<=s;case"eq":return o===s;case"gt":return o>s;case"lt":return o<s;default:return!1}}case"dismissed":{if(!n)return t.inverted??!1;let o=n.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!n)return t.inverted??!1;let o=n.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!n)return t.inverted??!1;let i=n.getFrequencyCount(t.key)>=t.limit;return t.inverted?!i:i}case"event_count":{if(!e.accumulator)return!1;let o=t,i=e.accumulator.getCount(o.key,o.withinMs);switch(o.operator){case"gte":return i>=o.count;case"lte":return i<=o.count;case"eq":return i===o.count;case"gt":return i>o.count;case"lt":return i<o.count;default:return!1}}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function q0(t,e){let a=[];for(let n of t.conditions){let r=z0(n,e);if(a.push({condition:n,result:r}),!r)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function Nc(t,e){for(let a=0;a<t.rules.length;a++){let n=t.rules[a],{matched:r,conditionResults:o}=q0(n,e);if(r)return{value:n.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:a,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function Hc(t,e){let{context:a}=e,n=a.augmented?.[t.field];return n===void 0||typeof n!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:n>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function NT(t,e){let{state:a,events:n,sessionMetrics:r,accumulator:o}=e;return{context:t,state:a?{isDismissed:i=>a.dismissals.isDismissed(i),isCooldownActive:i=>a.cooldowns.isActive(i),getFrequencyCount:i=>a.frequency.count(i),getSessionMetric:i=>r?.get(i)??0,getValue:i=>a.session.get(i)??a.user.get(i)}:void 0,events:n?{hasRecentEvent:(i,s)=>n.hasRecentEvent(i,s)}:void 0,accumulator:o?{getCount:(i,s)=>o.getCount(i,s)}:void 0}}async function $0(t,e,a={}){let n=NT(e,a);switch(t.type){case"rules":return Nc(t,n);case"score":return Hc(t,n);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function V0(t,e,a={}){let n=NT(e,a);switch(t.type){case"rules":return Nc(t,n);case"score":return Hc(t,n);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Qh(t){return{evaluate:(e,a)=>$0(e,a,t),evaluateSync:(e,a)=>V0(e,a,t)}}function Jh(t){let{eventBus:e,stateStore:a}=t,n=new Map,r=new Set,o=null,i=a.ns("accumulator");function s(u){let c=!1;for(let d of n.values()){if(!d.predicate(u))continue;let f=i.get(d.stateKey)||{count:0};f.count++,d.needsTimestamps&&(f.timestamps||(f.timestamps=[]),f.timestamps.push(u.ts),f.timestamps.length>200&&(f.timestamps=f.timestamps.slice(-200))),i.set(d.stateKey,f),c=!0}if(c)for(let d of r)try{d()}catch(f){console.error("[EventAccumulator] Subscriber error:",f)}}function l(){o||n.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let f=`ev:${u}`,h=n.get(f);if(h){d&&!h.needsTimestamps&&(h.needsTimestamps=!0);return}n.set(f,{stateKey:f,needsTimestamps:d,predicate:c}),l()},getCount(u,c){let d=`ev:${u}`,f=i.get(d);if(!f)return 0;if(c===void 0||!f.timestamps)return f.count;let h=Date.now()-c;return f.timestamps.filter(S=>S>=h).length},subscribe(u){return r.add(u),()=>{r.delete(u)}},destroy(){o&&(o(),o=null),n.clear(),r.clear()}}}function j0(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(n=>{try{return new RegExp(n).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Uc=class{constructor(e={}){B(this,"subscriptions",new Set);B(this,"history",[]);B(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,a){let n,r;typeof e=="function"?(n=void 0,r=e):(n=e,r=a);let o={filter:n,callback:r};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,a,n="canvas"){let r={ts:Date.now(),name:e,source:n,props:a,schemaVersion:ei};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(j0(e,a.filter))try{a.callback(e)}catch(n){console.error("[EventBus] Subscriber error:",n)}}getRecent(e,a){let n=this.history;return e&&(n=n.filter(r=>j0(r,e))),a&&a>0&&(n=n.slice(-a)),n}hasRecentEvent(e,a,n){let r=Date.now()-a;return this.history.some(o=>o.name===e&&o.ts>=r&&(n===void 0||o.source===n))}countRecentEvents(e,a){let n=this.history.filter(r=>j0(r,e));if(a!==void 0){let r=Date.now()-a;n=n.filter(o=>o.ts>=r)}return n.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function cl(t={}){return new Uc(t)}var HT={$autocapture:"ui.click",$click:Ce.UI_CLICK,$scroll:Ce.UI_SCROLL,$input:Ce.UI_INPUT,$change:Ce.UI_CHANGE,$submit:Ce.UI_SUBMIT,$pageview:Ce.NAV_PAGE_VIEW,$pageleave:Ce.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function J3(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(HT[e])return HT[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,n=t.properties?.$event_type;return n==="submit"?Ce.UI_SUBMIT:n==="change"?Ce.UI_CHANGE:a==="input"||a==="textarea"?Ce.UI_INPUT:Ce.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}var UT=new Set(["a","button","input","select","textarea"]);function eH(t,e){if(e&&UT.has(e)||!t)return e;for(let a of t){let n=a.tag_name;if(n&&UT.has(n))return n}return e}function tH(t){let e={},a=t.properties||{},n=a.$elements,r=a.$tag_name??n?.[0]?.tag_name,o=t.event==="$autocapture"||t.event==="$click";return e.tagName=o?eH(n,r):r,a.$el_text&&(e.elementText=a.$el_text),n&&(e.elements=n),a.$current_url&&(e.url=a.$current_url),a.$pathname&&(e.pathname=a.$pathname),a.$host&&(e.host=a.$host),a.$viewport_width&&(e.viewportWidth=a.$viewport_width),a.$viewport_height&&(e.viewportHeight=a.$viewport_height),a.$session_id&&(e.sessionId=a.$session_id),a.$scroll_depth&&(e.scrollDepth=a.$scroll_depth),a.$scroll_percentage&&(e.scrollPercentage=a.$scroll_percentage),e.originalEvent=t.event,e}function G0(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:J3(t),source:"posthog",props:tH(t),schemaVersion:ei}}function Z0(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function em(t){return(e,a)=>{if(typeof e!="string")return;let n={event:e,properties:a,timestamp:Date.now()};if(Z0(n)){let r=G0(n);t(r)}}}var W0=p.enum(["posthog","canvas","derived"]),zT=p.object({ts:p.number(),name:p.string(),source:W0,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),qT=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(W0).optional()});function aH(t){return zT.safeParse(t)}function nH(t){return qT.safeParse(t)}var dl=class{constructor(){B(this,"listeners",new Set);B(this,"capturedPushState");B(this,"capturedReplaceState");B(this,"wasNative");B(this,"destroyed",!1);B(this,"onPopState",()=>{this.notify(window.location.href,"popstate")});this.wasNative=this.isNativeFunction(history.pushState),this.capturedPushState=history.pushState,this.capturedReplaceState=history.replaceState,history.pushState=(...e)=>{this.capturedPushState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"pushState"))},history.replaceState=(...e)=>{this.capturedReplaceState.call(history,...e),queueMicrotask(()=>this.notify(window.location.href,"replaceState"))},window.addEventListener("popstate",this.onPopState)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}diagnose(){return{isNative:this.wasNative,subscriberCount:this.listeners.size}}destroy(){this.destroyed||(this.destroyed=!0,history.pushState=this.capturedPushState,history.replaceState=this.capturedReplaceState,window.removeEventListener("popstate",this.onPopState),this.listeners.clear())}notify(e,a){if(!this.destroyed)for(let n of this.listeners)try{n(e,a)}catch{}}isNativeFunction(e){try{return Function.prototype.toString.call(e).includes("[native code]")}catch{return!1}}};var X0="cooldown:";function $T(t){return{set(e,a){let n=X0+e,r=Date.now()+a;t.set(n,r)},isActive(e){return this.remaining(e)>0},remaining(e){let a=X0+e,n=t.get(a);if(n===void 0)return 0;let r=n-Date.now();return r<=0?(t.remove(a),0):r},clear(e){let a=X0+e;t.remove(a)}}}var zc="dismissed:";function VT(t,e){return{mark(a,n=!1){let r=zc+a;(n?e:t).set(r,!0)},isDismissed(a){let n=zc+a;return t.has(n)||e.has(n)},clear(a){let n=zc+a;t.remove(n),e.remove(n)},clearAll(){for(let a of t.keys())a.startsWith(zc)&&t.remove(a);for(let a of e.keys())a.startsWith(zc)&&e.remove(a)}}}var Y0="freq:";function jT(t){function e(a){let n=Y0+a,r=t.get(n);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(n);return}return r}}return{increment(a,n){let r=Y0+a,o=e(a),i=(o?.count??0)+1,s={count:i,resetAt:o?.resetAt??(n?Date.now()+n:void 0)};return t.set(r,s),i},count(a){return e(a)?.count??0},reset(a){let n=Y0+a;t.remove(n)},hasReachedLimit(a,n){return this.count(a)>=n}}}var rH="syntro";function K0(t,e){let a=`${e}:`;return{get(n){if(t)try{let r=t.getItem(a+n);if(!r)return;let o=JSON.parse(r);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(a+n);return}return o.value}catch{return}},set(n,r,o){if(t)try{let i={value:r,expiresAt:o?Date.now()+o:void 0};t.setItem(a+n,JSON.stringify(i))}catch(i){console.warn("[StateStore] Failed to save:",i)}},remove(n){t&&t.removeItem(a+n)},has(n){return t?this.get(n)!==void 0:!1},keys(){if(!t)return[];let n=[];for(let r=0;r<t.length;r++){let o=t.key(r);o?.startsWith(a)&&n.push(o.slice(a.length))}return n},clear(){if(!t)return;let n=this.keys();for(let r of n)t.removeItem(a+r)}}}function qc(t){let e=new Map,a=`${t}:`;return{get(n){let r=e.get(a+n);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(a+n);return}return r.value}},set(n,r,o){e.set(a+n,{value:r,expiresAt:o?Date.now()+o:void 0})},remove(n){e.delete(a+n)},has(n){return this.get(n)!==void 0},keys(){let n=[];for(let r of e.keys())r.startsWith(a)&&n.push(r.slice(a.length));return n},clear(){for(let n of e.keys())n.startsWith(a)&&e.delete(n)}}}var $c=class{constructor(e={}){B(this,"session");B(this,"user");B(this,"dismissals");B(this,"cooldowns");B(this,"frequency");B(this,"namespace");B(this,"namespacedStorages",new Map);this.namespace=e.namespace??rH;let a=n=>typeof n=="object"&&n!==null&&typeof n.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?K0(window.sessionStorage,this.namespace):qc(this.namespace),this.user=a(window.localStorage)?K0(window.localStorage,this.namespace):qc(this.namespace)):(this.session=qc(this.namespace),this.user=qc(this.namespace)),this.dismissals=VT(this.session,this.user),this.cooldowns=$T(this.user),this.frequency=jT(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let n=typeof window<"u"&&typeof sessionStorage<"u"?K0(sessionStorage,a):qc(a);this.namespacedStorages.set(a,n)}return this.namespacedStorages.get(a)}};function tm(t={}){return new $c(t)}function fl(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Vc(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var Q0={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},pl={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},GT={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function am(t,e,a){let n=Q0[e];Object.assign(t.style,n),a&&(a.maxWidth&&(t.style.maxWidth=a.maxWidth),a.maxHeight&&(t.style.maxHeight=a.maxHeight),a.minWidth&&(t.style.minWidth=a.minWidth),a.minHeight&&(t.style.minHeight=a.minHeight))}function nm(t,e,a){let n=a.placement==="auto"?"bottom":a.placement,r=[Nf(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&r.push(Uf()),a.shift!==!1&&r.push(Hf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Ff(e,t,async()=>{let{x:i,y:s,strategy:l}=await zf(e,t,{placement:n,middleware:r});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function rm(t,e,a="append"){return t.style.position="relative",t.style.display="inline-block",a==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function om(t,e){return e==="none"||pl[e].length===0?null:t.animate(pl[e],GT)}function im(t,e){if(e==="none"||pl[e].length===0)return Promise.resolve();let a=[...pl[e]].reverse(),n=t.animate(a,GT);return new Promise(r=>{n.onfinish=()=>r(),n.oncancel=()=>r()})}function sm(t,e){let a=document.createElement("div");return a.setAttribute("data-syntro-surface",t),a.setAttribute("data-syntro-mount-id",e),a.className="syntro-surface",Object.assign(a.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),a}function lm(t){switch(fl(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}function ZT(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),u=document.createElement("div");return u.append(l),u.innerHTML}catch{}let a=document.createElement("template");a.innerHTML=t;let n=a.content,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),i=[];for(;r.nextNode();){let s=r.currentNode,l=s.tagName.toLowerCase();if(!o.has(l)){i.push(s);continue}for(let u of Array.from(s.attributes)){let c=u.name.toLowerCase(),d=u.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&d.startsWith("javascript:");(f||h)&&s.removeAttribute(u.name)}}for(let s of i){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML=(n.firstChild,a.innerHTML)}var oH=0;function um(t){let{overlayRoot:e,eventBus:a,anchorResolver:n,defaultAnimation:r="fade",widgetRegistry:o}=t,i=new Map,s=new Map,l=new Map;function u(){return`mount-${++oH}`}function c(y,_){a&&a.publish(y,_)}function d(y){let _=l.get(y);if(_){let L=b(y);for(let C of _)try{C(L)}catch(I){console.error("[Surfaces] State callback error:",I)}}}let f=new Map;function h(y,_,L){switch(_.type){case"html":y.innerHTML=ZT(_.content);return;case"widget":{if(o?.has(_.widgetId)){let C=o.mount(_.widgetId,y,_.config);return L&&f.set(L,C),()=>{C.unmount(),L&&f.delete(L)}}console.warn(`[Surfaces] Widget not found: ${_.widgetId}`),y.innerHTML=`<div data-widget-id="${_.widgetId}" data-widget-missing="true">Widget: ${_.widgetId}</div>`;return}case"custom":return _.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(y,_,L){let C=u(),I=fl(y),w=L?.priority??0,k=L?.animation??r,T=L?.exclusive??!0,D=i.get(y);if(D&&T){if(D.options.priority>w)throw new Error(`Slot ${y} is occupied by higher priority content (${D.options.priority} > ${w})`);x(D)}let M=sm(y,C);M.style.zIndex=String(lm(y));let P;if(I==="static")am(M,y,L?.constraints),e.appendChild(M);else if(I==="inline"){let N=Vc(y);if(!N)throw new Error(`Invalid inline slot: ${y}`);if(!n)throw new Error("Anchor resolver required for inline slots");let X=n({selector:N,route:"**"});if(!X)throw new Error(`Anchor not found for inline slot: ${N}`);P=rm(M,X)}else if(I==="adjacent"){let N=Vc(y);if(!N)throw new Error(`Invalid adjacent slot: ${y}`);if(!n)throw new Error("Anchor resolver required for adjacent slots");let X=n({selector:N,route:"**"});if(!X)throw new Error(`Anchor not found for adjacent slot: ${N}`);e.appendChild(M),P=nm(M,X,L?.position??{placement:"bottom"})}let F=h(M,_,C);om(M,k);let U={id:C,slot:y,content:_,options:{priority:w,exclusive:T,animation:k,position:L?.position??{placement:"auto"},constraints:L?.constraints??{},adaptiveId:L?.adaptiveId,autoUnmountOnRouteChange:L?.autoUnmountOnRouteChange??!0},container:M,cleanup:()=>{P?.(),F?.()},mountedAt:Date.now()};return i.set(y,U),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:C,adaptiveId:L?.adaptiveId}),d(y),{id:C,update(N){let X=i.get(y);if(!X||X.id!==C)throw new Error("Mount no longer active");let ye=f.get(C);if(ye){if(N.type==="widget"){ye.update(N.config),X.content=N;return}ye.unmount(),f.delete(C)}X.container.innerHTML="";let qa=h(X.container,N,C);if(X.content=N,qa){let ht=X.cleanup;X.cleanup=()=>{ht?.(),qa()}}},setOptions(N){let X=i.get(y);if(!X||X.id!==C)throw new Error("Mount no longer active");N.priority!==void 0&&(X.options.priority=N.priority),N.animation!==void 0&&(X.options.animation=N.animation),N.constraints&&I==="static"&&(N.constraints.maxWidth&&(X.container.style.maxWidth=N.constraints.maxWidth),N.constraints.maxHeight&&(X.container.style.maxHeight=N.constraints.maxHeight),N.constraints.minWidth&&(X.container.style.minWidth=N.constraints.minWidth),N.constraints.minHeight&&(X.container.style.minHeight=N.constraints.minHeight)),d(y)},async unmount(){let N=i.get(y);!N||N.id!==C||await x(N)},isMounted(){return i.get(y)?.id===C},getContainer(){let N=i.get(y);return N?.id===C?N.container:null}}}async function x(y){y.container.isConnected&&await im(y.container,y.options.animation);try{y.cleanup?.()}catch(_){console.warn("[Surfaces] Cleanup error during unmount, ignoring:",_)}try{y.container.remove()}catch{}i.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),d(y.slot)}function b(y){let _=i.get(y);return{slot:y,occupied:!!_,currentPriority:_?.options.priority,currentAdaptiveId:_?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:_?.id}}function m(y,_){let L=l.get(y);return L||(L=new Set,l.set(y,L)),L.add(_),()=>{L?.delete(_),L?.size===0&&l.delete(y)}}function g(y,_){let L=i.get(y);return L?_!==void 0?_>=L.options.priority:!1:!0}function v(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(_){console.error("[Surfaces] Error during cleanup:",_)}i.clear(),l.clear()}return{mount:S,getState:b,onStateChange:m,canMount:g,destroy:v}}var jc=class{constructor(){B(this,"widgets",new Map);B(this,"mountedWidgets",new Map);B(this,"mountIdCounter",0);B(this,"runtimeRef");B(this,"listeners",new Set)}bindRuntime(e){this.runtimeRef=e}register(e,a,n="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:a,source:n,metadata:r}),this.notify({type:"registered",widgetId:e})}unregister(e){let a=this.widgets.get(e);return a?a.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),this.notify({type:"unregistered",widgetId:e}),!0):!1}unregisterBySource(e){for(let[a,n]of this.widgets.entries())n.source===e&&this.widgets.delete(a)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,a,n){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;a.setAttribute("data-widget-mount-id",o),a.setAttribute("data-widget-id",e);let i={...n,runtime:this.runtimeRef},s=r.widget.mount(a,i);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:a}),{widgetId:e,container:a,unmount:()=>{let u=this.mountedWidgets.get(o);u&&(a.isConnected&&u.cleanup?.(),this.mountedWidgets.delete(o),a.removeAttribute("data-widget-mount-id"),a.removeAttribute("data-widget-id"),a.innerHTML="")},update:u=>{if(r.widget.update)r.widget.update(a,u);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),a.innerHTML="";let d={...u,runtime:this.runtimeRef},f=r.widget.mount(a,d);c.cleanup=f??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(a=>a.source===e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){for(let a of this.listeners)try{a(e)}catch(n){console.error("[WidgetRegistry] Listener error:",n)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},cm=new jc;var eS="2.0.0";function iH(t,e){if(!e)return!0;let a;try{a=new URL(t).pathname}catch{a=t}let n=a.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(J0(n,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(J0(n,r))return!0;return!1}return!0}function J0(t,e){let a=e.replace(/\/$/,"")||"/";if(t===a)return!0;let n=a.replace(/\*\*/g,"\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${n}$`).test(t)}function WT(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(r=>J0(a,r))}function dm(t={}){let{telemetry:e,sessionMetrics:a,routes:n,mode:r="production",namespace:o}=t,i=t.widgets??cm,s=t.executors??Ln,l=t.apps??bs,u=new dl,c=Kh({telemetry:e,routes:n,navigation:u}),d=t.events??cl(),f=tm({namespace:o}),h=Jh({eventBus:d,stateStore:f}),S=Qh({state:f,events:d,sessionMetrics:a,accumulator:h}),x=Jk(),b=Yh(),m=C=>WT(C)?b.resolve(C.selector):null,g=async(C,I)=>{if(!WT(C))return null;try{return await b.waitFor(C.selector,I)}catch{return null}},v=um({overlayRoot:x,eventBus:d,anchorResolver:m,widgetRegistry:i}),y=Ph({overlayRoot:x,eventBus:d,surfaces:v,anchorResolver:m,waitForAnchor:g,executorRegistry:s,subscribeNavigation:C=>u.subscribe(C),runtime:{evaluateSync:C=>S.evaluateSync(C,c.get()),context:c,accumulator:h}}),_;if(a){a.increment("page_views");let C=typeof window<"u"?window.location.pathname:"/";_=u.subscribe((I,w)=>{if(w!=="replaceState")try{let k=new URL(I).pathname;k!==C&&(C=k,a.increment("page_views"))}catch{}})}let L={telemetry:e,context:c,events:d,state:f,sessionMetrics:a,actions:y,surfaces:v,widgets:i,executors:s,apps:l,accumulator:h,anchorResolver:b,navigation:u,version:eS,mode:r,async evaluate(C){return S.evaluate(C,c.get())},evaluateSync(C){return S.evaluateSync(C,c.get())},async filterTiles(C){let I=c.get().page.url,w=[];for(let k of C){let T=k.activation;if(!T){w.push(k);continue}if(iH(I,T.routes)){if(T.onlyIfPopulated){let D=k.props?.actions??[];if(D.length>0&&!D.some(P=>P.triggerWhen?S.evaluateSync(P.triggerWhen,c.get()).value:!0))continue}w.push(k)}}return w},setRoutes(C){c.setRoutes(C)},destroy(){l.unbind().catch(C=>{console.error("[Runtime] Error unbinding apps registry:",C)}),_?.(),b.destroy(),h.destroy(),u.destroy(),c.destroy(),y.destroy(),v.destroy()}};return l.bind(L),i.bindRuntime(L),L}var XT=p.object({value:p.unknown(),expiresAt:p.number().optional()}),YT=p.object({count:p.number(),resetAt:p.number().optional()});function sH(t){return XT.safeParse(t)}function lH(t){return YT.safeParse(t)}var KT={growthbook:t=>$p({...t,autoInit:!0})};function QT(t,e){let a=KT[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(KT).join(", ")}`);return a(e)}var uH=["cdn.syntrologie.com","localhost","127.0.0.1"];function cH(t){try{let e=new URL(t),a=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!a?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):uH.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var tS=class{constructor(e){B(this,"name","cdn");B(this,"url");B(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!cH(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),a=await fetch(this.url,{credentials:"omit",cache:"default"});if(!a.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${a.status})`);let n=await a.text();if(this.integrity){let l=await dH(n),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let r=JSON.parse(n),o=performance.now()-e,i=a.headers.get("cache-control"),s=a.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:o,cached:i?.includes("public")??!1,cacheAge:s?parseInt(s,10):void 0}}}};async function dH(t){let a=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-384",a),r=new Uint8Array(n);return btoa(String.fromCharCode(...r))}function JT(t){return new tS(t)}var fH="syntro_exp",pH="syntro_var",aS=class{constructor(e){B(this,"name","experiments");B(this,"client");B(this,"featureKey");B(this,"manifestKey");B(this,"variantFlagPrefix");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config",this.manifestKey=e.manifestKey,this.variantFlagPrefix=e.variantFlagPrefix}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),o=r.get(fH),i=r.get(pH);if(o&&i!==null&&this.client.setForcedVariations){let s=parseInt(i,10);Number.isNaN(s)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${s}`),this.client.setForcedVariations({[o]:s}))}}if(this.manifestKey||this.variantFlagPrefix||this.client.getAllFeatures){let r=this.fetchMultiFlag();if(r){let o=performance.now()-e;return{config:r,meta:{source:"experiments",fetchTimeMs:o,cached:!0}}}}let a=this.client.getFeatureValue?.(this.featureKey,null);if(!a||typeof a!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let n=performance.now()-e;return{config:a,meta:{source:"experiments",fetchTimeMs:n,cached:!0}}}fetchMultiFlag(){let e=this.getVariantFlagKeys();return!e||e.length===0?null:np(this.client,e)}getVariantFlagKeys(){if(this.manifestKey){let e=this.client.getFeatureValue?.(this.manifestKey,null);if(e&&typeof e=="object"){let a=e.variant_flags;if(a&&a.length>0)return a}}if(this.client.getAllFeatures){let e=this.client.getAllFeatures();return this.variantFlagPrefix?Object.keys(e).filter(a=>a.startsWith(this.variantFlagPrefix)):Object.keys(e)}return[]}};function eR(t){return new aS(t)}var hH="https://cdn.syntrologie.com/configs",tR={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return JT({baseUrl:t.baseUrl??hH,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return eR({featureKey:t.featureKey})}};function aR(t,e={}){let a=tR[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(tR).join(", ")}`);return a(e)}var nR={posthog:t=>Dh(t),noop:()=>Qp()};function rR(t,e){let a=nR[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(nR).join(", ")}`);return a(e)}var nS="syn_";function Gc(t){if(!t.startsWith(nS))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(nS.length).replace(/-/g,"+").replace(/_/g,"/"),n=atob(a),r=JSON.parse(n);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function fm(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return nS+a}function gr(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}var oR="syntro_segment_attributes";function mH(){if(typeof window>"u")return{};try{let t=localStorage.getItem(oR);if(t){let e=JSON.parse(t);return K("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ya("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function gH(t){if(!(typeof window>"u"))try{localStorage.setItem(oR,JSON.stringify(t)),K("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ya("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function vH(t){if(!t)return{};let e={};for(let[a,n]of Object.entries(t))a.startsWith("in_segment_")&&(e[a]=n===!0);return e}function yH(){if(typeof window>"u")return{};let t={};try{let e=new URLSearchParams(window.location.search);for(let a of["utm_source","utm_medium","utm_campaign","utm_content","utm_term"]){let n=e.get(a);n&&(t[a]=n)}}catch{}try{navigator.language&&(t.browser_language=navigator.language),navigator.languages?.length&&(t.browser_languages=[...navigator.languages])}catch{}try{let e=window.innerWidth;t.device_type=e<768?"mobile":e<1024?"tablet":"desktop"}catch{}try{if(document.referrer){t.referrer=document.referrer;try{t.referrer_hostname=new URL(document.referrer).hostname}catch{}}}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname}catch{}return t}async function xH(t){Fy(),K("Syntro Bootstrap","====== INIT ======"),K("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=lp();if(console.log(`[DIAG] Mode detection: sdkMode=${e}`),console.log("[DIAG] editorSource:",Mu()),console.log("[DIAG] editorConf:",sp()),K("Syntro Bootstrap","SDK mode:",e??"normal"),!e&&typeof window<"u"){let w=!!window.__SYNTRO_EDITOR_PARAMS__,k=!!window.__SYNTRO_AUDIT_LEGEND__,T=!!window.__SYNTRO_REVIEW_DATA__;if(w||k||T){let D=[w&&"__SYNTRO_EDITOR_PARAMS__",k&&"__SYNTRO_AUDIT_LEGEND__",T&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${D.join(", ")}. This suggests URL params were lost (redirect?) but the service worker injected mode data. Check if replaceState failed or if page JS changed the URL before init().`)}}console.log(`[DIAG] Token resolution: options.token=${t.token?t.token.slice(0,15)+"...":"null"}`);let a=t.token;if(!a&&e){let k=sp()?.syntro_token;k?.startsWith("syn_")&&(a=k,K("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${e} mode)`))}let n;if(a)if(a.startsWith("syn_"))K("Syntro Bootstrap","Token starts with syn_, decoding..."),n=Gc(a),Fy(n.d);else if(e)K("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${e} mode)`);else throw rp("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),rp("Syntro Bootstrap","Token received:",a),new Error("Invalid Syntro token: must start with 'syn_'");else if(e)K("Syntro Bootstrap",`\u2713 No token, but ${e} mode - proceeding`);else throw rp("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit/review mode!"),new Error("Syntro token is required (unless in editor, audit, or review mode)");let r=gr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||gr("VITE_SYNTRO_EXPERIMENT_HOST")||n?.eh,o=gr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||gr("VITE_SYNTRO_TELEMETRY_HOST")||n?.th,i=gr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||gr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,s=mH(),l=yH(),u={...l,...s};K("Syntro Bootstrap","Phase 1: Browser metadata:",l),K("Syntro Bootstrap","Phase 1: Cached segment attributes:",s);let c,d=cl();console.log("[Syntro Bootstrap] EventBus created");let f=em(w=>{d.publishEvent(w)}),h=w=>{K("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let k=vH(w);if(K("Syntro Bootstrap","Segment flags from PostHog:",k),gH(k),c){let T=x?.getAll?.()??{},D={...l,...T,...k};K("Syntro Bootstrap","Updating GrowthBook with attributes:",D),c.setAttributes?.(D)}},S;if(n?.t){let w=n.t==="noop"?"noop":"posthog";S=rR(w,{apiKey:n.t,apiHost:o,enableFeatureFlags:!0,onFeatureFlagsLoaded:h,onCapture:f}),console.log(`[Syntro Bootstrap] Telemetry client created (${w}) with EventBus wiring`)}let x;n?.e&&(c=QT("growthbook",{clientKey:n.e,apiHost:r,attributes:u,onExperimentViewed:S?.trackExperiment?(w,k,T)=>{S.trackExperiment(w,k,T)}:void 0})),x=Vp({experiments:c,onMetricChange:(w,k)=>{K("Syntro Bootstrap",`Session metric changed: ${w} = ${k}`)}}),K("Syntro Bootstrap","SessionMetricTracker created");let b="production";e==="editor"?b="editor":e==="audit"?b="audit":gr("NODE_ENV")==="development"&&(b="development");let m=dm({telemetry:S,sessionMetrics:x,mode:b,events:d});K("Syntro Bootstrap","Runtime created:",{version:m.version,mode:m.mode,hasContext:!!m.context,hasEvents:!!m.events,hasState:!!m.state}),K("Syntro Bootstrap","Core app executors already registered");let g=t.cdnBase||gr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||gr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",v=Zf({cdnBase:g,registry:m.apps,onLoadStart:w=>{K("Syntro Bootstrap",`Loading app from CDN: ${w}`)},onLoadEnd:(w,k,T)=>{k?K("Syntro Bootstrap",`App loaded successfully: ${w}`):ya("Syntro Bootstrap",`Failed to load app: ${w}`,T)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:m.apps,runtime:m,version:m.version},K("Syntro Bootstrap","Global SynOS object exposed"));let y=m.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${y.length} apps in registry:`,y.map(w=>`${w.manifest.id}(${w.state})`).join(", "));for(let w of y)if(w.state==="registered")try{await m.apps.activate(w.manifest.id),console.log(`[DIAG] Activated: ${w.manifest.id} \u2192 widgets: [${m.widgets.list().join(", ")}]`)}catch(k){console.error(`[DIAG] FAILED to activate: ${w.manifest.id}`,k),ya("Syntro Bootstrap",`Failed to auto-activate built-in app: ${w.manifest.id}`,k)}if(console.log(`[DIAG] Activation complete. Total widgets: [${m.widgets.list().join(", ")}]`),c?.refreshFeatures)try{await c.refreshFeatures(),K("Syntro Bootstrap","GrowthBook features loaded")}catch(w){ya("Syntro Bootstrap","Failed to load GrowthBook features:",w)}let _;if(t.fetcher)_=t.fetcher;else if(n?.f){let w=aR(n.f,n.o??{});_=async()=>{let k=await w.fetch();return{...k.config,tiles:k.config.tiles??[]}}}else c&&(_=Qo({experiments:c}));let L=new Set,C=_?async()=>{let w=await _();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${w.tiles?.length??0},`,`actions=${w.actions?.length??0},`,`theme=${w.theme?.name??"none"}`),w.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",w.actions.map((D,M)=>`[${M}] ${D.kind}${D.anchorId?` anchor="${D.anchorId.selector}"`:""}${D.label?` "${D.label}"`:""}`).join(", "));let k=w,T=v.getRequiredApps(k);return T.length>0?console.log("[Syntro Bootstrap] Required external apps:",T.join(", ")):K("Syntro Bootstrap","No external apps required (all executors are built-in)"),T.length>0&&await v.loadAppsForConfig(k).then(async M=>{let P=M.filter(j=>j.success),F=M.filter(j=>!j.success);P.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${P.map(j=>j.appId).join(", ")}`);let U=F.filter(j=>!L.has(j.appId));U.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",U.map(j=>`${j.appId} (${j.error})`).join(", ")),U.forEach(j=>L.add(j.appId)));for(let j of T)if(m.apps.has(j))try{await m.apps.activate(j),console.log(`[Syntro Bootstrap] App activated: ${j}`)}catch(N){console.error(`[Syntro Bootstrap] Failed to activate app: ${j}`,N)}else console.error(`[Syntro Bootstrap] App "${j}" required by config but NOT registered.`,`Available apps: [${Array.from(m.apps.list?.()??[]).join(", ")}]`)}),w}:void 0;return{canvas:await Lp({...t.canvas,fetcher:C,integrations:{experiments:c,telemetry:S},editorUrl:i,runtime:m}),runtime:m,experiments:c,telemetry:S,sessionMetrics:x,appLoader:v}}var rS={init:xH,encodeToken:fm,decodeToken:Gc};typeof window<"u"&&(window.Syntro=rS);var oS="2026-03-12T07:00:52.880Z (76b52807bc)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${oS}`);let t=window.SynOS,e=t?.appRegistry||bs;window.SynOS={...t,appRegistry:e,_runtimeBuild:oS,React:iR.default,ReactDOM:{...bH,createPortal:pm.createPortal,flushSync:pm.flushSync}},Uk(e)}return hR(SH);})();
465
520
  /*! Bundled license information:
466
521
 
467
522
  react/cjs/react.production.js:
@@ -527,13 +582,24 @@ lucide-react/dist/esm/defaultAttributes.js:
527
582
  lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
528
583
  lucide-react/dist/esm/Icon.js:
529
584
  lucide-react/dist/esm/createLucideIcon.js:
585
+ lucide-react/dist/esm/icons/arrow-right.js:
586
+ lucide-react/dist/esm/icons/banknote.js:
587
+ lucide-react/dist/esm/icons/bell.js:
588
+ lucide-react/dist/esm/icons/book-open.js:
589
+ lucide-react/dist/esm/icons/circle-check-big.js:
530
590
  lucide-react/dist/esm/icons/circle-question-mark.js:
591
+ lucide-react/dist/esm/icons/clipboard-list.js:
531
592
  lucide-react/dist/esm/icons/compass.js:
532
593
  lucide-react/dist/esm/icons/file-text.js:
533
594
  lucide-react/dist/esm/icons/gamepad-2.js:
595
+ lucide-react/dist/esm/icons/landmark.js:
534
596
  lucide-react/dist/esm/icons/layers.js:
597
+ lucide-react/dist/esm/icons/lightbulb.js:
535
598
  lucide-react/dist/esm/icons/message-circle.js:
599
+ lucide-react/dist/esm/icons/skip-forward.js:
536
600
  lucide-react/dist/esm/icons/sparkles.js:
601
+ lucide-react/dist/esm/icons/timer.js:
602
+ lucide-react/dist/esm/icons/triangle-alert.js:
537
603
  lucide-react/dist/esm/icons/trophy.js:
538
604
  lucide-react/dist/esm/lucide-react.js:
539
605
  (**