@syntrologie/runtime-sdk 2.8.0-canary.37 → 2.8.0-canary.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-64UIXABO.js → chunk-7GUWICM5.js} +2 -2
- package/dist/{chunk-64UIXABO.js.map → chunk-7GUWICM5.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/dist/smart-canvas.esm.js +65 -65
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +3587 -7897
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +65 -65
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/smart-canvas.min.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var SyntrologieSDK=(()=>{var FM=Object.create;var Tu=Object.defineProperty;var HM=Object.getOwnPropertyDescriptor;var UM=Object.getOwnPropertyNames;var zM=Object.getPrototypeOf,qM=Object.prototype.hasOwnProperty;var dC=t=>{throw TypeError(t)};var $M=(t,e,a)=>e in t?Tu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var Dr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zg=(t,e)=>{for(var a in e)Tu(t,a,{get:e[a],enumerable:!0})},fC=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of UM(e))!qM.call(t,n)&&n!==a&&Tu(t,n,{get:()=>e[n],enumerable:!(r=HM(e,n))||r.enumerable});return t};var ae=(t,e,a)=>(a=t!=null?FM(zM(t)):{},fC(e||!t||!t.__esModule?Tu(a,"default",{value:t,enumerable:!0}):a,t)),VM=t=>fC(Tu({},"__esModule",{value:!0}),t);var B=(t,e,a)=>$M(t,typeof e!="symbol"?e+"":e,a),pC=(t,e,a)=>e.has(t)||dC("Cannot "+a);var Ie=(t,e,a)=>(pC(t,e,"read from private field"),a?a.call(t):e.get(t)),no=(t,e,a)=>e.has(t)?dC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),Nr=(t,e,a,r)=>(pC(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var wC=Dr(fe=>{"use strict";var Yg=Symbol.for("react.transitional.element"),jM=Symbol.for("react.portal"),GM=Symbol.for("react.fragment"),ZM=Symbol.for("react.strict_mode"),WM=Symbol.for("react.profiler"),XM=Symbol.for("react.consumer"),YM=Symbol.for("react.context"),KM=Symbol.for("react.forward_ref"),QM=Symbol.for("react.suspense"),JM=Symbol.for("react.memo"),yC=Symbol.for("react.lazy"),eO=Symbol.for("react.activity"),hC=Symbol.iterator;function tO(t){return t===null||typeof t!="object"?null:(t=hC&&t[hC]||t["@@iterator"],typeof t=="function"?t:null)}var xC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bC=Object.assign,SC={};function Rs(t,e,a){this.props=t,this.context=e,this.refs=SC,this.updater=a||xC}Rs.prototype.isReactComponent={};Rs.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")};Rs.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _C(){}_C.prototype=Rs.prototype;function Kg(t,e,a){this.props=t,this.context=e,this.refs=SC,this.updater=a||xC}var Qg=Kg.prototype=new _C;Qg.constructor=Kg;bC(Qg,Rs.prototype);Qg.isPureReactComponent=!0;var mC=Array.isArray;function Xg(){}var We={H:null,A:null,T:null,S:null},CC=Object.prototype.hasOwnProperty;function Jg(t,e,a){var r=a.ref;return{$$typeof:Yg,type:t,key:e,ref:r!==void 0?r:null,props:a}}function aO(t,e){return Jg(t.type,e,t.props)}function ev(t){return typeof t=="object"&&t!==null&&t.$$typeof===Yg}function rO(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var gC=/\/+/g;function Wg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?rO(""+t.key):e.toString(36)}function nO(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Xg,Xg):(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 Ts(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 Yg:case jM:i=!0;break;case yC:return i=t._init,Ts(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Wg(t,0):r,mC(n)?(a="",i!=null&&(a=i.replace(gC,"$&/")+"/"),Ts(n,e,a,"",function(u){return u})):n!=null&&(ev(n)&&(n=aO(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(gC,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(mC(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Wg(r,l),i+=Ts(r,e,a,o,n);else if(l=tO(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Wg(r,l++),i+=Ts(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return Ts(nO(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 cf(t,e,a){if(t==null)return t;var r=[],n=0;return Ts(t,r,"","",function(o){return e.call(a,o,n++)}),r}function oO(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 vC=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)},iO={map:cf,forEach:function(t,e,a){cf(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return cf(t,function(){e++}),e},toArray:function(t){return cf(t,function(e){return e})||[]},only:function(t){if(!ev(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};fe.Activity=eO;fe.Children=iO;fe.Component=Rs;fe.Fragment=GM;fe.Profiler=WM;fe.PureComponent=Kg;fe.StrictMode=ZM;fe.Suspense=QM;fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=We;fe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return We.H.useMemoCache(t)}};fe.cache=function(t){return function(){return t.apply(null,arguments)}};fe.cacheSignal=function(){return null};fe.cloneElement=function(t,e,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=bC({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!CC.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 Jg(t.type,n,r)};fe.createContext=function(t){return t={$$typeof:YM,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:XM,_context:t},t};fe.createElement=function(t,e,a){var r,n={},o=null;if(e!=null)for(r in e.key!==void 0&&(o=""+e.key),e)CC.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 Jg(t,o,n)};fe.createRef=function(){return{current:null}};fe.forwardRef=function(t){return{$$typeof:KM,render:t}};fe.isValidElement=ev;fe.lazy=function(t){return{$$typeof:yC,_payload:{_status:-1,_result:t},_init:oO}};fe.memo=function(t,e){return{$$typeof:JM,type:t,compare:e===void 0?null:e}};fe.startTransition=function(t){var e=We.T,a={};We.T=a;try{var r=t(),n=We.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Xg,vC)}catch(o){vC(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),We.T=e}};fe.unstable_useCacheRefresh=function(){return We.H.useCacheRefresh()};fe.use=function(t){return We.H.use(t)};fe.useActionState=function(t,e,a){return We.H.useActionState(t,e,a)};fe.useCallback=function(t,e){return We.H.useCallback(t,e)};fe.useContext=function(t){return We.H.useContext(t)};fe.useDebugValue=function(){};fe.useDeferredValue=function(t,e){return We.H.useDeferredValue(t,e)};fe.useEffect=function(t,e){return We.H.useEffect(t,e)};fe.useEffectEvent=function(t){return We.H.useEffectEvent(t)};fe.useId=function(){return We.H.useId()};fe.useImperativeHandle=function(t,e,a){return We.H.useImperativeHandle(t,e,a)};fe.useInsertionEffect=function(t,e){return We.H.useInsertionEffect(t,e)};fe.useLayoutEffect=function(t,e){return We.H.useLayoutEffect(t,e)};fe.useMemo=function(t,e){return We.H.useMemo(t,e)};fe.useOptimistic=function(t,e){return We.H.useOptimistic(t,e)};fe.useReducer=function(t,e,a){return We.H.useReducer(t,e,a)};fe.useRef=function(t){return We.H.useRef(t)};fe.useState=function(t){return We.H.useState(t)};fe.useSyncExternalStore=function(t,e,a){return We.H.useSyncExternalStore(t,e,a)};fe.useTransition=function(){return We.H.useTransition()};fe.version="19.2.1"});var st=Dr((vq,kC)=>{"use strict";kC.exports=wC()});var IC=Dr(na=>{"use strict";var sO=st();function LC(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 oo(){}var ra={d:{f:oo,r:function(){throw Error(LC(522))},D:oo,C:oo,L:oo,m:oo,X:oo,S:oo,M:oo},p:0,findDOMNode:null},lO=Symbol.for("react.portal");function uO(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:lO,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var Ru=sO.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function df(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}na.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ra;na.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(LC(299));return uO(t,e,null,a)};na.flushSync=function(t){var e=Ru.T,a=ra.p;try{if(Ru.T=null,ra.p=2,t)return t()}finally{Ru.T=e,ra.p=a,ra.d.f()}};na.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,ra.d.C(t,e))};na.prefetchDNS=function(t){typeof t=="string"&&ra.d.D(t)};na.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=df(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?ra.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&ra.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};na.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=df(e.as,e.crossOrigin);ra.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&&ra.d.M(t)};na.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=df(a,e.crossOrigin);ra.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})}};na.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=df(e.as,e.crossOrigin);ra.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 ra.d.m(t)};na.requestFormReset=function(t){ra.d.r(t)};na.unstable_batchedUpdates=function(t,e){return t(e)};na.useFormState=function(t,e,a){return Ru.H.useFormState(t,e,a)};na.useFormStatus=function(){return Ru.H.useHostTransitionStatus()};na.version="19.2.1"});var Mu=Dr((xq,EC)=>{"use strict";function AC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AC)}catch(t){console.error(t)}}AC(),EC.exports=IC()});var HC=Dr(et=>{"use strict";function nv(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<ff(n,e))t[r]=e,t[a]=n,a=r;else break e}}function Br(t){return t.length===0?null:t[0]}function hf(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>ff(s,a))l<n&&0>ff(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>ff(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function ff(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}et.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(TC=performance,et.unstable_now=function(){return TC.now()}):(tv=Date,RC=tv.now(),et.unstable_now=function(){return tv.now()-RC});var TC,tv,RC,dn=[],io=[],cO=1,Wa=null,Qt=3,ov=!1,Ou=!1,Du=!1,iv=!1,DC=typeof setTimeout=="function"?setTimeout:null,NC=typeof clearTimeout=="function"?clearTimeout:null,MC=typeof setImmediate<"u"?setImmediate:null;function pf(t){for(var e=Br(io);e!==null;){if(e.callback===null)hf(io);else if(e.startTime<=t)hf(io),e.sortIndex=e.expirationTime,nv(dn,e);else break;e=Br(io)}}function sv(t){if(Du=!1,pf(t),!Ou)if(Br(dn)!==null)Ou=!0,Os||(Os=!0,Ms());else{var e=Br(io);e!==null&&lv(sv,e.startTime-t)}}var Os=!1,Nu=-1,BC=5,PC=-1;function FC(){return iv?!0:!(et.unstable_now()-PC<BC)}function av(){if(iv=!1,Os){var t=et.unstable_now();PC=t;var e=!0;try{e:{Ou=!1,Du&&(Du=!1,NC(Nu),Nu=-1),ov=!0;var a=Qt;try{t:{for(pf(t),Wa=Br(dn);Wa!==null&&!(Wa.expirationTime>t&&FC());){var r=Wa.callback;if(typeof r=="function"){Wa.callback=null,Qt=Wa.priorityLevel;var n=r(Wa.expirationTime<=t);if(t=et.unstable_now(),typeof n=="function"){Wa.callback=n,pf(t),e=!0;break t}Wa===Br(dn)&&hf(dn),pf(t)}else hf(dn);Wa=Br(dn)}if(Wa!==null)e=!0;else{var o=Br(io);o!==null&&lv(sv,o.startTime-t),e=!1}}break e}finally{Wa=null,Qt=a,ov=!1}e=void 0}}finally{e?Ms():Os=!1}}}var Ms;typeof MC=="function"?Ms=function(){MC(av)}:typeof MessageChannel<"u"?(rv=new MessageChannel,OC=rv.port2,rv.port1.onmessage=av,Ms=function(){OC.postMessage(null)}):Ms=function(){DC(av,0)};var rv,OC;function lv(t,e){Nu=DC(function(){t(et.unstable_now())},e)}et.unstable_IdlePriority=5;et.unstable_ImmediatePriority=1;et.unstable_LowPriority=4;et.unstable_NormalPriority=3;et.unstable_Profiling=null;et.unstable_UserBlockingPriority=2;et.unstable_cancelCallback=function(t){t.callback=null};et.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"):BC=0<t?Math.floor(1e3/t):5};et.unstable_getCurrentPriorityLevel=function(){return Qt};et.unstable_next=function(t){switch(Qt){case 1:case 2:case 3:var e=3;break;default:e=Qt}var a=Qt;Qt=e;try{return t()}finally{Qt=a}};et.unstable_requestPaint=function(){iv=!0};et.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=Qt;Qt=t;try{return e()}finally{Qt=a}};et.unstable_scheduleCallback=function(t,e,a){var r=et.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:cO++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,nv(io,t),Br(dn)===null&&t===Br(io)&&(Du?(NC(Nu),Nu=-1):Du=!0,lv(sv,a-r))):(t.sortIndex=n,nv(dn,t),Ou||ov||(Ou=!0,Os||(Os=!0,Ms()))),t};et.unstable_shouldYield=FC;et.unstable_wrapCallback=function(t){var e=Qt;return function(){var a=Qt;Qt=e;try{return t.apply(this,arguments)}finally{Qt=a}}}});var zC=Dr((Sq,UC)=>{"use strict";UC.exports=HC()});var J1=Dr(Hp=>{"use strict";var Tt=zC(),pk=st(),dO=Mu();function M(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 hk(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Sc(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 mk(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 gk(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 qC(t){if(Sc(t)!==t)throw Error(M(188))}function fO(t){var e=t.alternate;if(!e){if(e=Sc(t),e===null)throw Error(M(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 qC(n),t;if(o===r)return qC(n),e;o=o.sibling}throw Error(M(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(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?t:e}function vk(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=vk(t),e!==null)return e;t=t.sibling}return null}var Ke=Object.assign,pO=Symbol.for("react.element"),mf=Symbol.for("react.transitional.element"),$u=Symbol.for("react.portal"),Hs=Symbol.for("react.fragment"),yk=Symbol.for("react.strict_mode"),qv=Symbol.for("react.profiler"),xk=Symbol.for("react.consumer"),xn=Symbol.for("react.context"),Py=Symbol.for("react.forward_ref"),$v=Symbol.for("react.suspense"),Vv=Symbol.for("react.suspense_list"),Fy=Symbol.for("react.memo"),so=Symbol.for("react.lazy"),jv=Symbol.for("react.activity"),hO=Symbol.for("react.memo_cache_sentinel"),$C=Symbol.iterator;function Bu(t){return t===null||typeof t!="object"?null:(t=$C&&t[$C]||t["@@iterator"],typeof t=="function"?t:null)}var mO=Symbol.for("react.client.reference");function Gv(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===mO?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Hs:return"Fragment";case qv:return"Profiler";case yk:return"StrictMode";case $v:return"Suspense";case Vv:return"SuspenseList";case jv:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case $u:return"Portal";case xn:return t.displayName||"Context";case xk:return(t._context.displayName||"Context")+".Consumer";case Py:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fy:return e=t.displayName||null,e!==null?e:Gv(t.type)||"Memo";case so:e=t._payload,t=t._init;try{return Gv(t(e))}catch{}}return null}var Vu=Array.isArray,se=pk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re=dO.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,hi={pending:!1,data:null,method:null,action:null},Zv=[],Us=-1;function zr(t){return{current:t}}function Bt(t){0>Us||(t.current=Zv[Us],Zv[Us]=null,Us--)}function je(t,e){Us++,Zv[Us]=t.current,t.current=e}var Ur=zr(null),sc=zr(null),xo=zr(null),Wf=zr(null);function Xf(t,e){switch(je(xo,e),je(sc,t),je(Ur,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Yw(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Yw(e),t=H1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Bt(Ur),je(Ur,t)}function nl(){Bt(Ur),Bt(sc),Bt(xo)}function Wv(t){t.memoizedState!==null&&je(Wf,t);var e=Ur.current,a=H1(e,t.type);e!==a&&(je(sc,t),je(Ur,a))}function Yf(t){sc.current===t&&(Bt(Ur),Bt(sc)),Wf.current===t&&(Bt(Wf),yc._currentValue=hi)}var uv,VC;function ci(t){if(uv===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);uv=e&&e[1]||"",VC=-1<a.stack.indexOf(`
|
|
1
|
+
var SyntrologieSDK=(()=>{var r2=Object.create;var wl=Object.defineProperty;var n2=Object.getOwnPropertyDescriptor;var o2=Object.getOwnPropertyNames;var i2=Object.getPrototypeOf,s2=Object.prototype.hasOwnProperty;var YS=t=>{throw TypeError(t)};var l2=(t,e,a)=>e in t?wl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var fr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),KS=(t,e)=>{for(var a in e)wl(t,a,{get:e[a],enumerable:!0})},QS=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of o2(e))!s2.call(t,n)&&n!==a&&wl(t,n,{get:()=>e[n],enumerable:!(r=n2(e,n))||r.enumerable});return t};var K=(t,e,a)=>(a=t!=null?r2(i2(t)):{},QS(e||!t||!t.__esModule?wl(a,"default",{value:t,enumerable:!0}):a,t)),u2=t=>QS(wl({},"__esModule",{value:!0}),t);var B=(t,e,a)=>l2(t,typeof e!="symbol"?e+"":e,a),JS=(t,e,a)=>e.has(t)||YS("Cannot "+a);var ye=(t,e,a)=>(JS(t,e,"read from private field"),a?a.call(t):e.get(t)),Ln=(t,e,a)=>e.has(t)?YS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),pr=(t,e,a,r)=>(JS(t,e,"write to private field"),r?r.call(t,a):e.set(t,a),a);var c_=fr(oe=>{"use strict";var Hm=Symbol.for("react.transitional.element"),c2=Symbol.for("react.portal"),d2=Symbol.for("react.fragment"),f2=Symbol.for("react.strict_mode"),p2=Symbol.for("react.profiler"),h2=Symbol.for("react.consumer"),m2=Symbol.for("react.context"),g2=Symbol.for("react.forward_ref"),v2=Symbol.for("react.suspense"),y2=Symbol.for("react.memo"),n_=Symbol.for("react.lazy"),x2=Symbol.for("react.activity"),e_=Symbol.iterator;function b2(t){return t===null||typeof t!="object"?null:(t=e_&&t[e_]||t["@@iterator"],typeof t=="function"?t:null)}var o_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},i_=Object.assign,s_={};function Ti(t,e,a){this.props=t,this.context=e,this.refs=s_,this.updater=a||o_}Ti.prototype.isReactComponent={};Ti.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")};Ti.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function l_(){}l_.prototype=Ti.prototype;function Um(t,e,a){this.props=t,this.context=e,this.refs=s_,this.updater=a||o_}var zm=Um.prototype=new l_;zm.constructor=Um;i_(zm,Ti.prototype);zm.isPureReactComponent=!0;var t_=Array.isArray;function Fm(){}var Fe={H:null,A:null,T:null,S:null},u_=Object.prototype.hasOwnProperty;function qm(t,e,a){var r=a.ref;return{$$typeof:Hm,type:t,key:e,ref:r!==void 0?r:null,props:a}}function S2(t,e){return qm(t.type,e,t.props)}function $m(t){return typeof t=="object"&&t!==null&&t.$$typeof===Hm}function _2(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return e[a]})}var a_=/\/+/g;function Nm(t,e){return typeof t=="object"&&t!==null&&t.key!=null?_2(""+t.key):e.toString(36)}function C2(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Fm,Fm):(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 Ei(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 Hm:case c2:i=!0;break;case n_:return i=t._init,Ei(i(t._payload),e,a,r,n)}}if(i)return n=n(t),i=r===""?"."+Nm(t,0):r,t_(n)?(a="",i!=null&&(a=i.replace(a_,"$&/")+"/"),Ei(n,e,a,"",function(u){return u})):n!=null&&($m(n)&&(n=S2(n,a+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(a_,"$&/")+"/")+i)),e.push(n)),1;i=0;var s=r===""?".":r+":";if(t_(t))for(var l=0;l<t.length;l++)r=t[l],o=s+Nm(r,l),i+=Ei(r,e,a,o,n);else if(l=b2(t),typeof l=="function")for(t=l.call(t),l=0;!(r=t.next()).done;)r=r.value,o=s+Nm(r,l++),i+=Ei(r,e,a,o,n);else if(o==="object"){if(typeof t.then=="function")return Ei(C2(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 od(t,e,a){if(t==null)return t;var r=[],n=0;return Ei(t,r,"","",function(o){return e.call(a,o,n++)}),r}function w2(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 r_=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)},L2={map:od,forEach:function(t,e,a){od(t,function(){e.apply(this,arguments)},a)},count:function(t){var e=0;return od(t,function(){e++}),e},toArray:function(t){return od(t,function(e){return e})||[]},only:function(t){if(!$m(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};oe.Activity=x2;oe.Children=L2;oe.Component=Ti;oe.Fragment=d2;oe.Profiler=p2;oe.PureComponent=Um;oe.StrictMode=f2;oe.Suspense=v2;oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Fe;oe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Fe.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=i_({},t.props),n=t.key;if(e!=null)for(o in e.key!==void 0&&(n=""+e.key),e)!u_.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 qm(t.type,n,r)};oe.createContext=function(t){return t={$$typeof:m2,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:h2,_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)u_.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 qm(t,o,n)};oe.createRef=function(){return{current:null}};oe.forwardRef=function(t){return{$$typeof:g2,render:t}};oe.isValidElement=$m;oe.lazy=function(t){return{$$typeof:n_,_payload:{_status:-1,_result:t},_init:w2}};oe.memo=function(t,e){return{$$typeof:y2,type:t,compare:e===void 0?null:e}};oe.startTransition=function(t){var e=Fe.T,a={};Fe.T=a;try{var r=t(),n=Fe.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Fm,r_)}catch(o){r_(o)}finally{e!==null&&a.types!==null&&(e.types=a.types),Fe.T=e}};oe.unstable_useCacheRefresh=function(){return Fe.H.useCacheRefresh()};oe.use=function(t){return Fe.H.use(t)};oe.useActionState=function(t,e,a){return Fe.H.useActionState(t,e,a)};oe.useCallback=function(t,e){return Fe.H.useCallback(t,e)};oe.useContext=function(t){return Fe.H.useContext(t)};oe.useDebugValue=function(){};oe.useDeferredValue=function(t,e){return Fe.H.useDeferredValue(t,e)};oe.useEffect=function(t,e){return Fe.H.useEffect(t,e)};oe.useEffectEvent=function(t){return Fe.H.useEffectEvent(t)};oe.useId=function(){return Fe.H.useId()};oe.useImperativeHandle=function(t,e,a){return Fe.H.useImperativeHandle(t,e,a)};oe.useInsertionEffect=function(t,e){return Fe.H.useInsertionEffect(t,e)};oe.useLayoutEffect=function(t,e){return Fe.H.useLayoutEffect(t,e)};oe.useMemo=function(t,e){return Fe.H.useMemo(t,e)};oe.useOptimistic=function(t,e){return Fe.H.useOptimistic(t,e)};oe.useReducer=function(t,e,a){return Fe.H.useReducer(t,e,a)};oe.useRef=function(t){return Fe.H.useRef(t)};oe.useState=function(t){return Fe.H.useState(t)};oe.useSyncExternalStore=function(t,e,a){return Fe.H.useSyncExternalStore(t,e,a)};oe.useTransition=function(){return Fe.H.useTransition()};oe.version="19.2.1"});var Ke=fr((fU,d_)=>{"use strict";d_.exports=c_()});var p_=fr(Ut=>{"use strict";var k2=Ke();function f_(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 kn(){}var Ht={d:{f:kn,r:function(){throw Error(f_(522))},D:kn,C:kn,L:kn,m:kn,X:kn,S:kn,M:kn},p:0,findDOMNode:null},I2=Symbol.for("react.portal");function A2(t,e,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I2,key:r==null?null:""+r,children:t,containerInfo:e,implementation:a}}var Ll=k2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function id(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ht;Ut.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(f_(299));return A2(t,e,null,a)};Ut.flushSync=function(t){var e=Ll.T,a=Ht.p;try{if(Ll.T=null,Ht.p=2,t)return t()}finally{Ll.T=e,Ht.p=a,Ht.d.f()}};Ut.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Ht.d.C(t,e))};Ut.prefetchDNS=function(t){typeof t=="string"&&Ht.d.D(t)};Ut.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var a=e.as,r=id(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,o=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?Ht.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:o}):a==="script"&&Ht.d.X(t,{crossOrigin:r,integrity:n,fetchPriority:o,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ut.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=id(e.as,e.crossOrigin);Ht.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&&Ht.d.M(t)};Ut.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,r=id(a,e.crossOrigin);Ht.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})}};Ut.preloadModule=function(t,e){if(typeof t=="string")if(e){var a=id(e.as,e.crossOrigin);Ht.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 Ht.d.m(t)};Ut.requestFormReset=function(t){Ht.d.r(t)};Ut.unstable_batchedUpdates=function(t,e){return t(e)};Ut.useFormState=function(t,e,a){return Ll.H.useFormState(t,e,a)};Ut.useFormStatus=function(){return Ll.H.useHostTransitionStatus()};Ut.version="19.2.1"});var kl=fr((hU,m_)=>{"use strict";function h_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h_)}catch(t){console.error(t)}}h_(),m_.exports=p_()});var L_=fr(Ve=>{"use strict";function Wm(t,e){var a=t.length;t.push(e);e:for(;0<a;){var r=a-1>>>1,n=t[r];if(0<sd(n,e))t[r]=e,t[a]=n,a=r;else break e}}function hr(t){return t.length===0?null:t[0]}function ud(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>sd(s,a))l<n&&0>sd(u,s)?(t[r]=u,t[l]=a,r=l):(t[r]=s,t[i]=a,r=i);else if(l<n&&0>sd(u,a))t[r]=u,t[l]=a,r=l;else break e}}return e}function sd(t,e){var a=t.sortIndex-e.sortIndex;return a!==0?a:t.id-e.id}Ve.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(g_=performance,Ve.unstable_now=function(){return g_.now()}):(Vm=Date,v_=Vm.now(),Ve.unstable_now=function(){return Vm.now()-v_});var g_,Vm,v_,Rr=[],In=[],E2=1,Aa=null,Pt=3,Zm=!1,Il=!1,Al=!1,Xm=!1,b_=typeof setTimeout=="function"?setTimeout:null,S_=typeof clearTimeout=="function"?clearTimeout:null,y_=typeof setImmediate<"u"?setImmediate:null;function ld(t){for(var e=hr(In);e!==null;){if(e.callback===null)ud(In);else if(e.startTime<=t)ud(In),e.sortIndex=e.expirationTime,Wm(Rr,e);else break;e=hr(In)}}function Ym(t){if(Al=!1,ld(t),!Il)if(hr(Rr)!==null)Il=!0,Mi||(Mi=!0,Ri());else{var e=hr(In);e!==null&&Km(Ym,e.startTime-t)}}var Mi=!1,El=-1,__=5,C_=-1;function w_(){return Xm?!0:!(Ve.unstable_now()-C_<__)}function jm(){if(Xm=!1,Mi){var t=Ve.unstable_now();C_=t;var e=!0;try{e:{Il=!1,Al&&(Al=!1,S_(El),El=-1),Zm=!0;var a=Pt;try{t:{for(ld(t),Aa=hr(Rr);Aa!==null&&!(Aa.expirationTime>t&&w_());){var r=Aa.callback;if(typeof r=="function"){Aa.callback=null,Pt=Aa.priorityLevel;var n=r(Aa.expirationTime<=t);if(t=Ve.unstable_now(),typeof n=="function"){Aa.callback=n,ld(t),e=!0;break t}Aa===hr(Rr)&&ud(Rr),ld(t)}else ud(Rr);Aa=hr(Rr)}if(Aa!==null)e=!0;else{var o=hr(In);o!==null&&Km(Ym,o.startTime-t),e=!1}}break e}finally{Aa=null,Pt=a,Zm=!1}e=void 0}}finally{e?Ri():Mi=!1}}}var Ri;typeof y_=="function"?Ri=function(){y_(jm)}:typeof MessageChannel<"u"?(Gm=new MessageChannel,x_=Gm.port2,Gm.port1.onmessage=jm,Ri=function(){x_.postMessage(null)}):Ri=function(){b_(jm,0)};var Gm,x_;function Km(t,e){El=b_(function(){t(Ve.unstable_now())},e)}Ve.unstable_IdlePriority=5;Ve.unstable_ImmediatePriority=1;Ve.unstable_LowPriority=4;Ve.unstable_NormalPriority=3;Ve.unstable_Profiling=null;Ve.unstable_UserBlockingPriority=2;Ve.unstable_cancelCallback=function(t){t.callback=null};Ve.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"):__=0<t?Math.floor(1e3/t):5};Ve.unstable_getCurrentPriorityLevel=function(){return Pt};Ve.unstable_next=function(t){switch(Pt){case 1:case 2:case 3:var e=3;break;default:e=Pt}var a=Pt;Pt=e;try{return t()}finally{Pt=a}};Ve.unstable_requestPaint=function(){Xm=!0};Ve.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var a=Pt;Pt=t;try{return e()}finally{Pt=a}};Ve.unstable_scheduleCallback=function(t,e,a){var r=Ve.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:E2++,callback:e,priorityLevel:t,startTime:a,expirationTime:n,sortIndex:-1},a>r?(t.sortIndex=a,Wm(In,t),hr(Rr)===null&&t===hr(In)&&(Al?(S_(El),El=-1):Al=!0,Km(Ym,a-r))):(t.sortIndex=n,Wm(Rr,t),Il||Zm||(Il=!0,Mi||(Mi=!0,Ri()))),t};Ve.unstable_shouldYield=w_;Ve.unstable_wrapCallback=function(t){var e=Pt;return function(){var a=Pt;Pt=e;try{return t.apply(this,arguments)}finally{Pt=a}}}});var I_=fr((gU,k_)=>{"use strict";k_.exports=L_()});var H1=fr(Bf=>{"use strict";var mt=I_(),JC=Ke(),T2=kl();function M(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 ew(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function mu(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 tw(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 aw(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 A_(t){if(mu(t)!==t)throw Error(M(188))}function R2(t){var e=t.alternate;if(!e){if(e=mu(t),e===null)throw Error(M(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 A_(n),t;if(o===r)return A_(n),e;o=o.sibling}throw Error(M(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(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?t:e}function rw(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=rw(t),e!==null)return e;t=t.sibling}return null}var ze=Object.assign,M2=Symbol.for("react.element"),cd=Symbol.for("react.transitional.element"),Nl=Symbol.for("react.portal"),Fi=Symbol.for("react.fragment"),nw=Symbol.for("react.strict_mode"),Rg=Symbol.for("react.profiler"),ow=Symbol.for("react.consumer"),Hr=Symbol.for("react.context"),kv=Symbol.for("react.forward_ref"),Mg=Symbol.for("react.suspense"),Og=Symbol.for("react.suspense_list"),Iv=Symbol.for("react.memo"),An=Symbol.for("react.lazy"),Dg=Symbol.for("react.activity"),O2=Symbol.for("react.memo_cache_sentinel"),E_=Symbol.iterator;function Tl(t){return t===null||typeof t!="object"?null:(t=E_&&t[E_]||t["@@iterator"],typeof t=="function"?t:null)}var D2=Symbol.for("react.client.reference");function Bg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===D2?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Fi:return"Fragment";case Rg:return"Profiler";case nw:return"StrictMode";case Mg:return"Suspense";case Og:return"SuspenseList";case Dg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Nl:return"Portal";case Hr:return t.displayName||"Context";case ow:return(t._context.displayName||"Context")+".Consumer";case kv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Iv:return e=t.displayName||null,e!==null?e:Bg(t.type)||"Memo";case An:e=t._payload,t=t._init;try{return Bg(t(e))}catch{}}return null}var Fl=Array.isArray,te=JC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=T2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ro={pending:!1,data:null,method:null,action:null},Pg=[],Hi=-1;function xr(t){return{current:t}}function St(t){0>Hi||(t.current=Pg[Hi],Pg[Hi]=null,Hi--)}function Be(t,e){Hi++,Pg[Hi]=t.current,t.current=e}var yr=xr(null),tu=xr(null),Hn=xr(null),$d=xr(null);function Vd(t,e){switch(Be(Hn,e),Be(tu,t),Be(yr,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?PC(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=PC(e),t=L1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}St(yr),Be(yr,t)}function rs(){St(yr),St(tu),St(Hn)}function Ng(t){t.memoizedState!==null&&Be($d,t);var e=yr.current,a=L1(e,t.type);e!==a&&(Be(tu,t),Be(yr,a))}function jd(t){tu.current===t&&(St(yr),St(tu)),$d.current===t&&(St($d),fu._currentValue=Ro)}var Qm,T_;function Io(t){if(Qm===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);Qm=e&&e[1]||"",T_=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+Qm+t+T_}var Jm=!1;function eg(t,e){if(!t||Jm)return"";Jm=!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(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]}};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(`
|
|
4
4
|
`),u=s.split(`
|
|
5
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{
|
|
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{Jm=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Io(a):""}function B2(t,e){switch(t.tag){case 26:case 27:case 5:return Io(t.type);case 16:return Io("Lazy");case 13:return t.child!==e&&e!==null?Io("Suspense Fallback"):Io("Suspense");case 19:return Io("SuspenseList");case 0:case 15:return eg(t.type,!1);case 11:return eg(t.type.render,!1);case 1:return eg(t.type,!0);case 31:return Io("Activity");default:return""}}function R_(t){try{var e="",a=null;do e+=B2(t,a),a=t,t=t.return;while(t);return e}catch(r){return`
|
|
7
7
|
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var Xv=Object.prototype.hasOwnProperty,Hy=Tt.unstable_scheduleCallback,fv=Tt.unstable_cancelCallback,vO=Tt.unstable_shouldYield,yO=Tt.unstable_requestPaint,Na=Tt.unstable_now,xO=Tt.unstable_getCurrentPriorityLevel,bk=Tt.unstable_ImmediatePriority,Sk=Tt.unstable_UserBlockingPriority,Kf=Tt.unstable_NormalPriority,bO=Tt.unstable_LowPriority,_k=Tt.unstable_IdlePriority,SO=Tt.log,_O=Tt.unstable_setDisableYieldValue,_c=null,Ba=null;function ho(t){if(typeof SO=="function"&&_O(t),Ba&&typeof Ba.setStrictMode=="function")try{Ba.setStrictMode(_c,t)}catch{}}var Pa=Math.clz32?Math.clz32:kO,CO=Math.log,wO=Math.LN2;function kO(t){return t>>>=0,t===0?32:31-(CO(t)/wO|0)|0}var gf=256,vf=262144,yf=4194304;function di(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 Cp(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=di(r):(i&=s,i!==0?n=di(i):a||(a=s&~t,a!==0&&(n=di(a))))):(s=r&~o,s!==0?n=di(s):i!==0?n=di(i):a||(a=r&~t,a!==0&&(n=di(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 Cc(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function LO(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 Ck(){var t=yf;return yf<<=1,(yf&62914560)===0&&(yf=4194304),t}function pv(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function wc(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function IO(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-Pa(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 p=f[c];p!==null&&(p.lane&=-536870913)}a&=~d}r!==0&&wk(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function wk(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-Pa(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function kk(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-Pa(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function Lk(t,e){var a=e&-e;return a=(a&42)!==0?1:Uy(a),(a&(t.suspendedLanes|e))!==0?0:a}function Uy(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 zy(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ik(){var t=Re.p;return t!==0?t:(t=window.event,t===void 0?32:Y1(t.type))}function GC(t,e){var a=Re.p;try{return Re.p=t,e()}finally{Re.p=a}}var Mo=Math.random().toString(36).slice(2),zt="__reactFiber$"+Mo,ba="__reactProps$"+Mo,ml="__reactContainer$"+Mo,Yv="__reactEvents$"+Mo,AO="__reactListeners$"+Mo,EO="__reactHandles$"+Mo,ZC="__reactResources$"+Mo,kc="__reactMarker$"+Mo;function qy(t){delete t[zt],delete t[ba],delete t[Yv],delete t[AO],delete t[EO]}function zs(t){var e=t[zt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[ml]||a[zt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=tk(t);t!==null;){if(a=t[zt])return a;t=tk(t)}return e}t=a,a=t.parentNode}return null}function gl(t){if(t=t[zt]||t[ml]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function ju(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function Ks(t){var e=t[ZC];return e||(e=t[ZC]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Nt(t){t[kc]=!0}var Ak=new Set,Ek={};function wi(t,e){ol(t,e),ol(t+"Capture",e)}function ol(t,e){for(Ek[t]=e,t=0;t<e.length;t++)Ak.add(e[t])}var TO=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]*$"),WC={},XC={};function RO(t){return Xv.call(XC,t)?!0:Xv.call(WC,t)?!1:TO.test(t)?XC[t]=!0:(WC[t]=!0,!1)}function Of(t,e,a){if(RO(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 xf(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 fn(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 Ya(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Tk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function MO(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 Kv(t){if(!t._valueTracker){var e=Tk(t)?"checked":"value";t._valueTracker=MO(t,e,""+t[e])}}function Rk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=Tk(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Qf(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 OO=/[\n"\\]/g;function Ja(t){return t.replace(OO,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Qv(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=""+Ya(e)):t.value!==""+Ya(e)&&(t.value=""+Ya(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?Jv(t,i,Ya(e)):a!=null?Jv(t,i,Ya(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=""+Ya(s):t.removeAttribute("name")}function Mk(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)){Kv(t);return}a=a!=null?""+Ya(a):"",e=e!=null?""+Ya(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),Kv(t)}function Jv(t,e,a){e==="number"&&Qf(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Qs(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=""+Ya(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 Ok(t,e,a){if(e!=null&&(e=""+Ya(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Ya(a):""}function Dk(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(M(92));if(Vu(r)){if(1<r.length)throw Error(M(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Ya(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Kv(t)}function il(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var DO=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 YC(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||DO.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function Nk(t,e,a){if(e!=null&&typeof e!="object")throw Error(M(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&&YC(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&YC(t,o,e[o])}function $y(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 NO=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"]]),BO=/^[\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 Df(t){return BO.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function bn(){}var ey=null;function Vy(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qs=null,Js=null;function KC(t){var e=gl(t);if(e&&(t=e.stateNode)){var a=t[ba]||null;e:switch(t=e.stateNode,e.type){case"input":if(Qv(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="'+Ja(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[ba]||null;if(!n)throw Error(M(90));Qv(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&&Rk(r)}break e;case"textarea":Ok(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Qs(t,!!a.multiple,e,!1)}}}var hv=!1;function Bk(t,e,a){if(hv)return t(e,a);hv=!0;try{var r=t(e);return r}finally{if(hv=!1,(qs!==null||Js!==null)&&(Np(),qs&&(e=qs,t=Js,Js=qs=null,KC(e),t)))for(e=0;e<t.length;e++)KC(t[e])}}function lc(t,e){var a=t.stateNode;if(a===null)return null;var r=a[ba]||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(M(231,e,typeof a));return a}var kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ty=!1;if(kn)try{Ds={},Object.defineProperty(Ds,"passive",{get:function(){ty=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{ty=!1}var Ds,mo=null,jy=null,Nf=null;function Pk(){if(Nf)return Nf;var t,e=jy,a=e.length,r,n="value"in mo?mo.value:mo.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 Nf=n.slice(t,1<r?1-r:void 0)}function Bf(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 bf(){return!0}function QC(){return!1}function Sa(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)?bf:QC,this.isPropagationStopped=QC,this}return Ke(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=bf)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bf)},persist:function(){},isPersistent:bf}),e}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wp=Sa(ki),Lc=Ke({},ki,{view:0,detail:0}),PO=Sa(Lc),mv,gv,Pu,kp=Ke({},Lc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gy,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!==Pu&&(Pu&&t.type==="mousemove"?(mv=t.screenX-Pu.screenX,gv=t.screenY-Pu.screenY):gv=mv=0,Pu=t),mv)},movementY:function(t){return"movementY"in t?t.movementY:gv}}),JC=Sa(kp),FO=Ke({},kp,{dataTransfer:0}),HO=Sa(FO),UO=Ke({},Lc,{relatedTarget:0}),vv=Sa(UO),zO=Ke({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),qO=Sa(zO),$O=Ke({},ki,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),VO=Sa($O),jO=Ke({},ki,{data:0}),ew=Sa(jO),GO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZO={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"},WO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XO(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=WO[t])?!!e[t]:!1}function Gy(){return XO}var YO=Ke({},Lc,{key:function(t){if(t.key){var e=GO[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Bf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ZO[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gy,charCode:function(t){return t.type==="keypress"?Bf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Bf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),KO=Sa(YO),QO=Ke({},kp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tw=Sa(QO),JO=Ke({},Lc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gy}),eD=Sa(JO),tD=Ke({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),aD=Sa(tD),rD=Ke({},kp,{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}),nD=Sa(rD),oD=Ke({},ki,{newState:0,oldState:0}),iD=Sa(oD),sD=[9,13,27,32],Zy=kn&&"CompositionEvent"in window,Wu=null;kn&&"documentMode"in document&&(Wu=document.documentMode);var lD=kn&&"TextEvent"in window&&!Wu,Fk=kn&&(!Zy||Wu&&8<Wu&&11>=Wu),aw=" ",rw=!1;function Hk(t,e){switch(t){case"keyup":return sD.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uk(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $s=!1;function uD(t,e){switch(t){case"compositionend":return Uk(e);case"keypress":return e.which!==32?null:(rw=!0,aw);case"textInput":return t=e.data,t===aw&&rw?null:t;default:return null}}function cD(t,e){if($s)return t==="compositionend"||!Zy&&Hk(t,e)?(t=Pk(),Nf=jy=mo=null,$s=!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 Fk&&e.locale!=="ko"?null:e.data;default:return null}}var dD={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 nw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!dD[t.type]:e==="textarea"}function zk(t,e,a,r){qs?Js?Js.push(r):Js=[r]:qs=r,e=gp(e,"onChange"),0<e.length&&(a=new wp("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var Xu=null,uc=null;function fD(t){B1(t,0)}function Lp(t){var e=ju(t);if(Rk(e))return t}function ow(t,e){if(t==="change")return e}var qk=!1;kn&&(kn?(_f="oninput"in document,_f||(yv=document.createElement("div"),yv.setAttribute("oninput","return;"),_f=typeof yv.oninput=="function"),Sf=_f):Sf=!1,qk=Sf&&(!document.documentMode||9<document.documentMode));var Sf,_f,yv;function iw(){Xu&&(Xu.detachEvent("onpropertychange",$k),uc=Xu=null)}function $k(t){if(t.propertyName==="value"&&Lp(uc)){var e=[];zk(e,uc,t,Vy(t)),Bk(fD,e)}}function pD(t,e,a){t==="focusin"?(iw(),Xu=e,uc=a,Xu.attachEvent("onpropertychange",$k)):t==="focusout"&&iw()}function hD(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lp(uc)}function mD(t,e){if(t==="click")return Lp(e)}function gD(t,e){if(t==="input"||t==="change")return Lp(e)}function vD(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ha=typeof Object.is=="function"?Object.is:vD;function cc(t,e){if(Ha(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(!Xv.call(e,n)||!Ha(t[n],e[n]))return!1}return!0}function sw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lw(t,e){var a=sw(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=sw(a)}}function Vk(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Vk(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function jk(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Qf(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=Qf(t.document)}return e}function Wy(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 yD=kn&&"documentMode"in document&&11>=document.documentMode,Vs=null,ay=null,Yu=null,ry=!1;function uw(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ry||Vs==null||Vs!==Qf(r)||(r=Vs,"selectionStart"in r&&Wy(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}),Yu&&cc(Yu,r)||(Yu=r,r=gp(ay,"onSelect"),0<r.length&&(e=new wp("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=Vs)))}function ui(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var js={animationend:ui("Animation","AnimationEnd"),animationiteration:ui("Animation","AnimationIteration"),animationstart:ui("Animation","AnimationStart"),transitionrun:ui("Transition","TransitionRun"),transitionstart:ui("Transition","TransitionStart"),transitioncancel:ui("Transition","TransitionCancel"),transitionend:ui("Transition","TransitionEnd")},xv={},Gk={};kn&&(Gk=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function Li(t){if(xv[t])return xv[t];if(!js[t])return t;var e=js[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in Gk)return xv[t]=e[a];return t}var Zk=Li("animationend"),Wk=Li("animationiteration"),Xk=Li("animationstart"),xD=Li("transitionrun"),bD=Li("transitionstart"),SD=Li("transitioncancel"),Yk=Li("transitionend"),Kk=new Map,ny="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(" ");ny.push("scrollEnd");function xr(t,e){Kk.set(t,e),wi(e,[t])}var Jf=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)},Xa=[],Gs=0,Xy=0;function Ip(){for(var t=Gs,e=Xy=Gs=0;e<t;){var a=Xa[e];Xa[e++]=null;var r=Xa[e];Xa[e++]=null;var n=Xa[e];Xa[e++]=null;var o=Xa[e];if(Xa[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&&Qk(a,n,o)}}function Ap(t,e,a,r){Xa[Gs++]=t,Xa[Gs++]=e,Xa[Gs++]=a,Xa[Gs++]=r,Xy|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Yy(t,e,a,r){return Ap(t,e,a,r),ep(t)}function Ii(t,e){return Ap(t,null,null,e),ep(t)}function Qk(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-Pa(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function ep(t){if(50<oc)throw oc=0,ky=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Zs={};function _D(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 Oa(t,e,a,r){return new _D(t,e,a,r)}function Ky(t){return t=t.prototype,!(!t||!t.isReactComponent)}function _n(t,e){var a=t.alternate;return a===null?(a=Oa(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 Jk(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 Pf(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")Ky(t)&&(i=1);else if(typeof t=="string")i=kN(t,a,Ur.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case jv:return t=Oa(31,a,e,n),t.elementType=jv,t.lanes=o,t;case Hs:return mi(a.children,n,o,e);case yk:i=8,n|=24;break;case qv:return t=Oa(12,a,e,n|2),t.elementType=qv,t.lanes=o,t;case $v:return t=Oa(13,a,e,n),t.elementType=$v,t.lanes=o,t;case Vv:return t=Oa(19,a,e,n),t.elementType=Vv,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case xn:i=10;break e;case xk:i=9;break e;case Py:i=11;break e;case Fy:i=14;break e;case so:i=16,r=null;break e}i=29,a=Error(M(130,t===null?"null":typeof t,"")),r=null}return e=Oa(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function mi(t,e,a,r){return t=Oa(7,t,r,e),t.lanes=a,t}function bv(t,e,a){return t=Oa(6,t,null,e),t.lanes=a,t}function eL(t){var e=Oa(18,null,null,0);return e.stateNode=t,e}function Sv(t,e,a){return e=Oa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var cw=new WeakMap;function er(t,e){if(typeof t=="object"&&t!==null){var a=cw.get(t);return a!==void 0?a:(e={value:t,source:e,stack:jC(e)},cw.set(t,e),e)}return{value:t,source:e,stack:jC(e)}}var Ws=[],Xs=0,tp=null,dc=0,Ka=[],Qa=0,Ao=null,Pr=1,Fr="";function vn(t,e){Ws[Xs++]=dc,Ws[Xs++]=tp,tp=t,dc=e}function tL(t,e,a){Ka[Qa++]=Pr,Ka[Qa++]=Fr,Ka[Qa++]=Ao,Ao=t;var r=Pr;t=Fr;var n=32-Pa(r)-1;r&=~(1<<n),a+=1;var o=32-Pa(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,Pr=1<<32-Pa(e)+n|a<<n|r,Fr=o+t}else Pr=1<<o|a<<n|r,Fr=t}function Qy(t){t.return!==null&&(vn(t,1),tL(t,1,0))}function Jy(t){for(;t===tp;)tp=Ws[--Xs],Ws[Xs]=null,dc=Ws[--Xs],Ws[Xs]=null;for(;t===Ao;)Ao=Ka[--Qa],Ka[Qa]=null,Fr=Ka[--Qa],Ka[Qa]=null,Pr=Ka[--Qa],Ka[Qa]=null}function aL(t,e){Ka[Qa++]=Pr,Ka[Qa++]=Fr,Ka[Qa++]=Ao,Pr=e.id,Fr=e.overflow,Ao=t}var qt=null,Ye=null,Le=!1,bo=null,tr=!1,oy=Error(M(519));function Eo(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fc(er(e,t)),oy}function dw(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[zt]=t,e[ba]=r,a){case"dialog":xe("cancel",e),xe("close",e);break;case"iframe":case"object":case"embed":xe("load",e);break;case"video":case"audio":for(a=0;a<gc.length;a++)xe(gc[a],e);break;case"source":xe("error",e);break;case"img":case"image":case"link":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"input":xe("invalid",e),Mk(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":xe("invalid",e);break;case"textarea":xe("invalid",e),Dk(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||F1(e.textContent,a)?(r.popover!=null&&(xe("beforetoggle",e),xe("toggle",e)),r.onScroll!=null&&xe("scroll",e),r.onScrollEnd!=null&&xe("scrollend",e),r.onClick!=null&&(e.onclick=bn),e=!0):e=!1,e||Eo(t,!0)}function fw(t){for(qt=t.return;qt;)switch(qt.tag){case 5:case 31:case 13:tr=!1;return;case 27:case 3:tr=!0;return;default:qt=qt.return}}function Ns(t){if(t!==qt)return!1;if(!Le)return fw(t),Le=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Ty(t.type,t.memoizedProps)),a=!a),a&&Ye&&Eo(t),fw(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ye=ek(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ye=ek(t)}else e===27?(e=Ye,Oo(t.type)?(t=Dy,Dy=null,Ye=t):Ye=e):Ye=qt?rr(t.stateNode.nextSibling):null;return!0}function xi(){Ye=qt=null,Le=!1}function _v(){var t=bo;return t!==null&&(ya===null?ya=t:ya.push.apply(ya,t),bo=null),t}function fc(t){bo===null?bo=[t]:bo.push(t)}var iy=zr(null),Ai=null,Sn=null;function uo(t,e,a){je(iy,e._currentValue),e._currentValue=a}function Cn(t){t._currentValue=iy.current,Bt(iy)}function sy(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 ly(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),sy(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(M(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),sy(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 vl(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(M(387));if(i=i.memoizedProps,i!==null){var s=n.type;Ha(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===Wf.current){if(i=n.alternate,i===null)throw Error(M(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(yc):t=[yc])}n=n.return}t!==null&&ly(e,t,a,r),e.flags|=262144}function ap(t){for(t=t.firstContext;t!==null;){if(!Ha(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function bi(t){Ai=t,Sn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function $t(t){return rL(Ai,t)}function Cf(t,e){return Ai===null&&bi(t),rL(t,e)}function rL(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Sn===null){if(t===null)throw Error(M(308));Sn=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Sn=Sn.next=e;return a}var CD=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()})}},wD=Tt.unstable_scheduleCallback,kD=Tt.unstable_NormalPriority,Ct={$$typeof:xn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ex(){return{controller:new CD,data:new Map,refCount:0}}function Ic(t){t.refCount--,t.refCount===0&&wD(kD,function(){t.controller.abort()})}var Ku=null,uy=0,sl=0,el=null;function LD(t,e){if(Ku===null){var a=Ku=[];uy=0,sl=kx(),el={status:"pending",value:void 0,then:function(r){a.push(r)}}}return uy++,e.then(pw,pw),e}function pw(){if(--uy===0&&Ku!==null){el!==null&&(el.status="fulfilled");var t=Ku;Ku=null,sl=0,el=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function ID(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 hw=se.S;se.S=function(t,e){v1=Na(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&LD(t,e),hw!==null&&hw(t,e)};var gi=zr(null);function tx(){var t=gi.current;return t!==null?t:ze.pooledCache}function Ff(t,e){e===null?je(gi,gi.current):je(gi,e.pool)}function nL(){var t=tx();return t===null?null:{parent:Ct._currentValue,pool:t}}var yl=Error(M(460)),ax=Error(M(474)),Ep=Error(M(542)),rp={then:function(){}};function mw(t){return t=t.status,t==="fulfilled"||t==="rejected"}function oL(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,vw(t),t;default:if(typeof e.status=="string")e.then(bn,bn);else{if(t=ze,t!==null&&100<t.shellSuspendCounter)throw Error(M(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,vw(t),t}throw vi=e,yl}}function fi(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(vi=a,yl):a}}var vi=null;function gw(){if(vi===null)throw Error(M(459));var t=vi;return vi=null,t}function vw(t){if(t===yl||t===Ep)throw Error(M(483))}var tl=null,pc=0;function wf(t){var e=pc;return pc+=1,tl===null&&(tl=[]),oL(tl,t,e)}function Fu(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function kf(t,e){throw e.$$typeof===pO?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function iL(t){function e(m,h){if(t){var g=m.deletions;g===null?(m.deletions=[h],m.flags|=16):g.push(h)}}function a(m,h){if(!t)return null;for(;h!==null;)e(m,h),h=h.sibling;return null}function r(m){for(var h=new Map;m!==null;)m.key!==null?h.set(m.key,m):h.set(m.index,m),m=m.sibling;return h}function n(m,h){return m=_n(m,h),m.index=0,m.sibling=null,m}function o(m,h,g){return m.index=g,t?(g=m.alternate,g!==null?(g=g.index,g<h?(m.flags|=67108866,h):g):(m.flags|=67108866,h)):(m.flags|=1048576,h)}function i(m){return t&&m.alternate===null&&(m.flags|=67108866),m}function s(m,h,g,y){return h===null||h.tag!==6?(h=bv(g,m.mode,y),h.return=m,h):(h=n(h,g),h.return=m,h)}function l(m,h,g,y){var C=g.type;return C===Hs?c(m,h,g.props.children,y,g.key):h!==null&&(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===so&&fi(C)===h.type)?(h=n(h,g.props),Fu(h,g),h.return=m,h):(h=Pf(g.type,g.key,g.props,null,m.mode,y),Fu(h,g),h.return=m,h)}function u(m,h,g,y){return h===null||h.tag!==4||h.stateNode.containerInfo!==g.containerInfo||h.stateNode.implementation!==g.implementation?(h=Sv(g,m.mode,y),h.return=m,h):(h=n(h,g.children||[]),h.return=m,h)}function c(m,h,g,y,C){return h===null||h.tag!==7?(h=mi(g,m.mode,y,C),h.return=m,h):(h=n(h,g),h.return=m,h)}function d(m,h,g){if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return h=bv(""+h,m.mode,g),h.return=m,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case mf:return g=Pf(h.type,h.key,h.props,null,m.mode,g),Fu(g,h),g.return=m,g;case $u:return h=Sv(h,m.mode,g),h.return=m,h;case so:return h=fi(h),d(m,h,g)}if(Vu(h)||Bu(h))return h=mi(h,m.mode,g,null),h.return=m,h;if(typeof h.then=="function")return d(m,wf(h),g);if(h.$$typeof===xn)return d(m,Cf(m,h),g);kf(m,h)}return null}function f(m,h,g,y){var C=h!==null?h.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return C!==null?null:s(m,h,""+g,y);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case mf:return g.key===C?l(m,h,g,y):null;case $u:return g.key===C?u(m,h,g,y):null;case so:return g=fi(g),f(m,h,g,y)}if(Vu(g)||Bu(g))return C!==null?null:c(m,h,g,y,null);if(typeof g.then=="function")return f(m,h,wf(g),y);if(g.$$typeof===xn)return f(m,h,Cf(m,g),y);kf(m,g)}return null}function p(m,h,g,y,C){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return m=m.get(g)||null,s(h,m,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case mf:return m=m.get(y.key===null?g:y.key)||null,l(h,m,y,C);case $u:return m=m.get(y.key===null?g:y.key)||null,u(h,m,y,C);case so:return y=fi(y),p(m,h,g,y,C)}if(Vu(y)||Bu(y))return m=m.get(g)||null,c(h,m,y,C,null);if(typeof y.then=="function")return p(m,h,g,wf(y),C);if(y.$$typeof===xn)return p(m,h,g,Cf(h,y),C);kf(h,y)}return null}function S(m,h,g,y){for(var C=null,w=null,_=h,k=h=0,A=null;_!==null&&k<g.length;k++){_.index>k?(A=_,_=null):A=_.sibling;var I=f(m,_,g[k],y);if(I===null){_===null&&(_=A);break}t&&_&&I.alternate===null&&e(m,_),h=o(I,h,k),w===null?C=I:w.sibling=I,w=I,_=A}if(k===g.length)return a(m,_),Le&&vn(m,k),C;if(_===null){for(;k<g.length;k++)_=d(m,g[k],y),_!==null&&(h=o(_,h,k),w===null?C=_:w.sibling=_,w=_);return Le&&vn(m,k),C}for(_=r(_);k<g.length;k++)A=p(_,m,k,g[k],y),A!==null&&(t&&A.alternate!==null&&_.delete(A.key===null?k:A.key),h=o(A,h,k),w===null?C=A:w.sibling=A,w=A);return t&&_.forEach(function(R){return e(m,R)}),Le&&vn(m,k),C}function x(m,h,g,y){if(g==null)throw Error(M(151));for(var C=null,w=null,_=h,k=h=0,A=null,I=g.next();_!==null&&!I.done;k++,I=g.next()){_.index>k?(A=_,_=null):A=_.sibling;var R=f(m,_,I.value,y);if(R===null){_===null&&(_=A);break}t&&_&&R.alternate===null&&e(m,_),h=o(R,h,k),w===null?C=R:w.sibling=R,w=R,_=A}if(I.done)return a(m,_),Le&&vn(m,k),C;if(_===null){for(;!I.done;k++,I=g.next())I=d(m,I.value,y),I!==null&&(h=o(I,h,k),w===null?C=I:w.sibling=I,w=I);return Le&&vn(m,k),C}for(_=r(_);!I.done;k++,I=g.next())I=p(_,m,k,I.value,y),I!==null&&(t&&I.alternate!==null&&_.delete(I.key===null?k:I.key),h=o(I,h,k),w===null?C=I:w.sibling=I,w=I);return t&&_.forEach(function(U){return e(m,U)}),Le&&vn(m,k),C}function b(m,h,g,y){if(typeof g=="object"&&g!==null&&g.type===Hs&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case mf:e:{for(var C=g.key;h!==null;){if(h.key===C){if(C=g.type,C===Hs){if(h.tag===7){a(m,h.sibling),y=n(h,g.props.children),y.return=m,m=y;break e}}else if(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===so&&fi(C)===h.type){a(m,h.sibling),y=n(h,g.props),Fu(y,g),y.return=m,m=y;break e}a(m,h);break}else e(m,h);h=h.sibling}g.type===Hs?(y=mi(g.props.children,m.mode,y,g.key),y.return=m,m=y):(y=Pf(g.type,g.key,g.props,null,m.mode,y),Fu(y,g),y.return=m,m=y)}return i(m);case $u:e:{for(C=g.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){a(m,h.sibling),y=n(h,g.children||[]),y.return=m,m=y;break e}else{a(m,h);break}else e(m,h);h=h.sibling}y=Sv(g,m.mode,y),y.return=m,m=y}return i(m);case so:return g=fi(g),b(m,h,g,y)}if(Vu(g))return S(m,h,g,y);if(Bu(g)){if(C=Bu(g),typeof C!="function")throw Error(M(150));return g=C.call(g),x(m,h,g,y)}if(typeof g.then=="function")return b(m,h,wf(g),y);if(g.$$typeof===xn)return b(m,h,Cf(m,g),y);kf(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,h!==null&&h.tag===6?(a(m,h.sibling),y=n(h,g),y.return=m,m=y):(a(m,h),y=bv(g,m.mode,y),y.return=m,m=y),i(m)):a(m,h)}return function(m,h,g,y){try{pc=0;var C=b(m,h,g,y);return tl=null,C}catch(_){if(_===yl||_===Ep)throw _;var w=Oa(29,_,null,m.mode);return w.lanes=y,w.return=m,w}}}var Si=iL(!0),sL=iL(!1),lo=!1;function rx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cy(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 So(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _o(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(Te&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=ep(t),Qk(t,null,a),e}return Ap(t,r,e,a),ep(t)}function Qu(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,kk(t,a)}}function Cv(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 dy=!1;function Ju(){if(dy){var t=el;if(t!==null)throw t}}function ec(t,e,a,r){dy=!1;var n=t.updateQueue;lo=!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 f=s.lane&-536870913,p=f!==s.lane;if(p?(ke&f)===f:(r&f)===f){f!==0&&f===sl&&(dy=!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=Ke({},d,f);break e;case 2:lo=!0}}f=s.callback,f!==null&&(t.flags|=64,p&&(t.flags|=8192),p=n.callbacks,p===null?n.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,i|=f;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;p=s,s=p.next,p.next=null,n.lastBaseUpdate=p,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),Ro|=i,t.lanes=i,t.memoizedState=d}}function lL(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function uL(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)lL(a[t],e)}var ll=zr(null),np=zr(0);function yw(t,e){t=En,je(np,t),je(ll,e),En=t|e.baseLanes}function fy(){je(np,En),je(ll,ll.current)}function nx(){En=np.current,Bt(ll),Bt(np)}var Ua=zr(null),ar=null;function co(t){var e=t.alternate;je(gt,gt.current&1),je(Ua,t),ar===null&&(e===null||ll.current!==null||e.memoizedState!==null)&&(ar=t)}function py(t){je(gt,gt.current),je(Ua,t),ar===null&&(ar=t)}function cL(t){t.tag===22?(je(gt,gt.current),je(Ua,t),ar===null&&(ar=t)):fo(t)}function fo(){je(gt,gt.current),je(Ua,Ua.current)}function Ma(t){Bt(Ua),ar===t&&(ar=null),Bt(gt)}var gt=zr(0);function op(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||My(a)||Oy(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 Ln=0,pe=null,Pe=null,St=null,ip=!1,al=!1,_i=!1,sp=0,hc=0,rl=null,AD=0;function lt(){throw Error(M(321))}function ox(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!Ha(t[a],e[a]))return!1;return!0}function ix(t,e,a,r,n,o){return Ln=o,pe=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,se.H=t===null||t.memoizedState===null?zL:vx,_i=!1,o=a(r,n),_i=!1,al&&(o=fL(e,a,r,n)),dL(t),o}function dL(t){se.H=mc;var e=Pe!==null&&Pe.next!==null;if(Ln=0,St=Pe=pe=null,ip=!1,hc=0,rl=null,e)throw Error(M(300));t===null||wt||(t=t.dependencies,t!==null&&ap(t)&&(wt=!0))}function fL(t,e,a,r){pe=t;var n=0;do{if(al&&(rl=null),hc=0,al=!1,25<=n)throw Error(M(301));if(n+=1,St=Pe=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}se.H=qL,o=e(a,r)}while(al);return o}function ED(){var t=se.H,e=t.useState()[0];return e=typeof e.then=="function"?Ac(e):e,t=t.useState()[0],(Pe!==null?Pe.memoizedState:null)!==t&&(pe.flags|=1024),e}function sx(){var t=sp!==0;return sp=0,t}function lx(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function ux(t){if(ip){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}ip=!1}Ln=0,St=Pe=pe=null,al=!1,hc=sp=0,rl=null}function oa(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?pe.memoizedState=St=t:St=St.next=t,St}function vt(){if(Pe===null){var t=pe.alternate;t=t!==null?t.memoizedState:null}else t=Pe.next;var e=St===null?pe.memoizedState:St.next;if(e!==null)St=e,Pe=t;else{if(t===null)throw pe.alternate===null?Error(M(467)):Error(M(310));Pe=t,t={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},St===null?pe.memoizedState=St=t:St=St.next=t}return St}function Tp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ac(t){var e=hc;return hc+=1,rl===null&&(rl=[]),t=oL(rl,t,e),e=pe,(St===null?e.memoizedState:St.next)===null&&(e=e.alternate,se.H=e===null||e.memoizedState===null?zL:vx),t}function Rp(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ac(t);if(t.$$typeof===xn)return $t(t)}throw Error(M(438,String(t)))}function cx(t){var e=null,a=pe.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var r=pe.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=Tp(),pe.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]=hO;return e.index++,a}function In(t,e){return typeof e=="function"?e(t):e}function Hf(t){var e=vt();return dx(e,Pe,t)}function dx(t,e,a){var r=t.queue;if(r===null)throw Error(M(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?(ke&d)===d:(Ln&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===sl&&(c=!0);else if((Ln&f)===f){u=u.next,f===sl&&(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,pe.lanes|=f,Ro|=f;d=u.action,_i&&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,pe.lanes|=d,Ro|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!Ha(o,t.memoizedState)&&(wt=!0,c&&(a=el,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 wv(t){var e=vt(),a=e.queue;if(a===null)throw Error(M(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);Ha(o,e.memoizedState)||(wt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function pL(t,e,a){var r=pe,n=vt(),o=Le;if(o){if(a===void 0)throw Error(M(407));a=a()}else a=e();var i=!Ha((Pe||n).memoizedState,a);if(i&&(n.memoizedState=a,wt=!0),n=n.queue,fx(gL.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||St!==null&&St.memoizedState.tag&1){if(r.flags|=2048,ul(9,{destroy:void 0},mL.bind(null,r,n,a,e),null),ze===null)throw Error(M(349));o||(Ln&127)!==0||hL(r,e,a)}return a}function hL(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=pe.updateQueue,e===null?(e=Tp(),pe.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function mL(t,e,a,r){e.value=a,e.getSnapshot=r,vL(e)&&yL(t)}function gL(t,e,a){return a(function(){vL(e)&&yL(t)})}function vL(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!Ha(t,a)}catch{return!0}}function yL(t){var e=Ii(t,2);e!==null&&xa(e,t,2)}function hy(t){var e=oa();if(typeof t=="function"){var a=t;if(t=a(),_i){ho(!0);try{a()}finally{ho(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:In,lastRenderedState:t},e}function xL(t,e,a,r){return t.baseState=a,dx(t,Pe,typeof r=="function"?r:In)}function TD(t,e,a,r,n){if(Op(t))throw Error(M(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)}};se.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,bL(e,o)):(o.next=a.next,e.pending=a.next=o)}}function bL(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=se.T,i={};se.T=i;try{var s=a(n,r),l=se.S;l!==null&&l(i,s),xw(t,e,s)}catch(u){my(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),se.T=o}}else try{o=a(n,r),xw(t,e,o)}catch(u){my(t,e,u)}}function xw(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){bw(t,e,r)},function(r){return my(t,e,r)}):bw(t,e,a)}function bw(t,e,a){e.status="fulfilled",e.value=a,SL(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,bL(t,a)))}function my(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,SL(e),e=e.next;while(e!==r)}t.action=null}function SL(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function _L(t,e){return e}function Sw(t,e){if(Le){var a=ze.formState;if(a!==null){e:{var r=pe;if(Le){if(Ye){t:{for(var n=Ye,o=tr;n.nodeType!==8;){if(!o){n=null;break t}if(n=rr(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Ye=rr(n.nextSibling),r=n.data==="F!";break e}}Eo(r)}r=!1}r&&(e=a[0])}}return a=oa(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_L,lastRenderedState:e},a.queue=r,a=FL.bind(null,pe,r),r.dispatch=a,r=hy(!1),o=gx.bind(null,pe,!1,r.queue),r=oa(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=TD.bind(null,pe,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function _w(t){var e=vt();return CL(e,Pe,t)}function CL(t,e,a){if(e=dx(t,e,_L)[0],t=Hf(In)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=Ac(e)}catch(i){throw i===yl?Ep:i}else r=e;e=vt();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(pe.flags|=2048,ul(9,{destroy:void 0},RD.bind(null,n,a),null)),[r,o,t]}function RD(t,e){t.action=e}function Cw(t){var e=vt(),a=Pe;if(a!==null)return CL(e,a,t);vt(),e=e.memoizedState,a=vt();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function ul(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=pe.updateQueue,e===null&&(e=Tp(),pe.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 wL(){return vt().memoizedState}function Uf(t,e,a,r){var n=oa();pe.flags|=t,n.memoizedState=ul(1|e,{destroy:void 0},a,r===void 0?null:r)}function Mp(t,e,a,r){var n=vt();r=r===void 0?null:r;var o=n.memoizedState.inst;Pe!==null&&r!==null&&ox(r,Pe.memoizedState.deps)?n.memoizedState=ul(e,o,a,r):(pe.flags|=t,n.memoizedState=ul(1|e,o,a,r))}function ww(t,e){Uf(8390656,8,t,e)}function fx(t,e){Mp(2048,8,t,e)}function MD(t){pe.flags|=4;var e=pe.updateQueue;if(e===null)e=Tp(),pe.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function kL(t){var e=vt().memoizedState;return MD({ref:e,nextImpl:t}),function(){if((Te&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function LL(t,e){return Mp(4,2,t,e)}function IL(t,e){return Mp(4,4,t,e)}function AL(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 EL(t,e,a){a=a!=null?a.concat([t]):null,Mp(4,4,AL.bind(null,e,t),a)}function px(){}function TL(t,e){var a=vt();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&ox(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function RL(t,e){var a=vt();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&ox(e,r[1]))return r[0];if(r=t(),_i){ho(!0);try{t()}finally{ho(!1)}}return a.memoizedState=[r,e],r}function hx(t,e,a){return a===void 0||(Ln&1073741824)!==0&&(ke&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=x1(),pe.lanes|=t,Ro|=t,a)}function ML(t,e,a,r){return Ha(a,e)?a:ll.current!==null?(t=hx(t,a,r),Ha(t,e)||(wt=!0),t):(Ln&42)===0||(Ln&1073741824)!==0&&(ke&261930)===0?(wt=!0,t.memoizedState=a):(t=x1(),pe.lanes|=t,Ro|=t,e)}function OL(t,e,a,r,n){var o=Re.p;Re.p=o!==0&&8>o?o:8;var i=se.T,s={};se.T=s,gx(t,!1,e,a);try{var l=n(),u=se.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=ID(l,r);tc(t,e,c,Fa(t))}else tc(t,e,r,Fa(t))}catch(d){tc(t,e,{then:function(){},status:"rejected",reason:d},Fa())}finally{Re.p=o,i!==null&&s.types!==null&&(i.types=s.types),se.T=i}}function OD(){}function gy(t,e,a,r){if(t.tag!==5)throw Error(M(476));var n=DL(t).queue;OL(t,n,e,hi,a===null?OD:function(){return NL(t),a(r)})}function DL(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:hi,baseState:hi,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:In,lastRenderedState:hi},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:In,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function NL(t){var e=DL(t);e.next===null&&(e=t.alternate.memoizedState),tc(t,e.next.queue,{},Fa())}function mx(){return $t(yc)}function BL(){return vt().memoizedState}function PL(){return vt().memoizedState}function DD(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=Fa();t=So(a);var r=_o(e,t,a);r!==null&&(xa(r,e,a),Qu(r,e,a)),e={cache:ex()},t.payload=e;return}e=e.return}}function ND(t,e,a){var r=Fa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Op(t)?HL(e,a):(a=Yy(t,e,a,r),a!==null&&(xa(a,t,r),UL(a,e,r)))}function FL(t,e,a){var r=Fa();tc(t,e,a,r)}function tc(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Op(t))HL(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,Ha(s,i))return Ap(t,e,n,0),ze===null&&Ip(),!1}catch{}if(a=Yy(t,e,n,r),a!==null)return xa(a,t,r),UL(a,e,r),!0}return!1}function gx(t,e,a,r){if(r={lane:2,revertLane:kx(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Op(t)){if(e)throw Error(M(479))}else e=Yy(t,a,r,2),e!==null&&xa(e,t,2)}function Op(t){var e=t.alternate;return t===pe||e!==null&&e===pe}function HL(t,e){al=ip=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function UL(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,kk(t,a)}}var mc={readContext:$t,use:Rp,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt};mc.useEffectEvent=lt;var zL={readContext:$t,use:Rp,useCallback:function(t,e){return oa().memoizedState=[t,e===void 0?null:e],t},useContext:$t,useEffect:ww,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Uf(4194308,4,AL.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Uf(4194308,4,t,e)},useInsertionEffect:function(t,e){Uf(4,2,t,e)},useMemo:function(t,e){var a=oa();e=e===void 0?null:e;var r=t();if(_i){ho(!0);try{t()}finally{ho(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=oa();if(a!==void 0){var n=a(e);if(_i){ho(!0);try{a(e)}finally{ho(!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=ND.bind(null,pe,t),[r.memoizedState,t]},useRef:function(t){var e=oa();return t={current:t},e.memoizedState=t},useState:function(t){t=hy(t);var e=t.queue,a=FL.bind(null,pe,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:px,useDeferredValue:function(t,e){var a=oa();return hx(a,t,e)},useTransition:function(){var t=hy(!1);return t=OL.bind(null,pe,t.queue,!0,!1),oa().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=pe,n=oa();if(Le){if(a===void 0)throw Error(M(407));a=a()}else{if(a=e(),ze===null)throw Error(M(349));(ke&127)!==0||hL(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,ww(gL.bind(null,r,o,t),[t]),r.flags|=2048,ul(9,{destroy:void 0},mL.bind(null,r,o,a,e),null),a},useId:function(){var t=oa(),e=ze.identifierPrefix;if(Le){var a=Fr,r=Pr;a=(r&~(1<<32-Pa(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=sp++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=AD++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:mx,useFormState:Sw,useActionState:Sw,useOptimistic:function(t){var e=oa();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=gx.bind(null,pe,!0,a),a.dispatch=e,[t,e]},useMemoCache:cx,useCacheRefresh:function(){return oa().memoizedState=DD.bind(null,pe)},useEffectEvent:function(t){var e=oa(),a={impl:t};return e.memoizedState=a,function(){if((Te&2)!==0)throw Error(M(440));return a.impl.apply(void 0,arguments)}}},vx={readContext:$t,use:Rp,useCallback:TL,useContext:$t,useEffect:fx,useImperativeHandle:EL,useInsertionEffect:LL,useLayoutEffect:IL,useMemo:RL,useReducer:Hf,useRef:wL,useState:function(){return Hf(In)},useDebugValue:px,useDeferredValue:function(t,e){var a=vt();return ML(a,Pe.memoizedState,t,e)},useTransition:function(){var t=Hf(In)[0],e=vt().memoizedState;return[typeof t=="boolean"?t:Ac(t),e]},useSyncExternalStore:pL,useId:BL,useHostTransitionStatus:mx,useFormState:_w,useActionState:_w,useOptimistic:function(t,e){var a=vt();return xL(a,Pe,t,e)},useMemoCache:cx,useCacheRefresh:PL};vx.useEffectEvent=kL;var qL={readContext:$t,use:Rp,useCallback:TL,useContext:$t,useEffect:fx,useImperativeHandle:EL,useInsertionEffect:LL,useLayoutEffect:IL,useMemo:RL,useReducer:wv,useRef:wL,useState:function(){return wv(In)},useDebugValue:px,useDeferredValue:function(t,e){var a=vt();return Pe===null?hx(a,t,e):ML(a,Pe.memoizedState,t,e)},useTransition:function(){var t=wv(In)[0],e=vt().memoizedState;return[typeof t=="boolean"?t:Ac(t),e]},useSyncExternalStore:pL,useId:BL,useHostTransitionStatus:mx,useFormState:Cw,useActionState:Cw,useOptimistic:function(t,e){var a=vt();return Pe!==null?xL(a,Pe,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:cx,useCacheRefresh:PL};qL.useEffectEvent=kL;function kv(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:Ke({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var vy={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=Fa(),n=So(r);n.payload=e,a!=null&&(n.callback=a),e=_o(t,n,r),e!==null&&(xa(e,t,r),Qu(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=Fa(),n=So(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=_o(t,n,r),e!==null&&(xa(e,t,r),Qu(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=Fa(),r=So(a);r.tag=2,e!=null&&(r.callback=e),e=_o(t,r,a),e!==null&&(xa(e,t,a),Qu(e,t,a))}};function kw(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?!cc(a,r)||!cc(n,o):!0}function Lw(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&&vy.enqueueReplaceState(e,e.state,null)}function Ci(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=Ke({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function $L(t){Jf(t)}function VL(t){console.error(t)}function jL(t){Jf(t)}function lp(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function Iw(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 yy(t,e,a){return a=So(a),a.tag=3,a.payload={element:null},a.callback=function(){lp(t,e)},a}function GL(t){return t=So(t),t.tag=3,t}function ZL(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(){Iw(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){Iw(e,a,r),typeof n!="function"&&(Co===null?Co=new Set([this]):Co.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function BD(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&vl(e,a,n,!0),a=Ua.current,a!==null){switch(a.tag){case 31:case 13:return ar===null?pp():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===rp?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),Bv(t,r,n)),!1;case 22:return a.flags|=65536,r===rp?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)),Bv(t,r,n)),!1}throw Error(M(435,a.tag))}return Bv(t,r,n),pp(),!1}if(Le)return e=Ua.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==oy&&(t=Error(M(422),{cause:r}),fc(er(t,a)))):(r!==oy&&(e=Error(M(423),{cause:r}),fc(er(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=er(r,a),n=yy(t.stateNode,r,n),Cv(t,n),ut!==4&&(ut=2)),!1;var o=Error(M(520),{cause:r});if(o=er(o,a),nc===null?nc=[o]:nc.push(o),ut!==4&&(ut=2),e===null)return!0;r=er(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=yy(a.stateNode,r,t),Cv(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"&&(Co===null||!Co.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=GL(n),ZL(n,t,a,r),Cv(a,n),!1}a=a.return}while(a!==null);return!1}var yx=Error(M(461)),wt=!1;function Ut(t,e,a,r){e.child=t===null?sL(e,null,a,r):Si(e,t.child,a,r)}function Aw(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 bi(e),r=ix(t,e,a,i,o,n),s=sx(),t!==null&&!wt?(lx(t,e,n),An(t,e,n)):(Le&&s&&Qy(e),e.flags|=1,Ut(t,e,r,n),e.child)}function Ew(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!Ky(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,WL(t,e,o,r,n)):(t=Pf(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!xx(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:cc,a(i,r)&&t.ref===e.ref)return An(t,e,n)}return e.flags|=1,t=_n(o,r),t.ref=e.ref,t.return=e,e.child=t}function WL(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(cc(o,r)&&t.ref===e.ref)if(wt=!1,e.pendingProps=r=o,xx(t,n))(t.flags&131072)!==0&&(wt=!0);else return e.lanes=t.lanes,An(t,e,n)}return xy(t,e,a,r,n)}function XL(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 Tw(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ff(e,o!==null?o.cachePool:null),o!==null?yw(e,o):fy(),cL(e);else return r=e.lanes=536870912,Tw(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Ff(e,o.cachePool),yw(e,o),fo(e),e.memoizedState=null):(t!==null&&Ff(e,null),fy(),fo(e));return Ut(t,e,n,a),e.child}function Gu(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Tw(t,e,a,r,n){var o=tx();return o=o===null?null:{parent:Ct._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Ff(e,null),fy(),cL(e),t!==null&&vl(t,e,r,!0),e.childLanes=n,null}function zf(t,e){return e=up({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function Rw(t,e,a){return Si(e,t.child,null,a),t=zf(e,e.pendingProps),t.flags|=2,Ma(e),e.memoizedState=null,t}function PD(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Le){if(r.mode==="hidden")return t=zf(e,r),e.lanes=536870912,Gu(null,t);if(py(e),(t=Ye)?(t=z1(t,tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Ao!==null?{id:Pr,overflow:Fr}:null,retryLane:536870912,hydrationErrors:null},a=eL(t),a.return=e,e.child=a,qt=e,Ye=null)):t=null,t===null)throw Eo(e);return e.lanes=536870912,null}return zf(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(py(e),n)if(e.flags&256)e.flags&=-257,e=Rw(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(wt||vl(t,e,a,!1),n=(a&t.childLanes)!==0,wt||n){if(r=ze,r!==null&&(i=Lk(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Ii(t,i),xa(r,t,i),yx;pp(),e=Rw(t,e,a)}else t=o.treeContext,Ye=rr(i.nextSibling),qt=e,Le=!0,bo=null,tr=!1,t!==null&&aL(e,t),e=zf(e,r),e.flags|=4096;return e}return t=_n(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function qf(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(M(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function xy(t,e,a,r,n){return bi(e),a=ix(t,e,a,r,void 0,n),r=sx(),t!==null&&!wt?(lx(t,e,n),An(t,e,n)):(Le&&r&&Qy(e),e.flags|=1,Ut(t,e,a,n),e.child)}function Mw(t,e,a,r,n,o){return bi(e),e.updateQueue=null,a=fL(e,r,a,n),dL(t),r=sx(),t!==null&&!wt?(lx(t,e,o),An(t,e,o)):(Le&&r&&Qy(e),e.flags|=1,Ut(t,e,a,o),e.child)}function Ow(t,e,a,r,n){if(bi(e),e.stateNode===null){var o=Zs,i=a.contextType;typeof i=="object"&&i!==null&&(o=$t(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=vy,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},rx(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?$t(i):Zs,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(kv(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&&vy.enqueueReplaceState(o,o.state,null),ec(e,r,o,n),Ju(),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=Ci(a,s);o.props=l;var u=o.context,c=a.contextType;i=Zs,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)&&Lw(e,o,r,i),lo=!1;var f=e.memoizedState;o.state=f,ec(e,r,o,n),Ju(),u=e.memoizedState,s||f!==u||lo?(typeof d=="function"&&(kv(e,a,d,r),u=e.memoizedState),(l=lo||kw(e,a,l,r,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=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,cy(t,e),i=e.memoizedProps,c=Ci(a,i),o.props=c,d=e.pendingProps,f=o.context,u=a.contextType,l=Zs,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)&&Lw(e,o,r,l),lo=!1,f=e.memoizedState,o.state=f,ec(e,r,o,n),Ju();var p=e.memoizedState;i!==d||f!==p||lo||t!==null&&t.dependencies!==null&&ap(t.dependencies)?(typeof s=="function"&&(kv(e,a,s,r),p=e.memoizedState),(c=lo||kw(e,a,c,r,f,p,l)||t!==null&&t.dependencies!==null&&ap(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,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=r,e.memoizedState=p),o.props=r,o.state=p,o.context=l,r=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),r=!1)}return o=r,qf(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=Si(e,t.child,null,n),e.child=Si(e,null,a,n)):Ut(t,e,a,n),e.memoizedState=o.state,t=e.child):t=An(t,e,n),t}function Dw(t,e,a,r){return xi(),e.flags|=256,Ut(t,e,a,r),e.child}var Lv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Iv(t){return{baseLanes:t,cachePool:nL()}}function Av(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=Da),t}function YL(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:(gt.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(Le){if(n?co(e):fo(e),(t=Ye)?(t=z1(t,tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Ao!==null?{id:Pr,overflow:Fr}:null,retryLane:536870912,hydrationErrors:null},a=eL(t),a.return=e,e.child=a,qt=e,Ye=null)):t=null,t===null)throw Eo(e);return Oy(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(fo(e),n=e.mode,s=up({mode:"hidden",children:s},n),r=mi(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=Iv(a),r.childLanes=Av(t,i,a),e.memoizedState=Lv,Gu(null,r)):(co(e),by(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(co(e),e.flags&=-257,e=Ev(t,e,a)):e.memoizedState!==null?(fo(e),e.child=t.child,e.flags|=128,e=null):(fo(e),s=r.fallback,n=e.mode,r=up({mode:"visible",children:r.children},n),s=mi(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Si(e,t.child,null,a),r=e.child,r.memoizedState=Iv(a),r.childLanes=Av(t,i,a),e.memoizedState=Lv,e=Gu(null,r));else if(co(e),Oy(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(M(419)),r.stack="",r.digest=i,fc({value:r,source:null,stack:null}),e=Ev(t,e,a)}else if(wt||vl(t,e,a,!1),i=(a&t.childLanes)!==0,wt||i){if(i=ze,i!==null&&(r=Lk(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Ii(t,r),xa(i,t,r),yx;My(s)||pp(),e=Ev(t,e,a)}else My(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ye=rr(s.nextSibling),qt=e,Le=!0,bo=null,tr=!1,t!==null&&aL(e,t),e=by(e,r.children),e.flags|=4096);return e}return n?(fo(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=_n(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=_n(u,s):(s=mi(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,Gu(null,r),r=e.child,s=t.child.memoizedState,s===null?s=Iv(a):(n=s.cachePool,n!==null?(l=Ct._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=nL(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=Av(t,i,a),e.memoizedState=Lv,Gu(t.child,r)):(co(e),a=t.child,t=a.sibling,a=_n(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 by(t,e){return e=up({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function up(t,e){return t=Oa(22,t,null,e),t.lanes=0,t}function Ev(t,e,a){return Si(e,t.child,null,a),t=by(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Nw(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),sy(t.return,e,a)}function Tv(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 KL(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=gt.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,je(gt,i),Ut(t,e,r,a),r=Le?dc:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Nw(t,a,e);else if(t.tag===19)Nw(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&&op(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),Tv(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&&op(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}Tv(e,!0,a,null,o,r);break;case"together":Tv(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function An(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Ro|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(vl(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,a=_n(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=_n(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function xx(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&ap(t)))}function FD(t,e,a){switch(e.tag){case 3:Xf(e,e.stateNode.containerInfo),uo(e,Ct,t.memoizedState.cache),xi();break;case 27:case 5:Wv(e);break;case 4:Xf(e,e.stateNode.containerInfo);break;case 10:uo(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,py(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(co(e),e.flags|=128,null):(a&e.child.childLanes)!==0?YL(t,e,a):(co(e),t=An(t,e,a),t!==null?t.sibling:null);co(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(vl(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return KL(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),je(gt,gt.current),r)break;return null;case 22:return e.lanes=0,XL(t,e,a,e.pendingProps);case 24:uo(e,Ct,t.memoizedState.cache)}return An(t,e,a)}function QL(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)wt=!0;else{if(!xx(t,a)&&(e.flags&128)===0)return wt=!1,FD(t,e,a);wt=(t.flags&131072)!==0}else wt=!1,Le&&(e.flags&1048576)!==0&&tL(e,dc,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=fi(e.elementType),e.type=t,typeof t=="function")Ky(t)?(r=Ci(t,r),e.tag=1,e=Ow(null,e,t,r,a)):(e.tag=0,e=xy(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===Py){e.tag=11,e=Aw(null,e,t,r,a);break e}else if(n===Fy){e.tag=14,e=Ew(null,e,t,r,a);break e}}throw e=Gv(t)||t,Error(M(306,e,""))}}return e;case 0:return xy(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Ci(r,e.pendingProps),Ow(t,e,r,n,a);case 3:e:{if(Xf(e,e.stateNode.containerInfo),t===null)throw Error(M(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,cy(t,e),ec(e,r,null,a);var i=e.memoizedState;if(r=i.cache,uo(e,Ct,r),r!==o.cache&&ly(e,[Ct],a,!0),Ju(),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=Dw(t,e,r,a);break e}else if(r!==n){n=er(Error(M(424)),e),fc(n),e=Dw(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,Ye=rr(t.firstChild),qt=e,Le=!0,bo=null,tr=!0,a=sL(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(xi(),r===n){e=An(t,e,a);break e}Ut(t,e,r,a)}e=e.child}return e;case 26:return qf(t,e),t===null?(a=rk(e.type,null,e.pendingProps,null))?e.memoizedState=a:Le||(a=e.type,t=e.pendingProps,r=vp(xo.current).createElement(a),r[zt]=e,r[ba]=t,Vt(r,a,t),Nt(r),e.stateNode=r):e.memoizedState=rk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Wv(e),t===null&&Le&&(r=e.stateNode=q1(e.type,e.pendingProps,xo.current),qt=e,tr=!0,n=Ye,Oo(e.type)?(Dy=n,Ye=rr(r.firstChild)):Ye=n),Ut(t,e,e.pendingProps.children,a),qf(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Le&&((n=r=Ye)&&(r=fN(r,e.type,e.pendingProps,tr),r!==null?(e.stateNode=r,qt=e,Ye=rr(r.firstChild),tr=!1,n=!0):n=!1),n||Eo(e)),Wv(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,Ty(n,o)?r=null:i!==null&&Ty(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=ix(t,e,ED,null,null,a),yc._currentValue=n),qf(t,e),Ut(t,e,r,a),e.child;case 6:return t===null&&Le&&((t=a=Ye)&&(a=pN(a,e.pendingProps,tr),a!==null?(e.stateNode=a,qt=e,Ye=null,t=!0):t=!1),t||Eo(e)),null;case 13:return YL(t,e,a);case 4:return Xf(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Si(e,null,r,a):Ut(t,e,r,a),e.child;case 11:return Aw(t,e,e.type,e.pendingProps,a);case 7:return Ut(t,e,e.pendingProps,a),e.child;case 8:return Ut(t,e,e.pendingProps.children,a),e.child;case 12:return Ut(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,uo(e,e.type,r.value),Ut(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,bi(e),n=$t(n),r=r(n),e.flags|=1,Ut(t,e,r,a),e.child;case 14:return Ew(t,e,e.type,e.pendingProps,a);case 15:return WL(t,e,e.type,e.pendingProps,a);case 19:return KL(t,e,a);case 31:return PD(t,e,a);case 22:return XL(t,e,a,e.pendingProps);case 24:return bi(e),r=$t(Ct),t===null?(n=tx(),n===null&&(n=ze,o=ex(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},rx(e),uo(e,Ct,n)):((t.lanes&a)!==0&&(cy(t,e),ec(e,null,null,a),Ju()),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),uo(e,Ct,r)):(r=o.cache,uo(e,Ct,r),r!==n.cache&&ly(e,[Ct],a,!0))),Ut(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function pn(t){t.flags|=4}function Rv(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(_1())t.flags|=8192;else throw vi=rp,ax}else t.flags&=-16777217}function Bw(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!j1(e))if(_1())t.flags|=8192;else throw vi=rp,ax}function Lf(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Ck():536870912,t.lanes|=e,cl|=e)}function Hu(t,e){if(!Le)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 Xe(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 HD(t,e,a){var r=e.pendingProps;switch(Jy(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(e),null;case 1:return Xe(e),null;case 3:return a=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Cn(Ct),nl(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Ns(e)?pn(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,_v())),Xe(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(pn(e),o!==null?(Xe(e),Bw(e,o)):(Xe(e),Rv(e,n,null,r,a))):o?o!==t.memoizedState?(pn(e),Xe(e),Bw(e,o)):(Xe(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&pn(e),Xe(e),Rv(e,n,t,r,a)),null;case 27:if(Yf(e),a=xo.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&pn(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return Xe(e),null}t=Ur.current,Ns(e)?dw(e,t):(t=q1(n,r,a),e.stateNode=t,pn(e))}return Xe(e),null;case 5:if(Yf(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&pn(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return Xe(e),null}if(o=Ur.current,Ns(e))dw(e,o);else{var i=vp(xo.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[zt]=e,o[ba]=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(Vt(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&&pn(e)}}return Xe(e),Rv(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&pn(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(M(166));if(t=xo.current,Ns(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=qt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[zt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||F1(t.nodeValue,a)),t||Eo(e,!0)}else t=vp(t).createTextNode(r),t[zt]=e,e.stateNode=t}return Xe(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=Ns(e),a!==null){if(t===null){if(!r)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[zt]=e}else xi(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Xe(e),t=!1}else a=_v(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(Ma(e),e):(Ma(e),null);if((e.flags&128)!==0)throw Error(M(558))}return Xe(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=Ns(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(M(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[zt]=e}else xi(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Xe(e),n=!1}else n=_v(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(Ma(e),e):(Ma(e),null)}return Ma(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),Lf(e,e.updateQueue),Xe(e),null);case 4:return nl(),t===null&&Lx(e.stateNode.containerInfo),Xe(e),null;case 10:return Cn(e.type),Xe(e),null;case 19:if(Bt(gt),r=e.memoizedState,r===null)return Xe(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)Hu(r,!1);else{if(ut!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=op(t),o!==null){for(e.flags|=128,Hu(r,!1),t=o.updateQueue,e.updateQueue=t,Lf(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)Jk(a,t),a=a.sibling;return je(gt,gt.current&1|2),Le&&vn(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&Na()>dp&&(e.flags|=128,n=!0,Hu(r,!1),e.lanes=4194304)}else{if(!n)if(t=op(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,Lf(e,t),Hu(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Le)return Xe(e),null}else 2*Na()-r.renderingStartTime>dp&&a!==536870912&&(e.flags|=128,n=!0,Hu(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=Na(),t.sibling=null,a=gt.current,je(gt,n?a&1|2:a&1),Le&&vn(e,r.treeForkCount),t):(Xe(e),null);case 22:case 23:return Ma(e),nx(),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&&(Xe(e),e.subtreeFlags&6&&(e.flags|=8192)):Xe(e),a=e.updateQueue,a!==null&&Lf(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&&Bt(gi),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Cn(Ct),Xe(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function UD(t,e){switch(Jy(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Cn(Ct),nl(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Yf(e),null;case 31:if(e.memoizedState!==null){if(Ma(e),e.alternate===null)throw Error(M(340));xi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Ma(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));xi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Bt(gt),null;case 4:return nl(),null;case 10:return Cn(e.type),null;case 22:case 23:return Ma(e),nx(),t!==null&&Bt(gi),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Cn(Ct),null;case 25:return null;default:return null}}function JL(t,e){switch(Jy(e),e.tag){case 3:Cn(Ct),nl();break;case 26:case 27:case 5:Yf(e);break;case 4:nl();break;case 31:e.memoizedState!==null&&Ma(e);break;case 13:Ma(e);break;case 19:Bt(gt);break;case 10:Cn(e.type);break;case 22:case 23:Ma(e),nx(),t!==null&&Bt(gi);break;case 24:Cn(Ct)}}function Ec(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){De(e,e.return,s)}}function To(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){De(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){De(e,e.return,c)}}function e1(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{uL(e,a)}catch(r){De(t,t.return,r)}}}function t1(t,e,a){a.props=Ci(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){De(t,e,r)}}function ac(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){De(t,e,n)}}function Hr(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){De(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){De(t,e,n)}else a.current=null}function a1(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){De(t,t.return,n)}}function Mv(t,e,a){try{var r=t.stateNode;iN(r,t.type,a,e),r[ba]=e}catch(n){De(t,t.return,n)}}function r1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Oo(t.type)||t.tag===4}function Ov(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||r1(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&&Oo(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 Sy(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=bn));else if(r!==4&&(r===27&&Oo(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(Sy(t,e,a),t=t.sibling;t!==null;)Sy(t,e,a),t=t.sibling}function cp(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&&Oo(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(cp(t,e,a),t=t.sibling;t!==null;)cp(t,e,a),t=t.sibling}function n1(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Vt(e,r,a),e[zt]=t,e[ba]=a}catch(o){De(t,t.return,o)}}var yn=!1,_t=!1,Dv=!1,Pw=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function zD(t,e){if(t=t.containerInfo,Ay=Sp,t=jk(t),Wy(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,f=null;t:for(;;){for(var p;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),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===a&&++u===n&&(s=i),f===o&&++c===r&&(l=i),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}a=s===-1||l===-1?null:{start:s,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ey={focusedElem:t,selectionRange:a},Sp=!1,Dt=e;Dt!==null;)if(e=Dt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Dt=t;else for(;Dt!==null;){switch(e=Dt,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=Ci(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(x){De(a,a.return,x)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)Ry(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ry(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(M(163))}if(t=e.sibling,t!==null){t.return=e.return,Dt=t;break}Dt=e.return}}function o1(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:mn(t,a),r&4&&Ec(5,a);break;case 1:if(mn(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){De(a,a.return,i)}else{var n=Ci(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){De(a,a.return,i)}}r&64&&e1(a),r&512&&ac(a,a.return);break;case 3:if(mn(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{uL(t,e)}catch(i){De(a,a.return,i)}}break;case 27:e===null&&r&4&&n1(a);case 26:case 5:mn(t,a),e===null&&r&4&&a1(a),r&512&&ac(a,a.return);break;case 12:mn(t,a);break;case 31:mn(t,a),r&4&&l1(t,a);break;case 13:mn(t,a),r&4&&u1(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=YD.bind(null,a),hN(t,a))));break;case 22:if(r=a.memoizedState!==null||yn,!r){e=e!==null&&e.memoizedState!==null||_t,n=yn;var o=_t;yn=r,(_t=e)&&!o?gn(t,a,(a.subtreeFlags&8772)!==0):mn(t,a),yn=n,_t=o}break;case 30:break;default:mn(t,a)}}function i1(t){var e=t.alternate;e!==null&&(t.alternate=null,i1(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&qy(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 tt=null,va=!1;function hn(t,e,a){for(a=a.child;a!==null;)s1(t,e,a),a=a.sibling}function s1(t,e,a){if(Ba&&typeof Ba.onCommitFiberUnmount=="function")try{Ba.onCommitFiberUnmount(_c,a)}catch{}switch(a.tag){case 26:_t||Hr(a,e),hn(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_t||Hr(a,e);var r=tt,n=va;Oo(a.type)&&(tt=a.stateNode,va=!1),hn(t,e,a),ic(a.stateNode),tt=r,va=n;break;case 5:_t||Hr(a,e);case 6:if(r=tt,n=va,tt=null,hn(t,e,a),tt=r,va=n,tt!==null)if(va)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(a.stateNode)}catch(o){De(a,e,o)}else try{tt.removeChild(a.stateNode)}catch(o){De(a,e,o)}break;case 18:tt!==null&&(va?(t=tt,Qw(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),hl(t)):Qw(tt,a.stateNode));break;case 4:r=tt,n=va,tt=a.stateNode.containerInfo,va=!0,hn(t,e,a),tt=r,va=n;break;case 0:case 11:case 14:case 15:To(2,a,e),_t||To(4,a,e),hn(t,e,a);break;case 1:_t||(Hr(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&t1(a,e,r)),hn(t,e,a);break;case 21:hn(t,e,a);break;case 22:_t=(r=_t)||a.memoizedState!==null,hn(t,e,a),_t=r;break;default:hn(t,e,a)}}function l1(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{hl(t)}catch(a){De(e,e.return,a)}}}function u1(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{hl(t)}catch(a){De(e,e.return,a)}}function qD(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Pw),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Pw),e;default:throw Error(M(435,t.tag))}}function If(t,e){var a=qD(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=KD.bind(null,t,r);r.then(n,n)}})}function ma(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(Oo(s.type)){tt=s.stateNode,va=!1;break e}break;case 5:tt=s.stateNode,va=!1;break e;case 3:case 4:tt=s.stateNode.containerInfo,va=!0;break e}s=s.return}if(tt===null)throw Error(M(160));s1(o,i,n),tt=null,va=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)c1(e,t),e=e.sibling}var yr=null;function c1(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ma(e,t),ga(t),r&4&&(To(3,t,t.return),Ec(3,t),To(5,t,t.return));break;case 1:ma(e,t),ga(t),r&512&&(_t||a===null||Hr(a,a.return)),r&64&&yn&&(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=yr;if(ma(e,t),ga(t),r&512&&(_t||a===null||Hr(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[kc]||o[zt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),Vt(o,r,a),o[zt]=t,Nt(o),r=o;break e;case"link":var i=ok("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),Vt(o,r,a),n.head.appendChild(o);break;case"meta":if(i=ok("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),Vt(o,r,a),n.head.appendChild(o);break;default:throw Error(M(468,r))}o[zt]=t,Nt(o),r=o}t.stateNode=r}else ik(n,t.type,t.stateNode);else t.stateNode=nk(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?ik(n,t.type,t.stateNode):nk(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&Mv(t,t.memoizedProps,a.memoizedProps)}break;case 27:ma(e,t),ga(t),r&512&&(_t||a===null||Hr(a,a.return)),a!==null&&r&4&&Mv(t,t.memoizedProps,a.memoizedProps);break;case 5:if(ma(e,t),ga(t),r&512&&(_t||a===null||Hr(a,a.return)),t.flags&32){n=t.stateNode;try{il(n,"")}catch(S){De(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,Mv(t,n,a!==null?a.memoizedProps:n)),r&1024&&(Dv=!0);break;case 6:if(ma(e,t),ga(t),r&4){if(t.stateNode===null)throw Error(M(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){De(t,t.return,S)}}break;case 3:if(jf=null,n=yr,yr=yp(e.containerInfo),ma(e,t),yr=n,ga(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{hl(e.containerInfo)}catch(S){De(t,t.return,S)}Dv&&(Dv=!1,d1(t));break;case 4:r=yr,yr=yp(t.stateNode.containerInfo),ma(e,t),ga(t),yr=r;break;case 12:ma(e,t),ga(t);break;case 31:ma(e,t),ga(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,If(t,r)));break;case 13:ma(e,t),ga(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Dp=Na()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,If(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=yn,c=_t;if(yn=u||n,_t=c||l,ma(e,t),_t=c,yn=u,ga(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||yn||_t||pi(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,f=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(S){De(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){De(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var p=l.stateNode;n?Jw(p,!0):Jw(l.stateNode,!1)}catch(S){De(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,If(t,a))));break;case 19:ma(e,t),ga(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,If(t,r)));break;case 30:break;case 21:break;default:ma(e,t),ga(t)}}function ga(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if(r1(r)){a=r;break}r=r.return}if(a==null)throw Error(M(160));switch(a.tag){case 27:var n=a.stateNode,o=Ov(t);cp(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(il(i,""),a.flags&=-33);var s=Ov(t);cp(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=Ov(t);Sy(t,u,l);break;default:throw Error(M(161))}}catch(c){De(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function d1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;d1(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function mn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)o1(t,e.alternate,e),e=e.sibling}function pi(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:To(4,e,e.return),pi(e);break;case 1:Hr(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&t1(e,e.return,a),pi(e);break;case 27:ic(e.stateNode);case 26:case 5:Hr(e,e.return),pi(e);break;case 22:e.memoizedState===null&&pi(e);break;case 30:pi(e);break;default:pi(e)}t=t.sibling}}function gn(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:gn(n,o,a),Ec(4,o);break;case 1:if(gn(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){De(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++)lL(l[n],s)}catch(u){De(r,r.return,u)}}a&&i&64&&e1(o),ac(o,o.return);break;case 27:n1(o);case 26:case 5:gn(n,o,a),a&&r===null&&i&4&&a1(o),ac(o,o.return);break;case 12:gn(n,o,a);break;case 31:gn(n,o,a),a&&i&4&&l1(n,o);break;case 13:gn(n,o,a),a&&i&4&&u1(n,o);break;case 22:o.memoizedState===null&&gn(n,o,a),ac(o,o.return);break;case 30:break;default:gn(n,o,a)}e=e.sibling}}function bx(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&&Ic(a))}function Sx(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ic(t))}function vr(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)f1(t,e,a,r),e=e.sibling}function f1(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:vr(t,e,a,r),n&2048&&Ec(9,e);break;case 1:vr(t,e,a,r);break;case 3:vr(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&&Ic(t)));break;case 12:if(n&2048){vr(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){De(e,e.return,l)}}else vr(t,e,a,r);break;case 31:vr(t,e,a,r);break;case 13:vr(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?vr(t,e,a,r):rc(t,e):o._visibility&2?vr(t,e,a,r):(o._visibility|=2,Ps(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&bx(i,e);break;case 24:vr(t,e,a,r),n&2048&&Sx(e.alternate,e);break;default:vr(t,e,a,r)}}function Ps(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:Ps(o,i,s,l,n),Ec(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Ps(o,i,s,l,n):rc(o,i):(c._visibility|=2,Ps(o,i,s,l,n)),n&&u&2048&&bx(i.alternate,i);break;case 24:Ps(o,i,s,l,n),n&&u&2048&&Sx(i.alternate,i);break;default:Ps(o,i,s,l,n)}e=e.sibling}}function rc(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:rc(a,r),n&2048&&bx(r.alternate,r);break;case 24:rc(a,r),n&2048&&Sx(r.alternate,r);break;default:rc(a,r)}e=e.sibling}}var Zu=8192;function Bs(t,e,a){if(t.subtreeFlags&Zu)for(t=t.child;t!==null;)p1(t,e,a),t=t.sibling}function p1(t,e,a){switch(t.tag){case 26:Bs(t,e,a),t.flags&Zu&&t.memoizedState!==null&&LN(a,yr,t.memoizedState,t.memoizedProps);break;case 5:Bs(t,e,a);break;case 3:case 4:var r=yr;yr=yp(t.stateNode.containerInfo),Bs(t,e,a),yr=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Zu,Zu=16777216,Bs(t,e,a),Zu=r):Bs(t,e,a));break;default:Bs(t,e,a)}}function h1(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 Uu(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];Dt=r,g1(r,t)}h1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)m1(t),t=t.sibling}function m1(t){switch(t.tag){case 0:case 11:case 15:Uu(t),t.flags&2048&&To(9,t,t.return);break;case 3:Uu(t);break;case 12:Uu(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,$f(t)):Uu(t);break;default:Uu(t)}}function $f(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];Dt=r,g1(r,t)}h1(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:To(8,e,e.return),$f(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,$f(e));break;default:$f(e)}t=t.sibling}}function g1(t,e){for(;Dt!==null;){var a=Dt;switch(a.tag){case 0:case 11:case 15:To(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:Ic(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Dt=r;else e:for(a=t;Dt!==null;){r=Dt;var n=r.sibling,o=r.return;if(i1(r),r===a){Dt=null;break e}if(n!==null){n.return=o,Dt=n;break e}Dt=o}}}var $D={getCacheForType:function(t){var e=$t(Ct),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return $t(Ct).controller.signal}},VD=typeof WeakMap=="function"?WeakMap:Map,Te=0,ze=null,be=null,ke=0,Oe=0,Ra=null,go=!1,xl=!1,_x=!1,En=0,ut=0,Ro=0,yi=0,Cx=0,Da=0,cl=0,nc=null,ya=null,_y=!1,Dp=0,v1=0,dp=1/0,fp=null,Co=null,Et=0,wo=null,dl=null,wn=0,Cy=0,wy=null,y1=null,oc=0,ky=null;function Fa(){return(Te&2)!==0&&ke!==0?ke&-ke:se.T!==null?kx():Ik()}function x1(){if(Da===0)if((ke&536870912)===0||Le){var t=vf;vf<<=1,(vf&3932160)===0&&(vf=262144),Da=t}else Da=536870912;return t=Ua.current,t!==null&&(t.flags|=32),Da}function xa(t,e,a){(t===ze&&(Oe===2||Oe===9)||t.cancelPendingCommit!==null)&&(fl(t,0),vo(t,ke,Da,!1)),wc(t,a),((Te&2)===0||t!==ze)&&(t===ze&&((Te&2)===0&&(yi|=a),ut===4&&vo(t,ke,Da,!1)),qr(t))}function b1(t,e,a){if((Te&6)!==0)throw Error(M(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Cc(t,e),n=r?ZD(t,e):Nv(t,e,!0),o=r;do{if(n===0){xl&&!r&&vo(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!jD(a)){n=Nv(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=nc;var l=s.current.memoizedState.isDehydrated;if(l&&(fl(s,i).flags|=256),i=Nv(s,i,!1),i!==2){if(_x&&!l){s.errorRecoveryDisabledLanes|=o,yi|=o,n=4;break e}o=ya,ya=n,o!==null&&(ya===null?ya=o:ya.push.apply(ya,o))}n=i}if(o=!1,n!==2)continue}}if(n===1){fl(t,0),vo(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:vo(r,e,Da,!go);break e;case 2:ya=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(n=Dp+300-Na(),10<n)){if(vo(r,e,Da,!go),Cp(r,0,!0)!==0)break e;wn=e,r.timeoutHandle=U1(Fw.bind(null,r,a,ya,fp,_y,e,Da,yi,cl,go,o,"Throttled",-0,0),n);break e}Fw(r,a,ya,fp,_y,e,Da,yi,cl,go,o,null,-0,0)}}break}while(!0);qr(t)}function Fw(t,e,a,r,n,o,i,s,l,u,c,d,f,p){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},p1(e,o,d);var S=(o&62914560)===o?Dp-Na():(o&4194048)===o?v1-Na():0;if(S=IN(d,S),S!==null){wn=o,t.cancelPendingCommit=S(Uw.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,f,p)),vo(t,o,i,!u);return}}Uw(t,e,o,a,r,n,i,s,l)}function jD(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(!Ha(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 vo(t,e,a,r){e&=~Cx,e&=~yi,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-Pa(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&wk(t,a,e)}function Np(){return(Te&6)===0?(Tc(0,!1),!1):!0}function wx(){if(be!==null){if(Oe===0)var t=be.return;else t=be,Sn=Ai=null,ux(t),tl=null,pc=0,t=be;for(;t!==null;)JL(t.alternate,t),t=t.return;be=null}}function fl(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,uN(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),wn=0,wx(),ze=t,be=a=_n(t.current,null),ke=e,Oe=0,Ra=null,go=!1,xl=Cc(t,e),_x=!1,cl=Da=Cx=yi=Ro=ut=0,ya=nc=null,_y=!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-Pa(r),o=1<<n;e|=t[n],r&=~o}return En=e,Ip(),a}function S1(t,e){pe=null,se.H=mc,e===yl||e===Ep?(e=gw(),Oe=3):e===ax?(e=gw(),Oe=4):Oe=e===yx?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Ra=e,be===null&&(ut=1,lp(t,er(e,t.current)))}function _1(){var t=Ua.current;return t===null?!0:(ke&4194048)===ke?ar===null:(ke&62914560)===ke||(ke&536870912)!==0?t===ar:!1}function C1(){var t=se.H;return se.H=mc,t===null?mc:t}function w1(){var t=se.A;return se.A=$D,t}function pp(){ut=4,go||(ke&4194048)!==ke&&Ua.current!==null||(xl=!0),(Ro&134217727)===0&&(yi&134217727)===0||ze===null||vo(ze,ke,Da,!1)}function Nv(t,e,a){var r=Te;Te|=2;var n=C1(),o=w1();(ze!==t||ke!==e)&&(fp=null,fl(t,e)),e=!1;var i=ut;e:do try{if(Oe!==0&&be!==null){var s=be,l=Ra;switch(Oe){case 8:wx(),i=6;break e;case 3:case 2:case 9:case 6:Ua.current===null&&(e=!0);var u=Oe;if(Oe=0,Ra=null,Ys(t,s,l,u),a&&xl){i=0;break e}break;default:u=Oe,Oe=0,Ra=null,Ys(t,s,l,u)}}GD(),i=ut;break}catch(c){S1(t,c)}while(!0);return e&&t.shellSuspendCounter++,Sn=Ai=null,Te=r,se.H=n,se.A=o,be===null&&(ze=null,ke=0,Ip()),i}function GD(){for(;be!==null;)k1(be)}function ZD(t,e){var a=Te;Te|=2;var r=C1(),n=w1();ze!==t||ke!==e?(fp=null,dp=Na()+500,fl(t,e)):xl=Cc(t,e);e:do try{if(Oe!==0&&be!==null){e=be;var o=Ra;t:switch(Oe){case 1:Oe=0,Ra=null,Ys(t,e,o,1);break;case 2:case 9:if(mw(o)){Oe=0,Ra=null,Hw(e);break}e=function(){Oe!==2&&Oe!==9||ze!==t||(Oe=7),qr(t)},o.then(e,e);break e;case 3:Oe=7;break e;case 4:Oe=5;break e;case 7:mw(o)?(Oe=0,Ra=null,Hw(e)):(Oe=0,Ra=null,Ys(t,e,o,7));break;case 5:var i=null;switch(be.tag){case 26:i=be.memoizedState;case 5:case 27:var s=be;if(i?j1(i):s.stateNode.complete){Oe=0,Ra=null;var l=s.sibling;if(l!==null)be=l;else{var u=s.return;u!==null?(be=u,Bp(u)):be=null}break t}}Oe=0,Ra=null,Ys(t,e,o,5);break;case 6:Oe=0,Ra=null,Ys(t,e,o,6);break;case 8:wx(),ut=6;break e;default:throw Error(M(462))}}WD();break}catch(c){S1(t,c)}while(!0);return Sn=Ai=null,se.H=r,se.A=n,Te=a,be!==null?0:(ze=null,ke=0,Ip(),ut)}function WD(){for(;be!==null&&!vO();)k1(be)}function k1(t){var e=QL(t.alternate,t,En);t.memoizedProps=t.pendingProps,e===null?Bp(t):be=e}function Hw(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=Mw(a,e,e.pendingProps,e.type,void 0,ke);break;case 11:e=Mw(a,e,e.pendingProps,e.type.render,e.ref,ke);break;case 5:ux(e);default:JL(a,e),e=be=Jk(e,En),e=QL(a,e,En)}t.memoizedProps=t.pendingProps,e===null?Bp(t):be=e}function Ys(t,e,a,r){Sn=Ai=null,ux(e),tl=null,pc=0;var n=e.return;try{if(BD(t,n,e,a,ke)){ut=1,lp(t,er(a,t.current)),be=null;return}}catch(o){if(n!==null)throw be=n,o;ut=1,lp(t,er(a,t.current)),be=null;return}e.flags&32768?(Le||r===1?t=!0:xl||(ke&536870912)!==0?t=!1:(go=t=!0,(r===2||r===9||r===3||r===6)&&(r=Ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),L1(e,t)):Bp(e)}function Bp(t){var e=t;do{if((e.flags&32768)!==0){L1(e,go);return}t=e.return;var a=HD(e.alternate,e,En);if(a!==null){be=a;return}if(e=e.sibling,e!==null){be=e;return}be=e=t}while(e!==null);ut===0&&(ut=5)}function L1(t,e){do{var a=UD(t.alternate,t);if(a!==null){a.flags&=32767,be=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){be=t;return}be=t=a}while(t!==null);ut=6,be=null}function Uw(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Pp();while(Et!==0);if((Te&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=Xy,IO(t,a,o,i,s,l),t===ze&&(be=ze=null,ke=0),dl=e,wo=t,wn=a,Cy=o,wy=n,y1=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,QD(Kf,function(){return R1(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=se.T,se.T=null,n=Re.p,Re.p=2,i=Te,Te|=4;try{zD(t,e,a)}finally{Te=i,Re.p=n,se.T=r}}Et=1,I1(),A1(),E1()}}function I1(){if(Et===1){Et=0;var t=wo,e=dl,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=se.T,se.T=null;var r=Re.p;Re.p=2;var n=Te;Te|=4;try{c1(e,t);var o=Ey,i=jk(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&Vk(s.ownerDocument.documentElement,s)){if(l!==null&&Wy(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 p=f.getSelection(),S=s.textContent.length,x=Math.min(l.start,S),b=l.end===void 0?x:Math.min(l.end,S);!p.extend&&x>b&&(i=b,b=x,x=i);var m=lw(s,x),h=lw(s,b);if(m&&h&&(p.rangeCount!==1||p.anchorNode!==m.node||p.anchorOffset!==m.offset||p.focusNode!==h.node||p.focusOffset!==h.offset)){var g=d.createRange();g.setStart(m.node,m.offset),p.removeAllRanges(),x>b?(p.addRange(g),p.extend(h.node,h.offset)):(g.setEnd(h.node,h.offset),p.addRange(g))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.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}}Sp=!!Ay,Ey=Ay=null}finally{Te=n,Re.p=r,se.T=a}}t.current=e,Et=2}}function A1(){if(Et===2){Et=0;var t=wo,e=dl,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=se.T,se.T=null;var r=Re.p;Re.p=2;var n=Te;Te|=4;try{o1(t,e.alternate,e)}finally{Te=n,Re.p=r,se.T=a}}Et=3}}function E1(){if(Et===4||Et===3){Et=0,yO();var t=wo,e=dl,a=wn,r=y1;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?Et=5:(Et=0,dl=wo=null,T1(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&(Co=null),zy(a),e=e.stateNode,Ba&&typeof Ba.onCommitFiberRoot=="function")try{Ba.onCommitFiberRoot(_c,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=se.T,n=Re.p,Re.p=2,se.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{se.T=e,Re.p=n}}(wn&3)!==0&&Pp(),qr(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===ky?oc++:(oc=0,ky=t):oc=0,Tc(0,!1)}}function T1(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Ic(e)))}function Pp(){return I1(),A1(),E1(),R1()}function R1(){if(Et!==5)return!1;var t=wo,e=Cy;Cy=0;var a=zy(wn),r=se.T,n=Re.p;try{Re.p=32>a?32:a,se.T=null,a=wy,wy=null;var o=wo,i=wn;if(Et=0,dl=wo=null,wn=0,(Te&6)!==0)throw Error(M(331));var s=Te;if(Te|=4,m1(o.current),f1(o,o.current,i,a),Te=s,Tc(0,!1),Ba&&typeof Ba.onPostCommitFiberRoot=="function")try{Ba.onPostCommitFiberRoot(_c,o)}catch{}return!0}finally{Re.p=n,se.T=r,T1(t,e)}}function zw(t,e,a){e=er(a,e),e=yy(t.stateNode,e,2),t=_o(t,e,2),t!==null&&(wc(t,2),qr(t))}function De(t,e,a){if(t.tag===3)zw(t,t,a);else for(;e!==null;){if(e.tag===3){zw(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Co===null||!Co.has(r))){t=er(a,t),a=GL(2),r=_o(e,a,2),r!==null&&(ZL(a,r,e,t),wc(r,2),qr(r));break}}e=e.return}}function Bv(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new VD;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)||(_x=!0,n.add(a),t=XD.bind(null,t,e,a),e.then(t,t))}function XD(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,ze===t&&(ke&a)===a&&(ut===4||ut===3&&(ke&62914560)===ke&&300>Na()-Dp?(Te&2)===0&&fl(t,0):Cx|=a,cl===ke&&(cl=0)),qr(t)}function M1(t,e){e===0&&(e=Ck()),t=Ii(t,e),t!==null&&(wc(t,e),qr(t))}function YD(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),M1(t,a)}function KD(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(M(314))}r!==null&&r.delete(e),M1(t,a)}function QD(t,e){return Hy(t,e)}var hp=null,Fs=null,Ly=!1,mp=!1,Pv=!1,yo=0;function qr(t){t!==Fs&&t.next===null&&(Fs===null?hp=Fs=t:Fs=Fs.next=t),mp=!0,Ly||(Ly=!0,eN())}function Tc(t,e){if(!Pv&&mp){Pv=!0;do for(var a=!1,r=hp;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-Pa(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,qw(r,o))}else o=ke,o=Cp(r,r===ze?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||Cc(r,o)||(a=!0,qw(r,o));r=r.next}while(a);Pv=!1}}function JD(){O1()}function O1(){mp=Ly=!1;var t=0;yo!==0&&lN()&&(t=yo);for(var e=Na(),a=null,r=hp;r!==null;){var n=r.next,o=D1(r,e);o===0?(r.next=null,a===null?hp=n:a.next=n,n===null&&(Fs=a)):(a=r,(t!==0||(o&3)!==0)&&(mp=!0)),r=n}Et!==0&&Et!==5||Tc(t,!1),yo!==0&&(yo=0)}function D1(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-Pa(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=LO(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=ze,a=ke,a=Cp(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(Oe===2||Oe===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&fv(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Cc(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&fv(r),zy(a)){case 2:case 8:a=Sk;break;case 32:a=Kf;break;case 268435456:a=_k;break;default:a=Kf}return r=N1.bind(null,t),a=Hy(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&fv(r),t.callbackPriority=2,t.callbackNode=null,2}function N1(t,e){if(Et!==0&&Et!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Pp()&&t.callbackNode!==a)return null;var r=ke;return r=Cp(t,t===ze?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(b1(t,r,e),D1(t,Na()),t.callbackNode!=null&&t.callbackNode===a?N1.bind(null,t):null)}function qw(t,e){if(Pp())return null;b1(t,e,!0)}function eN(){cN(function(){(Te&6)!==0?Hy(bk,JD):O1()})}function kx(){if(yo===0){var t=sl;t===0&&(t=gf,gf<<=1,(gf&261888)===0&&(gf=256)),yo=t}return yo}function $w(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Df(""+t)}function Vw(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 tN(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=$w((n[ba]||null).action),i=r.submitter;i&&(e=(e=i[ba]||null)?$w(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new wp("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(yo!==0){var l=i?Vw(n,i):new FormData(n);gy(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?Vw(n,i):new FormData(n),gy(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(Af=0;Af<ny.length;Af++)Ef=ny[Af],jw=Ef.toLowerCase(),Gw=Ef[0].toUpperCase()+Ef.slice(1),xr(jw,"on"+Gw);var Ef,jw,Gw,Af;xr(Zk,"onAnimationEnd");xr(Wk,"onAnimationIteration");xr(Xk,"onAnimationStart");xr("dblclick","onDoubleClick");xr("focusin","onFocus");xr("focusout","onBlur");xr(xD,"onTransitionRun");xr(bD,"onTransitionStart");xr(SD,"onTransitionCancel");xr(Yk,"onTransitionEnd");ol("onMouseEnter",["mouseout","mouseover"]);ol("onMouseLeave",["mouseout","mouseover"]);ol("onPointerEnter",["pointerout","pointerover"]);ol("onPointerLeave",["pointerout","pointerover"]);wi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wi("onBeforeInput",["compositionend","keypress","textInput","paste"]);wi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gc="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(" "),aN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gc));function B1(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){Jf(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){Jf(c)}n.currentTarget=null,o=l}}}}function xe(t,e){var a=e[Yv];a===void 0&&(a=e[Yv]=new Set);var r=t+"__bubble";a.has(r)||(P1(e,t,2,!1),a.add(r))}function Fv(t,e,a){var r=0;e&&(r|=4),P1(a,t,r,e)}var Tf="_reactListening"+Math.random().toString(36).slice(2);function Lx(t){if(!t[Tf]){t[Tf]=!0,Ak.forEach(function(a){a!=="selectionchange"&&(aN.has(a)||Fv(a,!1,t),Fv(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Tf]||(e[Tf]=!0,Fv("selectionchange",!1,e))}}function P1(t,e,a,r){switch(Y1(e)){case 2:var n=TN;break;case 8:n=RN;break;default:n=Tx}a=n.bind(null,e,a,t),n=void 0,!ty||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 Hv(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=zs(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}Bk(function(){var u=o,c=Vy(a),d=[];e:{var f=Kk.get(t);if(f!==void 0){var p=wp,S=t;switch(t){case"keypress":if(Bf(a)===0)break e;case"keydown":case"keyup":p=KO;break;case"focusin":S="focus",p=vv;break;case"focusout":S="blur",p=vv;break;case"beforeblur":case"afterblur":p=vv;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":p=JC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=HO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=eD;break;case Zk:case Wk:case Xk:p=qO;break;case Yk:p=aD;break;case"scroll":case"scrollend":p=PO;break;case"wheel":p=nD;break;case"copy":case"cut":case"paste":p=VO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=tw;break;case"toggle":case"beforetoggle":p=iD}var x=(e&4)!==0,b=!x&&(t==="scroll"||t==="scrollend"),m=x?f!==null?f+"Capture":null:f;x=[];for(var h=u,g;h!==null;){var y=h;if(g=y.stateNode,y=y.tag,y!==5&&y!==26&&y!==27||g===null||m===null||(y=lc(h,m),y!=null&&x.push(vc(h,y,g))),b)break;h=h.return}0<x.length&&(f=new p(f,S,null,a,c),d.push({event:f,listeners:x}))}}if((e&7)===0){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&a!==ey&&(S=a.relatedTarget||a.fromElement)&&(zs(S)||S[ml]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(S=a.relatedTarget||a.toElement,p=u,S=S?zs(S):null,S!==null&&(b=Sc(S),x=S.tag,S!==b||x!==5&&x!==27&&x!==6)&&(S=null)):(p=null,S=u),p!==S)){if(x=JC,y="onMouseLeave",m="onMouseEnter",h="mouse",(t==="pointerout"||t==="pointerover")&&(x=tw,y="onPointerLeave",m="onPointerEnter",h="pointer"),b=p==null?f:ju(p),g=S==null?f:ju(S),f=new x(y,h+"leave",p,a,c),f.target=b,f.relatedTarget=g,y=null,zs(c)===u&&(x=new x(m,h+"enter",S,a,c),x.target=g,x.relatedTarget=b,y=x),b=y,p&&S)t:{for(x=rN,m=p,h=S,g=0,y=m;y;y=x(y))g++;y=0;for(var C=h;C;C=x(C))y++;for(;0<g-y;)m=x(m),g--;for(;0<y-g;)h=x(h),y--;for(;g--;){if(m===h||h!==null&&m===h.alternate){x=m;break t}m=x(m),h=x(h)}x=null}else x=null;p!==null&&Zw(d,f,p,x,!1),S!==null&&b!==null&&Zw(d,b,S,x,!0)}}e:{if(f=u?ju(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var w=ow;else if(nw(f))if(qk)w=gD;else{w=hD;var _=pD}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&$y(u.elementType)&&(w=ow):w=mD;if(w&&(w=w(t,u))){zk(d,w,a,c);break e}_&&_(t,f,u),t==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&Jv(f,"number",f.value)}switch(_=u?ju(u):window,t){case"focusin":(nw(_)||_.contentEditable==="true")&&(Vs=_,ay=u,Yu=null);break;case"focusout":Yu=ay=Vs=null;break;case"mousedown":ry=!0;break;case"contextmenu":case"mouseup":case"dragend":ry=!1,uw(d,a,c);break;case"selectionchange":if(yD)break;case"keydown":case"keyup":uw(d,a,c)}var k;if(Zy)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else $s?Hk(t,a)&&(A="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(A="onCompositionStart");A&&(Fk&&a.locale!=="ko"&&($s||A!=="onCompositionStart"?A==="onCompositionEnd"&&$s&&(k=Pk()):(mo=c,jy="value"in mo?mo.value:mo.textContent,$s=!0)),_=gp(u,A),0<_.length&&(A=new ew(A,t,null,a,c),d.push({event:A,listeners:_}),k?A.data=k:(k=Uk(a),k!==null&&(A.data=k)))),(k=lD?uD(t,a):cD(t,a))&&(A=gp(u,"onBeforeInput"),0<A.length&&(_=new ew("onBeforeInput","beforeinput",null,a,c),d.push({event:_,listeners:A}),_.data=k)),tN(d,t,u,a,c)}B1(d,e)})}function vc(t,e,a){return{instance:t,listener:e,currentTarget:a}}function gp(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=lc(t,a),n!=null&&r.unshift(vc(t,n,o)),n=lc(t,e),n!=null&&r.push(vc(t,n,o))),t.tag===3)return r;t=t.return}return[]}function rN(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Zw(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=lc(a,o),u!=null&&i.unshift(vc(a,u,l))):n||(u=lc(a,o),u!=null&&i.push(vc(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var nN=/\r\n?/g,oN=/\u0000|\uFFFD/g;function Ww(t){return(typeof t=="string"?t:""+t).replace(nN,`
|
|
9
|
-
`).replace(oN,"")}function F1(t,e){return e=Ww(e),Ww(t)===e}function Be(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||il(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&il(t,""+r);break;case"className":xf(t,"class",r);break;case"tabIndex":xf(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":xf(t,a,r);break;case"style":Nk(t,r,o);break;case"data":if(e!=="object"){xf(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=Df(""+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"&&Be(t,e,"name",n.name,n,null),Be(t,e,"formEncType",n.formEncType,n,null),Be(t,e,"formMethod",n.formMethod,n,null),Be(t,e,"formTarget",n.formTarget,n,null)):(Be(t,e,"encType",n.encType,n,null),Be(t,e,"method",n.method,n,null),Be(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Df(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=bn);break;case"onScroll":r!=null&&xe("scroll",t);break;case"onScrollEnd":r!=null&&xe("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(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=Df(""+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":xe("beforetoggle",t),xe("toggle",t),Of(t,"popover",r);break;case"xlinkActuate":fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":fn(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":fn(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":fn(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":fn(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Of(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=NO.get(a)||a,Of(t,a,r))}}function Iy(t,e,a,r,n,o){switch(a){case"style":Nk(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(60));t.innerHTML=a}}break;case"children":typeof r=="string"?il(t,r):(typeof r=="number"||typeof r=="bigint")&&il(t,""+r);break;case"onScroll":r!=null&&xe("scroll",t);break;case"onScrollEnd":r!=null&&xe("scrollend",t);break;case"onClick":r!=null&&(t.onclick=bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ek.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[ba]||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,""):Of(t,a,r)}}}function Vt(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",t),xe("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(M(137,e));default:Be(t,e,o,i,a,null)}}n&&Be(t,e,"srcSet",a.srcSet,a,null),r&&Be(t,e,"src",a.src,a,null);return;case"input":xe("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(M(137,e));break;default:Be(t,e,r,c,a,null)}}Mk(t,o,s,l,u,i,n,!1);return;case"select":xe("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:Be(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Qs(t,!!r,e,!1):a!=null&&Qs(t,!!r,a,!0);return;case"textarea":xe("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(M(91));break;default:Be(t,e,i,s,a,null)}Dk(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":Be(t,e,l,r,a,null));return;case"dialog":xe("beforetoggle",t),xe("toggle",t),xe("cancel",t),xe("close",t);break;case"iframe":case"object":xe("load",t);break;case"video":case"audio":for(r=0;r<gc.length;r++)xe(gc[r],t);break;case"image":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"embed":case"source":case"link":xe("error",t),xe("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(M(137,e));default:Be(t,e,u,r,a,null)}return;default:if($y(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&Iy(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&Be(t,e,s,r,a,null))}function iN(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(p in a){var d=a[p];if(a.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":l=d;default:r.hasOwnProperty(p)||Be(t,e,p,null,r,d)}}for(var f in r){var p=r[f];if(d=a[f],r.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":o=p;break;case"name":n=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":i=p;break;case"defaultValue":s=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(M(137,e));break;default:p!==d&&Be(t,e,f,p,r,d)}}Qv(t,i,s,l,u,c,o,n);return;case"select":p=i=s=f=null;for(o in a)if(l=a[o],a.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":p=l;default:r.hasOwnProperty(o)||Be(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":f=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&Be(t,e,n,o,r,l)}e=s,a=i,r=p,f!=null?Qs(t,!!a,f,!1):!!r!=!!a&&(e!=null?Qs(t,!!a,e,!0):Qs(t,!!a,a?[]:"",!1));return;case"textarea":p=f=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:Be(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":f=n;break;case"defaultValue":p=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(M(91));break;default:n!==o&&Be(t,e,i,n,r,o)}Ok(t,f,p);return;case"option":for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:Be(t,e,S,null,r,f));for(l in r)f=r[l],p=a[l],r.hasOwnProperty(l)&&f!==p&&(f!=null||p!=null)&&(l==="selected"?t.selected=f&&typeof f!="function"&&typeof f!="symbol":Be(t,e,l,f,r,p));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&&!r.hasOwnProperty(x)&&Be(t,e,x,null,r,f);for(u in r)if(f=r[u],p=a[u],r.hasOwnProperty(u)&&f!==p&&(f!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(M(137,e));break;default:Be(t,e,u,f,r,p)}return;default:if($y(e)){for(var b in a)f=a[b],a.hasOwnProperty(b)&&f!==void 0&&!r.hasOwnProperty(b)&&Iy(t,e,b,void 0,r,f);for(c in r)f=r[c],p=a[c],!r.hasOwnProperty(c)||f===p||f===void 0&&p===void 0||Iy(t,e,c,f,r,p);return}}for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!r.hasOwnProperty(m)&&Be(t,e,m,null,r,f);for(d in r)f=r[d],p=a[d],!r.hasOwnProperty(d)||f===p||f==null&&p==null||Be(t,e,d,f,r,p)}function Xw(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sN(){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&&Xw(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&&Xw(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 Ay=null,Ey=null;function vp(t){return t.nodeType===9?t:t.ownerDocument}function Yw(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 H1(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 Ty(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 Uv=null;function lN(){var t=window.event;return t&&t.type==="popstate"?t===Uv?!1:(Uv=t,!0):(Uv=null,!1)}var U1=typeof setTimeout=="function"?setTimeout:void 0,uN=typeof clearTimeout=="function"?clearTimeout:void 0,Kw=typeof Promise=="function"?Promise:void 0,cN=typeof queueMicrotask=="function"?queueMicrotask:typeof Kw<"u"?function(t){return Kw.resolve(null).then(t).catch(dN)}:U1;function dN(t){setTimeout(function(){throw t})}function Oo(t){return t==="head"}function Qw(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),hl(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")ic(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,ic(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[kc]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&ic(t.ownerDocument.body);a=n}while(a);hl(e)}function Jw(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 Ry(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":Ry(a),qy(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function fN(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[kc])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=rr(t.nextSibling),t===null)break}return null}function pN(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=rr(t.nextSibling),t===null))return null;return t}function z1(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=rr(t.nextSibling),t===null))return null;return t}function My(t){return t.data==="$?"||t.data==="$~"}function Oy(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function hN(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 rr(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 Dy=null;function ek(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return rr(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function tk(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 q1(t,e,a){switch(e=vp(a),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function ic(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);qy(t)}var nr=new Map,ak=new Set;function yp(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Tn=Re.d;Re.d={f:mN,r:gN,D:vN,C:yN,L:xN,m:bN,X:_N,S:SN,M:CN};function mN(){var t=Tn.f(),e=Np();return t||e}function gN(t){var e=gl(t);e!==null&&e.tag===5&&e.type==="form"?NL(e):Tn.r(t)}var bl=typeof document>"u"?null:document;function $1(t,e,a){var r=bl;if(r&&typeof e=="string"&&e){var n=Ja(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),ak.has(n)||(ak.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),Vt(e,"link",t),Nt(e),r.head.appendChild(e)))}}function vN(t){Tn.D(t),$1("dns-prefetch",t,null)}function yN(t,e){Tn.C(t,e),$1("preconnect",t,e)}function xN(t,e,a){Tn.L(t,e,a);var r=bl;if(r&&t&&e){var n='link[rel="preload"][as="'+Ja(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+Ja(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+Ja(a.imageSizes)+'"]')):n+='[href="'+Ja(t)+'"]';var o=n;switch(e){case"style":o=pl(t);break;case"script":o=Sl(t)}nr.has(o)||(t=Ke({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),nr.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(Rc(o))||e==="script"&&r.querySelector(Mc(o))||(e=r.createElement("link"),Vt(e,"link",t),Nt(e),r.head.appendChild(e)))}}function bN(t,e){Tn.m(t,e);var a=bl;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+Ja(r)+'"][href="'+Ja(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Sl(t)}if(!nr.has(o)&&(t=Ke({rel:"modulepreload",href:t},e),nr.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Mc(o)))return}r=a.createElement("link"),Vt(r,"link",t),Nt(r),a.head.appendChild(r)}}}function SN(t,e,a){Tn.S(t,e,a);var r=bl;if(r&&t){var n=Ks(r).hoistableStyles,o=pl(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(Rc(o)))s.loading=5;else{t=Ke({rel:"stylesheet",href:t,"data-precedence":e},a),(a=nr.get(o))&&Ix(t,a);var l=i=r.createElement("link");Nt(l),Vt(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,Vf(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function _N(t,e){Tn.X(t,e);var a=bl;if(a&&t){var r=Ks(a).hoistableScripts,n=Sl(t),o=r.get(n);o||(o=a.querySelector(Mc(n)),o||(t=Ke({src:t,async:!0},e),(e=nr.get(n))&&Ax(t,e),o=a.createElement("script"),Nt(o),Vt(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function CN(t,e){Tn.M(t,e);var a=bl;if(a&&t){var r=Ks(a).hoistableScripts,n=Sl(t),o=r.get(n);o||(o=a.querySelector(Mc(n)),o||(t=Ke({src:t,async:!0,type:"module"},e),(e=nr.get(n))&&Ax(t,e),o=a.createElement("script"),Nt(o),Vt(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function rk(t,e,a,r){var n=(n=xo.current)?yp(n):null;if(!n)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=pl(a.href),a=Ks(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=pl(a.href);var o=Ks(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(Rc(t)))&&!o._p&&(i.instance=o,i.state.loading=5),nr.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},nr.set(t,a),o||wN(n,t,a,i.state))),e&&r===null)throw Error(M(528,""));return i}if(e&&r!==null)throw Error(M(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Sl(a),a=Ks(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(M(444,t))}}function pl(t){return'href="'+Ja(t)+'"'}function Rc(t){return'link[rel="stylesheet"]['+t+"]"}function V1(t){return Ke({},t,{"data-precedence":t.precedence,precedence:null})}function wN(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}),Vt(e,"link",a),Nt(e),t.head.appendChild(e))}function Sl(t){return'[src="'+Ja(t)+'"]'}function Mc(t){return"script[async]"+t}function nk(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+Ja(a.href)+'"]');if(r)return e.instance=r,Nt(r),r;var n=Ke({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),Nt(r),Vt(r,"style",n),Vf(r,a.precedence,t),e.instance=r;case"stylesheet":n=pl(a.href);var o=t.querySelector(Rc(n));if(o)return e.state.loading|=4,e.instance=o,Nt(o),o;r=V1(a),(n=nr.get(n))&&Ix(r,n),o=(t.ownerDocument||t).createElement("link"),Nt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),Vt(o,"link",r),e.state.loading|=4,Vf(o,a.precedence,t),e.instance=o;case"script":return o=Sl(a.src),(n=t.querySelector(Mc(o)))?(e.instance=n,Nt(n),n):(r=a,(n=nr.get(o))&&(r=Ke({},a),Ax(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),Nt(n),Vt(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Vf(r,a.precedence,t));return e.instance}function Vf(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 Ix(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Ax(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var jf=null;function ok(t,e,a){if(jf===null){var r=new Map,n=jf=new Map;n.set(a,r)}else n=jf,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[kc]||o[zt]||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 ik(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function kN(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 j1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function LN(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=pl(r.href),o=e.querySelector(Rc(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=xp.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,Nt(o);return}o=e.ownerDocument||e,r=V1(r),(n=nr.get(n))&&Ix(r,n),o=o.createElement("link"),Nt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),Vt(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=xp.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var zv=0;function IN(t,e){return t.stylesheets&&t.count===0&&Gf(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&Gf(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&zv===0&&(zv=62500*sN());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Gf(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>zv?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function xp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gf(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var bp=null;function Gf(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bp=new Map,e.forEach(AN,t),bp=null,xp.call(t))}function AN(t,e){if(!(e.state.loading&4)){var a=bp.get(t);if(a)var r=a.get(null);else{a=new Map,bp.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=xp.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 yc={$$typeof:xn,Provider:null,Consumer:null,_currentValue:hi,_currentValue2:hi,_threadCount:0};function EN(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=pv(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pv(0),this.hiddenUpdates=pv(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 G1(t,e,a,r,n,o,i,s,l,u,c,d){return t=new EN(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=Oa(3,null,null,e),t.current=o,o.stateNode=t,e=ex(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},rx(o),t}function Z1(t){return t?(t=Zs,t):Zs}function W1(t,e,a,r,n,o){n=Z1(n),r.context===null?r.context=n:r.pendingContext=n,r=So(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=_o(t,r,e),a!==null&&(xa(a,t,e),Qu(a,t,e))}function sk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function Ex(t,e){sk(t,e),(t=t.alternate)&&sk(t,e)}function X1(t){if(t.tag===13||t.tag===31){var e=Ii(t,67108864);e!==null&&xa(e,t,67108864),Ex(t,67108864)}}function lk(t){if(t.tag===13||t.tag===31){var e=Fa();e=Uy(e);var a=Ii(t,e);a!==null&&xa(a,t,e),Ex(t,e)}}var Sp=!0;function TN(t,e,a,r){var n=se.T;se.T=null;var o=Re.p;try{Re.p=2,Tx(t,e,a,r)}finally{Re.p=o,se.T=n}}function RN(t,e,a,r){var n=se.T;se.T=null;var o=Re.p;try{Re.p=8,Tx(t,e,a,r)}finally{Re.p=o,se.T=n}}function Tx(t,e,a,r){if(Sp){var n=Ny(r);if(n===null)Hv(t,e,r,_p,a),uk(t,r);else if(ON(n,t,e,a,r))r.stopPropagation();else if(uk(t,r),e&4&&-1<MN.indexOf(t)){for(;n!==null;){var o=gl(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=di(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-Pa(i);s.entanglements[1]|=l,i&=~l}qr(o),(Te&6)===0&&(dp=Na()+500,Tc(0,!1))}}break;case 31:case 13:s=Ii(o,2),s!==null&&xa(s,o,2),Np(),Ex(o,2)}if(o=Ny(r),o===null&&Hv(t,e,r,_p,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else Hv(t,e,r,null,a)}}function Ny(t){return t=Vy(t),Rx(t)}var _p=null;function Rx(t){if(_p=null,t=zs(t),t!==null){var e=Sc(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=mk(e),t!==null)return t;t=null}else if(a===31){if(t=gk(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 _p=t,null}function Y1(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(xO()){case bk:return 2;case Sk:return 8;case Kf:case bO:return 32;case _k:return 268435456;default:return 32}default:return 32}}var By=!1,ko=null,Lo=null,Io=null,xc=new Map,bc=new Map,po=[],MN="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 uk(t,e){switch(t){case"focusin":case"focusout":ko=null;break;case"dragenter":case"dragleave":Lo=null;break;case"mouseover":case"mouseout":Io=null;break;case"pointerover":case"pointerout":xc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":bc.delete(e.pointerId)}}function zu(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=gl(e),e!==null&&X1(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function ON(t,e,a,r,n){switch(e){case"focusin":return ko=zu(ko,t,e,a,r,n),!0;case"dragenter":return Lo=zu(Lo,t,e,a,r,n),!0;case"mouseover":return Io=zu(Io,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return xc.set(o,zu(xc.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,bc.set(o,zu(bc.get(o)||null,t,e,a,r,n)),!0}return!1}function K1(t){var e=zs(t.target);if(e!==null){var a=Sc(e);if(a!==null){if(e=a.tag,e===13){if(e=mk(a),e!==null){t.blockedOn=e,GC(t.priority,function(){lk(a)});return}}else if(e===31){if(e=gk(a),e!==null){t.blockedOn=e,GC(t.priority,function(){lk(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 Zf(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=Ny(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);ey=r,a.target.dispatchEvent(r),ey=null}else return e=gl(a),e!==null&&X1(e),t.blockedOn=a,!1;e.shift()}return!0}function ck(t,e,a){Zf(t)&&a.delete(e)}function DN(){By=!1,ko!==null&&Zf(ko)&&(ko=null),Lo!==null&&Zf(Lo)&&(Lo=null),Io!==null&&Zf(Io)&&(Io=null),xc.forEach(ck),bc.forEach(ck)}function Rf(t,e){t.blockedOn===e&&(t.blockedOn=null,By||(By=!0,Tt.unstable_scheduleCallback(Tt.unstable_NormalPriority,DN)))}var Mf=null;function dk(t){Mf!==t&&(Mf=t,Tt.unstable_scheduleCallback(Tt.unstable_NormalPriority,function(){Mf===t&&(Mf=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(Rx(r||a)===null)continue;break}var o=gl(a);o!==null&&(t.splice(e,3),e-=3,gy(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function hl(t){function e(l){return Rf(l,t)}ko!==null&&Rf(ko,t),Lo!==null&&Rf(Lo,t),Io!==null&&Rf(Io,t),xc.forEach(e),bc.forEach(e);for(var a=0;a<po.length;a++){var r=po[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<po.length&&(a=po[0],a.blockedOn===null);)K1(a),a.blockedOn===null&&po.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[ba]||null;if(typeof o=="function")i||dk(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[ba]||null)s=i.formAction;else if(Rx(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),dk(a)}}}function Q1(){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 Mx(t){this._internalRoot=t}Fp.prototype.render=Mx.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var a=e.current,r=Fa();W1(a,r,t,e,null,null)};Fp.prototype.unmount=Mx.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;W1(t.current,2,null,t,null,null),Np(),e[ml]=null}};function Fp(t){this._internalRoot=t}Fp.prototype.unstable_scheduleHydration=function(t){if(t){var e=Ik();t={blockedOn:null,target:t,priority:e};for(var a=0;a<po.length&&e!==0&&e<po[a].priority;a++);po.splice(a,0,t),a===0&&K1(t)}};var fk=pk.version;if(fk!=="19.2.1")throw Error(M(527,fk,"19.2.1"));Re.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=fO(e),t=t!==null?vk(t):null,t=t===null?null:t.stateNode,t};var NN={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(qu=__REACT_DEVTOOLS_GLOBAL_HOOK__,!qu.isDisabled&&qu.supportsFiber))try{_c=qu.inject(NN),Ba=qu}catch{}var qu;Hp.createRoot=function(t,e){if(!hk(t))throw Error(M(299));var a=!1,r="",n=$L,o=VL,i=jL;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=G1(t,1,!1,null,null,a,r,null,n,o,i,Q1),t[ml]=e.current,Lx(t),new Mx(e)};Hp.hydrateRoot=function(t,e,a){if(!hk(t))throw Error(M(299));var r=!1,n="",o=$L,i=VL,s=jL,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=G1(t,1,!0,e,a??null,r,n,l,o,i,s,Q1),e.context=Z1(null),a=e.current,r=Fa(),r=Uy(r),n=So(r),n.callback=null,_o(a,n,r),a=r,e.current.lanes=a,wc(e,a),qr(e),t[ml]=e.current,Lx(t),new Fp(e)};Hp.version="19.2.1"});var Ei=Dr((Cq,tI)=>{"use strict";function eI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eI)}catch(t){console.error(t)}}eI(),tI.exports=J1()});var ZI=Dr(ah=>{"use strict";var AB=Symbol.for("react.transitional.element"),EB=Symbol.for("react.fragment");function GI(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:AB,type:t,key:r,ref:e!==void 0?e:null,props:a}}ah.Fragment=EB;ah.jsx=GI;ah.jsxs=GI});var Fe=Dr((B6,WI)=>{"use strict";WI.exports=ZI()});var hq={};Zg(hq,{ANIMATION_KEYFRAMES:()=>Au,ActivationConfigZ:()=>Jd,AddClassZ:()=>w_,AnchorIdZ:()=>Za,AnchorStateZ:()=>j2,AnchorVisibleConditionZ:()=>dg,AppRegistry:()=>Pc,AugmentationZ:()=>G2,BadgePositionZ:()=>p_,BadgeZ:()=>T_,BoundingBoxZ:()=>V2,CanvasEvents:()=>El,CanvasRecipeZ:()=>gm,ConditionZ:()=>to,ContextManager:()=>ef,CooldownActiveConditionZ:()=>vg,CounterDefZ:()=>gu,CtaButtonZ:()=>Sg,DEFAULT_COOLDOWN:()=>Ph,DEFAULT_TTL:()=>Bh,DecisionStrategyZ:()=>_u,DismissedConditionZ:()=>gg,EVENT_SCHEMA_VERSION:()=>ht,EventBus:()=>rf,EventCountConditionZ:()=>xg,EventFilterZ:()=>Q2,EventHistory:()=>wu,EventOccurredConditionZ:()=>fg,EventSourceZ:()=>j_,ExecutorRegistry:()=>Zd,ExternalStrategyZ:()=>Su,FrequencyEntryZ:()=>bM,FrequencyLimitConditionZ:()=>yg,HighlightStepZ:()=>_T,HighlightStyleZ:()=>f_,HighlightZ:()=>A_,InsertHtmlZ:()=>I_,InsertPositionZ:()=>v_,MAX_VISIBLE_TOASTS:()=>Nh,MatchOpZ:()=>mu,ModalContentZ:()=>g_,ModalZ:()=>M_,ModelStrategyZ:()=>bu,MountWidgetZ:()=>N_,NavigateZ:()=>D_,NavigationMonitor:()=>ku,NormalizedEventZ:()=>K2,NotificationToastStack:()=>Dh,PageContextZ:()=>U2,PageHistoryEntryZ:()=>z2,PageUrlConditionZ:()=>ug,ParallelZ:()=>F_,PlacementZ:()=>h_,PulseZ:()=>E_,RUNTIME_SDK_BUILD:()=>iC,RUNTIME_VERSION:()=>J_,RemoveClassZ:()=>k_,RouteConditionZ:()=>cg,RouteFilterZ:()=>c_,RuleStrategyZ:()=>yu,RuleZ:()=>vu,RuntimeContextZ:()=>Z2,RuntimeProvider:()=>qh,SDK_SCHEMA_VERSION:()=>Dn,SDK_VERSION:()=>xh,STATIC_SLOT_STYLES:()=>K_,ScoreStrategyZ:()=>xu,ScrollBehaviorZ:()=>S_,ScrollLogicalPositionZ:()=>bg,ScrollToZ:()=>O_,SelectorZ:()=>o0,SequenceZ:()=>P_,SessionContextZ:()=>q2,SessionMetricConditionZ:()=>mg,SessionMetricTracker:()=>md,SetAttrZ:()=>C_,SetStyleZ:()=>L_,SetTextZ:()=>__,ShadowCanvasOverlay:()=>Ob,ShadowRootProvider:()=>yb,SmartCanvasApp:()=>Nb,SmartCanvasController:()=>Ch,SmartCanvasElement:()=>Vh,SmartCanvasPortal:()=>kH,StandardEvents:()=>Pt,StateEqualsConditionZ:()=>pg,StateStore:()=>sf,StoredValueZ:()=>xM,Syntro:()=>oC,TileCard:()=>Rl,TileWheel:()=>s4,TooltipContentZ:()=>m_,TooltipStepZ:()=>ST,TooltipTriggerZ:()=>y_,TooltipZ:()=>R_,TourStepForSchemaZ:()=>b_,TourZ:()=>H_,TriggerWhenZ:()=>Qd,ViewportConditionZ:()=>hg,ViewportContextZ:()=>$2,WaitZ:()=>B_,WidgetConfigZ:()=>x_,WidgetRegistry:()=>uf,appRegistry:()=>wl,applyStaticSlotStyles:()=>Rg,cleanupAppContext:()=>oh,contentRuntime:()=>Up,coreActionStepSchemas:()=>F2,createActionEngine:()=>rg,createAnchorResolver:()=>_g,createAppContext:()=>nh,createAppLoader:()=>sh,createCanvasConfigFetcher:()=>qi,createContextManager:()=>Cg,createDecisionEngine:()=>wg,createEventAccumulator:()=>kg,createEventBus:()=>Cu,createGrowthBookClient:()=>um,createNoopClient:()=>ym,createOverlayRecipeFetcher:()=>wH,createPostHogClient:()=>Jm,createPostHogNormalizer:()=>bb,createSessionMetricTracker:()=>cm,createSmartCanvas:()=>jh,createSmartCanvasController:()=>vb,createSmartCanvasRuntime:()=>Ug,createStateStore:()=>Eg,createSurfaceContainer:()=>Bg,createSurfaces:()=>Fg,decisionSchemas:()=>b5,decodeToken:()=>Eu,encodeToken:()=>zg,evaluate:()=>$_,evaluateCondition:()=>z_,evaluateRule:()=>q_,evaluateRuleStrategy:()=>tf,evaluateScoreStrategy:()=>af,evaluateSync:()=>V_,executorRegistry:()=>sn,getAntiFlickerSnippet:()=>zA,getAppIdFromActionKind:()=>Kx,getAppIdFromWidgetId:()=>ih,getExecutor:()=>L2,getSlotAnchorId:()=>lf,getSlotType:()=>Iu,getSlotZIndex:()=>Pg,hasExecutor:()=>eg,interpolateTemplate:()=>sd,isCoreActionKind:()=>Yx,matchEvent:()=>Fh,needsMigration:()=>d4,normalizePostHogEvent:()=>Il,overlaysRuntime:()=>rh,parseVersion:()=>Ol,playEnterAnimation:()=>Dg,playExitAnimation:()=>Ng,registerConfigPredicates:()=>jc,registerSmartCanvasElement:()=>Pb,resolveConfigUri:()=>bh,setupAdjacentPositioning:()=>Mg,setupInlinePositioning:()=>Og,shouldNormalizeEvent:()=>Al,useDecision:()=>pE,useNotifications:()=>Hh,useNotifyWatcher:()=>zh,usePageContext:()=>$h,useRuntime:()=>Kr,useRuntimeContext:()=>ld,useRuntimeEvents:()=>dE,useRuntimeState:()=>fE,useSessionContext:()=>uE,useShadowCanvasConfig:()=>Db,useShadowRoot:()=>$i,useViewportContext:()=>cE,validateAction:()=>Mr,validateActions:()=>Wd,validateActivationConfig:()=>x5,validateCondition:()=>v5,validateConfig:()=>l4,validateEventFilter:()=>P5,validateEventName:()=>Lg,validateFrequencyEntry:()=>nq,validateNormalizedEvent:()=>B5,validateProps:()=>Ig,validateRecipe:()=>CH,validateRuntimeContext:()=>M5,validateStoredValue:()=>rq,validateStrategy:()=>y5,widgetRegistry:()=>Hg});var BM=ae(st(),1),qg=ae(Mu(),1),pq=ae(Ei(),1);function aI(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 f of d)for(let p of f.removedNodes)if(p===t){if(s>=n){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 BN=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 Ox(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=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!BN.has(l)){o.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"),S=(c==="href"||c==="src"||c==="formaction")&&(d.startsWith("javascript:")||d.startsWith("vbscript:")||d.startsWith("data:text/html"));(f||S)&&s.removeAttribute(u.name)}}let i=Array.from(r.querySelectorAll("svg"));for(let s of i)o.some(l=>s.contains(l)&&l.tagName.toLowerCase()==="script")&&o.push(s);for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML}var rI=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=Ox(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),p=(a.parentElement??a).querySelector(`[${n}="${d}"]`);p&&p.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:f}=t.deepLink;l=()=>{let p=window.SynOS?.handle;p&&(p.open(),p.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=aI(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=Ox(d.html))}}},nI=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.isConnected&&(a.textContent=r)},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},oI=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:()=>{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)}}},iI=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:()=>{a.isConnected&&(r||a.classList.remove(t.className))}}},sI=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:()=>{a.isConnected&&r&&a.classList.add(t.className)}}},lI=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:()=>{if(a.isConnected)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)}}},Dx=[{kind:"content:insertHtml",executor:rI},{kind:"content:setText",executor:nI},{kind:"content:setAttr",executor:oI},{kind:"content:addClass",executor:iI},{kind:"content:removeClass",executor:sI},{kind:"content:setStyle",executor:lI}],Up={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Dx};var PN={light:50,medium:100,heavy:200},FN=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],uI={init(t,e,a){let r=PN[a.intensity],n=a.colors.length>0?a.colors:FN,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 HN={light:20,medium:40,heavy:80},UN="\u{1F389}",cI={init(t,e,a){let r=HN[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:UN,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 zN={light:20,medium:40,heavy:80},qN={light:3,medium:4,heavy:5},dI={init(t,e,a){let r=zN[a.intensity],n=qN[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 f=Math.PI*2*d/r+(Math.random()-.5)*.3,p=Math.random()*3+2;i.push({x:l,y:u,vx:Math.cos(f)*p,vy:Math.sin(f)*p,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 $N={light:30,medium:60,heavy:120},fI={init(t,e,a){let r=$N[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 zp=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){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;this.container=e,this.effect=a,this.duration=r.duration;let o=document.createElement("canvas");o.setAttribute("data-syntro-celebrate",""),Object.assign(o.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let i=window.devicePixelRatio||1,s=window.innerWidth,l=window.innerHeight;o.width=s*i,o.height=l*i,o.style.width=`${s}px`,o.style.height=`${l}px`;let u=o.getContext("2d");u&&(u.scale(i,i),this.canvas=o,this.ctx=u,e.appendChild(o),this.particles=a.init(s,l,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 VN=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function jN(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function GN(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 jN(a,r||a)}catch{}return null}var pI=new Map([["confetti",uI],["fireworks",dI],["sparkles",fI],["emoji-rain",cI]]),hI=async(t,e)=>{let a=pI.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...pI.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??GN(e.overlayRoot)??VN,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new zp;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var Bx="syntro_active_tour",qp=new Map;function ZN(t){try{let e=localStorage.getItem(Bx);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function Nx(t){try{localStorage.setItem(Bx,JSON.stringify(t))}catch{}}function WN(){try{localStorage.removeItem(Bx)}catch{}}function Oc(){return window.location.pathname}function XN(t){if(!t.route)return!0;let e=Oc();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var Px=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(qp.has(a))return{cleanup:async()=>{let g=qp.get(a);g&&await g.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=ZN(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},Nx(i));let l=r.findIndex(g=>g.id===i.currentStepId);if(l===-1){let g=n||r[0].id;l=r.findIndex(y=>y.id===g),l===-1&&(l=0),i.currentStepId=r[l].id,Nx(i)}let u=r[l];if(!XN(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:Oc()}),{cleanup:()=>{}};let c=!1,d=null,f=null,p=null,S=async()=>{f&&(f(),f=null),d?.isApplied()&&(await d.revert(),d=null)},x=async g=>{if(c)return;if(await S(),g==="end"){WN(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let y=r.find(C=>C.id===g);if(!y){console.error(`[Tour] Step "${g}" not found`);return}if(i.currentStepId=g,Nx(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:g}),y.route&&y.route!==Oc()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:g,targetRoute:y.route});return}await b(y)},b=async g=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:g.id,stepIndex:r.findIndex(y=>y.id===g.id),totalSteps:r.length});try{d=await e.applyAction(g.action)}catch(y){console.error(`[Tour] Failed to execute step "${g.id}":`,y),e.publishEvent("tour.step_failed",{tourId:a,stepId:g.id,error:String(y)});return}if(g.onAction&&e.subscribeEvent){f=e.subscribeEvent("action.modal_cta_clicked",w=>{let _=w?.actionId;if(_&&g.onAction){let k=g.onAction[_];k&&x(k)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let _=w?.actionId;if(_&&g.onAction){let k=g.onAction[_];k&&x(k)}}),C=f;f=()=>{C(),y()}}}};p=(()=>{let g=Oc(),y=()=>{let _=Oc();_!==g&&(g=_,e.publishEvent("tour.route_changed",{tourId:a,newRoute:_}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>y());window.addEventListener("popstate",y);let C=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(..._)=>{C(..._),queueMicrotask(y)},history.replaceState=(..._)=>{w(..._),queueMicrotask(y)},()=>{window.removeEventListener("popstate",y),history.pushState=C,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await b(u);let h=async()=>{c=!0,qp.delete(a),await S(),p&&p(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return qp.set(a,{cleanup:h}),{cleanup:h}};var br={white:"#ffffff",black:"#000000"},de={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},L={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"},qe={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},jt={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},at={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},za={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Dc={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},ia={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Nc={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var qa={primary:L[10],secondary:L[9],tertiary:L[8]},zq={primary:L[2],secondary:L[0]},Fx={primary:L[4],secondary:L[3]},$p={primary:{text:br.white,icon:br.white,border:de[3],backgroundDefault:de[3],backgroundHover:de[2]},neutral:{text:L[10],textHover:br.white,icon:L[10],iconHover:br.white,border:L[4],background:L[2]},link:{text:br.white,icon:br.white,hover:de[5]},error:{text:at[5],hover:at[6]},success:{text:qe[5],hover:qe[6]}},qq={slateGrey:{content:L[10],pillOutline:L[10],borderPrimary:L[5],borderSecondary:L[5],background:L[3]},brand:{content:de[9],pillOutline:de[9],borderPrimary:de[6],borderSecondary:de[6],background:de[0]},red:{content:at[8],pillOutline:at[4],borderPrimary:at[2],borderSecondary:at[2],background:at[0]},yellow:{content:jt[8],pillOutline:jt[4],borderPrimary:jt[2],borderSecondary:jt[2],background:jt[0]},green:{content:qe[8],pillOutline:qe[4],borderPrimary:qe[2],borderSecondary:qe[2],background:qe[0]},purple:{content:ia[8],pillOutline:ia[4],borderPrimary:ia[2],borderSecondary:ia[2],background:ia[0]},blue:{content:za[8],pillOutline:za[4],borderPrimary:za[2],borderSecondary:za[2],background:za[0]},orange:{content:Dc[8],pillOutline:Dc[4],borderPrimary:Dc[2],borderSecondary:Dc[2],background:Dc[0]},pink:{content:Nc[8],pillOutline:Nc[4],borderPrimary:Nc[2],borderSecondary:Nc[2],background:Nc[0]}},$q={green:{content:qe[8],border:qe[2],background:qe[0]},yellow:{content:jt[8],border:jt[2],background:jt[0]},red:{content:at[8],border:at[2],background:at[0]}},Vq={green:{content:qe[1],background:qe[9]},yellow:{content:jt[1],background:jt[9]},red:{content:at[1],background:at[9]}},jq={content:L[10],border:L[4],background:"#1c2124"},Gq={backgroundDefault:L[2],backgroundHover:L[1],selected:L[3]},Zq={background:L[2],icon:L[10],borderDefault:L[4],borderSelected:de[3],textLabel:L[9],textPlaceholder:L[8],textHint:L[8]},Wq={backgroundDefault:L[2],backgroundDisabled:L[0],textLabel:L[9],textPlaceholder:L[8],textHint:L[8],textError:at[5],iconDefault:L[9],iconPlaceholder:L[10],iconError:at[5],borderDefault:L[4],borderSelected:de[3],borderError:at[5]},Xq={handleDefault:br.white,handleDisabled:L[10],off:{backgroundDefault:L[4],backgroundHover:L[5],backgroundDisabled:L[4]},on:{backgroundDefault:qe[3],backgroundHover:qe[2],backgroundDisabled:L[4]}},Yq={off:{backgroundDefault:"#00000000",backgroundHover:L[5],backgroundDisabled:L[2],border:L[6]},on:{backgroundDefault:qe[0],backgroundHover:qe[1],backgroundDisabled:L[2],border:qe[3]}},Kq={content:L[10],background:L[4]},Qq={background:L[4],active:qe[3]},Jq={background:L[1],content:L[9],border:L[4]},e6={backgroundDefault:L[1],backgroundHover:L[3],backgroundActive:L[4],border:L[4],contentPrimary:L[10],contentSecondary:L[9],contentTertiary:L[8]},t6={background:L[1],content:L[9],border:L[4]},a6={activeBackground:L[3],activeContent:de[5],inactiveContent:L[9],border:L[4]},r6={header:{textDefault:L[9],textHover:L[8],backgroundDefault:L[1]},border:L[4],cell:{textPrimary:L[10],textSecondary:L[9],backgroundDefault:L[2],backgroundHover:L[1]}},n6={textPrimaryDefault:L[10],textPrimaryHover:L[10],textSecondaryDefault:L[8],textSecondaryHover:L[9],iconPrimary:L[10],iconSecondary:L[8]},o6={background:qe[1],active:qe[5]},i6={textDefault:L[10],textSelected:br.white,textDisabled:L[7],backgroundDefault:L[2],backgroundMiddle:L[3],backgroundSelected:de[3],border:L[4]},s6=L[9];var mI=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function gI(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, ${za[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(),p=document.createElement("div");p.className="syntro-spotlight-scrim";let S=s||l;Object.assign(p.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(p),requestAnimationFrame(()=>p.style.opacity="1");let x=document.createElement("div");x.className="syntro-spotlight-ring",Object.assign(x.style,{position:"fixed",pointerEvents:"none",borderRadius:`${n}px`,border:`2px solid ${i||f||za[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(!mI)for(let A=0;A<4;A++){let I=document.createElement("div");I.style.position="fixed",I.style.background="inherit",b.push(I),p.appendChild(I)}let m=A=>{p.style.clipPath=A,p.style.webkitClipPath=A},h=()=>{if(!t.isConnected){k.destroy();return}let A=t.getBoundingClientRect(),I=A.left-r,R=A.top-r,U=A.width+r*2,E=A.height+r*2;if(Object.assign(x.style,{left:`${I}px`,top:`${R}px`,width:`${U}px`,height:`${E}px`}),mI){let N=window.innerWidth,O=window.innerHeight,H=Math.min(n,U/2,E/2),Y=`M 0 0 L ${N} 0 L ${N} ${O} L 0 ${O} Z`,z=`M ${I+H} ${R} A ${H} ${H} 0 0 0 ${I} ${R+H} L ${I} ${R+E-H} A ${H} ${H} 0 0 0 ${I+H} ${R+E} L ${I+U-H} ${R+E} A ${H} ${H} 0 0 0 ${I+U} ${R+E-H} L ${I+U} ${R+H} A ${H} ${H} 0 0 0 ${I+U-H} ${R} L ${I+H} ${R} Z`;m(`path('${Y} ${z}')`)}else{let[N,O,H,Y]=b;Object.assign(N.style,{left:"0px",top:"0px",width:"100vw",height:`${R}px`}),Object.assign(H.style,{left:"0px",top:`${R+E}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(R+E))}px`}),Object.assign(Y.style,{left:"0px",top:`${R}px`,width:`${I}px`,height:`${E}px`}),Object.assign(O.style,{left:`${I+U}px`,top:`${R}px`,width:`${Math.max(0,window.innerWidth-(I+U))}px`,height:`${E}px`})}},g=new ResizeObserver(()=>requestAnimationFrame(h));g.observe(t);let y=()=>requestAnimationFrame(h),C=()=>requestAnimationFrame(h);window.addEventListener("scroll",y,!0),window.addEventListener("resize",C);let w=A=>{A.key==="Escape"&&u&&(a?.onDismiss?.(),k.destroy())};u&&window.addEventListener("keydown",w);let _=A=>{s?(A.preventDefault(),A.stopPropagation()):l&&(a?.onDismiss?.(),k.destroy())};p.addEventListener("click",_);let k={destroy(){g.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",C),u&&window.removeEventListener("keydown",w),p.removeEventListener("click",_),p.style.pointerEvents="none",p.style.opacity="0",setTimeout(()=>{try{p.remove()}catch{}try{x.remove()}catch{}},220)}};return h(),k}var YN=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 $a(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(!YN.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 Ti={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)"},Hx=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=`
|
|
8
|
+
`+r.stack}}var Fg=Object.prototype.hasOwnProperty,Av=mt.unstable_scheduleCallback,tg=mt.unstable_cancelCallback,P2=mt.unstable_shouldYield,N2=mt.unstable_requestPaint,ha=mt.unstable_now,F2=mt.unstable_getCurrentPriorityLevel,iw=mt.unstable_ImmediatePriority,sw=mt.unstable_UserBlockingPriority,Gd=mt.unstable_NormalPriority,H2=mt.unstable_LowPriority,lw=mt.unstable_IdlePriority,U2=mt.log,z2=mt.unstable_setDisableYieldValue,gu=null,ma=null;function Dn(t){if(typeof U2=="function"&&z2(t),ma&&typeof ma.setStrictMode=="function")try{ma.setStrictMode(gu,t)}catch{}}var ga=Math.clz32?Math.clz32:V2,q2=Math.log,$2=Math.LN2;function V2(t){return t>>>=0,t===0?32:31-(q2(t)/$2|0)|0}var dd=256,fd=262144,pd=4194304;function Ao(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 xf(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=Ao(r):(i&=s,i!==0?n=Ao(i):a||(a=s&~t,a!==0&&(n=Ao(a))))):(s=r&~o,s!==0?n=Ao(s):i!==0?n=Ao(i):a||(a=r&~t,a!==0&&(n=Ao(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 vu(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function j2(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 uw(){var t=pd;return pd<<=1,(pd&62914560)===0&&(pd=4194304),t}function ag(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function yu(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function G2(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-ga(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}r!==0&&cw(t,r,0),o!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=o&~(i&~e))}function cw(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-ga(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function dw(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var r=31-ga(a),n=1<<r;n&e|t[r]&e&&(t[r]|=e),a&=~n}}function fw(t,e){var a=e&-e;return a=(a&42)!==0?1:Ev(a),(a&(t.suspendedLanes|e))!==0?0:a}function Ev(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 Tv(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pw(){var t=_e.p;return t!==0?t:(t=window.event,t===void 0?32:P1(t.type))}function M_(t,e){var a=_e.p;try{return _e.p=t,e()}finally{_e.p=a}}var Qn=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Qn,ta="__reactProps$"+Qn,hs="__reactContainer$"+Qn,Hg="__reactEvents$"+Qn,W2="__reactListeners$"+Qn,Z2="__reactHandles$"+Qn,O_="__reactResources$"+Qn,xu="__reactMarker$"+Qn;function Rv(t){delete t[Lt],delete t[ta],delete t[Hg],delete t[W2],delete t[Z2]}function Ui(t){var e=t[Lt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[hs]||a[Lt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=zC(t);t!==null;){if(a=t[Lt])return a;t=zC(t)}return e}t=a,a=t.parentNode}return null}function ms(t){if(t=t[Lt]||t[hs]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Hl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(M(33))}function Yi(t){var e=t[O_];return e||(e=t[O_]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function bt(t){t[xu]=!0}var hw=new Set,mw={};function zo(t,e){ns(t,e),ns(t+"Capture",e)}function ns(t,e){for(mw[t]=e,t=0;t<e.length;t++)hw.add(e[t])}var X2=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]*$"),D_={},B_={};function Y2(t){return Fg.call(B_,t)?!0:Fg.call(D_,t)?!1:X2.test(t)?B_[t]=!0:(D_[t]=!0,!1)}function Ad(t,e,a){if(Y2(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 hd(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 Mr(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 Ta(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function gw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function K2(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 Ug(t){if(!t._valueTracker){var e=gw(t)?"checked":"value";t._valueTracker=K2(t,e,""+t[e])}}function vw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),r="";return t&&(r=gw(t)?t.checked?"true":"false":t.value),t=r,t!==a?(e.setValue(t),!0):!1}function Wd(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 Q2=/[\n"\\]/g;function Oa(t){return t.replace(Q2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function zg(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=""+Ta(e)):t.value!==""+Ta(e)&&(t.value=""+Ta(e)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),e!=null?qg(t,i,Ta(e)):a!=null?qg(t,i,Ta(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=""+Ta(s):t.removeAttribute("name")}function yw(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)){Ug(t);return}a=a!=null?""+Ta(a):"",e=e!=null?""+Ta(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),Ug(t)}function qg(t,e,a){e==="number"&&Wd(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Ki(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=""+Ta(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 xw(t,e,a){if(e!=null&&(e=""+Ta(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+Ta(a):""}function bw(t,e,a,r){if(e==null){if(r!=null){if(a!=null)throw Error(M(92));if(Fl(r)){if(1<r.length)throw Error(M(93));r=r[0]}a=r}a==null&&(a=""),e=a}a=Ta(e),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Ug(t)}function os(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var J2=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 P_(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||J2.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function Sw(t,e,a){if(e!=null&&typeof e!="object")throw Error(M(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&&P_(t,n,r)}else for(var o in e)e.hasOwnProperty(o)&&P_(t,o,e[o])}function Mv(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 eM=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"]]),tM=/^[\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 Ed(t){return tM.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ur(){}var $g=null;function Ov(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var zi=null,Qi=null;function N_(t){var e=ms(t);if(e&&(t=e.stateNode)){var a=t[ta]||null;e:switch(t=e.stateNode,e.type){case"input":if(zg(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="'+Oa(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var r=a[e];if(r!==t&&r.form===t.form){var n=r[ta]||null;if(!n)throw Error(M(90));zg(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&&vw(r)}break e;case"textarea":xw(t,a.value,a.defaultValue);break e;case"select":e=a.value,e!=null&&Ki(t,!!a.multiple,e,!1)}}}var rg=!1;function _w(t,e,a){if(rg)return t(e,a);rg=!0;try{var r=t(e);return r}finally{if(rg=!1,(zi!==null||Qi!==null)&&(Rf(),zi&&(e=zi,t=Qi,Qi=zi=null,N_(e),t)))for(e=0;e<t.length;e++)N_(t[e])}}function au(t,e){var a=t.stateNode;if(a===null)return null;var r=a[ta]||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(M(231,e,typeof a));return a}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vg=!1;if(jr)try{Oi={},Object.defineProperty(Oi,"passive",{get:function(){Vg=!0}}),window.addEventListener("test",Oi,Oi),window.removeEventListener("test",Oi,Oi)}catch{Vg=!1}var Oi,Bn=null,Dv=null,Td=null;function Cw(){if(Td)return Td;var t,e=Dv,a=e.length,r,n="value"in Bn?Bn.value:Bn.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 Td=n.slice(t,1<r?1-r:void 0)}function Rd(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 md(){return!0}function F_(){return!1}function aa(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)?md:F_,this.isPropagationStopped=F_,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=md)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=md)},persist:function(){},isPersistent:md}),e}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bf=aa(qo),bu=ze({},qo,{view:0,detail:0}),aM=aa(bu),ng,og,Rl,Sf=ze({},bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bv,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!==Rl&&(Rl&&t.type==="mousemove"?(ng=t.screenX-Rl.screenX,og=t.screenY-Rl.screenY):og=ng=0,Rl=t),ng)},movementY:function(t){return"movementY"in t?t.movementY:og}}),H_=aa(Sf),rM=ze({},Sf,{dataTransfer:0}),nM=aa(rM),oM=ze({},bu,{relatedTarget:0}),ig=aa(oM),iM=ze({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),sM=aa(iM),lM=ze({},qo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),uM=aa(lM),cM=ze({},qo,{data:0}),U_=aa(cM),dM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fM={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"},pM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hM(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=pM[t])?!!e[t]:!1}function Bv(){return hM}var mM=ze({},bu,{key:function(t){if(t.key){var e=dM[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Rd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?fM[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bv,charCode:function(t){return t.type==="keypress"?Rd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Rd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gM=aa(mM),vM=ze({},Sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),z_=aa(vM),yM=ze({},bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bv}),xM=aa(yM),bM=ze({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),SM=aa(bM),_M=ze({},Sf,{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}),CM=aa(_M),wM=ze({},qo,{newState:0,oldState:0}),LM=aa(wM),kM=[9,13,27,32],Pv=jr&&"CompositionEvent"in window,ql=null;jr&&"documentMode"in document&&(ql=document.documentMode);var IM=jr&&"TextEvent"in window&&!ql,ww=jr&&(!Pv||ql&&8<ql&&11>=ql),q_=" ",$_=!1;function Lw(t,e){switch(t){case"keyup":return kM.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qi=!1;function AM(t,e){switch(t){case"compositionend":return kw(e);case"keypress":return e.which!==32?null:($_=!0,q_);case"textInput":return t=e.data,t===q_&&$_?null:t;default:return null}}function EM(t,e){if(qi)return t==="compositionend"||!Pv&&Lw(t,e)?(t=Cw(),Td=Dv=Bn=null,qi=!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 ww&&e.locale!=="ko"?null:e.data;default:return null}}var TM={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 V_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!TM[t.type]:e==="textarea"}function Iw(t,e,a,r){zi?Qi?Qi.push(r):Qi=[r]:zi=r,e=ff(e,"onChange"),0<e.length&&(a=new bf("onChange","change",null,a,r),t.push({event:a,listeners:e}))}var $l=null,ru=null;function RM(t){_1(t,0)}function _f(t){var e=Hl(t);if(vw(e))return t}function j_(t,e){if(t==="change")return e}var Aw=!1;jr&&(jr?(vd="oninput"in document,vd||(sg=document.createElement("div"),sg.setAttribute("oninput","return;"),vd=typeof sg.oninput=="function"),gd=vd):gd=!1,Aw=gd&&(!document.documentMode||9<document.documentMode));var gd,vd,sg;function G_(){$l&&($l.detachEvent("onpropertychange",Ew),ru=$l=null)}function Ew(t){if(t.propertyName==="value"&&_f(ru)){var e=[];Iw(e,ru,t,Ov(t)),_w(RM,e)}}function MM(t,e,a){t==="focusin"?(G_(),$l=e,ru=a,$l.attachEvent("onpropertychange",Ew)):t==="focusout"&&G_()}function OM(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return _f(ru)}function DM(t,e){if(t==="click")return _f(e)}function BM(t,e){if(t==="input"||t==="change")return _f(e)}function PM(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ya=typeof Object.is=="function"?Object.is:PM;function nu(t,e){if(ya(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(!Fg.call(e,n)||!ya(t[n],e[n]))return!1}return!0}function W_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Z_(t,e){var a=W_(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=W_(a)}}function Tw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Tw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Rw(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Wd(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=Wd(t.document)}return e}function Nv(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 NM=jr&&"documentMode"in document&&11>=document.documentMode,$i=null,jg=null,Vl=null,Gg=!1;function X_(t,e,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Gg||$i==null||$i!==Wd(r)||(r=$i,"selectionStart"in r&&Nv(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}),Vl&&nu(Vl,r)||(Vl=r,r=ff(jg,"onSelect"),0<r.length&&(e=new bf("onSelect","select",null,e,a),t.push({event:e,listeners:r}),e.target=$i)))}function ko(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var Vi={animationend:ko("Animation","AnimationEnd"),animationiteration:ko("Animation","AnimationIteration"),animationstart:ko("Animation","AnimationStart"),transitionrun:ko("Transition","TransitionRun"),transitionstart:ko("Transition","TransitionStart"),transitioncancel:ko("Transition","TransitionCancel"),transitionend:ko("Transition","TransitionEnd")},lg={},Mw={};jr&&(Mw=document.createElement("div").style,"AnimationEvent"in window||(delete Vi.animationend.animation,delete Vi.animationiteration.animation,delete Vi.animationstart.animation),"TransitionEvent"in window||delete Vi.transitionend.transition);function $o(t){if(lg[t])return lg[t];if(!Vi[t])return t;var e=Vi[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in Mw)return lg[t]=e[a];return t}var Ow=$o("animationend"),Dw=$o("animationiteration"),Bw=$o("animationstart"),FM=$o("transitionrun"),HM=$o("transitionstart"),UM=$o("transitioncancel"),Pw=$o("transitionend"),Nw=new Map,Wg="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(" ");Wg.push("scrollEnd");function Ya(t,e){Nw.set(t,e),zo(e,[t])}var Zd=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)},Ea=[],ji=0,Fv=0;function Cf(){for(var t=ji,e=Fv=ji=0;e<t;){var a=Ea[e];Ea[e++]=null;var r=Ea[e];Ea[e++]=null;var n=Ea[e];Ea[e++]=null;var o=Ea[e];if(Ea[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&&Fw(a,n,o)}}function wf(t,e,a,r){Ea[ji++]=t,Ea[ji++]=e,Ea[ji++]=a,Ea[ji++]=r,Fv|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Hv(t,e,a,r){return wf(t,e,a,r),Xd(t)}function Vo(t,e){return wf(t,null,null,e),Xd(t)}function Fw(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-ga(a),t=o.hiddenUpdates,r=t[n],r===null?t[n]=[e]:r.push(e),e.lane=a|536870912),o):null}function Xd(t){if(50<Jl)throw Jl=0,hv=null,Error(M(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Gi={};function zM(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 fa(t,e,a,r){return new zM(t,e,a,r)}function Uv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qr(t,e){var a=t.alternate;return a===null?(a=fa(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 Hw(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 Md(t,e,a,r,n,o){var i=0;if(r=t,typeof t=="function")Uv(t)&&(i=1);else if(typeof t=="string")i=VO(t,a,yr.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Dg:return t=fa(31,a,e,n),t.elementType=Dg,t.lanes=o,t;case Fi:return Mo(a.children,n,o,e);case nw:i=8,n|=24;break;case Rg:return t=fa(12,a,e,n|2),t.elementType=Rg,t.lanes=o,t;case Mg:return t=fa(13,a,e,n),t.elementType=Mg,t.lanes=o,t;case Og:return t=fa(19,a,e,n),t.elementType=Og,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Hr:i=10;break e;case ow:i=9;break e;case kv:i=11;break e;case Iv:i=14;break e;case An:i=16,r=null;break e}i=29,a=Error(M(130,t===null?"null":typeof t,"")),r=null}return e=fa(i,a,e,n),e.elementType=t,e.type=r,e.lanes=o,e}function Mo(t,e,a,r){return t=fa(7,t,r,e),t.lanes=a,t}function ug(t,e,a){return t=fa(6,t,null,e),t.lanes=a,t}function Uw(t){var e=fa(18,null,null,0);return e.stateNode=t,e}function cg(t,e,a){return e=fa(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var Y_=new WeakMap;function Da(t,e){if(typeof t=="object"&&t!==null){var a=Y_.get(t);return a!==void 0?a:(e={value:t,source:e,stack:R_(e)},Y_.set(t,e),e)}return{value:t,source:e,stack:R_(e)}}var Wi=[],Zi=0,Yd=null,ou=0,Ra=[],Ma=0,Zn=null,mr=1,gr="";function Nr(t,e){Wi[Zi++]=ou,Wi[Zi++]=Yd,Yd=t,ou=e}function zw(t,e,a){Ra[Ma++]=mr,Ra[Ma++]=gr,Ra[Ma++]=Zn,Zn=t;var r=mr;t=gr;var n=32-ga(r)-1;r&=~(1<<n),a+=1;var o=32-ga(e)+n;if(30<o){var i=n-n%5;o=(r&(1<<i)-1).toString(32),r>>=i,n-=i,mr=1<<32-ga(e)+n|a<<n|r,gr=o+t}else mr=1<<o|a<<n|r,gr=t}function zv(t){t.return!==null&&(Nr(t,1),zw(t,1,0))}function qv(t){for(;t===Yd;)Yd=Wi[--Zi],Wi[Zi]=null,ou=Wi[--Zi],Wi[Zi]=null;for(;t===Zn;)Zn=Ra[--Ma],Ra[Ma]=null,gr=Ra[--Ma],Ra[Ma]=null,mr=Ra[--Ma],Ra[Ma]=null}function qw(t,e){Ra[Ma++]=mr,Ra[Ma++]=gr,Ra[Ma++]=Zn,mr=e.id,gr=e.overflow,Zn=t}var kt=null,Ue=null,ve=!1,Un=null,Ba=!1,Zg=Error(M(519));function Xn(t){var e=Error(M(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw iu(Da(e,t)),Zg}function K_(t){var e=t.stateNode,a=t.type,r=t.memoizedProps;switch(e[Lt]=t,e[ta]=r,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<cu.length;a++)ce(cu[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),yw(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ce("invalid",e);break;case"textarea":ce("invalid",e),bw(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||w1(e.textContent,a)?(r.popover!=null&&(ce("beforetoggle",e),ce("toggle",e)),r.onScroll!=null&&ce("scroll",e),r.onScrollEnd!=null&&ce("scrollend",e),r.onClick!=null&&(e.onclick=Ur),e=!0):e=!1,e||Xn(t,!0)}function Q_(t){for(kt=t.return;kt;)switch(kt.tag){case 5:case 31:case 13:Ba=!1;return;case 27:case 3:Ba=!0;return;default:kt=kt.return}}function Di(t){if(t!==kt)return!1;if(!ve)return Q_(t),ve=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||xv(t.type,t.memoizedProps)),a=!a),a&&Ue&&Xn(t),Q_(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ue=UC(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));Ue=UC(t)}else e===27?(e=Ue,Jn(t.type)?(t=Cv,Cv=null,Ue=t):Ue=e):Ue=kt?Na(t.stateNode.nextSibling):null;return!0}function Po(){Ue=kt=null,ve=!1}function dg(){var t=Un;return t!==null&&(Jt===null?Jt=t:Jt.push.apply(Jt,t),Un=null),t}function iu(t){Un===null?Un=[t]:Un.push(t)}var Xg=xr(null),jo=null,zr=null;function Tn(t,e,a){Be(Xg,e._currentValue),e._currentValue=a}function $r(t){t._currentValue=Xg.current,St(Xg)}function Yg(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 Kg(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),Yg(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(M(341));i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),Yg(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 gs(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(M(387));if(i=i.memoizedProps,i!==null){var s=n.type;ya(n.pendingProps.value,i.value)||(t!==null?t.push(s):t=[s])}}else if(n===$d.current){if(i=n.alternate,i===null)throw Error(M(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(t!==null?t.push(fu):t=[fu])}n=n.return}t!==null&&Kg(e,t,a,r),e.flags|=262144}function Kd(t){for(t=t.firstContext;t!==null;){if(!ya(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function No(t){jo=t,zr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function It(t){return $w(jo,t)}function yd(t,e){return jo===null&&No(t),$w(t,e)}function $w(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},zr===null){if(t===null)throw Error(M(308));zr=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else zr=zr.next=e;return a}var qM=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()})}},$M=mt.unstable_scheduleCallback,VM=mt.unstable_NormalPriority,ut={$$typeof:Hr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $v(){return{controller:new qM,data:new Map,refCount:0}}function Su(t){t.refCount--,t.refCount===0&&$M(VM,function(){t.controller.abort()})}var jl=null,Qg=0,is=0,Ji=null;function jM(t,e){if(jl===null){var a=jl=[];Qg=0,is=hy(),Ji={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Qg++,e.then(J_,J_),e}function J_(){if(--Qg===0&&jl!==null){Ji!==null&&(Ji.status="fulfilled");var t=jl;jl=null,is=0,Ji=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function GM(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 eC=te.S;te.S=function(t,e){r1=ha(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&jM(t,e),eC!==null&&eC(t,e)};var Oo=xr(null);function Vv(){var t=Oo.current;return t!==null?t:Re.pooledCache}function Od(t,e){e===null?Be(Oo,Oo.current):Be(Oo,e.pool)}function Vw(){var t=Vv();return t===null?null:{parent:ut._currentValue,pool:t}}var vs=Error(M(460)),jv=Error(M(474)),Lf=Error(M(542)),Qd={then:function(){}};function tC(t){return t=t.status,t==="fulfilled"||t==="rejected"}function jw(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(Ur,Ur),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,rC(t),t;default:if(typeof e.status=="string")e.then(Ur,Ur);else{if(t=Re,t!==null&&100<t.shellSuspendCounter)throw Error(M(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,rC(t),t}throw Do=e,vs}}function Eo(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Do=a,vs):a}}var Do=null;function aC(){if(Do===null)throw Error(M(459));var t=Do;return Do=null,t}function rC(t){if(t===vs||t===Lf)throw Error(M(483))}var es=null,su=0;function xd(t){var e=su;return su+=1,es===null&&(es=[]),jw(es,t,e)}function Ml(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function bd(t,e){throw e.$$typeof===M2?Error(M(525)):(t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Gw(t){function e(g,m){if(t){var y=g.deletions;y===null?(g.deletions=[m],g.flags|=16):y.push(m)}}function a(g,m){if(!t)return null;for(;m!==null;)e(g,m),m=m.sibling;return null}function r(g){for(var m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function n(g,m){return g=qr(g,m),g.index=0,g.sibling=null,g}function o(g,m,y){return g.index=y,t?(y=g.alternate,y!==null?(y=y.index,y<m?(g.flags|=67108866,m):y):(g.flags|=67108866,m)):(g.flags|=1048576,m)}function i(g){return t&&g.alternate===null&&(g.flags|=67108866),g}function s(g,m,y,v){return m===null||m.tag!==6?(m=ug(y,g.mode,v),m.return=g,m):(m=n(m,y),m.return=g,m)}function l(g,m,y,v){var C=y.type;return C===Fi?c(g,m,y.props.children,v,y.key):m!==null&&(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===An&&Eo(C)===m.type)?(m=n(m,y.props),Ml(m,y),m.return=g,m):(m=Md(y.type,y.key,y.props,null,g.mode,v),Ml(m,y),m.return=g,m)}function u(g,m,y,v){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=cg(y,g.mode,v),m.return=g,m):(m=n(m,y.children||[]),m.return=g,m)}function c(g,m,y,v,C){return m===null||m.tag!==7?(m=Mo(y,g.mode,v,C),m.return=g,m):(m=n(m,y),m.return=g,m)}function d(g,m,y){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=ug(""+m,g.mode,y),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case cd:return y=Md(m.type,m.key,m.props,null,g.mode,y),Ml(y,m),y.return=g,y;case Nl:return m=cg(m,g.mode,y),m.return=g,m;case An:return m=Eo(m),d(g,m,y)}if(Fl(m)||Tl(m))return m=Mo(m,g.mode,y,null),m.return=g,m;if(typeof m.then=="function")return d(g,xd(m),y);if(m.$$typeof===Hr)return d(g,yd(g,m),y);bd(g,m)}return null}function f(g,m,y,v){var C=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return C!==null?null:s(g,m,""+y,v);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case cd:return y.key===C?l(g,m,y,v):null;case Nl:return y.key===C?u(g,m,y,v):null;case An:return y=Eo(y),f(g,m,y,v)}if(Fl(y)||Tl(y))return C!==null?null:c(g,m,y,v,null);if(typeof y.then=="function")return f(g,m,xd(y),v);if(y.$$typeof===Hr)return f(g,m,yd(g,y),v);bd(g,y)}return null}function h(g,m,y,v,C){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return g=g.get(y)||null,s(m,g,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case cd:return g=g.get(v.key===null?y:v.key)||null,l(m,g,v,C);case Nl:return g=g.get(v.key===null?y:v.key)||null,u(m,g,v,C);case An:return v=Eo(v),h(g,m,y,v,C)}if(Fl(v)||Tl(v))return g=g.get(y)||null,c(m,g,v,C,null);if(typeof v.then=="function")return h(g,m,y,xd(v),C);if(v.$$typeof===Hr)return h(g,m,y,yd(m,v),C);bd(m,v)}return null}function S(g,m,y,v){for(var C=null,w=null,_=m,L=m=0,A=null;_!==null&&L<y.length;L++){_.index>L?(A=_,_=null):A=_.sibling;var I=f(g,_,y[L],v);if(I===null){_===null&&(_=A);break}t&&_&&I.alternate===null&&e(g,_),m=o(I,m,L),w===null?C=I:w.sibling=I,w=I,_=A}if(L===y.length)return a(g,_),ve&&Nr(g,L),C;if(_===null){for(;L<y.length;L++)_=d(g,y[L],v),_!==null&&(m=o(_,m,L),w===null?C=_:w.sibling=_,w=_);return ve&&Nr(g,L),C}for(_=r(_);L<y.length;L++)A=h(_,g,L,y[L],v),A!==null&&(t&&A.alternate!==null&&_.delete(A.key===null?L:A.key),m=o(A,m,L),w===null?C=A:w.sibling=A,w=A);return t&&_.forEach(function(R){return e(g,R)}),ve&&Nr(g,L),C}function x(g,m,y,v){if(y==null)throw Error(M(151));for(var C=null,w=null,_=m,L=m=0,A=null,I=y.next();_!==null&&!I.done;L++,I=y.next()){_.index>L?(A=_,_=null):A=_.sibling;var R=f(g,_,I.value,v);if(R===null){_===null&&(_=A);break}t&&_&&R.alternate===null&&e(g,_),m=o(R,m,L),w===null?C=R:w.sibling=R,w=R,_=A}if(I.done)return a(g,_),ve&&Nr(g,L),C;if(_===null){for(;!I.done;L++,I=y.next())I=d(g,I.value,v),I!==null&&(m=o(I,m,L),w===null?C=I:w.sibling=I,w=I);return ve&&Nr(g,L),C}for(_=r(_);!I.done;L++,I=y.next())I=h(_,g,L,I.value,v),I!==null&&(t&&I.alternate!==null&&_.delete(I.key===null?L:I.key),m=o(I,m,L),w===null?C=I:w.sibling=I,w=I);return t&&_.forEach(function(F){return e(g,F)}),ve&&Nr(g,L),C}function b(g,m,y,v){if(typeof y=="object"&&y!==null&&y.type===Fi&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case cd:e:{for(var C=y.key;m!==null;){if(m.key===C){if(C=y.type,C===Fi){if(m.tag===7){a(g,m.sibling),v=n(m,y.props.children),v.return=g,g=v;break e}}else if(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===An&&Eo(C)===m.type){a(g,m.sibling),v=n(m,y.props),Ml(v,y),v.return=g,g=v;break e}a(g,m);break}else e(g,m);m=m.sibling}y.type===Fi?(v=Mo(y.props.children,g.mode,v,y.key),v.return=g,g=v):(v=Md(y.type,y.key,y.props,null,g.mode,v),Ml(v,y),v.return=g,g=v)}return i(g);case Nl:e:{for(C=y.key;m!==null;){if(m.key===C)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){a(g,m.sibling),v=n(m,y.children||[]),v.return=g,g=v;break e}else{a(g,m);break}else e(g,m);m=m.sibling}v=cg(y,g.mode,v),v.return=g,g=v}return i(g);case An:return y=Eo(y),b(g,m,y,v)}if(Fl(y))return S(g,m,y,v);if(Tl(y)){if(C=Tl(y),typeof C!="function")throw Error(M(150));return y=C.call(y),x(g,m,y,v)}if(typeof y.then=="function")return b(g,m,xd(y),v);if(y.$$typeof===Hr)return b(g,m,yd(g,y),v);bd(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,m!==null&&m.tag===6?(a(g,m.sibling),v=n(m,y),v.return=g,g=v):(a(g,m),v=ug(y,g.mode,v),v.return=g,g=v),i(g)):a(g,m)}return function(g,m,y,v){try{su=0;var C=b(g,m,y,v);return es=null,C}catch(_){if(_===vs||_===Lf)throw _;var w=fa(29,_,null,g.mode);return w.lanes=v,w.return=g,w}}}var Fo=Gw(!0),Ww=Gw(!1),En=!1;function Gv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jg(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 zn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function qn(t,e,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(Se&2)!==0){var n=r.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),r.pending=e,e=Xd(t),Fw(t,null,a),e}return wf(t,r,e,a),Xd(t)}function Gl(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,dw(t,a)}}function fg(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 ev=!1;function Wl(){if(ev){var t=Ji;if(t!==null)throw t}}function Zl(t,e,a,r){ev=!1;var n=t.updateQueue;En=!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 f=s.lane&-536870913,h=f!==s.lane;if(h?(me&f)===f:(r&f)===f){f!==0&&f===is&&(ev=!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:En=!0}}f=s.callback,f!==null&&(t.flags|=64,h&&(t.flags|=8192),h=n.callbacks,h===null?n.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=n.shared.pending,s===null)break;h=s,s=h.next,h.next=null,n.lastBaseUpdate=h,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),Kn|=i,t.lanes=i,t.memoizedState=d}}function Zw(t,e){if(typeof t!="function")throw Error(M(191,t));t.call(e)}function Xw(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Zw(a[t],e)}var ss=xr(null),Jd=xr(0);function nC(t,e){t=Xr,Be(Jd,t),Be(ss,e),Xr=t|e.baseLanes}function tv(){Be(Jd,Xr),Be(ss,ss.current)}function Wv(){Xr=Jd.current,St(ss),St(Jd)}var xa=xr(null),Pa=null;function Rn(t){var e=t.alternate;Be(rt,rt.current&1),Be(xa,t),Pa===null&&(e===null||ss.current!==null||e.memoizedState!==null)&&(Pa=t)}function av(t){Be(rt,rt.current),Be(xa,t),Pa===null&&(Pa=t)}function Yw(t){t.tag===22?(Be(rt,rt.current),Be(xa,t),Pa===null&&(Pa=t)):Mn(t)}function Mn(){Be(rt,rt.current),Be(xa,xa.current)}function da(t){St(xa),Pa===t&&(Pa=null),St(rt)}var rt=xr(0);function ef(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Sv(a)||_v(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 Gr=0,ie=null,Ae=null,st=null,tf=!1,ts=!1,Ho=!1,af=0,lu=0,as=null,WM=0;function Qe(){throw Error(M(321))}function Zv(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!ya(t[a],e[a]))return!1;return!0}function Xv(t,e,a,r,n,o){return Gr=o,ie=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,te.H=t===null||t.memoizedState===null?IL:iy,Ho=!1,o=a(r,n),Ho=!1,ts&&(o=Qw(e,a,r,n)),Kw(t),o}function Kw(t){te.H=uu;var e=Ae!==null&&Ae.next!==null;if(Gr=0,st=Ae=ie=null,tf=!1,lu=0,as=null,e)throw Error(M(300));t===null||ct||(t=t.dependencies,t!==null&&Kd(t)&&(ct=!0))}function Qw(t,e,a,r){ie=t;var n=0;do{if(ts&&(as=null),lu=0,ts=!1,25<=n)throw Error(M(301));if(n+=1,st=Ae=null,t.updateQueue!=null){var o=t.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}te.H=AL,o=e(a,r)}while(ts);return o}function ZM(){var t=te.H,e=t.useState()[0];return e=typeof e.then=="function"?_u(e):e,t=t.useState()[0],(Ae!==null?Ae.memoizedState:null)!==t&&(ie.flags|=1024),e}function Yv(){var t=af!==0;return af=0,t}function Kv(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Qv(t){if(tf){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}tf=!1}Gr=0,st=Ae=ie=null,ts=!1,lu=af=0,as=null}function zt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?ie.memoizedState=st=t:st=st.next=t,st}function nt(){if(Ae===null){var t=ie.alternate;t=t!==null?t.memoizedState:null}else t=Ae.next;var e=st===null?ie.memoizedState:st.next;if(e!==null)st=e,Ae=t;else{if(t===null)throw ie.alternate===null?Error(M(467)):Error(M(310));Ae=t,t={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},st===null?ie.memoizedState=st=t:st=st.next=t}return st}function kf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _u(t){var e=lu;return lu+=1,as===null&&(as=[]),t=jw(as,t,e),e=ie,(st===null?e.memoizedState:st.next)===null&&(e=e.alternate,te.H=e===null||e.memoizedState===null?IL:iy),t}function If(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return _u(t);if(t.$$typeof===Hr)return It(t)}throw Error(M(438,String(t)))}function Jv(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=kf(),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]=O2;return e.index++,a}function Wr(t,e){return typeof e=="function"?e(t):e}function Dd(t){var e=nt();return ey(e,Ae,t)}function ey(t,e,a){var r=t.queue;if(r===null)throw Error(M(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?(me&d)===d:(Gr&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===is&&(c=!0);else if((Gr&f)===f){u=u.next,f===is&&(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,Kn|=f;d=u.action,Ho&&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,Kn|=d;u=u.next}while(u!==null&&u!==e);if(l===null?i=o:l.next=s,!ya(o,t.memoizedState)&&(ct=!0,c&&(a=Ji,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 pg(t){var e=nt(),a=e.queue;if(a===null)throw Error(M(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);ya(o,e.memoizedState)||(ct=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),a.lastRenderedState=o}return[o,r]}function Jw(t,e,a){var r=ie,n=nt(),o=ve;if(o){if(a===void 0)throw Error(M(407));a=a()}else a=e();var i=!ya((Ae||n).memoizedState,a);if(i&&(n.memoizedState=a,ct=!0),n=n.queue,ty(aL.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||st!==null&&st.memoizedState.tag&1){if(r.flags|=2048,ls(9,{destroy:void 0},tL.bind(null,r,n,a,e),null),Re===null)throw Error(M(349));o||(Gr&127)!==0||eL(r,e,a)}return a}function eL(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=ie.updateQueue,e===null?(e=kf(),ie.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function tL(t,e,a,r){e.value=a,e.getSnapshot=r,rL(e)&&nL(t)}function aL(t,e,a){return a(function(){rL(e)&&nL(t)})}function rL(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!ya(t,a)}catch{return!0}}function nL(t){var e=Vo(t,2);e!==null&&ea(e,t,2)}function rv(t){var e=zt();if(typeof t=="function"){var a=t;if(t=a(),Ho){Dn(!0);try{a()}finally{Dn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:t},e}function oL(t,e,a,r){return t.baseState=a,ey(t,Ae,typeof r=="function"?r:Wr)}function XM(t,e,a,r,n){if(Ef(t))throw Error(M(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)}};te.T!==null?a(!0):o.isTransition=!1,r(o),a=e.pending,a===null?(o.next=e.pending=o,iL(e,o)):(o.next=a.next,e.pending=a.next=o)}}function iL(t,e){var a=e.action,r=e.payload,n=t.state;if(e.isTransition){var o=te.T,i={};te.T=i;try{var s=a(n,r),l=te.S;l!==null&&l(i,s),oC(t,e,s)}catch(u){nv(t,e,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),te.T=o}}else try{o=a(n,r),oC(t,e,o)}catch(u){nv(t,e,u)}}function oC(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){iC(t,e,r)},function(r){return nv(t,e,r)}):iC(t,e,a)}function iC(t,e,a){e.status="fulfilled",e.value=a,sL(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,iL(t,a)))}function nv(t,e,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=a,sL(e),e=e.next;while(e!==r)}t.action=null}function sL(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function lL(t,e){return e}function sC(t,e){if(ve){var a=Re.formState;if(a!==null){e:{var r=ie;if(ve){if(Ue){t:{for(var n=Ue,o=Ba;n.nodeType!==8;){if(!o){n=null;break t}if(n=Na(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){Ue=Na(n.nextSibling),r=n.data==="F!";break e}}Xn(r)}r=!1}r&&(e=a[0])}}return a=zt(),a.memoizedState=a.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lL,lastRenderedState:e},a.queue=r,a=wL.bind(null,ie,r),r.dispatch=a,r=rv(!1),o=oy.bind(null,ie,!1,r.queue),r=zt(),n={state:e,dispatch:null,action:t,pending:null},r.queue=n,a=XM.bind(null,ie,n,o,a),n.dispatch=a,r.memoizedState=t,[e,a,!1]}function lC(t){var e=nt();return uL(e,Ae,t)}function uL(t,e,a){if(e=ey(t,e,lL)[0],t=Dd(Wr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=_u(e)}catch(i){throw i===vs?Lf:i}else r=e;e=nt();var n=e.queue,o=n.dispatch;return a!==e.memoizedState&&(ie.flags|=2048,ls(9,{destroy:void 0},YM.bind(null,n,a),null)),[r,o,t]}function YM(t,e){t.action=e}function uC(t){var e=nt(),a=Ae;if(a!==null)return uL(e,a,t);nt(),e=e.memoizedState,a=nt();var r=a.queue.dispatch;return a.memoizedState=t,[e,r,!1]}function ls(t,e,a,r){return t={tag:t,create:a,deps:r,inst:e,next:null},e=ie.updateQueue,e===null&&(e=kf(),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 cL(){return nt().memoizedState}function Bd(t,e,a,r){var n=zt();ie.flags|=t,n.memoizedState=ls(1|e,{destroy:void 0},a,r===void 0?null:r)}function Af(t,e,a,r){var n=nt();r=r===void 0?null:r;var o=n.memoizedState.inst;Ae!==null&&r!==null&&Zv(r,Ae.memoizedState.deps)?n.memoizedState=ls(e,o,a,r):(ie.flags|=t,n.memoizedState=ls(1|e,o,a,r))}function cC(t,e){Bd(8390656,8,t,e)}function ty(t,e){Af(2048,8,t,e)}function KM(t){ie.flags|=4;var e=ie.updateQueue;if(e===null)e=kf(),ie.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function dL(t){var e=nt().memoizedState;return KM({ref:e,nextImpl:t}),function(){if((Se&2)!==0)throw Error(M(440));return e.impl.apply(void 0,arguments)}}function fL(t,e){return Af(4,2,t,e)}function pL(t,e){return Af(4,4,t,e)}function hL(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 mL(t,e,a){a=a!=null?a.concat([t]):null,Af(4,4,hL.bind(null,e,t),a)}function ay(){}function gL(t,e){var a=nt();e=e===void 0?null:e;var r=a.memoizedState;return e!==null&&Zv(e,r[1])?r[0]:(a.memoizedState=[t,e],t)}function vL(t,e){var a=nt();e=e===void 0?null:e;var r=a.memoizedState;if(e!==null&&Zv(e,r[1]))return r[0];if(r=t(),Ho){Dn(!0);try{t()}finally{Dn(!1)}}return a.memoizedState=[r,e],r}function ry(t,e,a){return a===void 0||(Gr&1073741824)!==0&&(me&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=o1(),ie.lanes|=t,Kn|=t,a)}function yL(t,e,a,r){return ya(a,e)?a:ss.current!==null?(t=ry(t,a,r),ya(t,e)||(ct=!0),t):(Gr&42)===0||(Gr&1073741824)!==0&&(me&261930)===0?(ct=!0,t.memoizedState=a):(t=o1(),ie.lanes|=t,Kn|=t,e)}function xL(t,e,a,r,n){var o=_e.p;_e.p=o!==0&&8>o?o:8;var i=te.T,s={};te.T=s,oy(t,!1,e,a);try{var l=n(),u=te.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=GM(l,r);Xl(t,e,c,va(t))}else Xl(t,e,r,va(t))}catch(d){Xl(t,e,{then:function(){},status:"rejected",reason:d},va())}finally{_e.p=o,i!==null&&s.types!==null&&(i.types=s.types),te.T=i}}function QM(){}function ov(t,e,a,r){if(t.tag!==5)throw Error(M(476));var n=bL(t).queue;xL(t,n,e,Ro,a===null?QM:function(){return SL(t),a(r)})}function bL(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ro,baseState:Ro,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:Ro},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function SL(t){var e=bL(t);e.next===null&&(e=t.alternate.memoizedState),Xl(t,e.next.queue,{},va())}function ny(){return It(fu)}function _L(){return nt().memoizedState}function CL(){return nt().memoizedState}function JM(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=va();t=zn(a);var r=qn(e,t,a);r!==null&&(ea(r,e,a),Gl(r,e,a)),e={cache:$v()},t.payload=e;return}e=e.return}}function eO(t,e,a){var r=va();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ef(t)?LL(e,a):(a=Hv(t,e,a,r),a!==null&&(ea(a,t,r),kL(a,e,r)))}function wL(t,e,a){var r=va();Xl(t,e,a,r)}function Xl(t,e,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ef(t))LL(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,ya(s,i))return wf(t,e,n,0),Re===null&&Cf(),!1}catch{}if(a=Hv(t,e,n,r),a!==null)return ea(a,t,r),kL(a,e,r),!0}return!1}function oy(t,e,a,r){if(r={lane:2,revertLane:hy(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ef(t)){if(e)throw Error(M(479))}else e=Hv(t,a,r,2),e!==null&&ea(e,t,2)}function Ef(t){var e=t.alternate;return t===ie||e!==null&&e===ie}function LL(t,e){ts=tf=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function kL(t,e,a){if((a&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,a|=r,e.lanes=a,dw(t,a)}}var uu={readContext:It,use:If,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};uu.useEffectEvent=Qe;var IL={readContext:It,use:If,useCallback:function(t,e){return zt().memoizedState=[t,e===void 0?null:e],t},useContext:It,useEffect:cC,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,Bd(4194308,4,hL.bind(null,e,t),a)},useLayoutEffect:function(t,e){return Bd(4194308,4,t,e)},useInsertionEffect:function(t,e){Bd(4,2,t,e)},useMemo:function(t,e){var a=zt();e=e===void 0?null:e;var r=t();if(Ho){Dn(!0);try{t()}finally{Dn(!1)}}return a.memoizedState=[r,e],r},useReducer:function(t,e,a){var r=zt();if(a!==void 0){var n=a(e);if(Ho){Dn(!0);try{a(e)}finally{Dn(!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=eO.bind(null,ie,t),[r.memoizedState,t]},useRef:function(t){var e=zt();return t={current:t},e.memoizedState=t},useState:function(t){t=rv(t);var e=t.queue,a=wL.bind(null,ie,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:ay,useDeferredValue:function(t,e){var a=zt();return ry(a,t,e)},useTransition:function(){var t=rv(!1);return t=xL.bind(null,ie,t.queue,!0,!1),zt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var r=ie,n=zt();if(ve){if(a===void 0)throw Error(M(407));a=a()}else{if(a=e(),Re===null)throw Error(M(349));(me&127)!==0||eL(r,e,a)}n.memoizedState=a;var o={value:a,getSnapshot:e};return n.queue=o,cC(aL.bind(null,r,o,t),[t]),r.flags|=2048,ls(9,{destroy:void 0},tL.bind(null,r,o,a,e),null),a},useId:function(){var t=zt(),e=Re.identifierPrefix;if(ve){var a=gr,r=mr;a=(r&~(1<<32-ga(r)-1)).toString(32)+a,e="_"+e+"R_"+a,a=af++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=WM++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:ny,useFormState:sC,useActionState:sC,useOptimistic:function(t){var e=zt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=oy.bind(null,ie,!0,a),a.dispatch=e,[t,e]},useMemoCache:Jv,useCacheRefresh:function(){return zt().memoizedState=JM.bind(null,ie)},useEffectEvent:function(t){var e=zt(),a={impl:t};return e.memoizedState=a,function(){if((Se&2)!==0)throw Error(M(440));return a.impl.apply(void 0,arguments)}}},iy={readContext:It,use:If,useCallback:gL,useContext:It,useEffect:ty,useImperativeHandle:mL,useInsertionEffect:fL,useLayoutEffect:pL,useMemo:vL,useReducer:Dd,useRef:cL,useState:function(){return Dd(Wr)},useDebugValue:ay,useDeferredValue:function(t,e){var a=nt();return yL(a,Ae.memoizedState,t,e)},useTransition:function(){var t=Dd(Wr)[0],e=nt().memoizedState;return[typeof t=="boolean"?t:_u(t),e]},useSyncExternalStore:Jw,useId:_L,useHostTransitionStatus:ny,useFormState:lC,useActionState:lC,useOptimistic:function(t,e){var a=nt();return oL(a,Ae,t,e)},useMemoCache:Jv,useCacheRefresh:CL};iy.useEffectEvent=dL;var AL={readContext:It,use:If,useCallback:gL,useContext:It,useEffect:ty,useImperativeHandle:mL,useInsertionEffect:fL,useLayoutEffect:pL,useMemo:vL,useReducer:pg,useRef:cL,useState:function(){return pg(Wr)},useDebugValue:ay,useDeferredValue:function(t,e){var a=nt();return Ae===null?ry(a,t,e):yL(a,Ae.memoizedState,t,e)},useTransition:function(){var t=pg(Wr)[0],e=nt().memoizedState;return[typeof t=="boolean"?t:_u(t),e]},useSyncExternalStore:Jw,useId:_L,useHostTransitionStatus:ny,useFormState:uC,useActionState:uC,useOptimistic:function(t,e){var a=nt();return Ae!==null?oL(a,Ae,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Jv,useCacheRefresh:CL};AL.useEffectEvent=dL;function hg(t,e,a,r){e=t.memoizedState,a=a(r,e),a=a==null?e:ze({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var iv={enqueueSetState:function(t,e,a){t=t._reactInternals;var r=va(),n=zn(r);n.payload=e,a!=null&&(n.callback=a),e=qn(t,n,r),e!==null&&(ea(e,t,r),Gl(e,t,r))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var r=va(),n=zn(r);n.tag=1,n.payload=e,a!=null&&(n.callback=a),e=qn(t,n,r),e!==null&&(ea(e,t,r),Gl(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=va(),r=zn(a);r.tag=2,e!=null&&(r.callback=e),e=qn(t,r,a),e!==null&&(ea(e,t,a),Gl(e,t,a))}};function dC(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?!nu(a,r)||!nu(n,o):!0}function fC(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&&iv.enqueueReplaceState(e,e.state,null)}function Uo(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=ze({},a));for(var n in t)a[n]===void 0&&(a[n]=t[n])}return a}function EL(t){Zd(t)}function TL(t){console.error(t)}function RL(t){Zd(t)}function rf(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function pC(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 sv(t,e,a){return a=zn(a),a.tag=3,a.payload={element:null},a.callback=function(){rf(t,e)},a}function ML(t){return t=zn(t),t.tag=3,t}function OL(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(){pC(e,a,r)}}var i=a.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){pC(e,a,r),typeof n!="function"&&($n===null?$n=new Set([this]):$n.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function tO(t,e,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=a.alternate,e!==null&&gs(e,a,n,!0),a=xa.current,a!==null){switch(a.tag){case 31:case 13:return Pa===null?uf():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===Qd?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([r]):e.add(r),Lg(t,r,n)),!1;case 22:return a.flags|=65536,r===Qd?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)),Lg(t,r,n)),!1}throw Error(M(435,a.tag))}return Lg(t,r,n),uf(),!1}if(ve)return e=xa.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=n,r!==Zg&&(t=Error(M(422),{cause:r}),iu(Da(t,a)))):(r!==Zg&&(e=Error(M(423),{cause:r}),iu(Da(e,a))),t=t.current.alternate,t.flags|=65536,n&=-n,t.lanes|=n,r=Da(r,a),n=sv(t.stateNode,r,n),fg(t,n),Je!==4&&(Je=2)),!1;var o=Error(M(520),{cause:r});if(o=Da(o,a),Ql===null?Ql=[o]:Ql.push(o),Je!==4&&(Je=2),e===null)return!0;r=Da(r,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=n&-n,a.lanes|=t,t=sv(a.stateNode,r,t),fg(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"&&($n===null||!$n.has(o))))return a.flags|=65536,n&=-n,a.lanes|=n,n=ML(n),OL(n,t,a,r),fg(a,n),!1}a=a.return}while(a!==null);return!1}var sy=Error(M(461)),ct=!1;function wt(t,e,a,r){e.child=t===null?Ww(e,null,a,r):Fo(e,t.child,a,r)}function hC(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 No(e),r=Xv(t,e,a,i,o,n),s=Yv(),t!==null&&!ct?(Kv(t,e,n),Zr(t,e,n)):(ve&&s&&zv(e),e.flags|=1,wt(t,e,r,n),e.child)}function mC(t,e,a,r,n){if(t===null){var o=a.type;return typeof o=="function"&&!Uv(o)&&o.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=o,DL(t,e,o,r,n)):(t=Md(a.type,null,r,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!ly(t,n)){var i=o.memoizedProps;if(a=a.compare,a=a!==null?a:nu,a(i,r)&&t.ref===e.ref)return Zr(t,e,n)}return e.flags|=1,t=qr(o,r),t.ref=e.ref,t.return=e,e.child=t}function DL(t,e,a,r,n){if(t!==null){var o=t.memoizedProps;if(nu(o,r)&&t.ref===e.ref)if(ct=!1,e.pendingProps=r=o,ly(t,n))(t.flags&131072)!==0&&(ct=!0);else return e.lanes=t.lanes,Zr(t,e,n)}return lv(t,e,a,r,n)}function BL(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 gC(t,e,o,a,r)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Od(e,o!==null?o.cachePool:null),o!==null?nC(e,o):tv(),Yw(e);else return r=e.lanes=536870912,gC(t,e,o!==null?o.baseLanes|a:a,a,r)}else o!==null?(Od(e,o.cachePool),nC(e,o),Mn(e),e.memoizedState=null):(t!==null&&Od(e,null),tv(),Mn(e));return wt(t,e,n,a),e.child}function Ul(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function gC(t,e,a,r,n){var o=Vv();return o=o===null?null:{parent:ut._currentValue,pool:o},e.memoizedState={baseLanes:a,cachePool:o},t!==null&&Od(e,null),tv(),Yw(e),t!==null&&gs(t,e,r,!0),e.childLanes=n,null}function Pd(t,e){return e=nf({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function vC(t,e,a){return Fo(e,t.child,null,a),t=Pd(e,e.pendingProps),t.flags|=2,da(e),e.memoizedState=null,t}function aO(t,e,a){var r=e.pendingProps,n=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(ve){if(r.mode==="hidden")return t=Pd(e,r),e.lanes=536870912,Ul(null,t);if(av(e),(t=Ue)?(t=I1(t,Ba),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Zn!==null?{id:mr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},a=Uw(t),a.return=e,e.child=a,kt=e,Ue=null)):t=null,t===null)throw Xn(e);return e.lanes=536870912,null}return Pd(e,r)}var o=t.memoizedState;if(o!==null){var i=o.dehydrated;if(av(e),n)if(e.flags&256)e.flags&=-257,e=vC(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(M(558));else if(ct||gs(t,e,a,!1),n=(a&t.childLanes)!==0,ct||n){if(r=Re,r!==null&&(i=fw(r,a),i!==0&&i!==o.retryLane))throw o.retryLane=i,Vo(t,i),ea(r,t,i),sy;uf(),e=vC(t,e,a)}else t=o.treeContext,Ue=Na(i.nextSibling),kt=e,ve=!0,Un=null,Ba=!1,t!==null&&qw(e,t),e=Pd(e,r),e.flags|=4096;return e}return t=qr(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function Nd(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(M(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function lv(t,e,a,r,n){return No(e),a=Xv(t,e,a,r,void 0,n),r=Yv(),t!==null&&!ct?(Kv(t,e,n),Zr(t,e,n)):(ve&&r&&zv(e),e.flags|=1,wt(t,e,a,n),e.child)}function yC(t,e,a,r,n,o){return No(e),e.updateQueue=null,a=Qw(e,r,a,n),Kw(t),r=Yv(),t!==null&&!ct?(Kv(t,e,o),Zr(t,e,o)):(ve&&r&&zv(e),e.flags|=1,wt(t,e,a,o),e.child)}function xC(t,e,a,r,n){if(No(e),e.stateNode===null){var o=Gi,i=a.contextType;typeof i=="object"&&i!==null&&(o=It(i)),o=new a(r,o),e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=iv,e.stateNode=o,o._reactInternals=e,o=e.stateNode,o.props=r,o.state=e.memoizedState,o.refs={},Gv(e),i=a.contextType,o.context=typeof i=="object"&&i!==null?It(i):Gi,o.state=e.memoizedState,i=a.getDerivedStateFromProps,typeof i=="function"&&(hg(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&&iv.enqueueReplaceState(o,o.state,null),Zl(e,r,o,n),Wl(),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=Uo(a,s);o.props=l;var u=o.context,c=a.contextType;i=Gi,typeof c=="object"&&c!==null&&(i=It(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)&&fC(e,o,r,i),En=!1;var f=e.memoizedState;o.state=f,Zl(e,r,o,n),Wl(),u=e.memoizedState,s||f!==u||En?(typeof d=="function"&&(hg(e,a,d,r),u=e.memoizedState),(l=En||dC(e,a,l,r,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=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,Jg(t,e),i=e.memoizedProps,c=Uo(a,i),o.props=c,d=e.pendingProps,f=o.context,u=a.contextType,l=Gi,typeof u=="object"&&u!==null&&(l=It(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)&&fC(e,o,r,l),En=!1,f=e.memoizedState,o.state=f,Zl(e,r,o,n),Wl();var h=e.memoizedState;i!==d||f!==h||En||t!==null&&t.dependencies!==null&&Kd(t.dependencies)?(typeof s=="function"&&(hg(e,a,s,r),h=e.memoizedState),(c=En||dC(e,a,c,r,f,h,l)||t!==null&&t.dependencies!==null&&Kd(t.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,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=r,e.memoizedState=h),o.props=r,o.state=h,o.context=l,r=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),r=!1)}return o=r,Nd(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=Fo(e,t.child,null,n),e.child=Fo(e,null,a,n)):wt(t,e,a,n),e.memoizedState=o.state,t=e.child):t=Zr(t,e,n),t}function bC(t,e,a,r){return Po(),e.flags|=256,wt(t,e,a,r),e.child}var mg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gg(t){return{baseLanes:t,cachePool:Vw()}}function vg(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=pa),t}function PL(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:(rt.current&2)!==0),i&&(n=!0,e.flags&=-129),i=(e.flags&32)!==0,e.flags&=-33,t===null){if(ve){if(n?Rn(e):Mn(e),(t=Ue)?(t=I1(t,Ba),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Zn!==null?{id:mr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},a=Uw(t),a.return=e,e.child=a,kt=e,Ue=null)):t=null,t===null)throw Xn(e);return _v(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,n?(Mn(e),n=e.mode,s=nf({mode:"hidden",children:s},n),r=Mo(r,n,a,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=gg(a),r.childLanes=vg(t,i,a),e.memoizedState=mg,Ul(null,r)):(Rn(e),uv(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(o)e.flags&256?(Rn(e),e.flags&=-257,e=yg(t,e,a)):e.memoizedState!==null?(Mn(e),e.child=t.child,e.flags|=128,e=null):(Mn(e),s=r.fallback,n=e.mode,r=nf({mode:"visible",children:r.children},n),s=Mo(s,n,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Fo(e,t.child,null,a),r=e.child,r.memoizedState=gg(a),r.childLanes=vg(t,i,a),e.memoizedState=mg,e=Ul(null,r));else if(Rn(e),_v(s)){if(i=s.nextSibling&&s.nextSibling.dataset,i)var u=i.dgst;i=u,r=Error(M(419)),r.stack="",r.digest=i,iu({value:r,source:null,stack:null}),e=yg(t,e,a)}else if(ct||gs(t,e,a,!1),i=(a&t.childLanes)!==0,ct||i){if(i=Re,i!==null&&(r=fw(i,a),r!==0&&r!==l.retryLane))throw l.retryLane=r,Vo(t,r),ea(i,t,r),sy;Sv(s)||uf(),e=yg(t,e,a)}else Sv(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ue=Na(s.nextSibling),kt=e,ve=!0,Un=null,Ba=!1,t!==null&&qw(e,t),e=uv(e,r.children),e.flags|=4096);return e}return n?(Mn(e),s=r.fallback,n=e.mode,l=t.child,u=l.sibling,r=qr(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u!==null?s=qr(u,s):(s=Mo(s,n,a,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,Ul(null,r),r=e.child,s=t.child.memoizedState,s===null?s=gg(a):(n=s.cachePool,n!==null?(l=ut._currentValue,n=n.parent!==l?{parent:l,pool:l}:n):n=Vw(),s={baseLanes:s.baseLanes|a,cachePool:n}),r.memoizedState=s,r.childLanes=vg(t,i,a),e.memoizedState=mg,Ul(t.child,r)):(Rn(e),a=t.child,t=a.sibling,a=qr(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 uv(t,e){return e=nf({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function nf(t,e){return t=fa(22,t,null,e),t.lanes=0,t}function yg(t,e,a){return Fo(e,t.child,null,a),t=uv(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function SC(t,e,a){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Yg(t.return,e,a)}function xg(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 NL(t,e,a){var r=e.pendingProps,n=r.revealOrder,o=r.tail;r=r.children;var i=rt.current,s=(i&2)!==0;if(s?(i=i&1|2,e.flags|=128):i&=1,Be(rt,i),wt(t,e,r,a),r=ve?ou:0,!s&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&SC(t,a,e);else if(t.tag===19)SC(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&&ef(t)===null&&(n=a),a=a.sibling;a=n,a===null?(n=e.child,e.child=null):(n=a.sibling,a.sibling=null),xg(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&&ef(t)===null){e.child=n;break}t=n.sibling,n.sibling=a,a=n,n=t}xg(e,!0,a,null,o,r);break;case"together":xg(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function Zr(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),Kn|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(gs(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,a=qr(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=qr(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function ly(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Kd(t)))}function rO(t,e,a){switch(e.tag){case 3:Vd(e,e.stateNode.containerInfo),Tn(e,ut,t.memoizedState.cache),Po();break;case 27:case 5:Ng(e);break;case 4:Vd(e,e.stateNode.containerInfo);break;case 10:Tn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,av(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(Rn(e),e.flags|=128,null):(a&e.child.childLanes)!==0?PL(t,e,a):(Rn(e),t=Zr(t,e,a),t!==null?t.sibling:null);Rn(e);break;case 19:var n=(t.flags&128)!==0;if(r=(a&e.childLanes)!==0,r||(gs(t,e,a,!1),r=(a&e.childLanes)!==0),n){if(r)return NL(t,e,a);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Be(rt,rt.current),r)break;return null;case 22:return e.lanes=0,BL(t,e,a,e.pendingProps);case 24:Tn(e,ut,t.memoizedState.cache)}return Zr(t,e,a)}function FL(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)ct=!0;else{if(!ly(t,a)&&(e.flags&128)===0)return ct=!1,rO(t,e,a);ct=(t.flags&131072)!==0}else ct=!1,ve&&(e.flags&1048576)!==0&&zw(e,ou,e.index);switch(e.lanes=0,e.tag){case 16:e:{var r=e.pendingProps;if(t=Eo(e.elementType),e.type=t,typeof t=="function")Uv(t)?(r=Uo(t,r),e.tag=1,e=xC(null,e,t,r,a)):(e.tag=0,e=lv(null,e,t,r,a));else{if(t!=null){var n=t.$$typeof;if(n===kv){e.tag=11,e=hC(null,e,t,r,a);break e}else if(n===Iv){e.tag=14,e=mC(null,e,t,r,a);break e}}throw e=Bg(t)||t,Error(M(306,e,""))}}return e;case 0:return lv(t,e,e.type,e.pendingProps,a);case 1:return r=e.type,n=Uo(r,e.pendingProps),xC(t,e,r,n,a);case 3:e:{if(Vd(e,e.stateNode.containerInfo),t===null)throw Error(M(387));r=e.pendingProps;var o=e.memoizedState;n=o.element,Jg(t,e),Zl(e,r,null,a);var i=e.memoizedState;if(r=i.cache,Tn(e,ut,r),r!==o.cache&&Kg(e,[ut],a,!0),Wl(),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=bC(t,e,r,a);break e}else if(r!==n){n=Da(Error(M(424)),e),iu(n),e=bC(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,Ue=Na(t.firstChild),kt=e,ve=!0,Un=null,Ba=!0,a=Ww(e,null,r,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Po(),r===n){e=Zr(t,e,a);break e}wt(t,e,r,a)}e=e.child}return e;case 26:return Nd(t,e),t===null?(a=$C(e.type,null,e.pendingProps,null))?e.memoizedState=a:ve||(a=e.type,t=e.pendingProps,r=pf(Hn.current).createElement(a),r[Lt]=e,r[ta]=t,At(r,a,t),bt(r),e.stateNode=r):e.memoizedState=$C(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Ng(e),t===null&&ve&&(r=e.stateNode=A1(e.type,e.pendingProps,Hn.current),kt=e,Ba=!0,n=Ue,Jn(e.type)?(Cv=n,Ue=Na(r.firstChild)):Ue=n),wt(t,e,e.pendingProps.children,a),Nd(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ve&&((n=r=Ue)&&(r=RO(r,e.type,e.pendingProps,Ba),r!==null?(e.stateNode=r,kt=e,Ue=Na(r.firstChild),Ba=!1,n=!0):n=!1),n||Xn(e)),Ng(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,r=o.children,xv(n,o)?r=null:i!==null&&xv(n,i)&&(e.flags|=32),e.memoizedState!==null&&(n=Xv(t,e,ZM,null,null,a),fu._currentValue=n),Nd(t,e),wt(t,e,r,a),e.child;case 6:return t===null&&ve&&((t=a=Ue)&&(a=MO(a,e.pendingProps,Ba),a!==null?(e.stateNode=a,kt=e,Ue=null,t=!0):t=!1),t||Xn(e)),null;case 13:return PL(t,e,a);case 4:return Vd(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Fo(e,null,r,a):wt(t,e,r,a),e.child;case 11:return hC(t,e,e.type,e.pendingProps,a);case 7:return wt(t,e,e.pendingProps,a),e.child;case 8:return wt(t,e,e.pendingProps.children,a),e.child;case 12:return wt(t,e,e.pendingProps.children,a),e.child;case 10:return r=e.pendingProps,Tn(e,e.type,r.value),wt(t,e,r.children,a),e.child;case 9:return n=e.type._context,r=e.pendingProps.children,No(e),n=It(n),r=r(n),e.flags|=1,wt(t,e,r,a),e.child;case 14:return mC(t,e,e.type,e.pendingProps,a);case 15:return DL(t,e,e.type,e.pendingProps,a);case 19:return NL(t,e,a);case 31:return aO(t,e,a);case 22:return BL(t,e,a,e.pendingProps);case 24:return No(e),r=It(ut),t===null?(n=Vv(),n===null&&(n=Re,o=$v(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=a),n=o),e.memoizedState={parent:r,cache:n},Gv(e),Tn(e,ut,n)):((t.lanes&a)!==0&&(Jg(t,e),Zl(e,null,null,a),Wl()),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),Tn(e,ut,r)):(r=o.cache,Tn(e,ut,r),r!==n.cache&&Kg(e,[ut],a,!0))),wt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(M(156,e.tag))}function Or(t){t.flags|=4}function bg(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(l1())t.flags|=8192;else throw Do=Qd,jv}else t.flags&=-16777217}function _C(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!R1(e))if(l1())t.flags|=8192;else throw Do=Qd,jv}function Sd(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?uw():536870912,t.lanes|=e,us|=e)}function Ol(t,e){if(!ve)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 He(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 nO(t,e,a){var r=e.pendingProps;switch(qv(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,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),$r(ut),rs(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Di(e)?Or(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,dg())),He(e),null;case 26:var n=e.type,o=e.memoizedState;return t===null?(Or(e),o!==null?(He(e),_C(e,o)):(He(e),bg(e,n,null,r,a))):o?o!==t.memoizedState?(Or(e),He(e),_C(e,o)):(He(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&Or(e),He(e),bg(e,n,t,r,a)),null;case 27:if(jd(e),a=Hn.current,n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Or(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return He(e),null}t=yr.current,Di(e)?K_(e,t):(t=A1(n,r,a),e.stateNode=t,Or(e))}return He(e),null;case 5:if(jd(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&Or(e);else{if(!r){if(e.stateNode===null)throw Error(M(166));return He(e),null}if(o=yr.current,Di(e))K_(e,o);else{var i=pf(Hn.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[Lt]=e,o[ta]=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(At(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&&Or(e)}}return He(e),bg(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&Or(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(M(166));if(t=Hn.current,Di(e)){if(t=e.stateNode,a=e.memoizedProps,r=null,n=kt,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}t[Lt]=e,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||w1(t.nodeValue,a)),t||Xn(e,!0)}else t=pf(t).createTextNode(r),t[Lt]=e,e.stateNode=t}return He(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(r=Di(e),a!==null){if(t===null){if(!r)throw Error(M(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(557));t[Lt]=e}else Po(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;He(e),t=!1}else a=dg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(da(e),e):(da(e),null);if((e.flags&128)!==0)throw Error(M(558))}return He(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=Di(e),r!==null&&r.dehydrated!==null){if(t===null){if(!n)throw Error(M(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[Lt]=e}else Po(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;He(e),n=!1}else n=dg(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(da(e),e):(da(e),null)}return da(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),Sd(e,e.updateQueue),He(e),null);case 4:return rs(),t===null&&my(e.stateNode.containerInfo),He(e),null;case 10:return $r(e.type),He(e),null;case 19:if(St(rt),r=e.memoizedState,r===null)return He(e),null;if(n=(e.flags&128)!==0,o=r.rendering,o===null)if(n)Ol(r,!1);else{if(Je!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(o=ef(t),o!==null){for(e.flags|=128,Ol(r,!1),t=o.updateQueue,e.updateQueue=t,Sd(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)Hw(a,t),a=a.sibling;return Be(rt,rt.current&1|2),ve&&Nr(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&ha()>sf&&(e.flags|=128,n=!0,Ol(r,!1),e.lanes=4194304)}else{if(!n)if(t=ef(o),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,Sd(e,t),Ol(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!ve)return He(e),null}else 2*ha()-r.renderingStartTime>sf&&a!==536870912&&(e.flags|=128,n=!0,Ol(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=ha(),t.sibling=null,a=rt.current,Be(rt,n?a&1|2:a&1),ve&&Nr(e,r.treeForkCount),t):(He(e),null);case 22:case 23:return da(e),Wv(),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&&(He(e),e.subtreeFlags&6&&(e.flags|=8192)):He(e),a=e.updateQueue,a!==null&&Sd(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&&St(Oo),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),$r(ut),He(e),null;case 25:return null;case 30:return null}throw Error(M(156,e.tag))}function oO(t,e){switch(qv(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return $r(ut),rs(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return jd(e),null;case 31:if(e.memoizedState!==null){if(da(e),e.alternate===null)throw Error(M(340));Po()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(da(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));Po()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return St(rt),null;case 4:return rs(),null;case 10:return $r(e.type),null;case 22:case 23:return da(e),Wv(),t!==null&&St(Oo),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return $r(ut),null;case 25:return null;default:return null}}function HL(t,e){switch(qv(e),e.tag){case 3:$r(ut),rs();break;case 26:case 27:case 5:jd(e);break;case 4:rs();break;case 31:e.memoizedState!==null&&da(e);break;case 13:da(e);break;case 19:St(rt);break;case 10:$r(e.type);break;case 22:case 23:da(e),Wv(),t!==null&&St(Oo);break;case 24:$r(ut)}}function Cu(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){ke(e,e.return,s)}}function Yn(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){ke(n,l,c)}}}r=r.next}while(r!==o)}}catch(c){ke(e,e.return,c)}}function UL(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{Xw(e,a)}catch(r){ke(t,t.return,r)}}}function zL(t,e,a){a.props=Uo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){ke(t,e,r)}}function Yl(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){ke(t,e,n)}}function vr(t,e){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){ke(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){ke(t,e,n)}else a.current=null}function qL(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){ke(t,t.return,n)}}function Sg(t,e,a){try{var r=t.stateNode;LO(r,t.type,a,e),r[ta]=e}catch(n){ke(t,t.return,n)}}function $L(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Jn(t.type)||t.tag===4}function _g(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||$L(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&&Jn(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 cv(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=Ur));else if(r!==4&&(r===27&&Jn(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(cv(t,e,a),t=t.sibling;t!==null;)cv(t,e,a),t=t.sibling}function of(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&&Jn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(of(t,e,a),t=t.sibling;t!==null;)of(t,e,a),t=t.sibling}function VL(t){var e=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);At(e,r,a),e[Lt]=t,e[ta]=a}catch(o){ke(t,t.return,o)}}var Fr=!1,lt=!1,Cg=!1,CC=typeof WeakSet=="function"?WeakSet:Set,xt=null;function iO(t,e){if(t=t.containerInfo,vv=vf,t=Rw(t),Nv(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,f=null;t:for(;;){for(var h;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),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===a&&++u===n&&(s=i),f===o&&++c===r&&(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(yv={focusedElem:t,selectionRange:a},vf=!1,xt=e;xt!==null;)if(e=xt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,xt=t;else for(;xt!==null;){switch(e=xt,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=Uo(a.type,n);t=r.getSnapshotBeforeUpdate(S,o),r.__reactInternalSnapshotBeforeUpdate=t}catch(x){ke(a,a.return,x)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)bv(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bv(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(M(163))}if(t=e.sibling,t!==null){t.return=e.return,xt=t;break}xt=e.return}}function jL(t,e,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Br(t,a),r&4&&Cu(5,a);break;case 1:if(Br(t,a),r&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(i){ke(a,a.return,i)}else{var n=Uo(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(n,e,t.__reactInternalSnapshotBeforeUpdate)}catch(i){ke(a,a.return,i)}}r&64&&UL(a),r&512&&Yl(a,a.return);break;case 3:if(Br(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{Xw(t,e)}catch(i){ke(a,a.return,i)}}break;case 27:e===null&&r&4&&VL(a);case 26:case 5:Br(t,a),e===null&&r&4&&qL(a),r&512&&Yl(a,a.return);break;case 12:Br(t,a);break;case 31:Br(t,a),r&4&&ZL(t,a);break;case 13:Br(t,a),r&4&&XL(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=mO.bind(null,a),OO(t,a))));break;case 22:if(r=a.memoizedState!==null||Fr,!r){e=e!==null&&e.memoizedState!==null||lt,n=Fr;var o=lt;Fr=r,(lt=e)&&!o?Pr(t,a,(a.subtreeFlags&8772)!==0):Br(t,a),Fr=n,lt=o}break;case 30:break;default:Br(t,a)}}function GL(t){var e=t.alternate;e!==null&&(t.alternate=null,GL(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Rv(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 je=null,Qt=!1;function Dr(t,e,a){for(a=a.child;a!==null;)WL(t,e,a),a=a.sibling}function WL(t,e,a){if(ma&&typeof ma.onCommitFiberUnmount=="function")try{ma.onCommitFiberUnmount(gu,a)}catch{}switch(a.tag){case 26:lt||vr(a,e),Dr(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:lt||vr(a,e);var r=je,n=Qt;Jn(a.type)&&(je=a.stateNode,Qt=!1),Dr(t,e,a),eu(a.stateNode),je=r,Qt=n;break;case 5:lt||vr(a,e);case 6:if(r=je,n=Qt,je=null,Dr(t,e,a),je=r,Qt=n,je!==null)if(Qt)try{(je.nodeType===9?je.body:je.nodeName==="HTML"?je.ownerDocument.body:je).removeChild(a.stateNode)}catch(o){ke(a,e,o)}else try{je.removeChild(a.stateNode)}catch(o){ke(a,e,o)}break;case 18:je!==null&&(Qt?(t=je,FC(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ps(t)):FC(je,a.stateNode));break;case 4:r=je,n=Qt,je=a.stateNode.containerInfo,Qt=!0,Dr(t,e,a),je=r,Qt=n;break;case 0:case 11:case 14:case 15:Yn(2,a,e),lt||Yn(4,a,e),Dr(t,e,a);break;case 1:lt||(vr(a,e),r=a.stateNode,typeof r.componentWillUnmount=="function"&&zL(a,e,r)),Dr(t,e,a);break;case 21:Dr(t,e,a);break;case 22:lt=(r=lt)||a.memoizedState!==null,Dr(t,e,a),lt=r;break;default:Dr(t,e,a)}}function ZL(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ps(t)}catch(a){ke(e,e.return,a)}}}function XL(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ps(t)}catch(a){ke(e,e.return,a)}}function sO(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new CC),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new CC),e;default:throw Error(M(435,t.tag))}}function _d(t,e){var a=sO(t);e.forEach(function(r){if(!a.has(r)){a.add(r);var n=gO.bind(null,t,r);r.then(n,n)}})}function Yt(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(Jn(s.type)){je=s.stateNode,Qt=!1;break e}break;case 5:je=s.stateNode,Qt=!1;break e;case 3:case 4:je=s.stateNode.containerInfo,Qt=!0;break e}s=s.return}if(je===null)throw Error(M(160));WL(o,i,n),je=null,Qt=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)YL(e,t),e=e.sibling}var Xa=null;function YL(t,e){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Yt(e,t),Kt(t),r&4&&(Yn(3,t,t.return),Cu(3,t),Yn(5,t,t.return));break;case 1:Yt(e,t),Kt(t),r&512&&(lt||a===null||vr(a,a.return)),r&64&&Fr&&(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=Xa;if(Yt(e,t),Kt(t),r&512&&(lt||a===null||vr(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[xu]||o[Lt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(r),n.head.insertBefore(o,n.querySelector("head > title"))),At(o,r,a),o[Lt]=t,bt(o),r=o;break e;case"link":var i=jC("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),At(o,r,a),n.head.appendChild(o);break;case"meta":if(i=jC("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),At(o,r,a),n.head.appendChild(o);break;default:throw Error(M(468,r))}o[Lt]=t,bt(o),r=o}t.stateNode=r}else GC(n,t.type,t.stateNode);else t.stateNode=VC(n,r,t.memoizedProps);else o!==r?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,r===null?GC(n,t.type,t.stateNode):VC(n,r,t.memoizedProps)):r===null&&t.stateNode!==null&&Sg(t,t.memoizedProps,a.memoizedProps)}break;case 27:Yt(e,t),Kt(t),r&512&&(lt||a===null||vr(a,a.return)),a!==null&&r&4&&Sg(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Yt(e,t),Kt(t),r&512&&(lt||a===null||vr(a,a.return)),t.flags&32){n=t.stateNode;try{os(n,"")}catch(S){ke(t,t.return,S)}}r&4&&t.stateNode!=null&&(n=t.memoizedProps,Sg(t,n,a!==null?a.memoizedProps:n)),r&1024&&(Cg=!0);break;case 6:if(Yt(e,t),Kt(t),r&4){if(t.stateNode===null)throw Error(M(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(S){ke(t,t.return,S)}}break;case 3:if(Ud=null,n=Xa,Xa=hf(e.containerInfo),Yt(e,t),Xa=n,Kt(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{ps(e.containerInfo)}catch(S){ke(t,t.return,S)}Cg&&(Cg=!1,KL(t));break;case 4:r=Xa,Xa=hf(t.stateNode.containerInfo),Yt(e,t),Kt(t),Xa=r;break;case 12:Yt(e,t),Kt(t);break;case 31:Yt(e,t),Kt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,_d(t,r)));break;case 13:Yt(e,t),Kt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Tf=ha()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,_d(t,r)));break;case 22:n=t.memoizedState!==null;var l=a!==null&&a.memoizedState!==null,u=Fr,c=lt;if(Fr=u||n,lt=c||l,Yt(e,t),lt=c,Fr=u,Kt(t),r&8192)e:for(e=t.stateNode,e._visibility=n?e._visibility&-2:e._visibility|1,n&&(a===null||l||Fr||lt||To(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,f=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(S){ke(l,l.return,S)}}}else if(e.tag===6){if(a===null){l=e;try{l.stateNode.nodeValue=n?"":l.memoizedProps}catch(S){ke(l,l.return,S)}}}else if(e.tag===18){if(a===null){l=e;try{var h=l.stateNode;n?HC(h,!0):HC(l.stateNode,!1)}catch(S){ke(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,_d(t,a))));break;case 19:Yt(e,t),Kt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,_d(t,r)));break;case 30:break;case 21:break;default:Yt(e,t),Kt(t)}}function Kt(t){var e=t.flags;if(e&2){try{for(var a,r=t.return;r!==null;){if($L(r)){a=r;break}r=r.return}if(a==null)throw Error(M(160));switch(a.tag){case 27:var n=a.stateNode,o=_g(t);of(t,o,n);break;case 5:var i=a.stateNode;a.flags&32&&(os(i,""),a.flags&=-33);var s=_g(t);of(t,s,i);break;case 3:case 4:var l=a.stateNode.containerInfo,u=_g(t);cv(t,u,l);break;default:throw Error(M(161))}}catch(c){ke(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function KL(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;KL(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Br(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)jL(t,e.alternate,e),e=e.sibling}function To(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Yn(4,e,e.return),To(e);break;case 1:vr(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&zL(e,e.return,a),To(e);break;case 27:eu(e.stateNode);case 26:case 5:vr(e,e.return),To(e);break;case 22:e.memoizedState===null&&To(e);break;case 30:To(e);break;default:To(e)}t=t.sibling}}function Pr(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:Pr(n,o,a),Cu(4,o);break;case 1:if(Pr(n,o,a),r=o,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){ke(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++)Zw(l[n],s)}catch(u){ke(r,r.return,u)}}a&&i&64&&UL(o),Yl(o,o.return);break;case 27:VL(o);case 26:case 5:Pr(n,o,a),a&&r===null&&i&4&&qL(o),Yl(o,o.return);break;case 12:Pr(n,o,a);break;case 31:Pr(n,o,a),a&&i&4&&ZL(n,o);break;case 13:Pr(n,o,a),a&&i&4&&XL(n,o);break;case 22:o.memoizedState===null&&Pr(n,o,a),Yl(o,o.return);break;case 30:break;default:Pr(n,o,a)}e=e.sibling}}function uy(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&&Su(a))}function cy(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Su(t))}function Za(t,e,a,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)QL(t,e,a,r),e=e.sibling}function QL(t,e,a,r){var n=e.flags;switch(e.tag){case 0:case 11:case 15:Za(t,e,a,r),n&2048&&Cu(9,e);break;case 1:Za(t,e,a,r);break;case 3:Za(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&&Su(t)));break;case 12:if(n&2048){Za(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){ke(e,e.return,l)}}else Za(t,e,a,r);break;case 31:Za(t,e,a,r);break;case 13:Za(t,e,a,r);break;case 23:break;case 22:o=e.stateNode,i=e.alternate,e.memoizedState!==null?o._visibility&2?Za(t,e,a,r):Kl(t,e):o._visibility&2?Za(t,e,a,r):(o._visibility|=2,Pi(t,e,a,r,(e.subtreeFlags&10256)!==0||!1)),n&2048&&uy(i,e);break;case 24:Za(t,e,a,r),n&2048&&cy(e.alternate,e);break;default:Za(t,e,a,r)}}function Pi(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:Pi(o,i,s,l,n),Cu(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?Pi(o,i,s,l,n):Kl(o,i):(c._visibility|=2,Pi(o,i,s,l,n)),n&&u&2048&&uy(i.alternate,i);break;case 24:Pi(o,i,s,l,n),n&&u&2048&&cy(i.alternate,i);break;default:Pi(o,i,s,l,n)}e=e.sibling}}function Kl(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:Kl(a,r),n&2048&&uy(r.alternate,r);break;case 24:Kl(a,r),n&2048&&cy(r.alternate,r);break;default:Kl(a,r)}e=e.sibling}}var zl=8192;function Bi(t,e,a){if(t.subtreeFlags&zl)for(t=t.child;t!==null;)JL(t,e,a),t=t.sibling}function JL(t,e,a){switch(t.tag){case 26:Bi(t,e,a),t.flags&zl&&t.memoizedState!==null&&jO(a,Xa,t.memoizedState,t.memoizedProps);break;case 5:Bi(t,e,a);break;case 3:case 4:var r=Xa;Xa=hf(t.stateNode.containerInfo),Bi(t,e,a),Xa=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=zl,zl=16777216,Bi(t,e,a),zl=r):Bi(t,e,a));break;default:Bi(t,e,a)}}function e1(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 Dl(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];xt=r,a1(r,t)}e1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)t1(t),t=t.sibling}function t1(t){switch(t.tag){case 0:case 11:case 15:Dl(t),t.flags&2048&&Yn(9,t,t.return);break;case 3:Dl(t);break;case 12:Dl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Fd(t)):Dl(t);break;default:Dl(t)}}function Fd(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];xt=r,a1(r,t)}e1(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Yn(8,e,e.return),Fd(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,Fd(e));break;default:Fd(e)}t=t.sibling}}function a1(t,e){for(;xt!==null;){var a=xt;switch(a.tag){case 0:case 11:case 15:Yn(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:Su(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,xt=r;else e:for(a=t;xt!==null;){r=xt;var n=r.sibling,o=r.return;if(GL(r),r===a){xt=null;break e}if(n!==null){n.return=o,xt=n;break e}xt=o}}}var lO={getCacheForType:function(t){var e=It(ut),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return It(ut).controller.signal}},uO=typeof WeakMap=="function"?WeakMap:Map,Se=0,Re=null,de=null,me=0,Le=0,ca=null,Pn=!1,ys=!1,dy=!1,Xr=0,Je=0,Kn=0,Bo=0,fy=0,pa=0,us=0,Ql=null,Jt=null,dv=!1,Tf=0,r1=0,sf=1/0,lf=null,$n=null,ht=0,Vn=null,cs=null,Vr=0,fv=0,pv=null,n1=null,Jl=0,hv=null;function va(){return(Se&2)!==0&&me!==0?me&-me:te.T!==null?hy():pw()}function o1(){if(pa===0)if((me&536870912)===0||ve){var t=fd;fd<<=1,(fd&3932160)===0&&(fd=262144),pa=t}else pa=536870912;return t=xa.current,t!==null&&(t.flags|=32),pa}function ea(t,e,a){(t===Re&&(Le===2||Le===9)||t.cancelPendingCommit!==null)&&(ds(t,0),Nn(t,me,pa,!1)),yu(t,a),((Se&2)===0||t!==Re)&&(t===Re&&((Se&2)===0&&(Bo|=a),Je===4&&Nn(t,me,pa,!1)),br(t))}function i1(t,e,a){if((Se&6)!==0)throw Error(M(327));var r=!a&&(e&127)===0&&(e&t.expiredLanes)===0||vu(t,e),n=r?fO(t,e):wg(t,e,!0),o=r;do{if(n===0){ys&&!r&&Nn(t,e,0,!1);break}else{if(a=t.current.alternate,o&&!cO(a)){n=wg(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=Ql;var l=s.current.memoizedState.isDehydrated;if(l&&(ds(s,i).flags|=256),i=wg(s,i,!1),i!==2){if(dy&&!l){s.errorRecoveryDisabledLanes|=o,Bo|=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){ds(t,0),Nn(t,e,0,!0);break}e:{switch(r=t,o=n,o){case 0:case 1:throw Error(M(345));case 4:if((e&4194048)!==e)break;case 6:Nn(r,e,pa,!Pn);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(M(329))}if((e&62914560)===e&&(n=Tf+300-ha(),10<n)){if(Nn(r,e,pa,!Pn),xf(r,0,!0)!==0)break e;Vr=e,r.timeoutHandle=k1(wC.bind(null,r,a,Jt,lf,dv,e,pa,Bo,us,Pn,o,"Throttled",-0,0),n);break e}wC(r,a,Jt,lf,dv,e,pa,Bo,us,Pn,o,null,-0,0)}}break}while(!0);br(t)}function wC(t,e,a,r,n,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:Ur},JL(e,o,d);var S=(o&62914560)===o?Tf-ha():(o&4194048)===o?r1-ha():0;if(S=GO(d,S),S!==null){Vr=o,t.cancelPendingCommit=S(kC.bind(null,t,e,o,a,r,n,i,s,l,c,d,null,f,h)),Nn(t,o,i,!u);return}}kC(t,e,o,a,r,n,i,s,l)}function cO(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(!ya(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 Nn(t,e,a,r){e&=~fy,e&=~Bo,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var n=e;0<n;){var o=31-ga(n),i=1<<o;r[o]=-1,n&=~i}a!==0&&cw(t,a,e)}function Rf(){return(Se&6)===0?(wu(0,!1),!1):!0}function py(){if(de!==null){if(Le===0)var t=de.return;else t=de,zr=jo=null,Qv(t),es=null,su=0,t=de;for(;t!==null;)HL(t.alternate,t),t=t.return;de=null}}function ds(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,AO(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Vr=0,py(),Re=t,de=a=qr(t.current,null),me=e,Le=0,ca=null,Pn=!1,ys=vu(t,e),dy=!1,us=pa=fy=Bo=Kn=Je=0,Jt=Ql=null,dv=!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-ga(r),o=1<<n;e|=t[n],r&=~o}return Xr=e,Cf(),a}function s1(t,e){ie=null,te.H=uu,e===vs||e===Lf?(e=aC(),Le=3):e===jv?(e=aC(),Le=4):Le=e===sy?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,ca=e,de===null&&(Je=1,rf(t,Da(e,t.current)))}function l1(){var t=xa.current;return t===null?!0:(me&4194048)===me?Pa===null:(me&62914560)===me||(me&536870912)!==0?t===Pa:!1}function u1(){var t=te.H;return te.H=uu,t===null?uu:t}function c1(){var t=te.A;return te.A=lO,t}function uf(){Je=4,Pn||(me&4194048)!==me&&xa.current!==null||(ys=!0),(Kn&134217727)===0&&(Bo&134217727)===0||Re===null||Nn(Re,me,pa,!1)}function wg(t,e,a){var r=Se;Se|=2;var n=u1(),o=c1();(Re!==t||me!==e)&&(lf=null,ds(t,e)),e=!1;var i=Je;e:do try{if(Le!==0&&de!==null){var s=de,l=ca;switch(Le){case 8:py(),i=6;break e;case 3:case 2:case 9:case 6:xa.current===null&&(e=!0);var u=Le;if(Le=0,ca=null,Xi(t,s,l,u),a&&ys){i=0;break e}break;default:u=Le,Le=0,ca=null,Xi(t,s,l,u)}}dO(),i=Je;break}catch(c){s1(t,c)}while(!0);return e&&t.shellSuspendCounter++,zr=jo=null,Se=r,te.H=n,te.A=o,de===null&&(Re=null,me=0,Cf()),i}function dO(){for(;de!==null;)d1(de)}function fO(t,e){var a=Se;Se|=2;var r=u1(),n=c1();Re!==t||me!==e?(lf=null,sf=ha()+500,ds(t,e)):ys=vu(t,e);e:do try{if(Le!==0&&de!==null){e=de;var o=ca;t:switch(Le){case 1:Le=0,ca=null,Xi(t,e,o,1);break;case 2:case 9:if(tC(o)){Le=0,ca=null,LC(e);break}e=function(){Le!==2&&Le!==9||Re!==t||(Le=7),br(t)},o.then(e,e);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:tC(o)?(Le=0,ca=null,LC(e)):(Le=0,ca=null,Xi(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?R1(i):s.stateNode.complete){Le=0,ca=null;var l=s.sibling;if(l!==null)de=l;else{var u=s.return;u!==null?(de=u,Mf(u)):de=null}break t}}Le=0,ca=null,Xi(t,e,o,5);break;case 6:Le=0,ca=null,Xi(t,e,o,6);break;case 8:py(),Je=6;break e;default:throw Error(M(462))}}pO();break}catch(c){s1(t,c)}while(!0);return zr=jo=null,te.H=r,te.A=n,Se=a,de!==null?0:(Re=null,me=0,Cf(),Je)}function pO(){for(;de!==null&&!P2();)d1(de)}function d1(t){var e=FL(t.alternate,t,Xr);t.memoizedProps=t.pendingProps,e===null?Mf(t):de=e}function LC(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=yC(a,e,e.pendingProps,e.type,void 0,me);break;case 11:e=yC(a,e,e.pendingProps,e.type.render,e.ref,me);break;case 5:Qv(e);default:HL(a,e),e=de=Hw(e,Xr),e=FL(a,e,Xr)}t.memoizedProps=t.pendingProps,e===null?Mf(t):de=e}function Xi(t,e,a,r){zr=jo=null,Qv(e),es=null,su=0;var n=e.return;try{if(tO(t,n,e,a,me)){Je=1,rf(t,Da(a,t.current)),de=null;return}}catch(o){if(n!==null)throw de=n,o;Je=1,rf(t,Da(a,t.current)),de=null;return}e.flags&32768?(ve||r===1?t=!0:ys||(me&536870912)!==0?t=!1:(Pn=t=!0,(r===2||r===9||r===3||r===6)&&(r=xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),f1(e,t)):Mf(e)}function Mf(t){var e=t;do{if((e.flags&32768)!==0){f1(e,Pn);return}t=e.return;var a=nO(e.alternate,e,Xr);if(a!==null){de=a;return}if(e=e.sibling,e!==null){de=e;return}de=e=t}while(e!==null);Je===0&&(Je=5)}function f1(t,e){do{var a=oO(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);Je=6,de=null}function kC(t,e,a,r,n,o,i,s,l){t.cancelPendingCommit=null;do Of();while(ht!==0);if((Se&6)!==0)throw Error(M(327));if(e!==null){if(e===t.current)throw Error(M(177));if(o=e.lanes|e.childLanes,o|=Fv,G2(t,a,o,i,s,l),t===Re&&(de=Re=null,me=0),cs=e,Vn=t,Vr=a,fv=o,pv=n,n1=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,vO(Gd,function(){return v1(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=te.T,te.T=null,n=_e.p,_e.p=2,i=Se,Se|=4;try{iO(t,e,a)}finally{Se=i,_e.p=n,te.T=r}}ht=1,p1(),h1(),m1()}}function p1(){if(ht===1){ht=0;var t=Vn,e=cs,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=te.T,te.T=null;var r=_e.p;_e.p=2;var n=Se;Se|=4;try{YL(e,t);var o=yv,i=Rw(t.containerInfo),s=o.focusedElem,l=o.selectionRange;if(i!==s&&s&&s.ownerDocument&&Tw(s.ownerDocument.documentElement,s)){if(l!==null&&Nv(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 g=Z_(s,x),m=Z_(s,b);if(g&&m&&(h.rangeCount!==1||h.anchorNode!==g.node||h.anchorOffset!==g.offset||h.focusNode!==m.node||h.focusOffset!==m.offset)){var y=d.createRange();y.setStart(g.node,g.offset),h.removeAllRanges(),x>b?(h.addRange(y),h.extend(m.node,m.offset)):(y.setEnd(m.node,m.offset),h.addRange(y))}}}}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 v=d[s];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}vf=!!vv,yv=vv=null}finally{Se=n,_e.p=r,te.T=a}}t.current=e,ht=2}}function h1(){if(ht===2){ht=0;var t=Vn,e=cs,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=te.T,te.T=null;var r=_e.p;_e.p=2;var n=Se;Se|=4;try{jL(t,e.alternate,e)}finally{Se=n,_e.p=r,te.T=a}}ht=3}}function m1(){if(ht===4||ht===3){ht=0,N2();var t=Vn,e=cs,a=Vr,r=n1;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ht=5:(ht=0,cs=Vn=null,g1(t,t.pendingLanes));var n=t.pendingLanes;if(n===0&&($n=null),Tv(a),e=e.stateNode,ma&&typeof ma.onCommitFiberRoot=="function")try{ma.onCommitFiberRoot(gu,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=te.T,n=_e.p,_e.p=2,te.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{te.T=e,_e.p=n}}(Vr&3)!==0&&Of(),br(t),n=t.pendingLanes,(a&261930)!==0&&(n&42)!==0?t===hv?Jl++:(Jl=0,hv=t):Jl=0,wu(0,!1)}}function g1(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Su(e)))}function Of(){return p1(),h1(),m1(),v1()}function v1(){if(ht!==5)return!1;var t=Vn,e=fv;fv=0;var a=Tv(Vr),r=te.T,n=_e.p;try{_e.p=32>a?32:a,te.T=null,a=pv,pv=null;var o=Vn,i=Vr;if(ht=0,cs=Vn=null,Vr=0,(Se&6)!==0)throw Error(M(331));var s=Se;if(Se|=4,t1(o.current),QL(o,o.current,i,a),Se=s,wu(0,!1),ma&&typeof ma.onPostCommitFiberRoot=="function")try{ma.onPostCommitFiberRoot(gu,o)}catch{}return!0}finally{_e.p=n,te.T=r,g1(t,e)}}function IC(t,e,a){e=Da(a,e),e=sv(t.stateNode,e,2),t=qn(t,e,2),t!==null&&(yu(t,2),br(t))}function ke(t,e,a){if(t.tag===3)IC(t,t,a);else for(;e!==null;){if(e.tag===3){IC(e,t,a);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&($n===null||!$n.has(r))){t=Da(a,t),a=ML(2),r=qn(e,a,2),r!==null&&(OL(a,r,e,t),yu(r,2),br(r));break}}e=e.return}}function Lg(t,e,a){var r=t.pingCache;if(r===null){r=t.pingCache=new uO;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)||(dy=!0,n.add(a),t=hO.bind(null,t,e,a),e.then(t,t))}function hO(t,e,a){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Re===t&&(me&a)===a&&(Je===4||Je===3&&(me&62914560)===me&&300>ha()-Tf?(Se&2)===0&&ds(t,0):fy|=a,us===me&&(us=0)),br(t)}function y1(t,e){e===0&&(e=uw()),t=Vo(t,e),t!==null&&(yu(t,e),br(t))}function mO(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),y1(t,a)}function gO(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(M(314))}r!==null&&r.delete(e),y1(t,a)}function vO(t,e){return Av(t,e)}var cf=null,Ni=null,mv=!1,df=!1,kg=!1,Fn=0;function br(t){t!==Ni&&t.next===null&&(Ni===null?cf=Ni=t:Ni=Ni.next=t),df=!0,mv||(mv=!0,xO())}function wu(t,e){if(!kg&&df){kg=!0;do for(var a=!1,r=cf;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-ga(42|t)+1)-1,o&=n&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,AC(r,o))}else o=me,o=xf(r,r===Re?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||vu(r,o)||(a=!0,AC(r,o));r=r.next}while(a);kg=!1}}function yO(){x1()}function x1(){df=mv=!1;var t=0;Fn!==0&&IO()&&(t=Fn);for(var e=ha(),a=null,r=cf;r!==null;){var n=r.next,o=b1(r,e);o===0?(r.next=null,a===null?cf=n:a.next=n,n===null&&(Ni=a)):(a=r,(t!==0||(o&3)!==0)&&(df=!0)),r=n}ht!==0&&ht!==5||wu(t,!1),Fn!==0&&(Fn=0)}function b1(t,e){for(var a=t.suspendedLanes,r=t.pingedLanes,n=t.expirationTimes,o=t.pendingLanes&-62914561;0<o;){var i=31-ga(o),s=1<<i,l=n[i];l===-1?((s&a)===0||(s&r)!==0)&&(n[i]=j2(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}if(e=Re,a=me,a=xf(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===e&&(Le===2||Le===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&tg(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||vu(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(r!==null&&tg(r),Tv(a)){case 2:case 8:a=sw;break;case 32:a=Gd;break;case 268435456:a=lw;break;default:a=Gd}return r=S1.bind(null,t),a=Av(a,r),t.callbackPriority=e,t.callbackNode=a,e}return r!==null&&r!==null&&tg(r),t.callbackPriority=2,t.callbackNode=null,2}function S1(t,e){if(ht!==0&&ht!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Of()&&t.callbackNode!==a)return null;var r=me;return r=xf(t,t===Re?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(i1(t,r,e),b1(t,ha()),t.callbackNode!=null&&t.callbackNode===a?S1.bind(null,t):null)}function AC(t,e){if(Of())return null;i1(t,e,!0)}function xO(){EO(function(){(Se&6)!==0?Av(iw,yO):x1()})}function hy(){if(Fn===0){var t=is;t===0&&(t=dd,dd<<=1,(dd&261888)===0&&(dd=256)),Fn=t}return Fn}function EC(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ed(""+t)}function TC(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 bO(t,e,a,r,n){if(e==="submit"&&a&&a.stateNode===n){var o=EC((n[ta]||null).action),i=r.submitter;i&&(e=(e=i[ta]||null)?EC(e.formAction):i.getAttribute("formAction"),e!==null&&(o=e,i=null));var s=new bf("action","action",null,r,n);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Fn!==0){var l=i?TC(n,i):new FormData(n);ov(a,{pending:!0,data:l,method:n.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=i?TC(n,i):new FormData(n),ov(a,{pending:!0,data:l,method:n.method,action:o},o,l))},currentTarget:n}]})}}for(Cd=0;Cd<Wg.length;Cd++)wd=Wg[Cd],RC=wd.toLowerCase(),MC=wd[0].toUpperCase()+wd.slice(1),Ya(RC,"on"+MC);var wd,RC,MC,Cd;Ya(Ow,"onAnimationEnd");Ya(Dw,"onAnimationIteration");Ya(Bw,"onAnimationStart");Ya("dblclick","onDoubleClick");Ya("focusin","onFocus");Ya("focusout","onBlur");Ya(FM,"onTransitionRun");Ya(HM,"onTransitionStart");Ya(UM,"onTransitionCancel");Ya(Pw,"onTransitionEnd");ns("onMouseEnter",["mouseout","mouseover"]);ns("onMouseLeave",["mouseout","mouseover"]);ns("onPointerEnter",["pointerout","pointerover"]);ns("onPointerLeave",["pointerout","pointerover"]);zo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));zo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));zo("onBeforeInput",["compositionend","keypress","textInput","paste"]);zo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));zo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));zo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cu="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(" "),SO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cu));function _1(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){Zd(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){Zd(c)}n.currentTarget=null,o=l}}}}function ce(t,e){var a=e[Hg];a===void 0&&(a=e[Hg]=new Set);var r=t+"__bubble";a.has(r)||(C1(e,t,2,!1),a.add(r))}function Ig(t,e,a){var r=0;e&&(r|=4),C1(a,t,r,e)}var Ld="_reactListening"+Math.random().toString(36).slice(2);function my(t){if(!t[Ld]){t[Ld]=!0,hw.forEach(function(a){a!=="selectionchange"&&(SO.has(a)||Ig(a,!1,t),Ig(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ld]||(e[Ld]=!0,Ig("selectionchange",!1,e))}}function C1(t,e,a,r){switch(P1(e)){case 2:var n=XO;break;case 8:n=YO;break;default:n=xy}a=n.bind(null,e,a,t),n=void 0,!Vg||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 Ag(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=Ui(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}_w(function(){var u=o,c=Ov(a),d=[];e:{var f=Nw.get(t);if(f!==void 0){var h=bf,S=t;switch(t){case"keypress":if(Rd(a)===0)break e;case"keydown":case"keyup":h=gM;break;case"focusin":S="focus",h=ig;break;case"focusout":S="blur",h=ig;break;case"beforeblur":case"afterblur":h=ig;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=H_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=nM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=xM;break;case Ow:case Dw:case Bw:h=sM;break;case Pw:h=SM;break;case"scroll":case"scrollend":h=aM;break;case"wheel":h=CM;break;case"copy":case"cut":case"paste":h=uM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=z_;break;case"toggle":case"beforetoggle":h=LM}var x=(e&4)!==0,b=!x&&(t==="scroll"||t==="scrollend"),g=x?f!==null?f+"Capture":null:f;x=[];for(var m=u,y;m!==null;){var v=m;if(y=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||y===null||g===null||(v=au(m,g),v!=null&&x.push(du(m,v,y))),b)break;m=m.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!==$g&&(S=a.relatedTarget||a.fromElement)&&(Ui(S)||S[hs]))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?Ui(S):null,S!==null&&(b=mu(S),x=S.tag,S!==b||x!==5&&x!==27&&x!==6)&&(S=null)):(h=null,S=u),h!==S)){if(x=H_,v="onMouseLeave",g="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(x=z_,v="onPointerLeave",g="onPointerEnter",m="pointer"),b=h==null?f:Hl(h),y=S==null?f:Hl(S),f=new x(v,m+"leave",h,a,c),f.target=b,f.relatedTarget=y,v=null,Ui(c)===u&&(x=new x(g,m+"enter",S,a,c),x.target=y,x.relatedTarget=b,v=x),b=v,h&&S)t:{for(x=_O,g=h,m=S,y=0,v=g;v;v=x(v))y++;v=0;for(var C=m;C;C=x(C))v++;for(;0<y-v;)g=x(g),y--;for(;0<v-y;)m=x(m),v--;for(;y--;){if(g===m||m!==null&&g===m.alternate){x=g;break t}g=x(g),m=x(m)}x=null}else x=null;h!==null&&OC(d,f,h,x,!1),S!==null&&b!==null&&OC(d,b,S,x,!0)}}e:{if(f=u?Hl(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var w=j_;else if(V_(f))if(Aw)w=BM;else{w=OM;var _=MM}else h=f.nodeName,!h||h.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&Mv(u.elementType)&&(w=j_):w=DM;if(w&&(w=w(t,u))){Iw(d,w,a,c);break e}_&&_(t,f,u),t==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&qg(f,"number",f.value)}switch(_=u?Hl(u):window,t){case"focusin":(V_(_)||_.contentEditable==="true")&&($i=_,jg=u,Vl=null);break;case"focusout":Vl=jg=$i=null;break;case"mousedown":Gg=!0;break;case"contextmenu":case"mouseup":case"dragend":Gg=!1,X_(d,a,c);break;case"selectionchange":if(NM)break;case"keydown":case"keyup":X_(d,a,c)}var L;if(Pv)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else qi?Lw(t,a)&&(A="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(A="onCompositionStart");A&&(ww&&a.locale!=="ko"&&(qi||A!=="onCompositionStart"?A==="onCompositionEnd"&&qi&&(L=Cw()):(Bn=c,Dv="value"in Bn?Bn.value:Bn.textContent,qi=!0)),_=ff(u,A),0<_.length&&(A=new U_(A,t,null,a,c),d.push({event:A,listeners:_}),L?A.data=L:(L=kw(a),L!==null&&(A.data=L)))),(L=IM?AM(t,a):EM(t,a))&&(A=ff(u,"onBeforeInput"),0<A.length&&(_=new U_("onBeforeInput","beforeinput",null,a,c),d.push({event:_,listeners:A}),_.data=L)),bO(d,t,u,a,c)}_1(d,e)})}function du(t,e,a){return{instance:t,listener:e,currentTarget:a}}function ff(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=au(t,a),n!=null&&r.unshift(du(t,n,o)),n=au(t,e),n!=null&&r.push(du(t,n,o))),t.tag===3)return r;t=t.return}return[]}function _O(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function OC(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=au(a,o),u!=null&&i.unshift(du(a,u,l))):n||(u=au(a,o),u!=null&&i.push(du(a,u,l)))),a=a.return}i.length!==0&&t.push({event:e,listeners:i})}var CO=/\r\n?/g,wO=/\u0000|\uFFFD/g;function DC(t){return(typeof t=="string"?t:""+t).replace(CO,`
|
|
9
|
+
`).replace(wO,"")}function w1(t,e){return e=DC(e),DC(t)===e}function Ie(t,e,a,r,n,o){switch(a){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||os(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&os(t,""+r);break;case"className":hd(t,"class",r);break;case"tabIndex":hd(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":hd(t,a,r);break;case"style":Sw(t,r,o);break;case"data":if(e!=="object"){hd(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=Ed(""+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"&&Ie(t,e,"name",n.name,n,null),Ie(t,e,"formEncType",n.formEncType,n,null),Ie(t,e,"formMethod",n.formMethod,n,null),Ie(t,e,"formTarget",n.formTarget,n,null)):(Ie(t,e,"encType",n.encType,n,null),Ie(t,e,"method",n.method,n,null),Ie(t,e,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=Ed(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=Ur);break;case"onScroll":r!=null&&ce("scroll",t);break;case"onScrollEnd":r!=null&&ce("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(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=Ed(""+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":ce("beforetoggle",t),ce("toggle",t),Ad(t,"popover",r);break;case"xlinkActuate":Mr(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Mr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Mr(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Mr(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Mr(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Mr(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Mr(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Mr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Mr(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Ad(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=eM.get(a)||a,Ad(t,a,r))}}function gv(t,e,a,r,n,o){switch(a){case"style":Sw(t,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(M(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(M(60));t.innerHTML=a}}break;case"children":typeof r=="string"?os(t,r):(typeof r=="number"||typeof r=="bigint")&&os(t,""+r);break;case"onScroll":r!=null&&ce("scroll",t);break;case"onScrollEnd":r!=null&&ce("scrollend",t);break;case"onClick":r!=null&&(t.onclick=Ur);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mw.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[ta]||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,""):Ad(t,a,r)}}}function At(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 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(M(137,e));default:Ie(t,e,o,i,a,null)}}n&&Ie(t,e,"srcSet",a.srcSet,a,null),r&&Ie(t,e,"src",a.src,a,null);return;case"input":ce("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(M(137,e));break;default:Ie(t,e,r,c,a,null)}}yw(t,o,s,l,u,i,n,!1);return;case"select":ce("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:Ie(t,e,n,s,a,null)}e=o,a=i,t.multiple=!!r,e!=null?Ki(t,!!r,e,!1):a!=null&&Ki(t,!!r,a,!0);return;case"textarea":ce("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(M(91));break;default:Ie(t,e,i,s,a,null)}bw(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":Ie(t,e,l,r,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(r=0;r<cu.length;r++)ce(cu[r],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)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(M(137,e));default:Ie(t,e,u,r,a,null)}return;default:if(Mv(e)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&gv(t,e,c,r,a,void 0));return}}for(s in a)a.hasOwnProperty(s)&&(r=a[s],r!=null&&Ie(t,e,s,r,a,null))}function LO(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(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:r.hasOwnProperty(h)||Ie(t,e,h,null,r,d)}}for(var f in r){var h=r[f];if(d=a[f],r.hasOwnProperty(f)&&(h!=null||d!=null))switch(f){case"type":o=h;break;case"name":n=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(M(137,e));break;default:h!==d&&Ie(t,e,f,h,r,d)}}zg(t,i,s,l,u,c,o,n);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:r.hasOwnProperty(o)||Ie(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":f=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:o!==l&&Ie(t,e,n,o,r,l)}e=s,a=i,r=h,f!=null?Ki(t,!!a,f,!1):!!r!=!!a&&(e!=null?Ki(t,!!a,e,!0):Ki(t,!!a,a?[]:"",!1));return;case"textarea":h=f=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:Ie(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":f=n;break;case"defaultValue":h=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(M(91));break;default:n!==o&&Ie(t,e,i,n,r,o)}xw(t,f,h);return;case"option":for(var S in a)f=a[S],a.hasOwnProperty(S)&&f!=null&&!r.hasOwnProperty(S)&&(S==="selected"?t.selected=!1:Ie(t,e,S,null,r,f));for(l in r)f=r[l],h=a[l],r.hasOwnProperty(l)&&f!==h&&(f!=null||h!=null)&&(l==="selected"?t.selected=f&&typeof f!="function"&&typeof f!="symbol":Ie(t,e,l,f,r,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&&!r.hasOwnProperty(x)&&Ie(t,e,x,null,r,f);for(u in r)if(f=r[u],h=a[u],r.hasOwnProperty(u)&&f!==h&&(f!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(M(137,e));break;default:Ie(t,e,u,f,r,h)}return;default:if(Mv(e)){for(var b in a)f=a[b],a.hasOwnProperty(b)&&f!==void 0&&!r.hasOwnProperty(b)&&gv(t,e,b,void 0,r,f);for(c in r)f=r[c],h=a[c],!r.hasOwnProperty(c)||f===h||f===void 0&&h===void 0||gv(t,e,c,f,r,h);return}}for(var g in a)f=a[g],a.hasOwnProperty(g)&&f!=null&&!r.hasOwnProperty(g)&&Ie(t,e,g,null,r,f);for(d in r)f=r[d],h=a[d],!r.hasOwnProperty(d)||f===h||f==null&&h==null||Ie(t,e,d,f,r,h)}function BC(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kO(){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&&BC(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&&BC(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 vv=null,yv=null;function pf(t){return t.nodeType===9?t:t.ownerDocument}function PC(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 L1(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 xv(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 Eg=null;function IO(){var t=window.event;return t&&t.type==="popstate"?t===Eg?!1:(Eg=t,!0):(Eg=null,!1)}var k1=typeof setTimeout=="function"?setTimeout:void 0,AO=typeof clearTimeout=="function"?clearTimeout:void 0,NC=typeof Promise=="function"?Promise:void 0,EO=typeof queueMicrotask=="function"?queueMicrotask:typeof NC<"u"?function(t){return NC.resolve(null).then(t).catch(TO)}:k1;function TO(t){setTimeout(function(){throw t})}function Jn(t){return t==="head"}function FC(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),ps(e);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")eu(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,eu(a);for(var o=a.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[xu]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=i}}else a==="body"&&eu(t.ownerDocument.body);a=n}while(a);ps(e)}function HC(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 bv(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":bv(a),Rv(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function RO(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[xu])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=Na(t.nextSibling),t===null)break}return null}function MO(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Na(t.nextSibling),t===null))return null;return t}function I1(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Na(t.nextSibling),t===null))return null;return t}function Sv(t){return t.data==="$?"||t.data==="$~"}function _v(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function OO(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 Na(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 Cv=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 Na(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function zC(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 A1(t,e,a){switch(e=pf(a),t){case"html":if(t=e.documentElement,!t)throw Error(M(452));return t;case"head":if(t=e.head,!t)throw Error(M(453));return t;case"body":if(t=e.body,!t)throw Error(M(454));return t;default:throw Error(M(451))}}function eu(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Rv(t)}var Fa=new Map,qC=new Set;function hf(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Yr=_e.d;_e.d={f:DO,r:BO,D:PO,C:NO,L:FO,m:HO,X:zO,S:UO,M:qO};function DO(){var t=Yr.f(),e=Rf();return t||e}function BO(t){var e=ms(t);e!==null&&e.tag===5&&e.type==="form"?SL(e):Yr.r(t)}var xs=typeof document>"u"?null:document;function E1(t,e,a){var r=xs;if(r&&typeof e=="string"&&e){var n=Oa(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),qC.has(n)||(qC.add(n),t={rel:t,crossOrigin:a,href:e},r.querySelector(n)===null&&(e=r.createElement("link"),At(e,"link",t),bt(e),r.head.appendChild(e)))}}function PO(t){Yr.D(t),E1("dns-prefetch",t,null)}function NO(t,e){Yr.C(t,e),E1("preconnect",t,e)}function FO(t,e,a){Yr.L(t,e,a);var r=xs;if(r&&t&&e){var n='link[rel="preload"][as="'+Oa(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+Oa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+Oa(a.imageSizes)+'"]')):n+='[href="'+Oa(t)+'"]';var o=n;switch(e){case"style":o=fs(t);break;case"script":o=bs(t)}Fa.has(o)||(t=ze({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Fa.set(o,t),r.querySelector(n)!==null||e==="style"&&r.querySelector(Lu(o))||e==="script"&&r.querySelector(ku(o))||(e=r.createElement("link"),At(e,"link",t),bt(e),r.head.appendChild(e)))}}function HO(t,e){Yr.m(t,e);var a=xs;if(a&&t){var r=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+Oa(r)+'"][href="'+Oa(t)+'"]',o=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=bs(t)}if(!Fa.has(o)&&(t=ze({rel:"modulepreload",href:t},e),Fa.set(o,t),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ku(o)))return}r=a.createElement("link"),At(r,"link",t),bt(r),a.head.appendChild(r)}}}function UO(t,e,a){Yr.S(t,e,a);var r=xs;if(r&&t){var n=Yi(r).hoistableStyles,o=fs(t);e=e||"default";var i=n.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(Lu(o)))s.loading=5;else{t=ze({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Fa.get(o))&&gy(t,a);var l=i=r.createElement("link");bt(l),At(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,Hd(i,e,r)}i={type:"stylesheet",instance:i,count:1,state:s},n.set(o,i)}}}function zO(t,e){Yr.X(t,e);var a=xs;if(a&&t){var r=Yi(a).hoistableScripts,n=bs(t),o=r.get(n);o||(o=a.querySelector(ku(n)),o||(t=ze({src:t,async:!0},e),(e=Fa.get(n))&&vy(t,e),o=a.createElement("script"),bt(o),At(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function qO(t,e){Yr.M(t,e);var a=xs;if(a&&t){var r=Yi(a).hoistableScripts,n=bs(t),o=r.get(n);o||(o=a.querySelector(ku(n)),o||(t=ze({src:t,async:!0,type:"module"},e),(e=Fa.get(n))&&vy(t,e),o=a.createElement("script"),bt(o),At(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(n,o))}}function $C(t,e,a,r){var n=(n=Hn.current)?hf(n):null;if(!n)throw Error(M(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=fs(a.href),a=Yi(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=fs(a.href);var o=Yi(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(Lu(t)))&&!o._p&&(i.instance=o,i.state.loading=5),Fa.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},Fa.set(t,a),o||$O(n,t,a,i.state))),e&&r===null)throw Error(M(528,""));return i}if(e&&r!==null)throw Error(M(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=bs(a),a=Yi(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(M(444,t))}}function fs(t){return'href="'+Oa(t)+'"'}function Lu(t){return'link[rel="stylesheet"]['+t+"]"}function T1(t){return ze({},t,{"data-precedence":t.precedence,precedence:null})}function $O(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}),At(e,"link",a),bt(e),t.head.appendChild(e))}function bs(t){return'[src="'+Oa(t)+'"]'}function ku(t){return"script[async]"+t}function VC(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+Oa(a.href)+'"]');if(r)return e.instance=r,bt(r),r;var n=ze({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),bt(r),At(r,"style",n),Hd(r,a.precedence,t),e.instance=r;case"stylesheet":n=fs(a.href);var o=t.querySelector(Lu(n));if(o)return e.state.loading|=4,e.instance=o,bt(o),o;r=T1(a),(n=Fa.get(n))&&gy(r,n),o=(t.ownerDocument||t).createElement("link"),bt(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),At(o,"link",r),e.state.loading|=4,Hd(o,a.precedence,t),e.instance=o;case"script":return o=bs(a.src),(n=t.querySelector(ku(o)))?(e.instance=n,bt(n),n):(r=a,(n=Fa.get(o))&&(r=ze({},a),vy(r,n)),t=t.ownerDocument||t,n=t.createElement("script"),bt(n),At(n,"link",r),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(M(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Hd(r,a.precedence,t));return e.instance}function Hd(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 gy(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function vy(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Ud=null;function jC(t,e,a){if(Ud===null){var r=new Map,n=Ud=new Map;n.set(a,r)}else n=Ud,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[xu]||o[Lt]||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 GC(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function VO(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 R1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function jO(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=fs(r.href),o=e.querySelector(Lu(n));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=mf.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=o,bt(o);return}o=e.ownerDocument||e,r=T1(r),(n=Fa.get(n))&&gy(r,n),o=o.createElement("link"),bt(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),At(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=mf.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Tg=0;function GO(t,e){return t.stylesheets&&t.count===0&&zd(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&zd(t,t.stylesheets),t.unsuspend){var o=t.unsuspend;t.unsuspend=null,o()}},6e4+e);0<t.imgBytes&&Tg===0&&(Tg=62500*kO());var n=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&zd(t,t.stylesheets),t.unsuspend)){var o=t.unsuspend;t.unsuspend=null,o()}},(t.imgBytes>Tg?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function mf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zd(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var gf=null;function zd(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,gf=new Map,e.forEach(WO,t),gf=null,mf.call(t))}function WO(t,e){if(!(e.state.loading&4)){var a=gf.get(t);if(a)var r=a.get(null);else{a=new Map,gf.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=mf.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 fu={$$typeof:Hr,Provider:null,Consumer:null,_currentValue:Ro,_currentValue2:Ro,_threadCount:0};function ZO(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=ag(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ag(0),this.hiddenUpdates=ag(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 M1(t,e,a,r,n,o,i,s,l,u,c,d){return t=new ZO(t,e,a,i,l,u,c,d,s),e=1,o===!0&&(e|=24),o=fa(3,null,null,e),t.current=o,o.stateNode=t,e=$v(),e.refCount++,t.pooledCache=e,e.refCount++,o.memoizedState={element:r,isDehydrated:a,cache:e},Gv(o),t}function O1(t){return t?(t=Gi,t):Gi}function D1(t,e,a,r,n,o){n=O1(n),r.context===null?r.context=n:r.pendingContext=n,r=zn(e),r.payload={element:a},o=o===void 0?null:o,o!==null&&(r.callback=o),a=qn(t,r,e),a!==null&&(ea(a,t,e),Gl(a,t,e))}function WC(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function yy(t,e){WC(t,e),(t=t.alternate)&&WC(t,e)}function B1(t){if(t.tag===13||t.tag===31){var e=Vo(t,67108864);e!==null&&ea(e,t,67108864),yy(t,67108864)}}function ZC(t){if(t.tag===13||t.tag===31){var e=va();e=Ev(e);var a=Vo(t,e);a!==null&&ea(a,t,e),yy(t,e)}}var vf=!0;function XO(t,e,a,r){var n=te.T;te.T=null;var o=_e.p;try{_e.p=2,xy(t,e,a,r)}finally{_e.p=o,te.T=n}}function YO(t,e,a,r){var n=te.T;te.T=null;var o=_e.p;try{_e.p=8,xy(t,e,a,r)}finally{_e.p=o,te.T=n}}function xy(t,e,a,r){if(vf){var n=wv(r);if(n===null)Ag(t,e,r,yf,a),XC(t,r);else if(QO(n,t,e,a,r))r.stopPropagation();else if(XC(t,r),e&4&&-1<KO.indexOf(t)){for(;n!==null;){var o=ms(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=Ao(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-ga(i);s.entanglements[1]|=l,i&=~l}br(o),(Se&6)===0&&(sf=ha()+500,wu(0,!1))}}break;case 31:case 13:s=Vo(o,2),s!==null&&ea(s,o,2),Rf(),yy(o,2)}if(o=wv(r),o===null&&Ag(t,e,r,yf,a),o===n)break;n=o}n!==null&&r.stopPropagation()}else Ag(t,e,r,null,a)}}function wv(t){return t=Ov(t),by(t)}var yf=null;function by(t){if(yf=null,t=Ui(t),t!==null){var e=mu(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=tw(e),t!==null)return t;t=null}else if(a===31){if(t=aw(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 yf=t,null}function P1(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(F2()){case iw:return 2;case sw:return 8;case Gd:case H2:return 32;case lw:return 268435456;default:return 32}default:return 32}}var Lv=!1,jn=null,Gn=null,Wn=null,pu=new Map,hu=new Map,On=[],KO="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 XC(t,e){switch(t){case"focusin":case"focusout":jn=null;break;case"dragenter":case"dragleave":Gn=null;break;case"mouseover":case"mouseout":Wn=null;break;case"pointerover":case"pointerout":pu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":hu.delete(e.pointerId)}}function Bl(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=ms(e),e!==null&&B1(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function QO(t,e,a,r,n){switch(e){case"focusin":return jn=Bl(jn,t,e,a,r,n),!0;case"dragenter":return Gn=Bl(Gn,t,e,a,r,n),!0;case"mouseover":return Wn=Bl(Wn,t,e,a,r,n),!0;case"pointerover":var o=n.pointerId;return pu.set(o,Bl(pu.get(o)||null,t,e,a,r,n)),!0;case"gotpointercapture":return o=n.pointerId,hu.set(o,Bl(hu.get(o)||null,t,e,a,r,n)),!0}return!1}function N1(t){var e=Ui(t.target);if(e!==null){var a=mu(e);if(a!==null){if(e=a.tag,e===13){if(e=tw(a),e!==null){t.blockedOn=e,M_(t.priority,function(){ZC(a)});return}}else if(e===31){if(e=aw(a),e!==null){t.blockedOn=e,M_(t.priority,function(){ZC(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 qd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=wv(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);$g=r,a.target.dispatchEvent(r),$g=null}else return e=ms(a),e!==null&&B1(e),t.blockedOn=a,!1;e.shift()}return!0}function YC(t,e,a){qd(t)&&a.delete(e)}function JO(){Lv=!1,jn!==null&&qd(jn)&&(jn=null),Gn!==null&&qd(Gn)&&(Gn=null),Wn!==null&&qd(Wn)&&(Wn=null),pu.forEach(YC),hu.forEach(YC)}function kd(t,e){t.blockedOn===e&&(t.blockedOn=null,Lv||(Lv=!0,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,JO)))}var Id=null;function KC(t){Id!==t&&(Id=t,mt.unstable_scheduleCallback(mt.unstable_NormalPriority,function(){Id===t&&(Id=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(by(r||a)===null)continue;break}var o=ms(a);o!==null&&(t.splice(e,3),e-=3,ov(o,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function ps(t){function e(l){return kd(l,t)}jn!==null&&kd(jn,t),Gn!==null&&kd(Gn,t),Wn!==null&&kd(Wn,t),pu.forEach(e),hu.forEach(e);for(var a=0;a<On.length;a++){var r=On[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<On.length&&(a=On[0],a.blockedOn===null);)N1(a),a.blockedOn===null&&On.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[ta]||null;if(typeof o=="function")i||KC(a);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(n=o,i=o[ta]||null)s=i.formAction;else if(by(n)!==null)continue}else s=i.action;typeof s=="function"?a[r+1]=s:(a.splice(r,3),r-=3),KC(a)}}}function F1(){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 Sy(t){this._internalRoot=t}Df.prototype.render=Sy.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));var a=e.current,r=va();D1(a,r,t,e,null,null)};Df.prototype.unmount=Sy.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;D1(t.current,2,null,t,null,null),Rf(),e[hs]=null}};function Df(t){this._internalRoot=t}Df.prototype.unstable_scheduleHydration=function(t){if(t){var e=pw();t={blockedOn:null,target:t,priority:e};for(var a=0;a<On.length&&e!==0&&e<On[a].priority;a++);On.splice(a,0,t),a===0&&N1(t)}};var QC=JC.version;if(QC!=="19.2.1")throw Error(M(527,QC,"19.2.1"));_e.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=R2(e),t=t!==null?rw(t):null,t=t===null?null:t.stateNode,t};var eD={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:te,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Pl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Pl.isDisabled&&Pl.supportsFiber))try{gu=Pl.inject(eD),ma=Pl}catch{}var Pl;Bf.createRoot=function(t,e){if(!ew(t))throw Error(M(299));var a=!1,r="",n=EL,o=TL,i=RL;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=M1(t,1,!1,null,null,a,r,null,n,o,i,F1),t[hs]=e.current,my(t),new Sy(e)};Bf.hydrateRoot=function(t,e,a){if(!ew(t))throw Error(M(299));var r=!1,n="",o=EL,i=TL,s=RL,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=M1(t,1,!0,e,a??null,r,n,l,o,i,s,F1),e.context=O1(null),a=e.current,r=va(),r=Ev(r),n=zn(r),n.callback=null,qn(a,n,r),a=r,e.current.lanes=a,yu(e,a),br(e),t[hs]=e.current,my(t),new Df(e)};Bf.version="19.2.1"});var Go=fr((yU,z1)=>{"use strict";function U1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U1)}catch(t){console.error(t)}}U1(),z1.exports=H1()});var Nk=fr(ep=>{"use strict";var XD=Symbol.for("react.transitional.element"),YD=Symbol.for("react.fragment");function Pk(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:XD,type:t,key:r,ref:e!==void 0?e:null,props:a}}ep.Fragment=YD;ep.jsx=Pk;ep.jsxs=Pk});var Ee=fr((Bz,Fk)=>{"use strict";Fk.exports=Nk()});var uU={};KS(uU,{ANIMATION_KEYFRAMES:()=>_l,ActivationConfigZ:()=>Xc,AddClassZ:()=>dS,AnchorIdZ:()=>Ia,AnchorStateZ:()=>wR,AnchorVisibleConditionZ:()=>am,AppRegistry:()=>Bu,AugmentationZ:()=>LR,BadgePositionZ:()=>eS,BadgeZ:()=>vS,BoundingBoxZ:()=>CR,CanvasEvents:()=>Ts,CanvasRecipeZ:()=>hh,ConditionZ:()=>_n,ContextManager:()=>Yc,CooldownActiveConditionZ:()=>lm,CounterDefZ:()=>dl,CtaButtonZ:()=>fm,DEFAULT_COOLDOWN:()=>Bp,DEFAULT_TTL:()=>Dp,DecisionStrategyZ:()=>vl,DismissedConditionZ:()=>sm,EVENT_SCHEMA_VERSION:()=>et,EventBus:()=>Jc,EventCountConditionZ:()=>cm,EventFilterZ:()=>RR,EventHistory:()=>xl,EventOccurredConditionZ:()=>rm,EventSourceZ:()=>MS,ExecutorRegistry:()=>Gc,ExternalStrategyZ:()=>gl,FrequencyEntryZ:()=>HR,FrequencyLimitConditionZ:()=>um,HighlightStepZ:()=>fE,HighlightStyleZ:()=>J0,HighlightZ:()=>mS,InsertHtmlZ:()=>hS,InsertPositionZ:()=>nS,MAX_VISIBLE_TOASTS:()=>Op,MatchOpZ:()=>cl,ModalContentZ:()=>rS,ModalZ:()=>xS,ModelStrategyZ:()=>ml,MountWidgetZ:()=>_S,NavigateZ:()=>SS,NavigationMonitor:()=>bl,NormalizedEventZ:()=>TR,NotificationToastStack:()=>Mp,PageContextZ:()=>xR,PageHistoryEntryZ:()=>bR,PageUrlConditionZ:()=>em,ParallelZ:()=>LS,PlacementZ:()=>tS,PulseZ:()=>gS,RUNTIME_SDK_BUILD:()=>jS,RUNTIME_VERSION:()=>FS,RemoveClassZ:()=>fS,RouteConditionZ:()=>tm,RouteFilterZ:()=>K0,RuleStrategyZ:()=>pl,RuleZ:()=>fl,RuntimeContextZ:()=>kR,RuntimeProvider:()=>Up,SDK_SCHEMA_VERSION:()=>tn,SDK_VERSION:()=>vp,STATIC_SLOT_STYLES:()=>PS,ScoreStrategyZ:()=>hl,ScrollBehaviorZ:()=>lS,ScrollLogicalPositionZ:()=>dm,ScrollToZ:()=>bS,SelectorZ:()=>Vx,SequenceZ:()=>wS,SessionContextZ:()=>SR,SessionMetricConditionZ:()=>im,SessionMetricTracker:()=>pc,SetAttrZ:()=>cS,SetStyleZ:()=>pS,SetTextZ:()=>uS,ShadowCanvasOverlay:()=>yx,ShadowRootProvider:()=>rx,SmartCanvasApp:()=>bx,SmartCanvasController:()=>Sp,SmartCanvasElement:()=>qp,SmartCanvasPortal:()=>GH,StandardEvents:()=>_t,StateEqualsConditionZ:()=>nm,StateStore:()=>ad,StoredValueZ:()=>FR,Syntro:()=>VS,TileCard:()=>Ms,TileWheel:()=>AN,TooltipContentZ:()=>aS,TooltipStepZ:()=>dE,TooltipTriggerZ:()=>oS,TooltipZ:()=>yS,TourStepForSchemaZ:()=>sS,TourZ:()=>kS,TriggerWhenZ:()=>Zc,ViewportConditionZ:()=>om,ViewportContextZ:()=>_R,WaitZ:()=>CS,WidgetConfigZ:()=>iS,WidgetRegistry:()=>nd,appRegistry:()=>Ls,applyStaticSlotStyles:()=>Sm,cleanupAppContext:()=>rp,contentRuntime:()=>Pf,coreActionStepSchemas:()=>vR,createActionEngine:()=>Jh,createAnchorResolver:()=>pm,createAppContext:()=>ap,createAppLoader:()=>op,createCanvasConfigFetcher:()=>ni,createContextManager:()=>hm,createDecisionEngine:()=>mm,createEventAccumulator:()=>gm,createEventBus:()=>yl,createGrowthBookClient:()=>sh,createNoopClient:()=>gh,createOverlayRecipeFetcher:()=>jH,createPostHogClient:()=>Xh,createPostHogNormalizer:()=>ox,createSessionMetricTracker:()=>lh,createSmartCanvas:()=>$p,createSmartCanvasController:()=>ax,createSmartCanvasRuntime:()=>Tm,createStateStore:()=>bm,createSurfaceContainer:()=>km,createSurfaces:()=>Am,decisionSchemas:()=>R4,decodeToken:()=>Cl,encodeToken:()=>Rm,evaluate:()=>TS,evaluateCondition:()=>AS,evaluateRule:()=>ES,evaluateRuleStrategy:()=>Kc,evaluateScoreStrategy:()=>Qc,evaluateSync:()=>RS,executorRegistry:()=>Tr,getAntiFlickerSnippet:()=>RI,getAppIdFromActionKind:()=>Py,getAppIdFromWidgetId:()=>np,getExecutor:()=>gR,getSlotAnchorId:()=>rd,getSlotType:()=>Sl,getSlotZIndex:()=>Im,hasExecutor:()=>Yh,interpolateTemplate:()=>oc,isCoreActionKind:()=>By,matchEvent:()=>Pp,needsMigration:()=>MN,normalizePostHogEvent:()=>As,overlaysRuntime:()=>tp,parseVersion:()=>Ds,playEnterAnimation:()=>wm,playExitAnimation:()=>Lm,registerConfigPredicates:()=>$u,registerSmartCanvasElement:()=>_x,resolveConfigUri:()=>yp,setupAdjacentPositioning:()=>_m,setupInlinePositioning:()=>Cm,shouldNormalizeEvent:()=>Es,useDecision:()=>rA,useNotifications:()=>Np,useNotifyWatcher:()=>Hp,usePageContext:()=>zp,useRuntime:()=>Cr,useRuntimeContext:()=>ic,useRuntimeEvents:()=>tA,useRuntimeState:()=>aA,useSessionContext:()=>JI,useShadowCanvasConfig:()=>xx,useShadowRoot:()=>oi,useViewportContext:()=>eA,validateAction:()=>dr,validateActions:()=>Wc,validateActivationConfig:()=>T4,validateCondition:()=>A4,validateConfig:()=>EN,validateEventFilter:()=>Z4,validateEventName:()=>vm,validateFrequencyEntry:()=>J4,validateNormalizedEvent:()=>W4,validateProps:()=>ym,validateRecipe:()=>VH,validateRuntimeContext:()=>$4,validateStoredValue:()=>Q4,validateStrategy:()=>E4,widgetRegistry:()=>Em});var t2=K(Ke(),1),Mm=K(kl(),1),lU=K(Go(),1);function q1(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 f of d)for(let h of f.removedNodes)if(h===t){if(s>=n){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 tD=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 _y(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=[];for(;n.nextNode();){let s=n.currentNode,l=s.tagName.toLowerCase();if(!tD.has(l)){o.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"),S=(c==="href"||c==="src"||c==="formaction")&&(d.startsWith("javascript:")||d.startsWith("vbscript:")||d.startsWith("data:text/html"));(f||S)&&s.removeAttribute(u.name)}}let i=Array.from(r.querySelectorAll("svg"));for(let s of i)o.some(l=>s.contains(l)&&l.tagName.toLowerCase()==="script")&&o.push(s);for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return a.innerHTML}var $1=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=_y(t.html),n="data-syntro-insert-label",o=t.label;if(o){let d=CSS.escape(o),h=(a.parentElement??a).querySelector(`[${n}="${d}"]`);h&&h.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: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=q1(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=_y(d.html))}}},V1=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.isConnected&&(a.textContent=r)},updateFn:n=>{"text"in n&&typeof n.text=="string"&&(a.textContent=n.text)}}},j1=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:()=>{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)}}},G1=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:()=>{a.isConnected&&(r||a.classList.remove(t.className))}}},W1=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:()=>{a.isConnected&&r&&a.classList.add(t.className)}}},Z1=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:()=>{if(a.isConnected)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)}}},Cy=[{kind:"content:insertHtml",executor:$1},{kind:"content:setText",executor:V1},{kind:"content:setAttr",executor:j1},{kind:"content:addClass",executor:G1},{kind:"content:removeClass",executor:W1},{kind:"content:setStyle",executor:Z1}],Pf={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Cy};var aD={light:50,medium:100,heavy:200},rD=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"],X1={init(t,e,a){let r=aD[a.intensity],n=a.colors.length>0?a.colors:rD,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 nD={light:20,medium:40,heavy:80},oD="\u{1F389}",Y1={init(t,e,a){let r=nD[a.intensity],n=typeof a.props?.emoji=="string"?a.props.emoji:oD,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 iD={light:20,medium:40,heavy:80},sD={light:3,medium:4,heavy:5},K1={init(t,e,a){let r=iD[a.intensity],n=sD[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 f=Math.PI*2*d/r+(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 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 lD={light:30,medium:60,heavy:120},Q1={init(t,e,a){let r=lD[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 Nf=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){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;this.container=e,this.effect=a,this.duration=r.duration;let o=document.createElement("canvas");o.setAttribute("data-syntro-celebrate",""),Object.assign(o.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483646"});let i=window.devicePixelRatio||1,s=window.innerWidth,l=window.innerHeight;o.width=s*i,o.height=l*i,o.style.width=`${s}px`,o.style.height=`${l}px`;let u=o.getContext("2d");u&&(u.scale(i,i),this.canvas=o,this.ctx=u,e.appendChild(o),this.particles=a.init(s,l,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 uD=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff"];function cD(t,e){return[t,e,`${t}cc`,`${e}cc`,"#ffffff",`${t}80`]}function dD(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 cD(a,r||a)}catch{}return null}var J1=new Map([["confetti",X1],["fireworks",K1],["sparkles",Q1],["emoji-rain",Y1]]),ek=async(t,e)=>{let a=J1.get(t.effect);if(!a)return console.warn(`[adaptive-overlays] Unknown celebration effect: "${t.effect}". Available: ${[...J1.keys()].join(", ")}`),{cleanup:()=>{}};let r=t.colors??dD(e.overlayRoot)??uD,n={duration:t.duration??3e3,intensity:t.intensity??"medium",colors:r,props:t.props},o=new Nf;return o.start(e.overlayRoot,a,n),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:celebrate",effect:t.effect}),{cleanup:()=>{o.stop()}}};var Ly="syntro_active_tour",Ff=new Map;function fD(t){try{let e=localStorage.getItem(Ly);if(!e)return null;let a=JSON.parse(e);return a.tourId!==t?null:a}catch{return null}}function wy(t){try{localStorage.setItem(Ly,JSON.stringify(t))}catch{}}function pD(){try{localStorage.removeItem(Ly)}catch{}}function Iu(){return window.location.pathname}function hD(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 ky=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(Ff.has(a))return{cleanup:async()=>{let y=Ff.get(a);y&&await y.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let i=fD(a),s=!!i;if(!s&&!o)return{cleanup:()=>{}};i||(i={tourId:a,currentStepId:n||r[0].id,startedAt:Date.now()},wy(i));let l=r.findIndex(y=>y.id===i.currentStepId);if(l===-1){let y=n||r[0].id;l=r.findIndex(v=>v.id===y),l===-1&&(l=0),i.currentStepId=r[l].id,wy(i)}let u=r[l];if(!hD(u))return e.publishEvent("tour.waiting_for_route",{tourId:a,stepId:u.id,expectedRoute:u.route,currentRoute:Iu()}),{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 y=>{if(c)return;if(await S(),y==="end"){pD(),e.publishEvent("tour.completed",{tourId:a,totalSteps:r.length}),c=!0;return}let v=r.find(C=>C.id===y);if(!v){console.error(`[Tour] Step "${y}" not found`);return}if(i.currentStepId=y,wy(i),e.publishEvent("tour.step_changed",{tourId:a,previousStepId:u.id,nextStepId:y}),v.route&&v.route!==Iu()){e.publishEvent("tour.awaiting_navigation",{tourId:a,stepId:y,targetRoute:v.route});return}await b(v)},b=async y=>{if(!c){e.publishEvent("tour.step_started",{tourId:a,stepId:y.id,stepIndex:r.findIndex(v=>v.id===y.id),totalSteps:r.length});try{d=await e.applyAction(y.action)}catch(v){console.error(`[Tour] Failed to execute step "${y.id}":`,v),e.publishEvent("tour.step_failed",{tourId:a,stepId:y.id,error:String(v)});return}if(y.onAction&&e.subscribeEvent){f=e.subscribeEvent("action.modal_cta_clicked",w=>{let _=w?.actionId;if(_&&y.onAction){let L=y.onAction[_];L&&x(L)}});let v=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let _=w?.actionId;if(_&&y.onAction){let L=y.onAction[_];L&&x(L)}}),C=f;f=()=>{C(),v()}}}};h=(()=>{let y=Iu(),v=()=>{let _=Iu();_!==y&&(y=_,e.publishEvent("tour.route_changed",{tourId:a,newRoute:_}))};if(e.subscribeNavigation)return e.subscribeNavigation(()=>v());window.addEventListener("popstate",v);let C=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(..._)=>{C(..._),queueMicrotask(v)},history.replaceState=(..._)=>{w(..._),queueMicrotask(v)},()=>{window.removeEventListener("popstate",v),history.pushState=C,history.replaceState=w}})(),s?e.publishEvent("tour.resumed",{tourId:a,stepId:i.currentStepId}):e.publishEvent("tour.started",{tourId:a,totalSteps:r.length,startStepId:i.currentStepId}),await b(u);let m=async()=>{c=!0,Ff.delete(a),await S(),h&&h(),e.publishEvent("tour.paused",{tourId:a,stepId:i.currentStepId})};return Ff.set(a,{cleanup:m}),{cleanup:m}};var Ka={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"},k={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"},Et={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},Ge={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},ba={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Au={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},qt={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Eu={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var Sa={primary:k[10],secondary:k[9],tertiary:k[8]},PU={primary:k[2],secondary:k[0]},Iy={primary:k[4],secondary:k[3]},Hf={primary:{text:Ka.white,icon:Ka.white,border:ne[3],backgroundDefault:ne[3],backgroundHover:ne[2]},neutral:{text:k[10],textHover:Ka.white,icon:k[10],iconHover:Ka.white,border:k[4],background:k[2]},link:{text:Ka.white,icon:Ka.white,hover:ne[5]},error:{text:Ge[5],hover:Ge[6]},success:{text:Me[5],hover:Me[6]}},NU={slateGrey:{content:k[10],pillOutline:k[10],borderPrimary:k[5],borderSecondary:k[5],background:k[3]},brand:{content:ne[9],pillOutline:ne[9],borderPrimary:ne[6],borderSecondary:ne[6],background:ne[0]},red:{content:Ge[8],pillOutline:Ge[4],borderPrimary:Ge[2],borderSecondary:Ge[2],background:Ge[0]},yellow:{content:Et[8],pillOutline:Et[4],borderPrimary:Et[2],borderSecondary:Et[2],background:Et[0]},green:{content:Me[8],pillOutline:Me[4],borderPrimary:Me[2],borderSecondary:Me[2],background:Me[0]},purple:{content:qt[8],pillOutline:qt[4],borderPrimary:qt[2],borderSecondary:qt[2],background:qt[0]},blue:{content:ba[8],pillOutline:ba[4],borderPrimary:ba[2],borderSecondary:ba[2],background:ba[0]},orange:{content:Au[8],pillOutline:Au[4],borderPrimary:Au[2],borderSecondary:Au[2],background:Au[0]},pink:{content:Eu[8],pillOutline:Eu[4],borderPrimary:Eu[2],borderSecondary:Eu[2],background:Eu[0]}},FU={green:{content:Me[8],border:Me[2],background:Me[0]},yellow:{content:Et[8],border:Et[2],background:Et[0]},red:{content:Ge[8],border:Ge[2],background:Ge[0]}},HU={green:{content:Me[1],background:Me[9]},yellow:{content:Et[1],background:Et[9]},red:{content:Ge[1],background:Ge[9]}},UU={content:k[10],border:k[4],background:"#1c2124"},zU={backgroundDefault:k[2],backgroundHover:k[1],selected:k[3]},qU={background:k[2],icon:k[10],borderDefault:k[4],borderSelected:ne[3],textLabel:k[9],textPlaceholder:k[8],textHint:k[8]},$U={backgroundDefault:k[2],backgroundDisabled:k[0],textLabel:k[9],textPlaceholder:k[8],textHint:k[8],textError:Ge[5],iconDefault:k[9],iconPlaceholder:k[10],iconError:Ge[5],borderDefault:k[4],borderSelected:ne[3],borderError:Ge[5]},VU={handleDefault:Ka.white,handleDisabled:k[10],off:{backgroundDefault:k[4],backgroundHover:k[5],backgroundDisabled:k[4]},on:{backgroundDefault:Me[3],backgroundHover:Me[2],backgroundDisabled:k[4]}},jU={off:{backgroundDefault:"#00000000",backgroundHover:k[5],backgroundDisabled:k[2],border:k[6]},on:{backgroundDefault:Me[0],backgroundHover:Me[1],backgroundDisabled:k[2],border:Me[3]}},GU={content:k[10],background:k[4]},WU={background:k[4],active:Me[3]},ZU={background:k[1],content:k[9],border:k[4]},XU={backgroundDefault:k[1],backgroundHover:k[3],backgroundActive:k[4],border:k[4],contentPrimary:k[10],contentSecondary:k[9],contentTertiary:k[8]},YU={background:k[1],content:k[9],border:k[4]},KU={activeBackground:k[3],activeContent:ne[5],inactiveContent:k[9],border:k[4]},QU={header:{textDefault:k[9],textHover:k[8],backgroundDefault:k[1]},border:k[4],cell:{textPrimary:k[10],textSecondary:k[9],backgroundDefault:k[2],backgroundHover:k[1]}},JU={textPrimaryDefault:k[10],textPrimaryHover:k[10],textSecondaryDefault:k[8],textSecondaryHover:k[9],iconPrimary:k[10],iconSecondary:k[8]},ez={background:Me[1],active:Me[5]},tz={textDefault:k[10],textSelected:Ka.white,textDisabled:k[7],backgroundDefault:k[2],backgroundMiddle:k[3],backgroundSelected:ne[3],border:k[4]},az=k[9];var tk=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function ak(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, ${ba[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:`${n}px`,border:`2px solid ${i||f||ba[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(!tk)for(let A=0;A<4;A++){let I=document.createElement("div");I.style.position="fixed",I.style.background="inherit",b.push(I),h.appendChild(I)}let g=A=>{h.style.clipPath=A,h.style.webkitClipPath=A},m=()=>{if(!t.isConnected){L.destroy();return}let A=t.getBoundingClientRect(),I=A.left-r,R=A.top-r,F=A.width+r*2,E=A.height+r*2;if(Object.assign(x.style,{left:`${I}px`,top:`${R}px`,width:`${F}px`,height:`${E}px`}),tk){let D=window.innerWidth,O=window.innerHeight,N=Math.min(n,F/2,E/2),W=`M 0 0 L ${D} 0 L ${D} ${O} L 0 ${O} Z`,H=`M ${I+N} ${R} A ${N} ${N} 0 0 0 ${I} ${R+N} L ${I} ${R+E-N} A ${N} ${N} 0 0 0 ${I+N} ${R+E} L ${I+F-N} ${R+E} A ${N} ${N} 0 0 0 ${I+F} ${R+E-N} L ${I+F} ${R+N} A ${N} ${N} 0 0 0 ${I+F-N} ${R} L ${I+N} ${R} Z`;g(`path('${W} ${H}')`)}else{let[D,O,N,W]=b;Object.assign(D.style,{left:"0px",top:"0px",width:"100vw",height:`${R}px`}),Object.assign(N.style,{left:"0px",top:`${R+E}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(R+E))}px`}),Object.assign(W.style,{left:"0px",top:`${R}px`,width:`${I}px`,height:`${E}px`}),Object.assign(O.style,{left:`${I+F}px`,top:`${R}px`,width:`${Math.max(0,window.innerWidth-(I+F))}px`,height:`${E}px`})}},y=new ResizeObserver(()=>requestAnimationFrame(m));y.observe(t);let v=()=>requestAnimationFrame(m),C=()=>requestAnimationFrame(m);window.addEventListener("scroll",v,!0),window.addEventListener("resize",C);let w=A=>{A.key==="Escape"&&u&&(a?.onDismiss?.(),L.destroy())};u&&window.addEventListener("keydown",w);let _=A=>{s?(A.preventDefault(),A.stopPropagation()):l&&(a?.onDismiss?.(),L.destroy())};h.addEventListener("click",_);let L={destroy(){y.disconnect(),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",C),u&&window.removeEventListener("keydown",w),h.removeEventListener("click",_),h.style.pointerEvents="none",h.style.opacity="0",setTimeout(()=>{try{h.remove()}catch{}try{x.remove()}catch{}},220)}};return m(),L}var mD=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 _a(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(!mD.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 Wo={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)"},Ay=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=`
|
|
10
10
|
position: fixed;
|
|
11
11
|
inset: 0;
|
|
12
12
|
background: rgba(0, 0, 0, ${o?.opacity??.6});
|
|
@@ -20,14 +20,14 @@ Error generating stack: `+r.message+`
|
|
|
20
20
|
transform: translate(-50%, -50%) scale(0.95);
|
|
21
21
|
max-width: ${c[r]};
|
|
22
22
|
width: 90%;
|
|
23
|
-
background: ${
|
|
24
|
-
border-radius: ${
|
|
23
|
+
background: ${Wo.bg};
|
|
24
|
+
border-radius: ${Wo.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: ${
|
|
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: ${Wo.title};">${_a(a.title)}</h2>`),d+=`<div class="syntro-modal-body" style="color: ${Wo.text}; line-height: 1.5;">${_a(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: ${
|
|
39
|
+
color: ${Wo.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 C of s){let w=C.primary??!1;d+=`
|
|
47
47
|
<button
|
|
48
48
|
class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
|
|
49
|
-
data-syntro-action="${
|
|
49
|
+
data-syntro-action="${_a(C.actionId)}"
|
|
50
50
|
style="
|
|
51
51
|
padding: 10px 20px;
|
|
52
52
|
border-radius: 8px;
|
|
@@ -54,12 +54,12 @@ Error generating stack: `+r.message+`
|
|
|
54
54
|
font-weight: 500;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
transition: background 150ms ease;
|
|
57
|
-
${w?`background: ${
|
|
57
|
+
${w?`background: ${Wo.accent}; color: white; border: none;`:`background: transparent; color: ${Wo.accent}; border: 1px solid currentColor; opacity: 0.7;`}
|
|
58
58
|
"
|
|
59
59
|
>
|
|
60
|
-
${
|
|
60
|
+
${_a(C.label)}
|
|
61
61
|
</button>
|
|
62
|
-
`}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let f=null,p=u.querySelectorAll("[data-syntro-action]"),S=C=>{let _=C.currentTarget.getAttribute("data-syntro-action");_&&(f=_,e.publishEvent("action.modal_cta_clicked",{actionId:_}),y.destroy())};p.forEach(C=>C.addEventListener("click",S));let x=C=>{C.key==="Escape"&&i?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",x);let b=()=>{n||y.destroy()};l.addEventListener("click",b);let m=[];n&&Array.from(document.body.children).forEach(C=>{C!==e.overlayRoot&&C.getAttribute("inert")===null&&!C.querySelector("[data-syntro-editor-panel]")&&!C.hasAttribute("data-syntro-editor-panel")&&(C.setAttribute("inert",""),m.push(C))});let h;i?.timeoutMs&&(h=setTimeout(()=>{y.destroy()},i.timeoutMs));let g=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');g.length>0&&requestAnimationFrame(()=>g[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(){h&&clearTimeout(h),window.removeEventListener("keydown",x),l.removeEventListener("click",b),p.forEach(C=>C.removeEventListener("click",S)),m.forEach(C=>C.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 xI=["top","right","bottom","left"];var or=Math.min,Jt=Math.max,$r=Math.round,Vr=Math.floor,ct=t=>({x:t,y:t}),KN={left:"right",right:"left",bottom:"top",top:"bottom"};function jp(t,e,a){return Jt(t,or(e,a))}function Ri(t,e){return typeof t=="function"?t(e):t}function Do(t){return t.split("-")[0]}function _l(t){return t.split("-")[1]}function Ux(t){return t==="x"?"y":"x"}function Gp(t){return t==="y"?"height":"width"}function Rn(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function Zp(t){return Ux(Rn(t))}function bI(t,e,a){a===void 0&&(a=!1);let r=_l(t),n=Zp(t),o=Gp(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=Bc(i)),[i,Bc(i)]}function SI(t){let e=Bc(t);return[Vp(t),e,Vp(e)]}function Vp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var vI=["left","right"],yI=["right","left"],QN=["top","bottom"],JN=["bottom","top"];function eB(t,e,a){switch(t){case"top":case"bottom":return a?e?yI:vI:e?vI:yI;case"left":case"right":return e?QN:JN;default:return[]}}function _I(t,e,a,r){let n=_l(t),o=eB(Do(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(Vp)))),o}function Bc(t){let e=Do(t);return KN[e]+t.slice(e.length)}function tB(t){return{top:0,right:0,bottom:0,left:0,...t}}function zx(t){return typeof t!="number"?tB(t):{top:t,right:t,bottom:t,left:t}}function jr(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 CI(t,e,a){let{reference:r,floating:n}=t,o=Rn(e),i=Zp(e),s=Gp(i),l=Do(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,f=r[s]/2-n[s]/2,p;switch(l){case"top":p={x:c,y:r.y-n.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-n.width,y:d};break;default:p={x:r.x,y:r.y}}switch(_l(e)){case"start":p[i]-=f*(a&&u?-1:1);break;case"end":p[i]+=f*(a&&u?-1:1);break}return p}async function qx(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:f=!1,padding:p=0}=Ri(e,t),S=zx(p),b=s[f?d==="floating"?"reference":"floating":d],m=jr(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})),h=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),y=await(o.isElement==null?void 0:o.isElement(g))?await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1}:{x:1,y:1},C=jr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:h,offsetParent:g,strategy:l}):h);return{top:(m.top-C.top+S.top)/y.y,bottom:(C.bottom-m.bottom+S.bottom)/y.y,left:(m.left-C.left+S.left)/y.x,right:(C.right-m.right+S.right)/y.x}}var aB=50,Wp=async(t,e,a)=>{let{placement:r="bottom",strategy:n="absolute",middleware:o=[],platform:i}=a,s=i.detectOverflow?i:{...i,detectOverflow:qx},l=await(i.isRTL==null?void 0:i.isRTL(e)),u=await i.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:d}=CI(u,r,l),f=r,p=0,S={};for(let x=0;x<o.length;x++){let b=o[x];if(!b)continue;let{name:m,fn:h}=b,{x:g,y,data:C,reset:w}=await h({x:c,y:d,initialPlacement:r,placement:f,strategy:n,middlewareData:S,rects:u,platform:s,elements:{reference:t,floating:e}});c=g??c,d=y??d,S[m]={...S[m],...C},w&&p<aB&&(p++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=CI(u,f,l)),x=-1)}return{x:c,y:d,placement:f,strategy:n,middlewareData:S}},$x=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}=Ri(t,e)||{};if(u==null)return{};let d=zx(c),f={x:a,y:r},p=Zp(n),S=Gp(p),x=await i.getDimensions(u),b=p==="y",m=b?"top":"left",h=b?"bottom":"right",g=b?"clientHeight":"clientWidth",y=o.reference[S]+o.reference[p]-f[p]-o.floating[S],C=f[p]-o.reference[p],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),_=w?w[g]:0;(!_||!await(i.isElement==null?void 0:i.isElement(w)))&&(_=s.floating[g]||o.floating[S]);let k=y/2-C/2,A=_/2-x[S]/2-1,I=or(d[m],A),R=or(d[h],A),U=I,E=_-x[S]-R,N=_/2-x[S]/2+k,O=jp(U,N,E),H=!l.arrow&&_l(n)!=null&&N!==O&&o.reference[S]/2-(N<U?I:R)-x[S]/2<0,Y=H?N<U?N-U:N-E:0;return{[p]:f[p]+Y,data:{[p]:O,centerOffset:N-O-Y,...H&&{alignmentOffset:Y}},reset:H}}});var Xp=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:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...b}=Ri(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let m=Do(n),h=Rn(s),g=Do(s)===s,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(g||!x?[Bc(s)]:SI(s)),w=S!=="none";!f&&w&&C.push(..._I(s,x,S,y));let _=[s,...C],k=await l.detectOverflow(e,b),A=[],I=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(k[m]),d){let N=bI(n,i,y);A.push(k[N[0]],k[N[1]])}if(I=[...I,{placement:n,overflows:A}],!A.every(N=>N<=0)){var R,U;let N=(((R=o.flip)==null?void 0:R.index)||0)+1,O=_[N];if(O&&(!(d==="alignment"?h!==Rn(O):!1)||I.every(z=>Rn(z.placement)===h?z.overflows[0]>0:!0)))return{data:{index:N,overflows:I},reset:{placement:O}};let H=(U=I.filter(Y=>Y.overflows[0]<=0).sort((Y,z)=>Y.overflows[1]-z.overflows[1])[0])==null?void 0:U.placement;if(!H)switch(p){case"bestFit":{var E;let Y=(E=I.filter(z=>{if(w){let Q=Rn(z.placement);return Q===h||Q==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(Q=>Q>0).reduce((Q,we)=>Q+we,0)]).sort((z,Q)=>z[1]-Q[1])[0])==null?void 0:E[0];Y&&(H=Y);break}case"initialPlacement":H=s;break}if(n!==H)return{reset:{placement:H}}}return{}}}};function wI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function kI(t){return xI.some(e=>t[e]>=0)}var Vx=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=Ri(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=wI(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:kI(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=wI(i,a.floating);return{data:{escapedOffsets:s,escaped:kI(s)}}}default:return{}}}}};var rB=new Set(["left","top"]);async function nB(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Do(a),s=_l(a),l=Rn(a)==="y",u=rB.has(i)?-1:1,c=o&&l?-1:1,d=Ri(e,t),{mainAxis:f,crossAxis:p,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"&&(p=s==="end"?S*-1:S),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}var Yp=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 nB(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}}}}},Kp=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:m=>{let{x:h,y:g}=m;return{x:h,y:g}}},...u}=Ri(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),f=Rn(Do(n)),p=Ux(f),S=c[p],x=c[f];if(i){let m=p==="y"?"top":"left",h=p==="y"?"bottom":"right",g=S+d[m],y=S-d[h];S=jp(g,S,y)}if(s){let m=f==="y"?"top":"left",h=f==="y"?"bottom":"right",g=x+d[m],y=x-d[h];x=jp(g,x,y)}let b=l.fn({...e,[p]:S,[f]:x});return{...b,data:{x:b.x-a,y:b.y-r,enabled:{[p]:i,[f]:s}}}}}};function Qp(){return typeof window<"u"}function Sr(t){return II(t)?(t.nodeName||"").toLowerCase():"#document"}function dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function yt(t){var e;return(e=(II(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function II(t){return Qp()?t instanceof Node||t instanceof dt(t).Node:!1}function ft(t){return Qp()?t instanceof Element||t instanceof dt(t).Element:!1}function kt(t){return Qp()?t instanceof HTMLElement||t instanceof dt(t).HTMLElement:!1}function LI(t){return!Qp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof dt(t).ShadowRoot}function Zr(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=pt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&n!=="inline"&&n!=="contents"}function Jp(t){return/^(table|td|th)$/.test(Sr(t))}function Mn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var oB=/transform|translate|scale|rotate|perspective|filter/,iB=/paint|layout|strict|content/,Mi=t=>!!t&&t!=="none",jx;function Oi(t){let e=ft(t)?pt(t):t;return Mi(e.transform)||Mi(e.translate)||Mi(e.scale)||Mi(e.rotate)||Mi(e.perspective)||!Di()&&(Mi(e.backdropFilter)||Mi(e.filter))||oB.test(e.willChange||"")||iB.test(e.contain||"")}function eh(t){let e=sa(t);for(;kt(e)&&!ir(e);){if(Oi(e))return e;if(Mn(e))return null;e=sa(e)}return null}function Di(){return jx==null&&(jx=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),jx}function ir(t){return/^(html|body|#document)$/.test(Sr(t))}function pt(t){return dt(t).getComputedStyle(t)}function Wr(t){return ft(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function sa(t){if(Sr(t)==="html")return t;let e=t.assignedSlot||t.parentNode||LI(t)&&t.host||yt(t);return LI(e)?e.host:e}function AI(t){let e=sa(t);return ir(e)?t.ownerDocument?t.ownerDocument.body:t.body:kt(e)&&Zr(e)?e:AI(e)}function Gr(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=AI(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=dt(n);if(o){let s=Ni(i);return e.concat(i,i.visualViewport||[],Zr(n)?n:[],s&&a?Gr(s):[])}else return e.concat(n,Gr(n,[],a))}function Ni(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function MI(t){let e=pt(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=kt(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=$r(a)!==o||$r(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Zx(t){return ft(t)?t:t.contextElement}function Cl(t){let e=Zx(t);if(!kt(e))return ct(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=MI(e),i=(o?$r(a.width):a.width)/r,s=(o?$r(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var dB=ct(0);function OI(t){let e=dt(t);return!Di()||!e.visualViewport?dB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function fB(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==dt(t)?!1:e}function Bi(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Zx(t),i=ct(1);e&&(r?ft(r)&&(i=Cl(r)):i=Cl(t));let s=fB(o,a,r)?OI(o):ct(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 f=dt(o),p=r&&ft(r)?dt(r):r,S=f,x=Ni(S);for(;x&&r&&p!==S;){let b=Cl(x),m=x.getBoundingClientRect(),h=pt(x),g=m.left+(x.clientLeft+parseFloat(h.paddingLeft))*b.x,y=m.top+(x.clientTop+parseFloat(h.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=g,u+=y,S=dt(x),x=Ni(S)}}return jr({width:c,height:d,x:l,y:u})}function th(t,e){let a=Wr(t).scrollLeft;return e?e.left+a:Bi(yt(t)).left+a}function DI(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-th(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function pB(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=yt(r),s=e?Mn(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=ct(1),c=ct(0),d=kt(r);if((d||!d&&!o)&&((Sr(r)!=="body"||Zr(i))&&(l=Wr(r)),kt(r))){let p=Bi(r);u=Cl(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}let f=i&&!d&&!o?DI(i,l):ct(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 hB(t){return Array.from(t.getClientRects())}function mB(t){let e=yt(t),a=Wr(t),r=t.ownerDocument.body,n=Jt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Jt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+th(t),s=-a.scrollTop;return pt(r).direction==="rtl"&&(i+=Jt(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var EI=25;function gB(t,e){let a=dt(t),r=yt(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=Di();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=th(r);if(u<=0){let c=r.ownerDocument,d=c.body,f=getComputedStyle(d),p=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-p);S<=EI&&(o-=S)}else u<=EI&&(o+=u);return{width:o,height:i,x:s,y:l}}var vB=new Set(["absolute","fixed"]);function yB(t,e){let a=Bi(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=kt(t)?Cl(t):ct(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 TI(t,e,a){let r;if(e==="viewport")r=gB(t,a);else if(e==="document")r=mB(yt(t));else if(ft(e))r=yB(e,a);else{let n=OI(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return jr(r)}function NI(t,e){let a=sa(t);return a===e||!ft(a)||ir(a)?!1:pt(a).position==="fixed"||NI(a,e)}function xB(t,e){let a=e.get(t);if(a)return a;let r=Gr(t,[],!1).filter(s=>ft(s)&&Sr(s)!=="body"),n=null,o=pt(t).position==="fixed",i=o?sa(t):t;for(;ft(i)&&!ir(i);){let s=pt(i),l=Oi(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&vB.has(n.position)||Zr(i)&&!l&&NI(t,i))?r=r.filter(c=>c!==i):n=s,i=sa(i)}return e.set(t,r),r}function bB(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?Mn(e)?[]:xB(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=TI(e,c,n);return u.top=Jt(d.top,u.top),u.right=or(d.right,u.right),u.bottom=or(d.bottom,u.bottom),u.left=Jt(d.left,u.left),u},TI(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function SB(t){let{width:e,height:a}=MI(t);return{width:e,height:a}}function _B(t,e,a){let r=kt(e),n=yt(e),o=a==="fixed",i=Bi(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=ct(0);function u(){l.x=th(n)}if(r||!r&&!o)if((Sr(e)!=="body"||Zr(n))&&(s=Wr(e)),r){let p=Bi(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?DI(n,s):ct(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 Gx(t){return pt(t).position==="static"}function RI(t,e){if(!kt(t)||pt(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return yt(t)===a&&(a=a.ownerDocument.body),a}function BI(t,e){let a=dt(t);if(Mn(t))return a;if(!kt(t)){let n=sa(t);for(;n&&!ir(n);){if(ft(n)&&!Gx(n))return n;n=sa(n)}return a}let r=RI(t,e);for(;r&&Jp(r)&&Gx(r);)r=RI(r,e);return r&&ir(r)&&Gx(r)&&!Oi(r)?a:r||eh(t)||a}var CB=async function(t){let e=this.getOffsetParent||BI,a=this.getDimensions,r=await a(t.floating);return{reference:_B(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wB(t){return pt(t).direction==="rtl"}var kB={convertOffsetParentRelativeRectToViewportRelativeRect:pB,getDocumentElement:yt,getClippingRect:bB,getOffsetParent:BI,getElementRects:CB,getClientRects:hB,getDimensions:SB,getScale:Cl,isElement:ft,isRTL:wB};function PI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function LB(t,e){let a=null,r,n=yt(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:f,height:p}=u;if(s||e(),!f||!p)return;let S=Vr(d),x=Vr(n.clientWidth-(c+f)),b=Vr(n.clientHeight-(d+p)),m=Vr(c),g={rootMargin:-S+"px "+-x+"px "+-b+"px "+-m+"px",threshold:Jt(0,or(1,l))||1},y=!0;function C(w){let _=w[0].intersectionRatio;if(_!==l){if(!y)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!PI(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(C,{...g,root:n.ownerDocument})}catch{a=new IntersectionObserver(C,g)}a.observe(t)}return i(!0),o}function FI(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=Zx(t),c=n||o?[...u?Gr(u):[],...Gr(e)]:[];c.forEach(m=>{n&&m.addEventListener("scroll",a,{passive:!0}),o&&m.addEventListener("resize",a)});let d=u&&s?LB(u,a):null,f=-1,p=null;i&&(p=new ResizeObserver(m=>{let[h]=m;h&&h.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=p)==null||g.observe(e)})),a()}),u&&!l&&p.observe(u),p.observe(e));let S,x=l?Bi(t):null;l&&b();function b(){let m=Bi(t);x&&!PI(x,m)&&a(),x=m,S=requestAnimationFrame(b)}return a(),()=>{var m;c.forEach(h=>{n&&h.removeEventListener("scroll",a),o&&h.removeEventListener("resize",a)}),d?.(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(S)}}var HI=Yp;var UI=Kp,zI=Xp;var qI=Vx,$I=$x;var VI=(t,e,a)=>{let r=new Map,n={platform:kB,...a},o={...n.platform,_c:r};return Wp(t,e,{...n,platform:o})};function IB(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 jI(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 r=document.createElement("div");if(r.className="syntro-tooltip",r.setAttribute("role","tooltip"),r.innerHTML=$a(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()),r.style.position="relative",r.appendChild(x)}let n=r.querySelectorAll("[data-syntro-action]"),o=x=>{let m=x.currentTarget.getAttribute("data-syntro-action");m&&a.onAction&&a.onAction(m)};n.forEach(x=>x.addEventListener("click",o));let i=document.createElement("div");i.className="syntro-tooltip-arrow",r.appendChild(i),e.appendChild(r);let s=[HI(a.offsetPx??8),zI(),UI({padding:8}),qI(),$I({element:i})],l=a.placement&&a.placement!=="auto"?a.placement:"top",u=FI(t,r,async()=>{if(!t.isConnected){S.destroy();return}let x=IB(t),b=await VI(x,r,{placement:l,strategy:"fixed",middleware:s}),{x:m,y:h,strategy:g,middlewareData:y,placement:C}=b;if(Object.assign(r.style,{left:`${m}px`,top:`${h}px`,position:g}),y.arrow){let{x:w,y:_}=y.arrow,k=C.split("-")[0],A={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(i.style,{left:w!=null?`${w}px`:"",top:_!=null?`${_}px`:"",right:"",bottom:"",[A[k]]:"-4px"});let I={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};i.style.transform=`rotate(${I[k]||"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(r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(x.length>0){let b=x[0],m=x[x.length-1],h=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===b&&(m.focus(),g.preventDefault()):document.activeElement===m&&(b.focus(),g.preventDefault()))};r.addEventListener("keydown",h),requestAnimationFrame(()=>b.focus())}}let p=(()=>{if(a.trigger==="hover"){let x=null,b=()=>{x&&(clearTimeout(x),x=null),r.style.visibility="visible",r.style.opacity="1"},m=()=>{x=setTimeout(()=>{r.style.visibility="hidden",r.style.opacity="0",x=null},100)};return r.style.visibility="hidden",r.style.opacity="0",r.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",b),t.addEventListener("mouseleave",m),r.addEventListener("mouseenter",b),r.addEventListener("mouseleave",m),t.addEventListener("focus",b),t.addEventListener("blur",m),()=>{x&&clearTimeout(x),t.removeEventListener("mouseenter",b),t.removeEventListener("mouseleave",m),r.removeEventListener("mouseenter",b),r.removeEventListener("mouseleave",m),t.removeEventListener("focus",b),t.removeEventListener("blur",m)}}if(a.trigger==="click"){let x=()=>{r.style.visibility==="visible"?S.destroy():(r.style.visibility="visible",r.style.opacity="1")};return r.style.visibility="hidden",r.style.opacity="0",r.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",x),()=>t.removeEventListener("click",x)}return r.style.opacity="0",r.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{r.style.opacity="1"}),()=>{}})(),S={el:r,destroy(){u(),p(),window.removeEventListener("keydown",c),n.forEach(x=>x.removeEventListener("click",o)),a.blocking&&Array.from(document.body.children).forEach(x=>{x!==e&&x.removeAttribute("inert")}),r.style.pointerEvents="none",r.style.opacity="0",setTimeout(()=>{try{r.remove()}catch{}},200)}};return S}var Wx=ae(Fe(),1),ot=ae(st(),1),KI=ae(Ei(),1);var rt=ae(Fe(),1);function TB({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,rt.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,rt.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 RB({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,rt.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,rt.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,rt.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,rt.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,rt.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,rt.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function MB({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,rt.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,rt.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,rt.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,rt.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,rt.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,rt.jsxs)("div",{className:"se-mb-2",children:[(0,rt.jsx)(TB,{completed:n,total:o}),(0,rt.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,rt.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,rt.jsx)(RB,{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,rt.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function XI({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,rt.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,rt.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,rt.jsx)(MB,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function YI(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 r,n=setTimeout(()=>{e.style.opacity="0",r=setTimeout(()=>{e.remove()},300)},4e3);return()=>{clearTimeout(n),clearTimeout(r),e.remove()}}function OB(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 DB({runtime:t}){let[e,a]=(0,ot.useState)(0),r=(0,ot.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return OB(b)},[t,e]),n=(0,ot.useRef)(r);n.current=r,(0,ot.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(b=>b+1))},[t]);let o=(0,ot.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,ot.useRef)(new Set),s=(0,ot.useRef)([]),l=(0,ot.useRef)(null),u=(0,ot.useRef)({}),[c,d]=(0,ot.useState)([]),f=(0,ot.useRef)(!1);if(!f.current&&o){let b=o.get?.("notified")||[];for(let h of b)i.current.add(h);let m=o.get?.("completed")||{};u.current={...m},f.current=!0}(0,ot.useEffect)(()=>{if(r.size===0)return;let b=o?.get?.("dismissed")||[],m=o?.get?.("completed")||{};d(h=>{let g=new Set(h.map(C=>C.tourId)),y=[];for(let[C,{meta:w,steps:_}]of r){if(g.has(C))continue;let k="active";b.includes(C)?k="dismissed":m[C]&&(k="completed"),y.push({tourId:C,meta:w,steps:_,currentStepId:null,completedSteps:[],status:k,completedAt:m[C]||void 0})}return y.length>0?[...h,...y]:h});for(let[h,{meta:g}]of r)if(!i.current.has(h)&&g.notification&&!b.includes(h)&&!m[h]){i.current.add(h),o?.set?.("notified",[...i.current]);let y=YI(g.notification);s.current.push(y)}},[r,o]),(0,ot.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},m=>{let h=m.props?.tourId;if(!h)return;let g=n.current;if(!g.has(h)&&m.name==="tour.started"){a(y=>y+1);return}g.has(h)&&d(y=>y.map(w=>{if(w.tourId!==h)return w;switch(m.name){case"tour.started":{let _=m.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(h)){i.current.add(h),o?.set?.("notified",[...i.current]);let A=g.get(h);if(A?.meta.notification){let I=YI(A.meta.notification);s.current.push(I)}}let k=y.filter(A=>A.status==="active"||A.tourId===h).map(A=>A.tourId);return k.includes(h)||k.push(h),o?.set?.("active",[...new Set(k)]),{...w,status:"active",currentStepId:_,completedSteps:w.status==="active"?w.completedSteps:[]}}case"tour.step_started":{let _=m.props?.stepId;return{...w,currentStepId:_||w.currentStepId}}case"tour.step_changed":{let _=m.props?.previousStepId,k=m.props?.nextStepId,A=_&&!w.completedSteps.includes(_)?[...w.completedSteps,_]:w.completedSteps;return{...w,currentStepId:k||w.currentStepId,completedSteps:A}}case"tour.completed":{let _=Date.now();return u.current[h]=_,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(k=>k.id),completedAt:_}}case"tour.paused":return w;default:return w}}))});return()=>{b();for(let m of s.current)m();s.current=[]}},[t,o]);let p=(0,ot.useCallback)((b,m)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:m})},[t]),S=(0,ot.useCallback)(b=>{d(m=>{let h=m.map(y=>y.tourId===b?{...y,status:"dismissed"}:y),g=h.filter(y=>y.status==="dismissed").map(y=>y.tourId);return o?.set?.("dismissed",g),h})},[o]),x=(0,ot.useMemo)(()=>c.filter(b=>b.status==="active"),[c]);return(0,Wx.jsx)("div",{ref:l,children:(0,Wx.jsx)(XI,{workflows:x,onStepClick:p,onDismiss:S})})}var QI={mount(t,e){let a=e?.runtime||null,r=(0,KI.createRoot)(t);return r.render(ot.default.createElement(DB,{runtime:a})),()=>{r.unmount()}}};var JI=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 n=t.style?.color;if(!n)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(n=i)}catch{}let o=gI(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,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")}}},eA=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(x=>requestAnimationFrame(x));let n=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=n(b)),m?.startsWith("#")&&m.length>=7&&(s=n(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=`
|
|
62
|
+
`}d+="</div>"}u.innerHTML=d,e.overlayRoot.appendChild(u);let f=null,h=u.querySelectorAll("[data-syntro-action]"),S=C=>{let _=C.currentTarget.getAttribute("data-syntro-action");_&&(f=_,e.publishEvent("action.modal_cta_clicked",{actionId:_}),v.destroy())};h.forEach(C=>C.addEventListener("click",S));let x=C=>{C.key==="Escape"&&i?.onEsc!==!1&&v.destroy()};window.addEventListener("keydown",x);let b=()=>{n||v.destroy()};l.addEventListener("click",b);let g=[];n&&Array.from(document.body.children).forEach(C=>{C!==e.overlayRoot&&C.getAttribute("inert")===null&&!C.querySelector("[data-syntro-editor-panel]")&&!C.hasAttribute("data-syntro-editor-panel")&&(C.setAttribute("inert",""),g.push(C))});let m;i?.timeoutMs&&(m=setTimeout(()=>{v.destroy()},i.timeoutMs));let y=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');y.length>0&&requestAnimationFrame(()=>y[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 v={destroy(){m&&clearTimeout(m),window.removeEventListener("keydown",x),l.removeEventListener("click",b),h.forEach(C=>C.removeEventListener("click",S)),g.forEach(C=>C.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:()=>{v.destroy()}}};var ok=["top","right","bottom","left"];var eo=Math.min,Kr=Math.max,Ru=Math.round,Mu=Math.floor,Qa=t=>({x:t,y:t}),gD={left:"right",right:"left",bottom:"top",top:"bottom"},vD={start:"end",end:"start"};function zf(t,e,a){return Kr(t,eo(e,a))}function Zo(t,e){return typeof t=="function"?t(e):t}function to(t){return t.split("-")[0]}function Ss(t){return t.split("-")[1]}function Ey(t){return t==="x"?"y":"x"}function qf(t){return t==="y"?"height":"width"}var yD=new Set(["top","bottom"]);function Qr(t){return yD.has(to(t))?"y":"x"}function $f(t){return Ey(Qr(t))}function ik(t,e,a){a===void 0&&(a=!1);let r=Ss(t),n=$f(t),o=qf(n),i=n==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=Tu(i)),[i,Tu(i)]}function sk(t){let e=Tu(t);return[Uf(t),e,Uf(e)]}function Uf(t){return t.replace(/start|end/g,e=>vD[e])}var rk=["left","right"],nk=["right","left"],xD=["top","bottom"],bD=["bottom","top"];function SD(t,e,a){switch(t){case"top":case"bottom":return a?e?nk:rk:e?rk:nk;case"left":case"right":return e?xD:bD;default:return[]}}function lk(t,e,a,r){let n=Ss(t),o=SD(to(t),a==="start",r);return n&&(o=o.map(i=>i+"-"+n),e&&(o=o.concat(o.map(Uf)))),o}function Tu(t){return t.replace(/left|right|bottom|top/g,e=>gD[e])}function _D(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ty(t){return typeof t!="number"?_D(t):{top:t,right:t,bottom:t,left:t}}function Xo(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 uk(t,e,a){let{reference:r,floating:n}=t,o=Qr(e),i=$f(e),s=qf(i),l=to(e),u=o==="y",c=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,f=r[s]/2-n[s]/2,h;switch(l){case"top":h={x:c,y:r.y-n.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-n.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Ss(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 fk(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:f=!1,padding:h=0}=Zo(e,t),S=Ty(h),b=s[f?d==="floating"?"reference":"floating":d],g=Xo(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})),m=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),v=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},C=Xo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:y,strategy:l}):m);return{top:(g.top-C.top+S.top)/v.y,bottom:(C.bottom-g.bottom+S.bottom)/v.y,left:(g.left-C.left+S.left)/v.x,right:(C.right-g.right+S.right)/v.x}}var pk=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}=uk(u,r,l),f=r,h={},S=0;for(let b=0;b<s.length;b++){var x;let{name:g,fn:m}=s[b],{x:y,y:v,data:C,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:f,strategy:n,middlewareData:h,rects:u,platform:{...i,detectOverflow:(x=i.detectOverflow)!=null?x:fk},elements:{reference:t,floating:e}});c=y??c,d=v??d,h={...h,[g]:{...h[g],...C}},w&&S<=50&&(S++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:n}):w.rects),{x:c,y:d}=uk(u,f,l)),b=-1)}return{x:c,y:d,placement:f,strategy:n,middlewareData:h}},hk=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}=Zo(t,e)||{};if(u==null)return{};let d=Ty(c),f={x:a,y:r},h=$f(n),S=qf(h),x=await i.getDimensions(u),b=h==="y",g=b?"top":"left",m=b?"bottom":"right",y=b?"clientHeight":"clientWidth",v=o.reference[S]+o.reference[h]-f[h]-o.floating[S],C=f[h]-o.reference[h],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),_=w?w[y]:0;(!_||!await(i.isElement==null?void 0:i.isElement(w)))&&(_=s.floating[y]||o.floating[S]);let L=v/2-C/2,A=_/2-x[S]/2-1,I=eo(d[g],A),R=eo(d[m],A),F=I,E=_-x[S]-R,D=_/2-x[S]/2+L,O=zf(F,D,E),N=!l.arrow&&Ss(n)!=null&&D!==O&&o.reference[S]/2-(D<F?I:R)-x[S]/2<0,W=N?D<F?D-F:D-E:0;return{[h]:f[h]+W,data:{[h]:O,centerOffset:D-O-W,...N&&{alignmentOffset:W}},reset:N}}});var mk=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:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...b}=Zo(t,e);if((a=o.arrow)!=null&&a.alignmentOffset)return{};let g=to(n),m=Qr(s),y=to(s)===s,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(y||!x?[Tu(s)]:sk(s)),w=S!=="none";!f&&w&&C.push(...lk(s,x,S,v));let _=[s,...C],L=await l.detectOverflow(e,b),A=[],I=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(L[g]),d){let D=ik(n,i,v);A.push(L[D[0]],L[D[1]])}if(I=[...I,{placement:n,overflows:A}],!A.every(D=>D<=0)){var R,F;let D=(((R=o.flip)==null?void 0:R.index)||0)+1,O=_[D];if(O&&(!(d==="alignment"?m!==Qr(O):!1)||I.every(H=>Qr(H.placement)===m?H.overflows[0]>0:!0)))return{data:{index:D,overflows:I},reset:{placement:O}};let N=(F=I.filter(W=>W.overflows[0]<=0).sort((W,H)=>W.overflows[1]-H.overflows[1])[0])==null?void 0:F.placement;if(!N)switch(h){case"bestFit":{var E;let W=(E=I.filter(H=>{if(w){let Z=Qr(H.placement);return Z===m||Z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Z=>Z>0).reduce((Z,he)=>Z+he,0)]).sort((H,Z)=>H[1]-Z[1])[0])==null?void 0:E[0];W&&(N=W);break}case"initialPlacement":N=s;break}if(n!==N)return{reset:{placement:N}}}return{}}}};function ck(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function dk(t){return ok.some(e=>t[e]>=0)}var gk=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:a,platform:r}=e,{strategy:n="referenceHidden",...o}=Zo(t,e);switch(n){case"referenceHidden":{let i=await r.detectOverflow(e,{...o,elementContext:"reference"}),s=ck(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:dk(s)}}}case"escaped":{let i=await r.detectOverflow(e,{...o,altBoundary:!0}),s=ck(i,a.floating);return{data:{escapedOffsets:s,escaped:dk(s)}}}default:return{}}}}};var CD=new Set(["left","top"]);async function wD(t,e){let{placement:a,platform:r,elements:n}=t,o=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=to(a),s=Ss(a),l=Qr(a)==="y",u=CD.has(i)?-1:1,c=o&&l?-1:1,d=Zo(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 vk=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 wD(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}}}}},yk=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:g=>{let{x:m,y}=g;return{x:m,y}}},...u}=Zo(t,e),c={x:a,y:r},d=await o.detectOverflow(e,u),f=Qr(to(n)),h=Ey(f),S=c[h],x=c[f];if(i){let g=h==="y"?"top":"left",m=h==="y"?"bottom":"right",y=S+d[g],v=S-d[m];S=zf(y,S,v)}if(s){let g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",y=x+d[g],v=x-d[m];x=zf(y,x,v)}let b=l.fn({...e,[h]:S,[f]:x});return{...b,data:{x:b.x-a,y:b.y-r,enabled:{[h]:i,[f]:s}}}}}};function Vf(){return typeof window<"u"}function Yo(t){return bk(t)?(t.nodeName||"").toLowerCase():"#document"}function ra(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ja(t){var e;return(e=(bk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function bk(t){return Vf()?t instanceof Node||t instanceof ra(t).Node:!1}function Ha(t){return Vf()?t instanceof Element||t instanceof ra(t).Element:!1}function er(t){return Vf()?t instanceof HTMLElement||t instanceof ra(t).HTMLElement:!1}function xk(t){return!Vf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ra(t).ShadowRoot}var LD=new Set(["inline","contents"]);function Cs(t){let{overflow:e,overflowX:a,overflowY:r,display:n}=Ua(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!LD.has(n)}var kD=new Set(["table","td","th"]);function Sk(t){return kD.has(Yo(t))}var ID=[":popover-open",":modal"];function Ou(t){return ID.some(e=>{try{return t.matches(e)}catch{return!1}})}var AD=["transform","translate","scale","rotate","perspective"],ED=["transform","translate","scale","rotate","perspective","filter"],TD=["paint","layout","strict","content"];function jf(t){let e=Gf(),a=Ha(t)?Ua(t):t;return AD.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)||ED.some(r=>(a.willChange||"").includes(r))||TD.some(r=>(a.contain||"").includes(r))}function _k(t){let e=Jr(t);for(;er(e)&&!Ko(e);){if(jf(e))return e;if(Ou(e))return null;e=Jr(e)}return null}function Gf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var RD=new Set(["html","body","#document"]);function Ko(t){return RD.has(Yo(t))}function Ua(t){return ra(t).getComputedStyle(t)}function Du(t){return Ha(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Jr(t){if(Yo(t)==="html")return t;let e=t.assignedSlot||t.parentNode||xk(t)&&t.host||Ja(t);return xk(e)?e.host:e}function Ck(t){let e=Jr(t);return Ko(e)?t.ownerDocument?t.ownerDocument.body:t.body:er(e)&&Cs(e)?e:Ck(e)}function _s(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);let n=Ck(t),o=n===((r=t.ownerDocument)==null?void 0:r.body),i=ra(n);if(o){let s=Wf(i);return e.concat(i,i.visualViewport||[],Cs(n)?n:[],s&&a?_s(s):[])}return e.concat(n,_s(n,[],a))}function Wf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ik(t){let e=Ua(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=er(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=Ru(a)!==o||Ru(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function My(t){return Ha(t)?t:t.contextElement}function ws(t){let e=My(t);if(!er(e))return Qa(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=Ik(e),i=(o?Ru(a.width):a.width)/r,s=(o?Ru(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var MD=Qa(0);function Ak(t){let e=ra(t);return!Gf()||!e.visualViewport?MD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function OD(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==ra(t)?!1:e}function Qo(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=My(t),i=Qa(1);e&&(r?Ha(r)&&(i=ws(r)):i=ws(t));let s=OD(o,a,r)?Ak(o):Qa(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 f=ra(o),h=r&&Ha(r)?ra(r):r,S=f,x=Wf(S);for(;x&&r&&h!==S;){let b=ws(x),g=x.getBoundingClientRect(),m=Ua(x),y=g.left+(x.clientLeft+parseFloat(m.paddingLeft))*b.x,v=g.top+(x.clientTop+parseFloat(m.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=y,u+=v,S=ra(x),x=Wf(S)}}return Xo({width:c,height:d,x:l,y:u})}function Zf(t,e){let a=Du(t).scrollLeft;return e?e.left+a:Qo(Ja(t)).left+a}function Ek(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Zf(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function DD(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=Ja(r),s=e?Ou(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=Qa(1),c=Qa(0),d=er(r);if((d||!d&&!o)&&((Yo(r)!=="body"||Cs(i))&&(l=Du(r)),er(r))){let h=Qo(r);u=ws(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}let f=i&&!d&&!o?Ek(i,l):Qa(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 BD(t){return Array.from(t.getClientRects())}function PD(t){let e=Ja(t),a=Du(t),r=t.ownerDocument.body,n=Kr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Kr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+Zf(t),s=-a.scrollTop;return Ua(r).direction==="rtl"&&(i+=Kr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var wk=25;function ND(t,e){let a=ra(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=Gf();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=Zf(r);if(u<=0){let c=r.ownerDocument,d=c.body,f=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-h);S<=wk&&(o-=S)}else u<=wk&&(o+=u);return{width:o,height:i,x:s,y:l}}var FD=new Set(["absolute","fixed"]);function HD(t,e){let a=Qo(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=er(t)?ws(t):Qa(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 Lk(t,e,a){let r;if(e==="viewport")r=ND(t,a);else if(e==="document")r=PD(Ja(t));else if(Ha(e))r=HD(e,a);else{let n=Ak(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Xo(r)}function Tk(t,e){let a=Jr(t);return a===e||!Ha(a)||Ko(a)?!1:Ua(a).position==="fixed"||Tk(a,e)}function UD(t,e){let a=e.get(t);if(a)return a;let r=_s(t,[],!1).filter(s=>Ha(s)&&Yo(s)!=="body"),n=null,o=Ua(t).position==="fixed",i=o?Jr(t):t;for(;Ha(i)&&!Ko(i);){let s=Ua(i),l=jf(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&FD.has(n.position)||Cs(i)&&!l&&Tk(t,i))?r=r.filter(c=>c!==i):n=s,i=Jr(i)}return e.set(t,r),r}function zD(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?Ou(e)?[]:UD(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=Lk(e,c,n);return u.top=Kr(d.top,u.top),u.right=eo(d.right,u.right),u.bottom=eo(d.bottom,u.bottom),u.left=Kr(d.left,u.left),u},Lk(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qD(t){let{width:e,height:a}=Ik(t);return{width:e,height:a}}function $D(t,e,a){let r=er(e),n=Ja(e),o=a==="fixed",i=Qo(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=Qa(0);function u(){l.x=Zf(n)}if(r||!r&&!o)if((Yo(e)!=="body"||Cs(n))&&(s=Du(e)),r){let h=Qo(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?Ek(n,s):Qa(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 Ry(t){return Ua(t).position==="static"}function kk(t,e){if(!er(t)||Ua(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return Ja(t)===a&&(a=a.ownerDocument.body),a}function Rk(t,e){let a=ra(t);if(Ou(t))return a;if(!er(t)){let n=Jr(t);for(;n&&!Ko(n);){if(Ha(n)&&!Ry(n))return n;n=Jr(n)}return a}let r=kk(t,e);for(;r&&Sk(r)&&Ry(r);)r=kk(r,e);return r&&Ko(r)&&Ry(r)&&!jf(r)?a:r||_k(t)||a}var VD=async function(t){let e=this.getOffsetParent||Rk,a=this.getDimensions,r=await a(t.floating);return{reference:$D(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jD(t){return Ua(t).direction==="rtl"}var GD={convertOffsetParentRelativeRectToViewportRelativeRect:DD,getDocumentElement:Ja,getClippingRect:zD,getOffsetParent:Rk,getElementRects:VD,getClientRects:BD,getDimensions:qD,getScale:ws,isElement:Ha,isRTL:jD};function Mk(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function WD(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:f,height:h}=u;if(s||e(),!f||!h)return;let S=Mu(d),x=Mu(n.clientWidth-(c+f)),b=Mu(n.clientHeight-(d+h)),g=Mu(c),y={rootMargin:-S+"px "+-x+"px "+-b+"px "+-g+"px",threshold:Kr(0,eo(1,l))||1},v=!0;function C(w){let _=w[0].intersectionRatio;if(_!==l){if(!v)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Mk(u,t.getBoundingClientRect())&&i(),v=!1}try{a=new IntersectionObserver(C,{...y,root:n.ownerDocument})}catch{a=new IntersectionObserver(C,y)}a.observe(t)}return i(!0),o}function Xf(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=My(t),c=n||o?[...u?_s(u):[],..._s(e)]:[];c.forEach(g=>{n&&g.addEventListener("scroll",a,{passive:!0}),o&&g.addEventListener("resize",a)});let d=u&&s?WD(u,a):null,f=-1,h=null;i&&(h=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(e)})),a()}),u&&!l&&h.observe(u),h.observe(e));let S,x=l?Qo(t):null;l&&b();function b(){let g=Qo(t);x&&!Mk(x,g)&&a(),x=g,S=requestAnimationFrame(b)}return a(),()=>{var g;c.forEach(m=>{n&&m.removeEventListener("scroll",a),o&&m.removeEventListener("resize",a)}),d?.(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(S)}}var Yf=vk;var Kf=yk,Qf=mk;var Ok=gk,Dk=hk;var Jf=(t,e,a)=>{let r=new Map,n={platform:GD,...a},o={...n.platform,_c:r};return pk(t,e,{...n,platform:o})};function ZD(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 Bk(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 r=document.createElement("div");if(r.className="syntro-tooltip",r.setAttribute("role","tooltip"),r.innerHTML=_a(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()),r.style.position="relative",r.appendChild(x)}let n=r.querySelectorAll("[data-syntro-action]"),o=x=>{let g=x.currentTarget.getAttribute("data-syntro-action");g&&a.onAction&&a.onAction(g)};n.forEach(x=>x.addEventListener("click",o));let i=document.createElement("div");i.className="syntro-tooltip-arrow",r.appendChild(i),e.appendChild(r);let s=[Yf(a.offsetPx??8),Qf(),Kf({padding:8}),Ok(),Dk({element:i})],l=a.placement&&a.placement!=="auto"?a.placement:"top",u=Xf(t,r,async()=>{if(!t.isConnected){S.destroy();return}let x=ZD(t),b=await Jf(x,r,{placement:l,strategy:"fixed",middleware:s}),{x:g,y:m,strategy:y,middlewareData:v,placement:C}=b;if(Object.assign(r.style,{left:`${g}px`,top:`${m}px`,position:y}),v.arrow){let{x:w,y:_}=v.arrow,L=C.split("-")[0],A={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(i.style,{left:w!=null?`${w}px`:"",top:_!=null?`${_}px`:"",right:"",bottom:"",[A[L]]:"-4px"});let I={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};i.style.transform=`rotate(${I[L]||"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(r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(x.length>0){let b=x[0],g=x[x.length-1],m=y=>{y.key==="Tab"&&(y.shiftKey?document.activeElement===b&&(g.focus(),y.preventDefault()):document.activeElement===g&&(b.focus(),y.preventDefault()))};r.addEventListener("keydown",m),requestAnimationFrame(()=>b.focus())}}let h=(()=>{if(a.trigger==="hover"){let x=null,b=()=>{x&&(clearTimeout(x),x=null),r.style.visibility="visible",r.style.opacity="1"},g=()=>{x=setTimeout(()=>{r.style.visibility="hidden",r.style.opacity="0",x=null},100)};return r.style.visibility="hidden",r.style.opacity="0",r.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",b),t.addEventListener("mouseleave",g),r.addEventListener("mouseenter",b),r.addEventListener("mouseleave",g),t.addEventListener("focus",b),t.addEventListener("blur",g),()=>{x&&clearTimeout(x),t.removeEventListener("mouseenter",b),t.removeEventListener("mouseleave",g),r.removeEventListener("mouseenter",b),r.removeEventListener("mouseleave",g),t.removeEventListener("focus",b),t.removeEventListener("blur",g)}}if(a.trigger==="click"){let x=()=>{r.style.visibility==="visible"?S.destroy():(r.style.visibility="visible",r.style.opacity="1")};return r.style.visibility="hidden",r.style.opacity="0",r.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",x),()=>t.removeEventListener("click",x)}return r.style.opacity="0",r.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{r.style.opacity="1"}),()=>{}})(),S={el:r,destroy(){u(),h(),window.removeEventListener("keydown",c),n.forEach(x=>x.removeEventListener("click",o)),a.blocking&&Array.from(document.body.children).forEach(x=>{x!==e&&x.removeAttribute("inert")}),r.style.pointerEvents="none",r.style.opacity="0",setTimeout(()=>{try{r.remove()}catch{}},200)}};return S}var Oy=K(Ee(),1),Xe=K(Ke(),1),zk=K(Go(),1);var We=K(Ee(),1);function KD({completed:t,total:e}){let a=e>0?Math.round(t/e*100):0;return(0,We.jsx)("div",{className:"se-w-full se-h-1.5 se-rounded-full se-bg-white/[0.08] se-overflow-hidden",children:(0,We.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 QD({step:t,isCompleted:e,isCurrent:a,tourId:r,onStepClick:n}){return(0,We.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,We.jsx)("span",{className:"se-shrink-0 se-w-4 se-text-center",children:e?(0,We.jsx)("span",{role:"img","aria-label":"completed",className:"se-text-green-5",children:"\u2713"}):a?(0,We.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-blue-5"}):(0,We.jsx)("span",{className:"se-inline-block se-w-1.5 se-h-1.5 se-rounded-full se-bg-white/[0.12]"})}),(0,We.jsx)("span",{className:"se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap",children:t.title})]})}function JD({workflow:t,expanded:e,onStepClick:a,onDismiss:r}){let n=t.completedSteps.length,o=t.steps.length;return(0,We.jsxs)("div",{className:"se-p-3 se-rounded-lg se-border se-border-white/[0.08] se-bg-white/[0.02]",children:[(0,We.jsxs)("div",{className:"se-flex se-items-center se-gap-2 se-mb-2",children:[t.meta.icon&&(0,We.jsx)("span",{"data-testid":"workflow-icon",className:"se-shrink-0 se-text-sm",children:t.meta.icon}),(0,We.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,We.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,We.jsxs)("div",{className:"se-mb-2",children:[(0,We.jsx)(KD,{completed:n,total:o}),(0,We.jsxs)("div",{className:"se-text-[10px] se-text-slate-grey-7 se-mt-1",children:[n," of ",o," steps"]})]}),(0,We.jsx)("div",{className:"se-flex se-flex-col",children:t.steps.map(i=>(0,We.jsx)(QD,{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,We.jsx)("div",{className:"se-mt-2 se-text-[11px] se-text-slate-grey-7",children:t.meta.description})]})}function Hk({workflows:t,expanded:e,onStepClick:a,onDismiss:r}){return t.length===0?(0,We.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,We.jsx)("div",{className:"se-flex se-flex-col se-gap-2",children:t.map(n=>(0,We.jsx)(JD,{workflow:n,expanded:e,onStepClick:a,onDismiss:r},n.tourId))})}function Uk(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 r,n=setTimeout(()=>{e.style.opacity="0",r=setTimeout(()=>{e.remove()},300)},4e3);return()=>{clearTimeout(n),clearTimeout(r),e.remove()}}function eB(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 tB({runtime:t}){let[e,a]=(0,Xe.useState)(0),r=(0,Xe.useMemo)(()=>{let b=t?.actions?.getActive?.()||[];return eB(b)},[t,e]),n=(0,Xe.useRef)(r);n.current=r,(0,Xe.useEffect)(()=>{if(t?.events?.subscribe)return t.events.subscribe({names:["tour.started","tour.resumed"]},()=>a(b=>b+1))},[t]);let o=(0,Xe.useMemo)(()=>t?.state?.user?.ns?.("workflows"),[t]),i=(0,Xe.useRef)(new Set),s=(0,Xe.useRef)([]),l=(0,Xe.useRef)(null),u=(0,Xe.useRef)({}),[c,d]=(0,Xe.useState)([]),f=(0,Xe.useRef)(!1);if(!f.current&&o){let b=o.get?.("notified")||[];for(let m of b)i.current.add(m);let g=o.get?.("completed")||{};u.current={...g},f.current=!0}(0,Xe.useEffect)(()=>{if(r.size===0)return;let b=o?.get?.("dismissed")||[],g=o?.get?.("completed")||{};d(m=>{let y=new Set(m.map(C=>C.tourId)),v=[];for(let[C,{meta:w,steps:_}]of r){if(y.has(C))continue;let L="active";b.includes(C)?L="dismissed":g[C]&&(L="completed"),v.push({tourId:C,meta:w,steps:_,currentStepId:null,completedSteps:[],status:L,completedAt:g[C]||void 0})}return v.length>0?[...m,...v]:m});for(let[m,{meta:y}]of r)if(!i.current.has(m)&&y.notification&&!b.includes(m)&&!g[m]){i.current.add(m),o?.set?.("notified",[...i.current]);let v=Uk(y.notification);s.current.push(v)}},[r,o]),(0,Xe.useEffect)(()=>{if(!t?.events?.subscribe)return;let b=t.events.subscribe({patterns:["^tour\\."]},g=>{let m=g.props?.tourId;if(!m)return;let y=n.current;if(!y.has(m)&&g.name==="tour.started"){a(v=>v+1);return}y.has(m)&&d(v=>v.map(w=>{if(w.tourId!==m)return w;switch(g.name){case"tour.started":{let _=g.props?.startStepId||w.steps[0]?.id||null;if(!i.current.has(m)){i.current.add(m),o?.set?.("notified",[...i.current]);let A=y.get(m);if(A?.meta.notification){let I=Uk(A.meta.notification);s.current.push(I)}}let L=v.filter(A=>A.status==="active"||A.tourId===m).map(A=>A.tourId);return L.includes(m)||L.push(m),o?.set?.("active",[...new Set(L)]),{...w,status:"active",currentStepId:_,completedSteps:w.status==="active"?w.completedSteps:[]}}case"tour.step_started":{let _=g.props?.stepId;return{...w,currentStepId:_||w.currentStepId}}case"tour.step_changed":{let _=g.props?.previousStepId,L=g.props?.nextStepId,A=_&&!w.completedSteps.includes(_)?[...w.completedSteps,_]:w.completedSteps;return{...w,currentStepId:L||w.currentStepId,completedSteps:A}}case"tour.completed":{let _=Date.now();return u.current[m]=_,o?.set?.("completed",{...u.current}),{...w,status:"completed",currentStepId:null,completedSteps:w.steps.map(L=>L.id),completedAt:_}}case"tour.paused":return w;default:return w}}))});return()=>{b();for(let g of s.current)g();s.current=[]}},[t,o]);let h=(0,Xe.useCallback)((b,g)=>{t?.events?.publish?.("workflow:jump_to_step",{tourId:b,stepId:g})},[t]),S=(0,Xe.useCallback)(b=>{d(g=>{let m=g.map(v=>v.tourId===b?{...v,status:"dismissed"}:v),y=m.filter(v=>v.status==="dismissed").map(v=>v.tourId);return o?.set?.("dismissed",y),m})},[o]),x=(0,Xe.useMemo)(()=>c.filter(b=>b.status==="active"),[c]);return(0,Oy.jsx)("div",{ref:l,children:(0,Oy.jsx)(Hk,{workflows:x,onStepClick:h,onDismiss:S})})}var qk={mount(t,e){let a=e?.runtime||null,r=(0,zk.createRoot)(t);return r.render(Xe.default.createElement(tB,{runtime:a})),()=>{r.unmount()}}};var $k=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 n=t.style?.color;if(!n)try{let i=getComputedStyle(e.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();i&&(n=i)}catch{}let o=ak(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,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")}}},Vk=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(x=>requestAnimationFrame(x));let n=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(),g=x.getPropertyValue("--sc-color-primary-hover")?.trim();b?.startsWith("#")&&b.length>=7&&(i=n(b)),g?.startsWith("#")&&g.length>=7&&(s=n(g))}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:g}=s;u.textContent=`
|
|
63
63
|
@keyframes syntro-pulse-anim {
|
|
64
64
|
0%, 100% {
|
|
65
65
|
box-shadow: 0 0 0 0 rgba(${c}, ${d}, ${f}, 0.35);
|
|
@@ -68,10 +68,10 @@ Error generating stack: `+r.message+`
|
|
|
68
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(${x}, ${b}, ${
|
|
71
|
+
box-shadow: 0 0 0 0 rgba(${x}, ${b}, ${g}, 0.35);
|
|
72
72
|
}
|
|
73
73
|
75% {
|
|
74
|
-
box-shadow: 0 0 0 12px rgba(${x}, ${b}, ${
|
|
74
|
+
box-shadow: 0 0 0 12px rgba(${x}, ${b}, ${g}, 0);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
`}else u.textContent=`
|
|
@@ -83,51 +83,51 @@ Error generating stack: `+r.message+`
|
|
|
83
83
|
box-shadow: 0 0 0 12px rgba(${c}, ${d}, ${f}, 0);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
`;document.head.appendChild(u);let
|
|
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")},r);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:r}),{cleanup:()=>{clearTimeout(S),a.isConnected&&(a.style.animation=h,a.removeAttribute("data-syntro-pulse"))}}},jk=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:()=>{try{n.remove()}catch{}a.isConnected&&i!==void 0&&(a.style.position=i)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(n.textContent=s.content)}}},Gk=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">${_a(r.title)}</div>`),n+=`<div class="syntro-tt-body">${_a(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+=`
|
|
87
87
|
<button
|
|
88
88
|
class="syntro-tt-btn ${s?"syntro-tt-btn-primary":""}"
|
|
89
|
-
data-syntro-action="${
|
|
89
|
+
data-syntro-action="${_a(i.actionId)}"
|
|
90
90
|
>
|
|
91
|
-
${
|
|
91
|
+
${_a(i.label)}
|
|
92
92
|
</button>
|
|
93
93
|
`}n+="</div>"}else r.cta&&(n+=`<div class="syntro-tt-actions">
|
|
94
94
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
95
|
-
${
|
|
95
|
+
${_a(r.cta.label)}
|
|
96
96
|
</button>
|
|
97
|
-
</div>`);let o=
|
|
97
|
+
</div>`);let o=Bk(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()}}},Dy=[{kind:"overlays:highlight",executor:$k},{kind:"overlays:pulse",executor:Vk},{kind:"overlays:badge",executor:jk},{kind:"overlays:tooltip",executor:Gk},{kind:"overlays:modal",executor:Ay},{kind:"core:tour",executor:ky},{kind:"overlays:celebrate",executor:ek}],tp={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, celebrations, visual overlays, and workflow tracking",executors:Dy,widgets:[{id:"adaptive-overlays:workflow-tracker",component:qk,metadata:{name:"Workflow Tracker",icon:"\u{1F4CB}",description:"Tracks multi-step workflow progress across tours"}}]};function ap(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 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,r),o.push(u.kind)},registerWidget:u=>{a.widgets.register(u.id,u.component,e,u.metadata),i.push(u.id)}}}function rp(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var aB=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"]),rB=new Set(["adaptive-chatbot","adaptive-content","adaptive-faq","adaptive-gamification","adaptive-nav","adaptive-overlays"]),nB={faq:"adaptive-faq",nav:"adaptive-nav",gamification:"adaptive-gamification",chatbot:"adaptive-chatbot"};function Wk(t){return nB[t]??t}function By(t){return aB.has(t)}function Py(t){if(By(t))return null;let e=t.indexOf(":");return e===-1?null:Wk(t.slice(0,e))}function np(t){let e=t.indexOf(":");return e===-1?null:Wk(t.slice(0,e))}function op(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(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()=>{n?.(x);try{let g=u(x);if(s.has(g)){let C=a.get(x);if(C)return o?.(x,!0),{appId:x,success:!0,manifest:C.manifest}}let m=new Promise((C,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${x}`)),r)}),y=d(g,x);await Promise.race([y,m]),s.add(g);let v=a.get(x);if(!v)throw new Error(`App ${x} did not register after loading`);return o?.(x,!0),{appId:x,success:!0,manifest:v.manifest}}catch(g){let m=g instanceof Error?g.message:String(g);o?.(x,!1,m);let y={appId:x,success:!1,error:m};return l.set(x,y),y}finally{i.delete(x)}})();return i.set(x,b),b}async function d(x,b){if(typeof window<"u"){try{let g=await import(x);g.manifest?a.register(g.manifest):g.default?.manifest?a.register(g.default.manifest):g.default&&a.register(g.default);return}catch{}return new Promise((g,m)=>{let y=document.createElement("script");y.src=x,y.async=!0,y.onload=()=>{a.get(b)?g():m(new Error(`App ${b} did not self-register`))},y.onerror=()=>{m(new Error(`Failed to load app script: ${x}`))},document.head.appendChild(y)})}throw new Error("Dynamic app loading not supported in SSR")}function f(x){let b=new Set;if(x.apps)for(let g of x.apps)b.add(g);if(x.actions)for(let g of x.actions){let m=Py(g.kind);if(m&&b.add(m),g.kind==="core:mountWidget"){let y=g.widget?.widgetId;if(y){let v=np(y);v&&b.add(v)}}}if(x.tiles){for(let g of x.tiles)if(g.widget){let m=np(g.widget);m&&b.add(m)}}for(let g of rB)b.delete(g);return Array.from(b)}async function h(x){let b=f(x);return b.length===0?[]:await Promise.all(b.map(m=>c(m)))}async function S(x){return Promise.all(x.map(b=>c(b)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:S,getRequiredApps:f,getAppUrl:u}}var Bu=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 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=ap({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)}rp(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()}},Ls=new Bu;var ar=K(Ee(),1);var Jo=K(Ke(),1),Fy=K(Go(),1);var en=K(Ke(),1);var Zk=/```json\s*\n([\s\S]*?)```/g;function Xk(t){let e=[],a=t,r=[],n;for(Zk.lastIndex=0;(n=Zk.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,`
|
|
98
98
|
|
|
99
|
-
`).trim(),{displayText:a,actions:e}}var
|
|
100
|
-
<div style="padding: 16px; font-family: system-ui; color: ${
|
|
101
|
-
<p style="margin: 0 0 8px; color: ${
|
|
102
|
-
<p style="margin: 0; font-size: 12px; color: ${
|
|
99
|
+
`).trim(),{displayText:a,actions:e}}var Pu=class extends Error{constructor(e){super(e),this.name="AuthError"}};function oB(){let t=document.cookie.match(/stytch_session_jwt=([^;]*)/);if(!t||!t[1])throw new Pu("No authentication token found");let e=localStorage.getItem("syntrologie_workspace_id");if(!e)throw new Pu("No workspace ID found");return{Authorization:`Bearer ${t[1]}`,"X-Workspace-Id":e}}async function Yk(t,e){let a=oB(),r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(e)});if(!r.ok)throw r.status===401?new Pu("Session expired or unauthorized"):new Error(`Chat request failed: ${r.status} ${r.statusText}`);return r.json()}var iB=0;function Ny(){return`msg-${Date.now()}-${++iB}`}function Kk(t){let{backendUrl:e,tileId:a,runtime:r,greeting:n,maxHistory:o=20,mlflowRunId:i,config:s}=t,[l,u]=(0,en.useState)(()=>n?[{id:Ny(),role:"assistant",text:n,timestamp:Date.now()}]:[]),[c,d]=(0,en.useState)(!1),[f,h]=(0,en.useState)(null),S=(0,en.useRef)(null),x=(0,en.useCallback)(async g=>{let m=g.trim();if(!m)return;h(null);let y={id:Ny(),role:"user",text:m,timestamp:Date.now()};u(v=>[...v,y]),d(!0);try{let C=[...l,y].slice(-o).map(I=>({role:I.role,content:I.text})),w=await Yk(e,{message:m,history:C,mlflow_run_id:i,current_config:s}),{displayText:_,actions:L}=Xk(w.response),A={id:Ny(),role:"assistant",text:_,timestamp:Date.now()};u(I=>[...I,A]),L.length>0&&(S.current?.isApplied()&&await S.current.revertAll(),S.current=await r.actions.applyBatch(L),r.events.publish("chatbot.actions_applied",{count:L.length,kinds:L.map(I=>I.kind),tileId:a}))}catch(v){let C=v instanceof Error?v.message:"An unexpected error occurred";h(C)}finally{d(!1)}},[e,l,o,i,s,r,a]),b=(0,en.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 tr={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:qt[4],color:Ka.white,borderBottomRightRadius:"4px"},assistantMessage:{alignSelf:"flex-start",backgroundColor:"rgba(255, 255, 255, 0.08)",color:k[10],borderBottomLeftRadius:"4px"},loadingDots:{alignSelf:"flex-start",padding:"8px 16px",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:"12px",color:k[8],fontSize:"13px"},errorBanner:{padding:"8px 12px",backgroundColor:"rgba(239, 68, 68, 0.1)",color:Ge[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:k[12],fontSize:"14px",outline:"none",fontFamily:"inherit"},sendButton:{padding:"8px 16px",borderRadius:"8px",border:"none",backgroundColor:qt[4],color:Ka.white,fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap"},sendButtonDisabled:{opacity:.5,cursor:"not-allowed"}};function sB({message:t}){let e=t.role==="user",a={...tr.messageBubble,...e?tr.userMessage:tr.assistantMessage};return(0,ar.jsx)("div",{style:a,children:t.text})}function lB({config:t,runtime:e,tileId:a}){let{messages:r,isLoading:n,error:o,sendMessage:i,clearMessages:s}=Kk({backendUrl:t.backendUrl,tileId:a,runtime:e,greeting:t.greeting,maxHistory:t.maxHistory,mlflowRunId:t.mlflowRunId}),l=(0,Jo.useRef)(null),u=(0,Jo.useRef)(null);(0,Jo.useEffect)(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[]);let c=d=>{d.preventDefault();let f=u.current;if(!f||!f.value.trim()||n)return;let h=f.value;f.value="",i(h)};return(0,ar.jsxs)("div",{style:tr.container,"data-testid":"chat-assistant",children:[(0,ar.jsxs)("div",{ref:l,style:tr.messageList,children:[r.map(d=>(0,ar.jsx)(sB,{message:d},d.id)),n&&(0,ar.jsx)("div",{style:tr.loadingDots,children:"Thinking..."})]}),o&&(0,ar.jsx)("div",{style:tr.errorBanner,children:o}),(0,ar.jsxs)("form",{onSubmit:c,style:tr.inputForm,children:[(0,ar.jsx)("input",{ref:u,style:tr.input,placeholder:"Ask anything...",disabled:n,"data-testid":"chat-input"}),(0,ar.jsx)("button",{type:"submit",disabled:n,style:{...tr.sendButton,...n?tr.sendButtonDisabled:{}},"data-testid":"chat-send",children:"Send"})]})]})}var Qk={mount(t,e){let{config:a,runtime:r,tileId:n="chatbot-widget"}=e||{};if(a&&r&&typeof Fy.createRoot=="function"){let o=(0,Fy.createRoot)(t);return o.render(Jo.default.createElement(lB,{config:a,runtime:r,tileId:n})),()=>{o.unmount()}}return!a||!r?(t.innerHTML=`<div style="padding: 16px; color: ${k[8]};">Chat widget requires config and runtime.</div>`,()=>{t.innerHTML=""}):(t.innerHTML=`
|
|
100
|
+
<div style="padding: 16px; font-family: system-ui; color: ${k[10]};">
|
|
101
|
+
<p style="margin: 0 0 8px; color: ${k[8]};">${a.greeting||"Hi! How can I help?"}</p>
|
|
102
|
+
<p style="margin: 0; font-size: 12px; color: ${k[7]};">Chat widget mounted. Awaiting React renderer.</p>
|
|
103
103
|
</div>
|
|
104
|
-
`,()=>{t.innerHTML=""})}};var
|
|
105
|
-
]`).replace("lheading",
|
|
104
|
+
`,()=>{t.innerHTML=""})}};var Jk={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:Qk,metadata:{name:"Chat Assistant",description:"AI-powered chat assistant that can execute DOM actions",icon:"\u{1F4AC}"}}]};function eI(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 uB(t,e,a){let r=eI(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 cB(t,e,a){let r=eI(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 dB(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 tI=[{kind:"faq:scroll_to",executor:uB},{kind:"faq:toggle_item",executor:cB},{kind:"faq:update",executor:dB}];var qe=K(Ee(),1);function qy(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ai=qy();function lI(t){ai=t}var ei={exec:()=>null};function xe(t,e=""){let a=typeof t=="string"?t:t.source,r={replace:(n,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace($t.caret,"$1"),a=a.replace(n,i),r},getRegex:()=>new RegExp(a,e)};return r}var fB=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$t={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,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"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},pB=/^(?:[ \t]*(?:\n|$))+/,hB=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mB=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Uu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gB=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$y=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,uI=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cI=xe(uI).replace(/bull/g,$y).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(),vB=xe(uI).replace(/bull/g,$y).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(),Vy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yB=/^[^\n]+/,jy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xB=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jy).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bB=xe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$y).getRegex(),dp="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",Gy=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,SB=xe("^ {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",Gy).replace("tag",dp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dI=xe(Vy).replace("hr",Uu).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dp).getRegex(),_B=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dI).getRegex(),Wy={blockquote:_B,code:hB,def:xB,fences:mB,heading:gB,hr:Uu,html:SB,lheading:cI,list:bB,newline:pB,paragraph:dI,table:ei,text:yB},aI=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Uu).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dp).getRegex(),CB={...Wy,lheading:vB,table:aI,paragraph:xe(Vy).replace("hr",Uu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",aI).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dp).getRegex()},wB={...Wy,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gy).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:ei,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(Vy).replace("hr",Uu).replace("heading",` *#{1,6} *[^
|
|
105
|
+
]`).replace("lheading",cI).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},LB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fI=/^( {2,}|\\)\n(?!\s*$)/,IB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fp=/[\p{P}\p{S}]/u,Zy=/[\s\p{P}\p{S}]/u,pI=/[^\s\p{P}\p{S}]/u,AB=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zy).getRegex(),hI=/(?!~)[\p{P}\p{S}]/u,EB=/(?!~)[\s\p{P}\p{S}]/u,TB=/(?:[^\s\p{P}\p{S}]|~)/u,mI=/(?![*_])[\p{P}\p{S}]/u,RB=/(?![*_])[\s\p{P}\p{S}]/u,MB=/(?:[^\s\p{P}\p{S}]|[*_])/u,OB=xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",fB?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),gI=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,DB=xe(gI,"u").replace(/punct/g,fp).getRegex(),BB=xe(gI,"u").replace(/punct/g,hI).getRegex(),vI="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",PB=xe(vI,"gu").replace(/notPunctSpace/g,pI).replace(/punctSpace/g,Zy).replace(/punct/g,fp).getRegex(),NB=xe(vI,"gu").replace(/notPunctSpace/g,TB).replace(/punctSpace/g,EB).replace(/punct/g,hI).getRegex(),FB=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,pI).replace(/punctSpace/g,Zy).replace(/punct/g,fp).getRegex(),HB=xe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,mI).getRegex(),UB="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zB=xe(UB,"gu").replace(/notPunctSpace/g,MB).replace(/punctSpace/g,RB).replace(/punct/g,mI).getRegex(),qB=xe(/\\(punct)/,"gu").replace(/punct/g,fp).getRegex(),$B=xe(/^<(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(),VB=xe(Gy).replace("(?:-->|$)","-->").getRegex(),jB=xe("^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",VB).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,GB=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",lp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yI=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",lp).replace("ref",jy).getRegex(),xI=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",jy).getRegex(),WB=xe("reflink|nolink(?!\\()","g").replace("reflink",yI).replace("nolink",xI).getRegex(),rI=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xy={_backpedal:ei,anyPunctuation:qB,autolink:$B,blockSkip:OB,br:fI,code:kB,del:ei,delLDelim:ei,delRDelim:ei,emStrongLDelim:DB,emStrongRDelimAst:PB,emStrongRDelimUnd:FB,escape:LB,link:GB,nolink:xI,punctuation:AB,reflink:yI,reflinkSearch:WB,tag:jB,text:IB,url:ei},ZB={...Xy,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",lp).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lp).getRegex()},Hy={...Xy,emStrongRDelimAst:NB,emStrongLDelim:BB,delLDelim:HB,delRDelim:zB,url:xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",rI).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",rI).getRegex()},XB={...Hy,br:xe(fI).replace("{2,}","*").getRegex(),text:xe(Hy.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ip={normal:Wy,gfm:CB,pedantic:wB},Nu={normal:Xy,gfm:Hy,breaks:XB,pedantic:ZB},YB={"&":"&","<":"<",">":">",'"':""","'":"'"},nI=t=>YB[t];function Sr(t,e){if(e){if($t.escapeTest.test(t))return t.replace($t.escapeReplace,nI)}else if($t.escapeTestNoEncode.test(t))return t.replace($t.escapeReplaceNoEncode,nI);return t}function oI(t){try{t=encodeURI(t).replace($t.percentDecode,"%")}catch{return null}return t}function iI(t,e){let a=t.replace($t.findPipe,(o,i,s)=>{let l=!1,u=i;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),r=a.split($t.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace($t.slashPipe,"|");return r}function Fu(t,e,a){let r=t.length;if(r===0)return"";let n=0;for(;n<r;){let o=t.charAt(r-n-1);if(o===e&&!a)n++;else if(o!==e&&a)n++;else break}return t.slice(0,r-n)}function KB(t,e){if(t.indexOf(e[1])===-1)return-1;let a=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])a++;else if(t[r]===e[1]&&(a--,a<0))return r;return a>0?-2:-1}function QB(t,e=0){let a=e,r="";for(let n of t)if(n===" "){let o=4-a%4;r+=" ".repeat(o),a+=o}else r+=n,a++;return r}function sI(t,e,a,r,n){let o=e.href,i=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:a,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function JB(t,e,a){let r=t.match(a.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
|
|
106
106
|
`).map(o=>{let i=o.match(a.other.beginningSpace);if(i===null)return o;let[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(`
|
|
107
|
-
`)}var
|
|
108
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let a=e[0],r=
|
|
109
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let a=
|
|
107
|
+
`)}var up=class{constructor(t){B(this,"options");B(this,"rules");B(this,"lexer");this.options=t||ai}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:Fu(a,`
|
|
108
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let a=e[0],r=JB(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:r}}}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 r=Fu(a,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(a=r.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:Fu(e[0],`
|
|
109
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let a=Fu(e[0],`
|
|
110
110
|
`).split(`
|
|
111
111
|
`),r="",n="",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
112
|
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
113
113
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
114
114
|
${u}`:u,n=n?`${n}
|
|
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
|
|
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
116
|
`+a.join(`
|
|
117
|
-
`),x=this.blockquote(S);o[o.length-1]=x,r=r.substring(0,r.length-
|
|
117
|
+
`),x=this.blockquote(S);o[o.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,n=n.substring(0,n.length-h.text.length)+x.text;break}else if(f?.type==="list"){let h=f,S=h.raw+`
|
|
118
118
|
`+a.join(`
|
|
119
|
-
`),x=this.list(S);o[o.length-1]=x,r=r.substring(0,r.length-f.raw.length)+x.raw,n=n.substring(0,n.length-
|
|
120
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let a=e[1].trim(),r=a.length>1,n={type:"list",raw:"",ordered:r,start:r?+a.slice(0,-1):"",loose:!1,items:[]};a=r?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=r?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=
|
|
119
|
+
`),x=this.list(S);o[o.length-1]=x,r=r.substring(0,r.length-f.raw.length)+x.raw,n=n.substring(0,n.length-h.raw.length)+x.raw,a=S.substring(o.at(-1).raw.length).split(`
|
|
120
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let a=e[1].trim(),r=a.length>1,n={type:"list",raw:"",ordered:r,start:r?+a.slice(0,-1):"",loose:!1,items:[]};a=r?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=r?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=QB(e[2].split(`
|
|
121
121
|
`,1)[0],e[1].length),f=t.split(`
|
|
122
|
-
`,1)[0],
|
|
123
|
-
`,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(S),b=this.rules.other.hrRegex(S),
|
|
124
|
-
`,1)[0],w;if(f=C,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),w=f):w=f.replace(this.rules.other.tabCharGlobal," "),
|
|
125
|
-
`+w.slice(S);else{if(
|
|
126
|
-
`+f}
|
|
127
|
-
`,t=t.substring(C.length+1),d=w.slice(S)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0)),n.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=u}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let l of n.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=c.checked,n.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!n.loose){let u=l.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=c}}if(n.loose)for(let l of n.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return n}}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," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=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:r,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let a=
|
|
128
|
-
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(a.length===r.length){for(let i of r)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 n)o.rows.push(
|
|
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=
|
|
130
|
-
`),this.blockTokens(e,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let r=this.inlineQueue[a];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,a=[],r=!1){for(this.options.pedantic&&(e=e.replace(
|
|
122
|
+
`,1)[0],h=!d.trim(),S=0;if(this.options.pedantic?(S=2,c=d.trimStart()):h?S=e[1].length+1:(S=d.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 x=this.rules.other.nextBulletRegex(S),b=this.rules.other.hrRegex(S),g=this.rules.other.fencesBeginRegex(S),m=this.rules.other.headingBeginRegex(S),y=this.rules.other.htmlBeginRegex(S),v=this.rules.other.blockquoteBeginRegex(S);for(;t;){let C=t.split(`
|
|
124
|
+
`,1)[0],w;if(f=C,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),w=f):w=f.replace(this.rules.other.tabCharGlobal," "),g.test(f)||m.test(f)||y.test(f)||v.test(f)||x.test(f)||b.test(f))break;if(w.search(this.rules.other.nonSpaceChar)>=S||!f.trim())c+=`
|
|
125
|
+
`+w.slice(S);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(d)||m.test(d)||b.test(d))break;c+=`
|
|
126
|
+
`+f}h=!f.trim(),u+=C+`
|
|
127
|
+
`,t=t.substring(C.length+1),d=w.slice(S)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0)),n.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=u}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let l of n.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=c.checked,n.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!n.loose){let u=l.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=c}}if(n.loose)for(let l of n.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return n}}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," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=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:r,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let a=iI(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
128
|
+
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(a.length===r.length){for(let i of r)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 n)o.rows.push(iI(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=Fu(a.slice(0,-1),"\\");if((a.length-o.length)%2===0)return}else{let o=KB(e[2],"()");if(o===-2)return;if(o>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],n=o[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?r=r.slice(1):r=r.slice(1,-1)),sI(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.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 r=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[r.toLowerCase()];if(!n){let o=a[0].charAt(0);return{type:"text",raw:o,text:o}}return sI(a,n,a[0],this.lexer,this.rules)}}emStrong(t,e,a=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!a||this.rules.inline.punctuation.exec(a))){let n=[...r[0]].length-1,o,i,s=n,l=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+n);(r=u.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){s+=i;continue}else if((r[5]||r[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+l);let c=[...r[0]][0].length,d=t.slice(0,n+r.index+c+i);if(Math.min(n,i)%2){let h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let a=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(a),n=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return r&&n&&(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,e,a=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!a||this.rules.inline.punctuation.exec(a))){let n=[...r[0]].length-1,o,i,s=n,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+n);(r=l.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(i=[...o].length,i!==n))continue;if(r[3]||r[4]){s+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s);let u=[...r[0]][0].length,c=t.slice(0,n+r.index+u+i),d=c.slice(n,-n);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let a,r;return e[2]==="@"?(a=e[1],r="mailto:"+a):(a=e[1],r=a),{type:"link",raw:e[0],text:a,href:r,tokens:[{type:"text",raw:a,text:a}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let a,r;if(e[2]==="@")a=e[0],r="mailto:"+a;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);a=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:a,href:r,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}}}},rr=class Uy{constructor(e){B(this,"tokens");B(this,"options");B(this,"state");B(this,"inlineQueue");B(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ai,this.options.tokenizer=this.options.tokenizer||new up,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:$t,block:ip.normal,inline:Nu.normal};this.options.pedantic?(a.block=ip.pedantic,a.inline=Nu.pedantic):this.options.gfm&&(a.block=ip.gfm,this.options.breaks?a.inline=Nu.breaks:a.inline=Nu.gfm),this.tokenizer.rules=a}static get rules(){return{block:ip,inline:Nu}}static lex(e,a){return new Uy(a).lex(e)}static lexInline(e,a){return new Uy(a).inlineTokens(e)}lex(e){e=e.replace($t.carriageReturn,`
|
|
130
|
+
`),this.blockTokens(e,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let r=this.inlineQueue[a];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,a=[],r=!1){for(this.options.pedantic&&(e=e.replace($t.tabCharGlobal," ").replace($t.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,a))?(e=e.substring(n.raw.length),a.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=a.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
|
|
131
131
|
`:a.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=a.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
132
132
|
`)?"":`
|
|
133
133
|
`)+n.raw,i.text+=`
|
|
@@ -140,9 +140,9 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
140
140
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=a.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
141
141
|
`)?"":`
|
|
142
142
|
`)+n.raw,i.text+=`
|
|
143
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(n);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 r=e,n=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=n[2]?n[2].length:0,r=r.slice(0,n.index+o)+"["+"a".repeat(n[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,s="";for(;e;){i||(s=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,a))?(e=e.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=a.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(l=this.tokenizer.emStrong(e,r,s)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.del(e,r,s)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),a.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),a.push(l);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(
|
|
144
|
-
`;return r?'<pre><code class="language-'+
|
|
145
|
-
`:"<pre><code>"+(a?n:
|
|
143
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):a.push(n);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 r=e,n=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=n[2]?n[2].length:0,r=r.slice(0,n.index+o)+"["+"a".repeat(n[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,s="";for(;e;){i||(s=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,a))?(e=e.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=a.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(l=this.tokenizer.emStrong(e,r,s)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.del(e,r,s)){e=e.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),a.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),a.push(l);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),i=!0;let c=a.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):a.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return a}},cp=class{constructor(t){B(this,"options");B(this,"parser");this.options=t||ai}space(t){return""}code({text:t,lang:e,escaped:a}){let r=(e||"").match($t.notSpaceStart)?.[0],n=t.replace($t.endingNewline,"")+`
|
|
144
|
+
`;return r?'<pre><code class="language-'+Sr(r)+'">'+(a?n:Sr(n,!0))+`</code></pre>
|
|
145
|
+
`:"<pre><code>"+(a?n:Sr(n,!0))+`</code></pre>
|
|
146
146
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
147
147
|
${this.parser.parse(t)}</blockquote>
|
|
148
148
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
@@ -158,33 +158,33 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
158
158
|
`}tablerow({text:t}){return`<tr>
|
|
159
159
|
${t}</tr>
|
|
160
160
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),a=t.header?"th":"td";return(t.align?`<${a} align="${t.align}">`:`<${a}>`)+e+`</${a}>
|
|
161
|
-
`}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>${
|
|
162
|
-
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Xr(a.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(a);throw a}}},Hi=new fb;function He(t,e){return Hi.parse(t,e)}He.options=He.setOptions=function(t){return Hi.setOptions(t),He.defaults=Hi.defaults,yA(He.defaults),He};He.getDefaults=rb;He.defaults=Ui;He.use=function(...t){return Hi.use(...t),He.defaults=Hi.defaults,yA(He.defaults),He};He.walkTokens=function(t,e){return Hi.walkTokens(t,e)};He.parseInline=Hi.parseInline;He.Parser=kr;He.parser=kr.parse;He.Renderer=fh;He.TextRenderer=db;He.Lexer=wr;He.lexer=wr.lex;He.Tokenizer=dh;He.Hooks=zc;He.parse=He;var g$=He.options,v$=He.setOptions,y$=He.use,x$=He.walkTokens,b$=He.parseInline;var S$=kr.parse,_$=wr.lex;var $e=ae(st(),1),pb=ae(Ei(),1);var Gt={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"}},zi={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${L[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:ia[8],color:ia[2]},categoryHeader:{color:L[7]},emptyState:{color:L[8]},feedbackPrompt:{color:L[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${L[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:ia[0],color:ia[6]},categoryHeader:{color:L[8]},emptyState:{color:L[7]},feedbackPrompt:{color:L[8]}}};var OP=new fb({async:!1,gfm:!0,breaks:!0});function TA(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function DP(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=OP.parse(t.content);return(0,Qe.jsx)("div",{style:{margin:0},"data-faq-markdown":"",dangerouslySetInnerHTML:{__html:e}})}function NP(t){return t?t===!0?{style:"thumbs"}:t:null}function BP(t){return t.prompt||"Was this helpful?"}function PP({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,$e.useState)(!1),d=zi[o],{question:f,answer:p}=t.config,S={...Gt.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)"}},x={...Gt.question,...d.question,...u?d.questionHover:{}},b={...Gt.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},m={...Gt.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},h={...Gt.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:n,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:[DP(p),e&&i&&(0,Qe.jsxs)("div",{style:h,children:[(0,Qe.jsx)("span",{children:BP(i)}),(0,Qe.jsx)("button",{type:"button",style:{...Gt.feedbackButton,...s==="up"?Gt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,f,"up"),children:"\u{1F44D}"}),(0,Qe.jsx)("button",{type:"button",style:{...Gt.feedbackButton,...s==="down"?Gt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,f,"down"),children:"\u{1F44E}"})]})]})]})}function FP({config:t,runtime:e,instanceId:a}){let[r,n]=(0,$e.useReducer)(R=>R+1,0),[o,i]=(0,$e.useState)(new Set),[s,l]=(0,$e.useState)(null),[u,c]=(0,$e.useState)(""),[d,f]=(0,$e.useState)(new Map),p=(0,$e.useMemo)(()=>NP(t.feedback),[t.feedback]);(0,$e.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,$e.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,$e.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let E=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(N=>{let O=N.props?.actionId;return typeof O=="string"&&O.startsWith("faq:open:")}).pop();if(E&&Date.now()-E.ts<1e4){let N=E.props.actionId.replace("faq:open:","");i(new Set([N])),requestAnimationFrame(()=>{let O=document.querySelector(`[data-faq-item-id="${N}"]`);O&&O.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},U=>{let E=U.props?.actionId;if(typeof E!="string"||!E.startsWith("faq:open:"))return;let N=E.replace("faq:open:","");i(new Set([N])),requestAnimationFrame(()=>{let O=document.querySelector(`[data-faq-item-id="${N}"]`);O&&O.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,$e.useEffect)(()=>{if(!e.events.subscribe)return;let R=E=>{let N=E.props?.tileId,O=E.props?.itemId;N===a&&O&&(i(new Set([O])),l(O),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let H=document.querySelector(`[data-faq-item-id="${O}"]`);H&&H.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let N=e.events.getRecent({names:["notification.deep_link"]},5).filter(O=>O.props?.tileId===a&&O.props?.itemId).pop();N&&Date.now()-N.ts<1e4&&R(N)}return e.events.subscribe({names:["notification.deep_link"]},R)},[e,a]);let S=(0,$e.useMemo)(()=>(t.actions??[]).filter(R=>R.triggerWhen?e.evaluateSync(R.triggerWhen).value:!0),[t.actions,e,r]),x=(0,$e.useMemo)(()=>t.ordering==="priority"?[...S].sort((R,U)=>(U.config.priority??0)-(R.config.priority??0)):S,[S,t.ordering]),b=(0,$e.useMemo)(()=>{if(!t.searchable||!u.trim())return x;let R=u.toLowerCase();return x.filter(U=>U.config.question.toLowerCase().includes(R)||TA(U.config.answer).toLowerCase().includes(R)||U.config.category?.toLowerCase().includes(R))},[x,u,t.searchable]),m=(0,$e.useMemo)(()=>{let R=new Map;for(let U of b){let E=U.config.category;R.has(E)||R.set(E,[]),R.get(E).push(U)}return R},[b]),h=(0,$e.useMemo)(()=>b.some(R=>R.config.category),[b]),g=(0,$e.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),y=(0,$e.useCallback)(R=>{i(U=>{let E=new Set(U);return t.expandBehavior==="single"?U.has(R)?new Set:new Set([R]):(U.has(R)?E.delete(R):E.add(R),E)}),e.events.publish("faq:toggled",{instanceId:a,questionId:R,expanded:!o.has(R),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),C=(0,$e.useCallback)((R,U,E)=>{f(N=>{let O=new Map(N);return O.set(R,E),O}),e.events.publish("faq:feedback",{itemId:R,question:U,value:E})},[e.events]),w={...Gt.container,...zi[g].container},_={...Gt.searchInput,...zi[g].searchInput},k={...Gt.emptyState,...zi[g].emptyState},A={...Gt.categoryHeader,...zi[g].categoryHeader},I=R=>R.map((U,E)=>(0,Qe.jsx)(PP,{item:U,isExpanded:o.has(U.config.id),isHighlighted:s===U.config.id,isLast:E===R.length-1,onToggle:()=>y(U.config.id),theme:g,feedbackConfig:p,feedbackValue:d.get(U.config.id),onFeedback:C},U.config.id));return S.length===0?(0,Qe.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,Qe.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,Qe.jsxs)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,Qe.jsxs)("div",{style:Gt.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:R=>c(R.target.value),style:_})]}),(0,Qe.jsx)("div",{style:Gt.accordion,children:h?Array.from(m.entries()).map(([R,U])=>(0,Qe.jsxs)($e.default.Fragment,{children:[R&&(0,Qe.jsx)("div",{style:A,"data-category-header":R,children:R}),I(U)]},R??"__ungrouped")):I(b)}),t.searchable&&b.length===0&&u&&(0,Qe.jsxs)("div",{style:{...Gt.noResults,...zi[g].emptyState},children:['No questions found matching "',u,'"']})]})}var RA={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof pb.createRoot=="function"){let i=(0,pb.createRoot)(t);return i.render($e.default.createElement(FP,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
161
|
+
`}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>${Sr(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 r=this.parser.parseInline(a),n=oI(t);if(n===null)return r;t=n;let o='<a href="'+t+'"';return e&&(o+=' title="'+Sr(e)+'"'),o+=">"+r+"</a>",o}image({href:t,title:e,text:a,tokens:r}){r&&(a=this.parser.parseInline(r,this.parser.textRenderer));let n=oI(t);if(n===null)return Sr(a);t=n;let o=`<img src="${t}" alt="${Sr(a)}"`;return e&&(o+=` title="${Sr(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Sr(t.text)}},Yy=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""}checkbox({raw:t}){return t}},nr=class zy{constructor(e){B(this,"options");B(this,"renderer");B(this,"textRenderer");this.options=e||ai,this.options.renderer=this.options.renderer||new cp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yy}static parse(e,a){return new zy(a).parse(e)}static parseInline(e,a){return new zy(a).parseInline(e)}parse(e){let a="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){a+=s||"";continue}}let o=n;switch(o.type){case"space":{a+=this.renderer.space(o);break}case"hr":{a+=this.renderer.hr(o);break}case"heading":{a+=this.renderer.heading(o);break}case"code":{a+=this.renderer.code(o);break}case"table":{a+=this.renderer.table(o);break}case"blockquote":{a+=this.renderer.blockquote(o);break}case"list":{a+=this.renderer.list(o);break}case"checkbox":{a+=this.renderer.checkbox(o);break}case"html":{a+=this.renderer.html(o);break}case"def":{a+=this.renderer.def(o);break}case"paragraph":{a+=this.renderer.paragraph(o);break}case"text":{a+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return a}parseInline(e,a=this.renderer){let r="";for(let n=0;n<e.length;n++){let o=e[n];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)){r+=s||"";continue}}let i=o;switch(i.type){case"escape":{r+=a.text(i);break}case"html":{r+=a.html(i);break}case"link":{r+=a.link(i);break}case"image":{r+=a.image(i);break}case"checkbox":{r+=a.checkbox(i);break}case"strong":{r+=a.strong(i);break}case"em":{r+=a.em(i);break}case"codespan":{r+=a.codespan(i);break}case"br":{r+=a.br(i);break}case"del":{r+=a.del(i);break}case"text":{r+=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 r}},sp,Hu=(sp=class{constructor(t){B(this,"options");B(this,"block");this.options=t||ai}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?rr.lex:rr.lexInline}provideParser(){return this.block?nr.parse:nr.parseInline}},B(sp,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),B(sp,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),sp),Ky=class{constructor(...t){B(this,"defaults",qy());B(this,"options",this.setOptions);B(this,"parse",this.parseMarkdown(!0));B(this,"parseInline",this.parseMarkdown(!1));B(this,"Parser",nr);B(this,"Renderer",cp);B(this,"TextRenderer",Yy);B(this,"Lexer",rr);B(this,"Tokenizer",up);B(this,"Hooks",Hu);this.use(...t)}walkTokens(t,e){let a=[];for(let r of t)switch(a=a.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let o of n.header)a=a.concat(this.walkTokens(o.tokens,e));for(let o of n.rows)for(let i of o)a=a.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;a=a.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let i=n[o].flat(1/0);a=a.concat(this.walkTokens(i,e))}):n.tokens&&(a=a.concat(this.walkTokens(n.tokens,e)))}}return a}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(a=>{let r={...a};if(r.async=this.defaults.async||r.async||!1,a.extensions&&(a.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=e.renderers[n.name];o?e.renderers[n.name]=function(...i){let s=n.renderer.apply(this,i);return s===!1&&(s=o.apply(this,i)),s}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[n.level];o?o.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),a.renderer){let n=this.defaults.renderer||new cp(this.defaults);for(let o in a.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,s=a.renderer[i],l=n[i];n[i]=(...u)=>{let c=s.apply(n,u);return c===!1&&(c=l.apply(n,u)),c||""}}r.renderer=n}if(a.tokenizer){let n=this.defaults.tokenizer||new up(this.defaults);for(let o in a.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,s=a.tokenizer[i],l=n[i];n[i]=(...u)=>{let c=s.apply(n,u);return c===!1&&(c=l.apply(n,u)),c}}r.tokenizer=n}if(a.hooks){let n=this.defaults.hooks||new Hu;for(let o in a.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,s=a.hooks[i],l=n[i];Hu.passThroughHooks.has(o)?n[i]=u=>{if(this.defaults.async&&Hu.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await s.call(n,u);return l.call(n,d)})();let c=s.call(n,u);return l.call(n,c)}:n[i]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await s.apply(n,u);return d===!1&&(d=await l.apply(n,u)),d})();let c=s.apply(n,u);return c===!1&&(c=l.apply(n,u)),c}}r.hooks=n}if(a.walkTokens){let n=this.defaults.walkTokens,o=a.walkTokens;r.walkTokens=function(i){let s=[];return s.push(o.call(this,i)),n&&(s=s.concat(n.call(this,i))),s}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return rr.lex(t,e??this.defaults)}parser(t,e){return nr.parse(t,e??this.defaults)}parseMarkdown(t){return(e,a)=>{let r={...a},n={...this.defaults,...r},o=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return o(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 e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,s=await(n.hooks?await n.hooks.provideLexer():t?rr.lex:rr.lexInline)(i,n),l=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let u=await(n.hooks?await n.hooks.provideParser():t?nr.parse:nr.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(u):u})().catch(o);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer():t?rr.lex:rr.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let s=(n.hooks?n.hooks.provideParser():t?nr.parse:nr.parseInline)(i,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(i){return o(i)}}}onError(t,e){return a=>{if(a.message+=`
|
|
162
|
+
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Sr(a.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(a);throw a}}},ti=new Ky;function Te(t,e){return ti.parse(t,e)}Te.options=Te.setOptions=function(t){return ti.setOptions(t),Te.defaults=ti.defaults,lI(Te.defaults),Te};Te.getDefaults=qy;Te.defaults=ai;Te.use=function(...t){return ti.use(...t),Te.defaults=ti.defaults,lI(Te.defaults),Te};Te.walkTokens=function(t,e){return ti.walkTokens(t,e)};Te.parseInline=ti.parseInline;Te.Parser=nr;Te.parser=nr.parse;Te.Renderer=cp;Te.TextRenderer=Yy;Te.Lexer=rr;Te.lexer=rr.lex;Te.Tokenizer=up;Te.Hooks=Hu;Te.parse=Te;var m5=Te.options,g5=Te.setOptions,v5=Te.use,y5=Te.walkTokens,x5=Te.parseInline;var b5=nr.parse,S5=rr.lex;var Oe=K(Ke(),1),Qy=K(Go(),1);var Tt={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"}},ri={light:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${k[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:qt[8],color:qt[2]},categoryHeader:{color:k[7]},emptyState:{color:k[8]},feedbackPrompt:{color:k[7]}},dark:{container:{backgroundColor:"transparent",color:"inherit"},searchInput:{border:`1px solid ${k[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:qt[0],color:qt[6]},categoryHeader:{color:k[8]},emptyState:{color:k[7]},feedbackPrompt:{color:k[8]}}};var eP=new Ky({async:!1,gfm:!0,breaks:!0});function bI(t){return typeof t=="string"?t:t.type==="rich"?t.html:t.content}function tP(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=eP.parse(t.content);return(0,qe.jsx)("div",{style:{margin:0},"data-faq-markdown":"",dangerouslySetInnerHTML:{__html:e}})}function aP(t){return t?t===!0?{style:"thumbs"}:t:null}function rP(t){return t.prompt||"Was this helpful?"}function nP({item:t,isExpanded:e,isHighlighted:a,isLast:r,onToggle:n,theme:o,feedbackConfig:i,feedbackValue:s,onFeedback:l}){let[u,c]=(0,Oe.useState)(!1),d=ri[o],{question:f,answer:h}=t.config,S={...Tt.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)"}},x={...Tt.question,...d.question,...u?d.questionHover:{}},b={...Tt.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},g={...Tt.answer,...d.answer,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},m={...Tt.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:n,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:g,"aria-hidden":!e,children:[tP(h),e&&i&&(0,qe.jsxs)("div",{style:m,children:[(0,qe.jsx)("span",{children:rP(i)}),(0,qe.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...s==="up"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs up",onClick:()=>l(t.config.id,f,"up"),children:"\u{1F44D}"}),(0,qe.jsx)("button",{type:"button",style:{...Tt.feedbackButton,...s==="down"?Tt.feedbackButtonSelected:{}},"aria-label":"Thumbs down",onClick:()=>l(t.config.id,f,"down"),children:"\u{1F44E}"})]})]})]})}function oP({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Oe.useReducer)(R=>R+1,0),[o,i]=(0,Oe.useState)(new Set),[s,l]=(0,Oe.useState)(null),[u,c]=(0,Oe.useState)(""),[d,f]=(0,Oe.useState)(new Map),h=(0,Oe.useMemo)(()=>aP(t.feedback),[t.feedback]);(0,Oe.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Oe.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]),(0,Oe.useEffect)(()=>{if(!e.events.subscribe)return;if(e.events.getRecent){let E=e.events.getRecent({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},10).filter(D=>{let O=D.props?.actionId;return typeof O=="string"&&O.startsWith("faq:open:")}).pop();if(E&&Date.now()-E.ts<1e4){let D=E.props.actionId.replace("faq:open:","");i(new Set([D])),requestAnimationFrame(()=>{let O=document.querySelector(`[data-faq-item-id="${D}"]`);O&&O.scrollIntoView({behavior:"smooth",block:"center"})})}}return e.events.subscribe({patterns:["^action\\.tooltip_cta_clicked$","^action\\.modal_cta_clicked$"]},F=>{let E=F.props?.actionId;if(typeof E!="string"||!E.startsWith("faq:open:"))return;let D=E.replace("faq:open:","");i(new Set([D])),requestAnimationFrame(()=>{let O=document.querySelector(`[data-faq-item-id="${D}"]`);O&&O.scrollIntoView({behavior:"smooth",block:"center"})}),e.events.publish("canvas.requestOpen")})},[e]),(0,Oe.useEffect)(()=>{if(!e.events.subscribe)return;let R=E=>{let D=E.props?.tileId,O=E.props?.itemId;D===a&&O&&(i(new Set([O])),l(O),setTimeout(()=>l(null),1500),requestAnimationFrame(()=>{let N=document.querySelector(`[data-faq-item-id="${O}"]`);N&&N.scrollIntoView({behavior:"smooth",block:"center"})}))};if(e.events.getRecent){let D=e.events.getRecent({names:["notification.deep_link"]},5).filter(O=>O.props?.tileId===a&&O.props?.itemId).pop();D&&Date.now()-D.ts<1e4&&R(D)}return e.events.subscribe({names:["notification.deep_link"]},R)},[e,a]);let S=(0,Oe.useMemo)(()=>(t.actions??[]).filter(R=>R.triggerWhen?e.evaluateSync(R.triggerWhen).value:!0),[t.actions,e,r]),x=(0,Oe.useMemo)(()=>t.ordering==="priority"?[...S].sort((R,F)=>(F.config.priority??0)-(R.config.priority??0)):S,[S,t.ordering]),b=(0,Oe.useMemo)(()=>{if(!t.searchable||!u.trim())return x;let R=u.toLowerCase();return x.filter(F=>F.config.question.toLowerCase().includes(R)||bI(F.config.answer).toLowerCase().includes(R)||F.config.category?.toLowerCase().includes(R))},[x,u,t.searchable]),g=(0,Oe.useMemo)(()=>{let R=new Map;for(let F of b){let E=F.config.category;R.has(E)||R.set(E,[]),R.get(E).push(F)}return R},[b]),m=(0,Oe.useMemo)(()=>b.some(R=>R.config.category),[b]),y=(0,Oe.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),v=(0,Oe.useCallback)(R=>{i(F=>{let E=new Set(F);return t.expandBehavior==="single"?F.has(R)?new Set:new Set([R]):(F.has(R)?E.delete(R):E.add(R),E)}),e.events.publish("faq:toggled",{instanceId:a,questionId:R,expanded:!o.has(R),timestamp:Date.now()})},[t.expandBehavior,e.events,a,o]),C=(0,Oe.useCallback)((R,F,E)=>{f(D=>{let O=new Map(D);return O.set(R,E),O}),e.events.publish("faq:feedback",{itemId:R,question:F,value:E})},[e.events]),w={...Tt.container,...ri[y].container},_={...Tt.searchInput,...ri[y].searchInput},L={...Tt.emptyState,...ri[y].emptyState},A={...Tt.categoryHeader,...ri[y].categoryHeader},I=R=>R.map((F,E)=>(0,qe.jsx)(nP,{item:F,isExpanded:o.has(F.config.id),isHighlighted:s===F.config.id,isLast:E===R.length-1,onToggle:()=>v(F.config.id),theme:y,feedbackConfig:h,feedbackValue:d.get(F.config.id),onFeedback:C},F.config.id));return S.length===0?(0,qe.jsx)("div",{style:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:(0,qe.jsx)("div",{style:L,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:w,"data-adaptive-id":a,"data-adaptive-type":"adaptive-faq",children:[t.searchable&&(0,qe.jsxs)("div",{style:Tt.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:R=>c(R.target.value),style:_})]}),(0,qe.jsx)("div",{style:Tt.accordion,children:m?Array.from(g.entries()).map(([R,F])=>(0,qe.jsxs)(Oe.default.Fragment,{children:[R&&(0,qe.jsx)("div",{style:A,"data-category-header":R,children:R}),I(F)]},R??"__ungrouped")):I(b)}),t.searchable&&b.length===0&&u&&(0,qe.jsxs)("div",{style:{...Tt.noResults,...ri[y].emptyState},children:['No questions found matching "',u,'"']})]})}var SI={mount(t,e){let{runtime:a,instanceId:r="faq-widget",...n}=e||{expandBehavior:"single",searchable:!1,theme:"auto",actions:[]};if(a&&typeof Qy.createRoot=="function"){let i=(0,Qy.createRoot)(t);return i.render(Oe.default.createElement(oP,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
163
163
|
<div style="font-family: system-ui; max-width: 800px;">
|
|
164
164
|
${o.map(i=>`
|
|
165
|
-
<div style="margin-bottom: 8px; padding: 16px; background: ${
|
|
165
|
+
<div style="margin-bottom: 8px; padding: 16px; background: ${k[12]}; border-radius: 8px;">
|
|
166
166
|
<strong>${i.config.question}</strong>
|
|
167
|
-
<p style="margin-top: 8px; color: ${
|
|
167
|
+
<p style="margin-top: 8px; color: ${k[6]};">${bI(i.config.answer)}</p>
|
|
168
168
|
</div>
|
|
169
169
|
`).join("")}
|
|
170
170
|
</div>
|
|
171
|
-
`,()=>{t.innerHTML=""}}};var MA={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:dA,widgets:[{id:"adaptive-faq:accordion",component:RA,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 HP=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},UP=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},zP={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},qP=[{kind:"gamification:awardBadge",executor:HP},{kind:"gamification:addPoints",executor:UP}],$P=[zP],OA={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:qP,eventHandlers:$P};var Zt=ae(Fe(),1);var Lt=ae(st(),1),hb=ae(Ei(),1),VP={"\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 NA(t){return VP[t]??mh(t)}function mh(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Lr={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"}},gh={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:L[7]},emptyState:{color:L[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:L[8]},emptyState:{color:L[7]}}};function DA(t){if(typeof window>"u")return!1;let e=window.location.pathname;return t.some(a=>{let r=a.split("?")[0].split("#")[0];return r.endsWith("/**")?e.startsWith(r.slice(0,-3)):e===r})}function jP(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 GP({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,onFocusAnchor:o,theme:i}){let[s,l]=(0,Lt.useState)(!1),u=gh[i],{title:c,description:d,href:f,icon:p,external:S,anchor:x}=t.config,b={...Lr.item,...u.item,...e?u.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},m={...Lr.header,...u.header,...s?u.headerHover:{}},h={...Lr.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},g={...Lr.body,...u.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},y=x?Array.isArray(x.route)?x.route[0]:x.route:f,C=x?DA(Array.isArray(x.route)?x.route:[x.route]):y?DA([y]):!1,w=x?.selector&&x.selector!=="*",_=C&&w,k=!!y||_,A=R=>{R.preventDefault(),R.stopPropagation(),_&&x?o(x):y&&n(y,S??!1)},I=_?"Focus \u2192":S?"Go \u2197":"Go \u2192";return(0,Zt.jsxs)("div",{style:b,"data-nav-tip-id":t.config.id,children:[(0,Zt.jsxs)("button",{type:"button",style:m,onClick:r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[p&&(0,Zt.jsx)("span",{style:Lr.icon,dangerouslySetInnerHTML:{__html:NA(p)}}),(0,Zt.jsx)("span",{children:c}),(0,Zt.jsx)("span",{style:h,children:"\u203A"})]}),(0,Zt.jsxs)("div",{style:g,"aria-hidden":!e,children:[(0,Zt.jsx)("p",{style:Lr.description,children:d}),k&&(0,Zt.jsx)("a",{href:y||"#",onClick:A,style:{...Lr.linkButton,...u.linkButton},target:S?"_blank":void 0,rel:S?"noopener noreferrer":void 0,children:I})]})]})}function ZP({config:t,runtime:e,instanceId:a}){let[r,n]=(0,Lt.useReducer)(h=>h+1,0),[o,i]=(0,Lt.useState)(new Set);(0,Lt.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,Lt.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]);let s=(0,Lt.useMemo)(()=>t.actions.filter(h=>{if(!h.triggerWhen)return!0;try{return e.evaluateSync(h.triggerWhen).value}catch{return!1}}),[t.actions,e,r]),l=(0,Lt.useMemo)(()=>{let h=new Map;for(let g of s){let y=g.config.category;h.has(y)||h.set(y,[]),h.get(y).push(g)}return h},[s]),u=(0,Lt.useMemo)(()=>s.some(h=>h.config.category),[s]),c=(0,Lt.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,Lt.useCallback)(h=>{i(g=>{let y=g.has(h),C;if(t.expandBehavior==="single"){for(let w of g)w!==h&&e.events.publish("nav:toggled",{instanceId:a,tipId:w,expanded:!1,timestamp:Date.now()});C=y?new Set:new Set([h])}else C=new Set(g),y?C.delete(h):C.add(h);return e.events.publish("nav:toggled",{instanceId:a,tipId:h,expanded:!y,timestamp:Date.now()}),C})},[t.expandBehavior,e.events,a]),f=(0,Lt.useCallback)((h,g)=>{let y=h.trim().toLowerCase();if(!(y.startsWith("javascript:")||y.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:h,external:g,timestamp:Date.now()}),g)window.open(h,"_blank","noopener,noreferrer");else{let C=new URL(h,window.location.origin);C.search=window.location.search,window.history.pushState(null,"",C.toString()),window.dispatchEvent(new PopStateEvent("popstate"))}},[e.events,a]),p=(0,Lt.useCallback)(h=>{let g=document.querySelector(h.selector);g instanceof HTMLElement&&(e.events.publish("nav:tip_focused",{instanceId:a,selector:h.selector,route:h.route,timestamp:Date.now()}),g.scrollIntoView({behavior:"smooth",block:"center"}),jP(g),setTimeout(()=>g.focus(),400))},[e.events,a]),S={...Lr.container,...gh[c].container},x={...Lr.categoryHeader,...gh[c].categoryHeader},b={...Lr.emptyState,...gh[c].emptyState},m=h=>h.map((g,y)=>(0,Zt.jsx)(GP,{item:g,isExpanded:o.has(g.config.id),isLast:y===h.length-1,onToggle:()=>d(g.config.id),onNavigate:f,onFocusAnchor:p,theme:c},g.config.id));return s.length===0?(0,Zt.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Zt.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,Zt.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Zt.jsx)("div",{style:Lr.accordion,children:u?Array.from(l.entries()).map(([h,g])=>(0,Zt.jsxs)(Lt.default.Fragment,{children:[h&&(0,Zt.jsx)("div",{style:x,"data-category-header":h,children:h}),m(g)]},h??"__ungrouped")):m(s)})})}var BA={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof hb.createRoot=="function"){let i=(0,hb.createRoot)(t);return i.render(Lt.default.createElement(ZP,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
171
|
+
`,()=>{t.innerHTML=""}}};var _I={id:"adaptive-faq",version:"2.0.0",name:"FAQ Accordion",description:"Collapsible Q&A accordion with actions, rich content, feedback, and personalization",executors:tI,widgets:[{id:"adaptive-faq:accordion",component:SI,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 iP=async(t,e)=>{let{badgeId:a}=t;return e.publishEvent("gamification.badge_awarded",{badgeId:a,awardedAt:Date.now()}),{cleanup:()=>{}}},sP=async(t,e)=>{let{points:a,reason:r}=t;return e.publishEvent("gamification.points_added",{points:a,reason:r,timestamp:Date.now()}),{cleanup:()=>{}}},lP={names:["page_view","button_click"],handler:(t,e)=>{console.log("[Gamification] Event received for badge trigger check")}},uP=[{kind:"gamification:awardBadge",executor:iP},{kind:"gamification:addPoints",executor:sP}],cP=[lP],CI={id:"adaptive-gamification",version:"1.0.0",name:"Gamification",description:"Badges, rewards, points, and engagement mechanics",executors:uP,eventHandlers:cP};var Rt=K(Ee(),1);var dt=K(Ke(),1),Jy=K(Go(),1),dP={"\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 LI(t){return dP[t]??pp(t)}function pp(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var or={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"}},hp={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:k[7]},emptyState:{color:k[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:k[8]},emptyState:{color:k[7]}}};function wI(t){if(typeof window>"u")return!1;let e=window.location.pathname;return t.some(a=>{let r=a.split("?")[0].split("#")[0];return r.endsWith("/**")?e.startsWith(r.slice(0,-3)):e===r})}function fP(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 pP({item:t,isExpanded:e,isLast:a,onToggle:r,onNavigate:n,onFocusAnchor:o,theme:i}){let[s,l]=(0,dt.useState)(!1),u=hp[i],{title:c,description:d,href:f,icon:h,external:S,anchor:x}=t.config,b={...or.item,...u.item,...e?u.itemExpanded:{},...a?{}:{borderBottom:"var(--sc-content-item-divider, none)"}},g={...or.header,...u.header,...s?u.headerHover:{}},m={...or.chevron,transform:e?"rotate(90deg)":"rotate(0deg)"},y={...or.body,...u.body,maxHeight:e?"500px":"0",paddingBottom:e?"16px":"0"},v=x?Array.isArray(x.route)?x.route[0]:x.route:f,C=x?wI(Array.isArray(x.route)?x.route:[x.route]):v?wI([v]):!1,w=x?.selector&&x.selector!=="*",_=C&&w,L=!!v||_,A=R=>{R.preventDefault(),R.stopPropagation(),_&&x?o(x):v&&n(v,S??!1)},I=_?"Focus \u2192":S?"Go \u2197":"Go \u2192";return(0,Rt.jsxs)("div",{style:b,"data-nav-tip-id":t.config.id,children:[(0,Rt.jsxs)("button",{type:"button",style:g,onClick:r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-expanded":e,children:[h&&(0,Rt.jsx)("span",{style:or.icon,dangerouslySetInnerHTML:{__html:LI(h)}}),(0,Rt.jsx)("span",{children:c}),(0,Rt.jsx)("span",{style:m,children:"\u203A"})]}),(0,Rt.jsxs)("div",{style:y,"aria-hidden":!e,children:[(0,Rt.jsx)("p",{style:or.description,children:d}),L&&(0,Rt.jsx)("a",{href:v||"#",onClick:A,style:{...or.linkButton,...u.linkButton},target:S?"_blank":void 0,rel:S?"noopener noreferrer":void 0,children:I})]})]})}function hP({config:t,runtime:e,instanceId:a}){let[r,n]=(0,dt.useReducer)(m=>m+1,0),[o,i]=(0,dt.useState)(new Set);(0,dt.useEffect)(()=>e.context.subscribe(()=>{n()}),[e.context]),(0,dt.useEffect)(()=>{if(e.accumulator?.subscribe)return e.accumulator.subscribe(()=>{n()})},[e.accumulator]);let s=(0,dt.useMemo)(()=>t.actions.filter(m=>{if(!m.triggerWhen)return!0;try{return e.evaluateSync(m.triggerWhen).value}catch{return!1}}),[t.actions,e,r]),l=(0,dt.useMemo)(()=>{let m=new Map;for(let y of s){let v=y.config.category;m.has(v)||m.set(v,[]),m.get(v).push(y)}return m},[s]),u=(0,dt.useMemo)(()=>s.some(m=>m.config.category),[s]),c=(0,dt.useMemo)(()=>t.theme&&t.theme!=="auto"?t.theme:typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",[t.theme]),d=(0,dt.useCallback)(m=>{i(y=>{let v=y.has(m),C;if(t.expandBehavior==="single"){for(let w of y)w!==m&&e.events.publish("nav:toggled",{instanceId:a,tipId:w,expanded:!1,timestamp:Date.now()});C=v?new Set:new Set([m])}else C=new Set(y),v?C.delete(m):C.add(m);return e.events.publish("nav:toggled",{instanceId:a,tipId:m,expanded:!v,timestamp:Date.now()}),C})},[t.expandBehavior,e.events,a]),f=(0,dt.useCallback)((m,y)=>{let v=m.trim().toLowerCase();if(!(v.startsWith("javascript:")||v.startsWith("data:")))if(e.events.publish("nav:tip_clicked",{instanceId:a,href:m,external:y,timestamp:Date.now()}),y)window.open(m,"_blank","noopener,noreferrer");else{let C=new URL(m,window.location.origin);C.search=window.location.search,window.history.pushState(null,"",C.toString()),window.dispatchEvent(new PopStateEvent("popstate"))}},[e.events,a]),h=(0,dt.useCallback)(m=>{let y=document.querySelector(m.selector);y instanceof HTMLElement&&(e.events.publish("nav:tip_focused",{instanceId:a,selector:m.selector,route:m.route,timestamp:Date.now()}),y.scrollIntoView({behavior:"smooth",block:"center"}),fP(y),setTimeout(()=>y.focus(),400))},[e.events,a]),S={...or.container,...hp[c].container},x={...or.categoryHeader,...hp[c].categoryHeader},b={...or.emptyState,...hp[c].emptyState},g=m=>m.map((y,v)=>(0,Rt.jsx)(pP,{item:y,isExpanded:o.has(y.config.id),isLast:v===m.length-1,onToggle:()=>d(y.config.id),onNavigate:f,onFocusAnchor:h,theme:c},y.config.id));return s.length===0?(0,Rt.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Rt.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,Rt.jsx)("div",{style:S,"data-adaptive-id":a,"data-adaptive-type":"adaptive-nav",children:(0,Rt.jsx)("div",{style:or.accordion,children:u?Array.from(l.entries()).map(([m,y])=>(0,Rt.jsxs)(dt.default.Fragment,{children:[m&&(0,Rt.jsx)("div",{style:x,"data-category-header":m,children:m}),g(y)]},m??"__ungrouped")):g(s)})})}var kI={mount(t,e){let{runtime:a,instanceId:r="nav-widget",...n}=e||{expandBehavior:"single",theme:"auto",actions:[]};if(a&&typeof Jy.createRoot=="function"){let i=(0,Jy.createRoot)(t);return i.render(dt.default.createElement(hP,{config:n,runtime:a,instanceId:r})),()=>{i.unmount()}}let o=n.actions||[];return t.innerHTML=`
|
|
172
172
|
<div style="font-family: system-ui; max-width: 100%;">
|
|
173
173
|
${o.map(i=>`
|
|
174
|
-
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${
|
|
175
|
-
${i.config.icon?`<span>${
|
|
176
|
-
<p style="margin-top: 8px; color: ${
|
|
177
|
-
${i.config.href?`<a href="${
|
|
174
|
+
<div style="margin-bottom: 4px; padding: 12px 16px; background: ${k[12]}; border-radius: 8px;">
|
|
175
|
+
${i.config.icon?`<span>${LI(i.config.icon)}</span> `:""}<strong>${pp(i.config.title)}</strong>
|
|
176
|
+
<p style="margin-top: 8px; color: ${k[6]}; font-size: 13px;">${pp(i.config.description)}</p>
|
|
177
|
+
${i.config.href?`<a href="${pp(i.config.href)}" style="color: ${qt[2]}; font-size: 13px;">Go →</a>`:""}
|
|
178
178
|
</div>
|
|
179
179
|
`).join("")}
|
|
180
180
|
</div>
|
|
181
|
-
`,()=>{t.innerHTML=""}}};var
|
|
181
|
+
`,()=>{t.innerHTML=""}}};var mP=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 gP(t){try{return new URL(t,window.location.origin).origin===window.location.origin}catch{return!1}}var vP=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&&gP(a)?(window.history.pushState(null,"",a),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.href=a,{cleanup:()=>{}}},yP=[{kind:"navigation:scrollTo",executor:mP},{kind:"navigation:navigate",executor:vP}],II={id:"adaptive-nav",version:"2.0.0",name:"Navigation Tips",description:"Navigation actions and accordion-based tips with per-item conditional visibility",executors:yP,widgets:[{id:"adaptive-nav:tips",component:kI,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 xP=[Jk,Pf,_I,CI,II,tp],bP=xP.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 AI(t){let e=0;for(let a of bP)t.has(a.id)||(t.register(a),e++);console.log("[Syntro Runtime] Registered",e,"built-in runtime modules")}var EI={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important",hostLoadingSelector:"",waitForHostReady:""};function TI(t={}){let{timeout:e,className:a,style:r,hostLoadingSelector:n,waitForHostReady:o}={...EI,...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 RI(t={}){let{className:e,style:a}={...EI,...t};return`
|
|
182
182
|
(function() {
|
|
183
183
|
var s = document.createElement('style');
|
|
184
184
|
s.textContent = '.${e} { ${a} }';
|
|
185
185
|
document.head.appendChild(s);
|
|
186
186
|
document.documentElement.className += ' ${e}';
|
|
187
|
-
})();`}function
|
|
187
|
+
})();`}function mp(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 ex=!1;function MI(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function tx(t){if(MI()){ex=!0;return}ex=t??!1}function SP(){return MI()?!0:ex}function Y(t,e,a){SP()&&(a!==void 0?console.log(`[${t}]`,e,a):console.log(`[${t}]`,e))}function na(t,e,a){a!==void 0?console.warn(`[${t}]`,e,a):console.warn(`[${t}]`,e)}function gp(t,e,a){a!==void 0?console.error(`[${t}]`,e,a):console.error(`[${t}]`,e)}var vp="2.8.0-canary.39";var tn="2.0";var _P=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function CP(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):_P.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 wP(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var OI="syntro_config_cache",LP=1440*60*1e3;function DI(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function kP(t,e){if(DI())try{let a={config:t,timestamp:Date.now(),sdkVersion:e};localStorage.setItem(OI,JSON.stringify(a))}catch{}}function IP(t){if(!DI())return null;try{let e=localStorage.getItem(OI);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>LP?null:a.config}catch{return null}}var yp=({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 AP(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 ni=({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=AP(e,o,i);if(c.length>0){let d=mp(e,c);if(d)return Y("SmartCanvas Config","Resolved config from variant flags",d),d}}let l=yp({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(!CP(l))throw new Error(`SmartCanvas: config URI not allowed: ${l}`);let u=r??(wP(l)?"include":"omit");try{let c=await fetch(l,{credentials:u,headers:{"X-SDK-Version":vp,"X-SDK-Schema-Version":tn}});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&&kP(d,s),d}catch(c){if(s){let d=IP(s);if(d)return Y("SmartCanvas Config","Serving config from offline cache"),d}throw c}};var EP=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function BI(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 na("Syntro Runtime",`Failed to decode ${t}:`,r),null}}var ks,Is;function qu(){if(ks==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.token)ks={token:t.token,api_base:t.apiBase||""},console.log(`[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${ks.token.slice(0,15)}...)`);else{let e=BI("editor_source");e&&(ks=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 ks??null}function xp(){if(Is==null){let t=typeof window<"u"?window.__SYNTRO_EDITOR_PARAMS__:null;if(t?.mode)Is={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=${Is.mode})`);else{let e=BI("editor_conf");e&&(Is=e),console.log(`[DIAG] getEditorConf: from URL param \u2192 ${e?`mode=${e.mode}`:"NULL"}`)}}return Is??null}function TP(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?(na("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):EP.some(n=>n.startsWith(".")?e.hostname.endsWith(n)||e.hostname===n.slice(1):e.hostname===n)?(Y("Syntro Runtime","\u2713 Editor URL validated"),!0):(na("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return na("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var bp=()=>{let t=xp();return!qu()?.token||!t?.mode?null:t.mode};function RP(){return qu()?.token??null}function MP(){return qu()?.api_base??null}var zu=null,PI=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(zu)return Y("Syntro Runtime","Editor SDK load already in progress, waiting..."),zu;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=MP(),n=(a?`${a}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!n){na("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),Y("Syntro Runtime","================================");return}let o=RP();if(!o){na("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)}...`}),!TP(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..."),zu=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","================================"),zu=null,l(c)},document.head.appendChild(u),Y("Syntro Runtime","Script tag appended to <head>")}),zu};var OP=new Set(["tag_name","$el_text"]);function DP(t){return OP.has(t)||t.startsWith("attr__")}function NI(t,e){return t.equals!==void 0?e===t.equals:t.contains!==void 0?typeof e=="string"&&e.includes(t.contains):!1}function BP(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(DP(n)){let i=r.props?.elements;if(!i||!i.some(l=>NI(o,l[n])))return!1}else if(!NI(o,r.props?.[n]))return!1}return!0}}function FI(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?BP(n):()=>!0,i=typeof r.withinMs=="number";e.register(r.key,o,i)}}function $u(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"&&FI(i.triggerWhen,e)}if(a)for(let r of a){let n=r;n.triggerWhen?.type==="rules"&&FI(n.triggerWhen,e)}}var _r=null;function UI(t){_r&&_r!==t?t.appendChild(_r):_r=t;let e=t.getRootNode();e instanceof ShadowRoot&&PP(e)}function zI(){return _r||(_r=document.createElement("div"),_r.id="syntro-overlays",Object.assign(_r.style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),document.body.appendChild(_r)),_r}var HI=!1;function PP(t){if(HI)return;let e=`
|
|
188
188
|
:host {
|
|
189
189
|
--syntro-surface: var(--sc-overlay-background, #0f1318);
|
|
190
190
|
--syntro-fg: var(--sc-overlay-text-color, #cbd0d7);
|
|
@@ -446,7 +446,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
446
446
|
.syntro-modal-btn-primary:hover {
|
|
447
447
|
background: var(--syntro-accent-hover, #d44844);
|
|
448
448
|
}
|
|
449
|
-
`,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),XA=!0}var wE=ae(Ei(),1);var Ch=class{constructor(e){B(this,"state");B(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)}},vb=t=>new Ch(t);var wh=ae(st(),1),JA=ae(Fe(),1),QA=(0,wh.createContext)(null);function yb({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,JA.jsx)(QA.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function $i(){let t=(0,wh.useContext)(QA);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var da=ae(st(),1);var It=ae(st(),1),Mb=ae(Mu(),1);var ht="1.0.0",Je={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",UI_HESITATE:"ui.hesitate",UI_RAGE_CLICK:"ui.rage_click",UI_SCROLL_THRASH:"ui.scroll_thrash",UI_FOCUS_BOUNCE:"ui.focus_bounce",UI_IDLE:"ui.idle",UI_HOVER:"ui.hover"},ua={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,Drag:12},Gc={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},xb={hesitationMs:3e3,hesitationRadiusPx:10,rageClickCount:3,rageClickWindowMs:1e3,rageClickRadiusPx:30,scrollThrashReversals:3,scrollThrashWindowMs:2e3,focusBounceMaxInputs:0,idleMs:5e3,hoverSampleMs:100};var kh=class{constructor(e,a){this.config=e,this.emit=a,this.focused=new Map}ingest(e){if(e.type!==3)return;let a=e.timestamp;if(e.data.source===ua.MouseInteraction){let r=e.data.id??0;if(e.data.type===Gc.Focus)this.focused.set(r,{id:r,focusTs:a,inputCount:0});else if(e.data.type===Gc.Blur){let n=this.focused.get(r);n&&n.inputCount<=this.config.focusBounceMaxInputs&&this.emit({ts:a,name:Je.UI_FOCUS_BOUNCE,source:"rrweb",schemaVersion:ht,props:{elementId:r,duration_ms:a-n.focusTs}}),this.focused.delete(r)}}else if(e.data.source===ua.Input){let r=e.data.id??0,n=this.focused.get(r);n&&n.inputCount++}}};var Lh=class{constructor(e,a){this.config=e,this.emit=a,this.anchorX=0,this.anchorY=0,this.anchorTs=0,this.emitted=!1,this.hasPosition=!1}ingest(e){if(e.type!==3||e.data.source!==ua.MouseMove)return;let a=e.data.positions;if(!a||a.length===0)return;let r=a[a.length-1],n=e.timestamp+(r.timeOffset??0);if(!this.hasPosition){this.anchorX=r.x,this.anchorY=r.y,this.anchorTs=n,this.hasPosition=!0,this.emitted=!1;return}let o=r.x-this.anchorX,i=r.y-this.anchorY;Math.sqrt(o*o+i*i)>this.config.hesitationRadiusPx&&(this.anchorX=r.x,this.anchorY=r.y,this.anchorTs=n,this.emitted=!1)}tick(e){if(!this.hasPosition||this.emitted)return;let a=e-this.anchorTs;a>=this.config.hesitationMs&&(this.emit({ts:e,name:Je.UI_HESITATE,source:"rrweb",schemaVersion:ht,props:{x:this.anchorX,y:this.anchorY,duration_ms:a}}),this.emitted=!0)}};var Ih=class{constructor(e,a,r){this.config=e,this.emit=a,this.elementResolver=r,this.currentElement=null,this.hoverStartTs=null,this.lastX=0,this.lastY=0,this.lastSampleTs=-1/0}ingest(e){if(e.type!==3||e.data.source!==ua.MouseMove)return;let a=e.data.positions;if(!a||a.length===0)return;let r=a[a.length-1];this.lastX=r.x,this.lastY=r.y}tick(e){if(!this.elementResolver||e-this.lastSampleTs<this.config.hoverSampleMs)return;this.lastSampleTs=e;let a=this.elementResolver(this.lastX,this.lastY),r=a?eE(a):null,n=this.currentElement?eE(this.currentElement):null;r!==n&&(this.currentElement&&this.hoverStartTs!==null&&this.emit({ts:e,name:Je.UI_HOVER,source:"rrweb",schemaVersion:ht,props:{x:this.lastX,y:this.lastY,duration_ms:e-this.hoverStartTs,element:this.currentElement}}),this.currentElement=a,this.hoverStartTs=e)}};function eE(t){return`${t.tag_name??""}|${t.attr__id??""}|${(t.classes??[]).join(",")}`}var Ah=class{constructor(e,a){this.config=e,this.emit=a,this.lastActivityTs=null,this.emitted=!1}ingest(e){if(e.type!==3)return;let a=e.data.source;(a===ua.MouseMove||a===ua.MouseInteraction||a===ua.Scroll)&&(this.lastActivityTs=e.timestamp,this.emitted=!1)}tick(e){this.lastActivityTs===null||this.emitted||e-this.lastActivityTs>=this.config.idleMs&&(this.emit({ts:e,name:Je.UI_IDLE,source:"rrweb",schemaVersion:ht,props:{idle_ms:e-this.lastActivityTs}}),this.emitted=!0)}};var Eh=class{constructor(e,a){this.config=e,this.emit=a,this.clicks=[]}ingest(e){if(e.type!==3||e.data.source!==ua.MouseInteraction||e.data.type!==Gc.Click)return;let a=e.data.x??0,r=e.data.y??0,n=e.timestamp,o=n-this.config.rageClickWindowMs;this.clicks=this.clicks.filter(s=>s.ts>=o),this.clicks.push({ts:n,x:a,y:r});let i=this.clicks.filter(s=>{let l=s.x-a,u=s.y-r;return Math.sqrt(l*l+u*u)<=this.config.rageClickRadiusPx});i.length>=this.config.rageClickCount&&(this.emit({ts:n,name:Je.UI_RAGE_CLICK,source:"rrweb",schemaVersion:ht,props:{x:a,y:r,clickCount:i.length,duration_ms:n-i[0].ts}}),this.clicks=[])}};var Th=class{constructor(e,a){this.config=e,this.emit=a,this.lastY=null,this.lastDirection=null,this.reversals=[]}ingest(e){if(e.type!==3||e.data.source!==ua.Scroll)return;let a=e.data.y??0,r=e.timestamp;if(this.lastY!==null){let n=a>this.lastY?"down":a<this.lastY?"up":this.lastDirection;if(n&&n!==this.lastDirection){let o=r-this.config.scrollThrashWindowMs;this.reversals=this.reversals.filter(i=>i>o),this.reversals.push(r),this.reversals.length>=this.config.scrollThrashReversals&&(this.emit({ts:r,name:Je.UI_SCROLL_THRASH,source:"rrweb",schemaVersion:ht,props:{reversals:this.reversals.length,duration_ms:r-this.reversals[0]}}),this.reversals=[])}this.lastDirection=n}this.lastY=a}};var tE={$click:Je.UI_CLICK,$scroll:Je.UI_SCROLL,$input:Je.UI_INPUT,$change:Je.UI_CHANGE,$submit:Je.UI_SUBMIT,$pageview:Je.NAV_PAGE_VIEW,$pageleave:Je.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function gF(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(tE[e])return tE[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?Je.UI_SUBMIT:r==="change"?Je.UI_CHANGE:a==="input"||a==="textarea"?Je.UI_INPUT:Je.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}var aE=new Set(["a","button","input","select","textarea"]);function vF(t,e){if(e&&aE.has(e)||!t)return e;for(let a of t){let r=a.tag_name;if(r&&aE.has(r))return r}return e}function yF(t){let e={},a=t.properties||{},r=a.$elements,n=a.$tag_name??r?.[0]?.tag_name,o=t.event==="$autocapture"||t.event==="$click";return e.tagName=o?vF(r,n):n,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 Il(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:gF(t),source:"posthog",props:yF(t),schemaVersion:ht}}function Al(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 bb(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(Al(r)){let n=Il(r);t(n)}}}function Sb(t){let e={...xb,...t?.config},a=[];function r(d){for(let f of a)f(d)}let n=new Lh(e,r),o=new Eh(e,r),i=new Th(e,r),s=new kh(e,r),l=new Ah(e,r),u=new Ih(e,r,t?.elementResolver),c=[];return{ingest(d){if(d.kind==="posthog"){let{kind:f,...p}=d;Al(p)&&r(Il(p))}else d.kind==="rrweb"&&(n.ingest(d),o.ingest(d),i.ingest(d),s.ingest(d),l.ingest(d),u.ingest(d))},onEvent(d){a.push(d)},tick(d){n.tick(d),l.tick(d),u.tick(d)},enrichClickAttributes(d,f){c.push({ts:d,elements:f});let p=d-500;for(;c.length>0&&c[0].ts<p;)c.shift()}}}var Pt={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"};function Ir(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ht}}function xF(t){return Ir(Pt.CANVAS_OPENED,{surface:t})}function bF(t){return Ir(Pt.CANVAS_CLOSED,{surface:t})}function SF(t,e){return Ir(Pt.TILE_VIEWED,{tileId:t,surface:e})}function _F(t,e){return Ir(Pt.TILE_EXPANDED,{tileId:t,surface:e})}function CF(t,e){return Ir(Pt.TILE_COLLAPSED,{tileId:t,surface:e})}function wF(t,e,a){return Ir(Pt.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function kF(t,e){return Ir(Pt.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function LF(t,e){return Ir(Pt.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function IF(t,e,a){return Ir(Pt.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function AF(t,e,a){return Ir(Pt.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function EF(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return Ir(a,e)}var El={canvasOpened:xF,canvasClosed:bF,tileViewed:SF,tileExpanded:_F,tileCollapsed:CF,tileAction:wF,overlayStarted:kF,overlayCompleted:LF,overlayDismissed:IF,overlayStepViewed:AF,custom:EF};var Mh=ae(st());var Rh=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var rE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var nE=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var _b=t=>{let e=nE(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Zc=ae(st());var oE={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 iE=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var sE=(0,Zc.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,Zc.createElement)("svg",{ref:l,...oE,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:Rh("lucide",n),...!o&&!iE(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,Zc.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var ye=(t,e)=>{let a=(0,Mh.forwardRef)(({className:r,...n},o)=>(0,Mh.createElement)(sE,{ref:o,iconNode:e,className:Rh(`lucide-${rE(_b(t))}`,`lucide-${t}`,r),...n}));return a.displayName=_b(t),a};var TF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Wc=ye("arrow-right",TF);var RF=[["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"}]],Tl=ye("banknote",RF);var MF=[["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"}]],Xc=ye("bell",MF);var OF=[["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"}]],Yc=ye("book-open",OF);var DF=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],No=ye("circle-check-big",DF);var NF=[["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"}]],Ar=ye("circle-question-mark",NF);var BF=[["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"}]],Kc=ye("clipboard-list",BF);var PF=[["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"}]],Qc=ye("compass",PF);var FF=[["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"}]],Jc=ye("file-text",FF);var HF=[["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"}]],ed=ye("gamepad-2",HF);var UF=[["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"}]],td=ye("landmark",UF);var zF=[["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"}]],Bo=ye("layers",zF);var qF=[["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"}]],ad=ye("lightbulb",qF);var $F=[["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"}]],rd=ye("message-circle",$F);var VF=[["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"}]],nd=ye("skip-forward",VF);var jF=[["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"}]],Po=ye("sparkles",jF);var GF=[["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"}]],od=ye("timer",GF);var ZF=[["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"}]],Fo=ye("triangle-alert",ZF);var WF=[["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"}]],id=ye("trophy",WF);var Cb=ae(Fe(),1),XF={"\u2753":Ar,"\u{1F9ED}":Qc,"\u{1F4DD}":Jc,"\u{1F3AF}":Bo,"\u{1F3C6}":id,"\u2728":Po,"\u{1F4AC}":rd,"\u{1F3AE}":ed,"\u{1F4A1}":ad,"\u{1F4B0}":Tl,"\u{1F4CB}":Kc,"\u2705":No,"\u26A0\uFE0F":Fo,"\u{1F4B5}":Tl,"\u{1F3DB}\uFE0F":td,"\u23ED\uFE0F":nd,"\u27A1\uFE0F":Wc,"\u23F1\uFE0F":od,"\u{1F4D6}":Yc,"\u{1F514}":Xc};function Oh({emoji:t,size:e=14,color:a="currentColor"}){let r=XF[t];return r?(0,Cb.jsx)(r,{size:e,color:a}):(0,Cb.jsx)("span",{children:t})}var Va=ae(Fe(),1),lE="syntro-toast-styles",YF=`
|
|
449
|
+
`,a=document.createElement("style");a.setAttribute("data-syntro","base-overlay"),a.textContent=e,t.appendChild(a),HI=!0}var hA=K(Go(),1);var Sp=class{constructor(e){B(this,"state");B(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)}},ax=t=>new Sp(t);var _p=K(Ke(),1),$I=K(Ee(),1),qI=(0,_p.createContext)(null);function rx({shadowRoot:t,portalRoot:e,overlayContainer:a,children:r}){return(0,$I.jsx)(qI.Provider,{value:{shadowRoot:t,portalRoot:e,overlayContainer:a},children:r})}function oi(){let t=(0,_p.useContext)(qI);if(!t)throw new Error("useShadowRoot() called outside ShadowRootProvider");return t}var Gt=K(Ke(),1);var ft=K(Ke(),1),vx=K(kl(),1);var et="1.0.0",$e={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",UI_HESITATE:"ui.hesitate",UI_RAGE_CLICK:"ui.rage_click",UI_SCROLL_THRASH:"ui.scroll_thrash",UI_FOCUS_BOUNCE:"ui.focus_bounce",UI_IDLE:"ui.idle",UI_HOVER:"ui.hover"},Vt={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,Drag:12},Vu={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},nx={hesitationMs:3e3,hesitationRadiusPx:10,rageClickCount:3,rageClickWindowMs:1e3,rageClickRadiusPx:30,scrollThrashReversals:3,scrollThrashWindowMs:2e3,focusBounceMaxInputs:0,idleMs:5e3,hoverSampleMs:100};var Cp=class{constructor(e,a){this.config=e,this.emit=a,this.focused=new Map}ingest(e){if(e.type!==3)return;let a=e.timestamp;if(e.data.source===Vt.MouseInteraction){let r=e.data.id??0;if(e.data.type===Vu.Focus)this.focused.set(r,{id:r,focusTs:a,inputCount:0});else if(e.data.type===Vu.Blur){let n=this.focused.get(r);n&&n.inputCount<=this.config.focusBounceMaxInputs&&this.emit({ts:a,name:$e.UI_FOCUS_BOUNCE,source:"rrweb",schemaVersion:et,props:{elementId:r,duration_ms:a-n.focusTs}}),this.focused.delete(r)}}else if(e.data.source===Vt.Input){let r=e.data.id??0,n=this.focused.get(r);n&&n.inputCount++}}};var wp=class{constructor(e,a){this.config=e,this.emit=a,this.anchorX=0,this.anchorY=0,this.anchorTs=0,this.emitted=!1,this.hasPosition=!1}ingest(e){if(e.type!==3||e.data.source!==Vt.MouseMove)return;let a=e.data.positions;if(!a||a.length===0)return;let r=a[a.length-1],n=e.timestamp+(r.timeOffset??0);if(!this.hasPosition){this.anchorX=r.x,this.anchorY=r.y,this.anchorTs=n,this.hasPosition=!0,this.emitted=!1;return}let o=r.x-this.anchorX,i=r.y-this.anchorY;Math.sqrt(o*o+i*i)>this.config.hesitationRadiusPx&&(this.anchorX=r.x,this.anchorY=r.y,this.anchorTs=n,this.emitted=!1)}tick(e){if(!this.hasPosition||this.emitted)return;let a=e-this.anchorTs;a>=this.config.hesitationMs&&(this.emit({ts:e,name:$e.UI_HESITATE,source:"rrweb",schemaVersion:et,props:{x:this.anchorX,y:this.anchorY,duration_ms:a}}),this.emitted=!0)}};var Lp=class{constructor(e,a,r){this.config=e,this.emit=a,this.elementResolver=r,this.currentElement=null,this.hoverStartTs=null,this.lastX=0,this.lastY=0,this.lastSampleTs=-1/0}ingest(e){if(e.type!==3||e.data.source!==Vt.MouseMove)return;let a=e.data.positions;if(!a||a.length===0)return;let r=a[a.length-1];this.lastX=r.x,this.lastY=r.y}tick(e){if(!this.elementResolver||e-this.lastSampleTs<this.config.hoverSampleMs)return;this.lastSampleTs=e;let a=this.elementResolver(this.lastX,this.lastY),r=a?VI(a):null,n=this.currentElement?VI(this.currentElement):null;r!==n&&(this.currentElement&&this.hoverStartTs!==null&&this.emit({ts:e,name:$e.UI_HOVER,source:"rrweb",schemaVersion:et,props:{x:this.lastX,y:this.lastY,duration_ms:e-this.hoverStartTs,element:this.currentElement}}),this.currentElement=a,this.hoverStartTs=e)}};function VI(t){return`${t.tag_name??""}|${t.attr__id??""}|${(t.classes??[]).join(",")}`}var kp=class{constructor(e,a){this.config=e,this.emit=a,this.lastActivityTs=null,this.emitted=!1}ingest(e){if(e.type!==3)return;let a=e.data.source;(a===Vt.MouseMove||a===Vt.MouseInteraction||a===Vt.Scroll)&&(this.lastActivityTs=e.timestamp,this.emitted=!1)}tick(e){this.lastActivityTs===null||this.emitted||e-this.lastActivityTs>=this.config.idleMs&&(this.emit({ts:e,name:$e.UI_IDLE,source:"rrweb",schemaVersion:et,props:{idle_ms:e-this.lastActivityTs}}),this.emitted=!0)}};var Ip=class{constructor(e,a){this.config=e,this.emit=a,this.clicks=[]}ingest(e){if(e.type!==3||e.data.source!==Vt.MouseInteraction||e.data.type!==Vu.Click)return;let a=e.data.x??0,r=e.data.y??0,n=e.timestamp,o=n-this.config.rageClickWindowMs;this.clicks=this.clicks.filter(s=>s.ts>=o),this.clicks.push({ts:n,x:a,y:r});let i=this.clicks.filter(s=>{let l=s.x-a,u=s.y-r;return Math.sqrt(l*l+u*u)<=this.config.rageClickRadiusPx});i.length>=this.config.rageClickCount&&(this.emit({ts:n,name:$e.UI_RAGE_CLICK,source:"rrweb",schemaVersion:et,props:{x:a,y:r,clickCount:i.length,duration_ms:n-i[0].ts}}),this.clicks=[])}};var Ap=class{constructor(e,a){this.config=e,this.emit=a,this.lastY=null,this.lastDirection=null,this.reversals=[]}ingest(e){if(e.type!==3||e.data.source!==Vt.Scroll)return;let a=e.data.y??0,r=e.timestamp;if(this.lastY!==null){let n=a>this.lastY?"down":a<this.lastY?"up":this.lastDirection;if(n&&n!==this.lastDirection){let o=r-this.config.scrollThrashWindowMs;this.reversals=this.reversals.filter(i=>i>o),this.reversals.push(r),this.reversals.length>=this.config.scrollThrashReversals&&(this.emit({ts:r,name:$e.UI_SCROLL_THRASH,source:"rrweb",schemaVersion:et,props:{reversals:this.reversals.length,duration_ms:r-this.reversals[0]}}),this.reversals=[])}this.lastDirection=n}this.lastY=a}};var jI={$click:$e.UI_CLICK,$scroll:$e.UI_SCROLL,$input:$e.UI_INPUT,$change:$e.UI_CHANGE,$submit:$e.UI_SUBMIT,$pageview:$e.NAV_PAGE_VIEW,$pageleave:$e.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function NP(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(jI[e])return jI[e];if(e==="$autocapture"){let a=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?$e.UI_SUBMIT:r==="change"?$e.UI_CHANGE:a==="input"||a==="textarea"?$e.UI_INPUT:$e.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}var GI=new Set(["a","button","input","select","textarea"]);function FP(t,e){if(e&&GI.has(e)||!t)return e;for(let a of t){let r=a.tag_name;if(r&&GI.has(r))return r}return e}function HP(t){let e={},a=t.properties||{},r=a.$elements,n=a.$tag_name??r?.[0]?.tag_name,o=t.event==="$autocapture"||t.event==="$click";return e.tagName=o?FP(r,n):n,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 As(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:NP(t),source:"posthog",props:HP(t),schemaVersion:et}}function Es(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 ox(t){return(e,a)=>{if(typeof e!="string")return;let r={event:e,properties:a,timestamp:Date.now()};if(Es(r)){let n=As(r);t(n)}}}function ix(t){let e={...nx,...t?.config},a=[];function r(d){for(let f of a)f(d)}let n=new wp(e,r),o=new Ip(e,r),i=new Ap(e,r),s=new Cp(e,r),l=new kp(e,r),u=new Lp(e,r,t?.elementResolver),c=[];return{ingest(d){if(d.kind==="posthog"){let{kind:f,...h}=d;Es(h)&&r(As(h))}else d.kind==="rrweb"&&(n.ingest(d),o.ingest(d),i.ingest(d),s.ingest(d),l.ingest(d),u.ingest(d))},onEvent(d){a.push(d)},tick(d){n.tick(d),l.tick(d),u.tick(d)},enrichClickAttributes(d,f){c.push({ts:d,elements:f});let h=d-500;for(;c.length>0&&c[0].ts<h;)c.shift()}}}var _t={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"};function ir(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:et}}function UP(t){return ir(_t.CANVAS_OPENED,{surface:t})}function zP(t){return ir(_t.CANVAS_CLOSED,{surface:t})}function qP(t,e){return ir(_t.TILE_VIEWED,{tileId:t,surface:e})}function $P(t,e){return ir(_t.TILE_EXPANDED,{tileId:t,surface:e})}function VP(t,e){return ir(_t.TILE_COLLAPSED,{tileId:t,surface:e})}function jP(t,e,a){return ir(_t.TILE_ACTION,{tileId:t,actionId:e,surface:a})}function GP(t,e){return ir(_t.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function WP(t,e){return ir(_t.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function ZP(t,e,a){return ir(_t.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:a})}function XP(t,e,a){return ir(_t.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:a})}function YP(t,e){let a=t.startsWith("canvas.")?t:`canvas.${t}`;return ir(a,e)}var Ts={canvasOpened:UP,canvasClosed:zP,tileViewed:qP,tileExpanded:$P,tileCollapsed:VP,tileAction:jP,overlayStarted:GP,overlayCompleted:WP,overlayDismissed:ZP,overlayStepViewed:XP,custom:YP};var Tp=K(Ke());var Ep=(...t)=>t.filter((e,a,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===a).join(" ").trim();var WI=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var ZI=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,r)=>r?r.toUpperCase():a.toLowerCase());var sx=t=>{let e=ZI(t);return e.charAt(0).toUpperCase()+e.slice(1)};var ju=K(Ke());var XI={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 YI=t=>{for(let e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};var KI=(0,ju.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...s},l)=>(0,ju.createElement)("svg",{ref:l,...XI,width:e,height:e,stroke:t,strokeWidth:r?Number(a)*24/Number(e):a,className:Ep("lucide",n),...!o&&!YI(s)&&{"aria-hidden":"true"},...s},[...i.map(([u,c])=>(0,ju.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var ue=(t,e)=>{let a=(0,Tp.forwardRef)(({className:r,...n},o)=>(0,Tp.createElement)(KI,{ref:o,iconNode:e,className:Ep(`lucide-${WI(sx(t))}`,`lucide-${t}`,r),...n}));return a.displayName=sx(t),a};var KP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Gu=ue("arrow-right",KP);var QP=[["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"}]],Rs=ue("banknote",QP);var JP=[["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"}]],Wu=ue("bell",JP);var eN=[["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"}]],Zu=ue("book-open",eN);var tN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ao=ue("circle-check-big",tN);var aN=[["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"}]],sr=ue("circle-question-mark",aN);var rN=[["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"}]],Xu=ue("clipboard-list",rN);var nN=[["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"}]],Yu=ue("compass",nN);var oN=[["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"}]],Ku=ue("file-text",oN);var iN=[["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"}]],Qu=ue("gamepad-2",iN);var sN=[["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"}]],Ju=ue("landmark",sN);var lN=[["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"}]],ro=ue("layers",lN);var uN=[["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"}]],ec=ue("lightbulb",uN);var cN=[["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"}]],tc=ue("message-circle",cN);var dN=[["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"}]],ac=ue("skip-forward",dN);var fN=[["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"}]],no=ue("sparkles",fN);var pN=[["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"}]],rc=ue("timer",pN);var hN=[["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"}]],oo=ue("triangle-alert",hN);var mN=[["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"}]],nc=ue("trophy",mN);var lx=K(Ee(),1),gN={"\u2753":sr,"\u{1F9ED}":Yu,"\u{1F4DD}":Ku,"\u{1F3AF}":ro,"\u{1F3C6}":nc,"\u2728":no,"\u{1F4AC}":tc,"\u{1F3AE}":Qu,"\u{1F4A1}":ec,"\u{1F4B0}":Rs,"\u{1F4CB}":Xu,"\u2705":ao,"\u26A0\uFE0F":oo,"\u{1F4B5}":Rs,"\u{1F3DB}\uFE0F":Ju,"\u23ED\uFE0F":ac,"\u27A1\uFE0F":Gu,"\u23F1\uFE0F":rc,"\u{1F4D6}":Zu,"\u{1F514}":Wu};function Rp({emoji:t,size:e=14,color:a="currentColor"}){let r=gN[t];return r?(0,lx.jsx)(r,{size:e,color:a}):(0,lx.jsx)("span",{children:t})}var Ca=K(Ee(),1),QI="syntro-toast-styles",vN=`
|
|
450
450
|
@keyframes syntro-toast-slide-in {
|
|
451
451
|
from { opacity: 0; transform: translateY(12px); }
|
|
452
452
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -464,10 +464,10 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
464
464
|
.syntro-toast-progress.paused {
|
|
465
465
|
animation-play-state: paused;
|
|
466
466
|
}
|
|
467
|
-
`;function KF(t){if(t.querySelector(`#${lE}`))return;let e=document.createElement("style");e.id=lE,e.textContent=YF,t.appendChild(e)}function Dh({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=$i();return KF(n),t.length===0?null:(0,Va.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,Va.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,Va.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Va.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,Va.jsx)(Oh,{emoji:o.icon??"\u{1F514}",size:14})}),(0,Va.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Va.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,Va.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,Va.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,Va.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Va.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var Er=ae(st(),1);var Nh=3,Bh=8e3,Ph=3e4;var QF=0;function sd(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function JF(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Fh(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!JF(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++QF}-${o}`,title:sd(n.title,t.props),body:n.body?sd(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?sd(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function Hh(t,e){let[a,r]=(0,Er.useState)([]),n=(0,Er.useRef)(new Map),o=(0,Er.useRef)(new Map),i=(0,Er.useCallback)(u=>{t?.publish(Pt.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,Er.useCallback)(u=>{let c=setTimeout(()=>{r(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,Er.useCallback)(u=>{r(d=>{let f=d.find(p=>p.id===u);return f&&i(f),d.filter(p=>p.id!==u)});let c=o.current.get(u);c&&(clearTimeout(c),o.current.delete(u))},[i]);return(0,Er.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Fh(c,e);if(!d)return;let{notification:f,rule:p}=d,S=f.itemId?`${f.tileId}:${c.name}:${f.itemId}`:`${f.tileId}:${c.name}`,x=n.current.get(S),b=Date.now(),m=p.cooldown??3e4;x!==void 0&&b-x<m||(n.current.set(S,b),r(h=>{if(f.itemId&&h.some(C=>C.tileId===f.tileId&&C.itemId===f.itemId))return h;let g=[...h,f];if(g.length>3){let y=g.shift(),C=o.current.get(y.id);C&&(clearTimeout(C),o.current.delete(y.id))}return g}),t.publish(Pt.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 Uh=ae(st(),1);function e4(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 zh(t,e,a){let r=(0,Uh.useRef)(new Map);(0,Uh.useEffect)(()=>{if(!t?.events||!a)return;let n=e4(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 Ca=ae(st(),1),hE=ae(Fe(),1),wb=(0,Ca.createContext)({runtime:null,context:null});function qh({runtime:t,children:e}){let[a,r]=(0,Ca.useState)(t?t.context.get():null);(0,Ca.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,Ca.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,hE.jsx)(wb.Provider,{value:n,children:e})}function Kr(){let{runtime:t}=(0,Ca.useContext)(wb);return t}function ld(){let{context:t}=(0,Ca.useContext)(wb);return t}function $h(){return ld()?.page??null}function uE(){return ld()?.session??null}function cE(){return ld()?.viewport??null}function dE(t,e,a=[]){let r=Kr();(0,Ca.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function fE(){return Kr()?.state??null}function pE(t,e){let a=Kr(),[r,n]=(0,Ca.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Ca.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 ce(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var t4={colorPrimary:de[3],colorPrimaryHover:de[4],colorPrimaryMuted:de[0],colorBackground:ce(L[1],.95),colorBackgroundElevated:ce(L[3],.95),colorBackgroundSubtle:ce(L[0],.2),colorSurface:ce(L[4],.8),colorSurfaceHover:ce(L[5],.8),colorText:qa.primary,colorTextSecondary:qa.secondary,colorTextMuted:qa.tertiary,colorTextInverse:L[1],colorBorder:Fx.primary,colorBorderSubtle:Fx.secondary,colorSuccess:qe[4],colorSuccessMuted:qe[0],colorWarning:jt[4],colorWarningMuted:jt[0],colorError:at[4],colorErrorMuted:at[0],colorInfo:za[4],colorInfoMuted:za[0],colorNotification:de[4],colorNotificationMuted:ce(de[4],.4),glassBackground:ce(L[1],.6),glassBackgroundHover:ce(L[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"},a4={colorPrimary:de[3],colorPrimaryHover:de[2],colorPrimaryMuted:ce(de[5],.1),colorBackground:ce(L[12],.95),colorBackgroundElevated:ce(L[11],.95),colorBackgroundSubtle:ce(L[0],.02),colorSurface:ce(L[11],.6),colorSurfaceHover:ce(L[10],.6),colorText:L[1],colorTextSecondary:L[6],colorTextMuted:L[8],colorTextInverse:L[12],colorBorder:ce(L[0],.12),colorBorderSubtle:ce(L[0],.06),colorSuccess:qe[4],colorSuccessMuted:ce(qe[4],.12),colorWarning:jt[4],colorWarningMuted:ce(jt[4],.12),colorError:at[4],colorErrorMuted:ce(at[4],.12),colorInfo:za[4],colorInfoMuted:ce(za[4],.12),colorNotification:de[3],colorNotificationMuted:ce(de[3],.4),glassBackground:ce(L[12],.7),glassBackgroundHover:ce(L[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 r4(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var kb={mode:"dark",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:de[3],colorPrimaryHover:de[4],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ce(L[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:$p.primary.backgroundDefault,backgroundHover:$p.primary.backgroundHover,color:$p.primary.icon,size:"56px",shadow:`0 8px 32px ${ce(L[0],.6)}`,borderRadius:"9999px"},tile:{background:ce(L[1],.6),backgroundHover:ce(L[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:qa.primary,textColor:qa.secondary,iconBackground:`linear-gradient(135deg, ${de[3]} 0%, ${de[3]}cc 100%)`,iconShadow:`0 2px 8px ${de[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ce(L[1],.6),textColor:qa.primary,titleColor:qa.primary,arrowColor:ce(L[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${de[3]}`},notification:{background:ce(L[0],.95),textColor:qa.primary,textSecondaryColor:qa.secondary,border:`1px solid ${L[5]}`,borderRadius:"12px",successColor:qe[4],warningColor:jt[4],errorColor:at[4],iconBackground:ce(de[3],.15),progressGradient:`linear-gradient(90deg, ${de[3]}, ${de[4]})`},content:{background:ce(L[3],.8),backgroundHover:ce(L[5],.6),border:`1px solid ${ce(L[5],.5)}`,borderRadius:"8px",textColor:qa.primary,textSecondaryColor:qa.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:ce(L[3],.8),searchColor:qa.primary,chevronColor:"currentColor"}},Lb={mode:"light",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif",colorPrimary:de[3],colorPrimaryHover:de[2],borderRadius:"12px",canvas:{position:"right",layout:"overlay",background:ce(L[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:de[3],backgroundHover:de[2],color:"#ffffff",size:"56px",shadow:"0 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:"9999px"},tile:{background:ce(L[12],.7),backgroundHover:ce(L[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:L[1],textColor:L[6],iconBackground:`linear-gradient(135deg, ${de[3]} 0%, ${de[3]}cc 100%)`,iconShadow:`0 2px 8px ${de[3]}40`,headerPadding:"0.375rem 0.75rem",bodyPadding:"0 0.75rem 0.5rem",gap:"0.25rem"},overlay:{background:ce(L[12],.7),textColor:L[1],titleColor:L[1],arrowColor:ce(L[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${de[3]}`},notification:{background:ce(L[12],.95),textColor:L[1],textSecondaryColor:L[6],border:`1px solid ${ce(L[0],.12)}`,borderRadius:"12px",successColor:qe[4],warningColor:jt[4],errorColor:at[4],iconBackground:ce(de[3],.1),progressGradient:`linear-gradient(90deg, ${de[3]}, ${de[2]})`},content:{background:ce(L[12],.8),backgroundHover:ce(L[11],.6),border:`1px solid ${L[11]}`,borderRadius:"8px",textColor:L[1],textSecondaryColor:L[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:L[12],searchColor:L[1],chevronColor:"currentColor"}};function Ib(t){let e=t.mode==="light"?Lb:kb;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 Ab(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?Lb:kb;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 n4=["canvas","launcher","tile","overlay","notification","content"];function Eb(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 n4){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${r4(n)}`]=o)}return e}var Nn=ae(st(),1);var gE=ae(Fe(),1),mE=(0,Nn.createContext)(null);function Tb({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,Nn.useMemo)(()=>a?Ab(a,e??{}):Ib(e??{}),[e,a]),o=(0,Nn.useMemo)(()=>Eb(n),[n]);(0,Nn.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(`
|
|
467
|
+
`;function yN(t){if(t.querySelector(`#${QI}`))return;let e=document.createElement("style");e.id=QI,e.textContent=vN,t.appendChild(e)}function Mp({notifications:t,onDismiss:e,onClickNotification:a,position:r}){let{shadowRoot:n}=oi();return yN(n),t.length===0?null:(0,Ca.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,Ca.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,Ca.jsxs)("div",{onClick:()=>a(o),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px"},children:[(0,Ca.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,Ca.jsx)(Rp,{emoji:o.icon??"\u{1F514}",size:14})}),(0,Ca.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ca.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,Ca.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,Ca.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,Ca.jsx)("div",{style:{height:"2px",background:"rgba(0, 0, 0, 0.08)"},children:(0,Ca.jsx)("div",{className:"syntro-toast-progress",style:{height:"100%",background:"var(--sc-notification-progress-gradient)",animationDuration:`${o.ttl}ms`}})})]},o.id))})}var lr=K(Ke(),1);var Op=3,Dp=8e3,Bp=3e4;var xN=0;function oc(t,e){return t.replace(/\{\{props\.(\w+)\}\}/g,(a,r)=>!e||!(r in e)?a:String(e[r]))}function bN(t,e){if(t===e)return!0;try{return new RegExp(e).test(t)}catch{return!1}}function Pp(t,e){for(let a of e){let r=a.notifications;if(!(!r||r.length===0))for(let n of r){if(!bN(t.name,n.on))continue;let o=Date.now(),i=n.ttl??8e3;return{notification:{id:`notif-${++xN}-${o}`,title:oc(n.title,t.props),body:n.body?oc(n.body,t.props):void 0,icon:n.icon,tileId:a.id,itemId:n.deepLink?.itemId?oc(n.deepLink.itemId,t.props):void 0,expiresAt:o+i,createdAt:o,ttl:i},rule:n}}}return null}function Np(t,e){let[a,r]=(0,lr.useState)([]),n=(0,lr.useRef)(new Map),o=(0,lr.useRef)(new Map),i=(0,lr.useCallback)(u=>{t?.publish(_t.NOTIFICATION_DISMISSED,{notificationId:u.id,tileId:u.tileId,itemId:u.itemId})},[t]),s=(0,lr.useCallback)(u=>{let c=setTimeout(()=>{r(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,lr.useCallback)(u=>{r(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,lr.useEffect)(()=>{if(!t)return;let u=t.subscribe(c=>{let d=Pp(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=n.current.get(S),b=Date.now(),g=h.cooldown??3e4;x!==void 0&&b-x<g||(n.current.set(S,b),r(m=>{if(f.itemId&&m.some(C=>C.tileId===f.tileId&&C.itemId===f.itemId))return m;let y=[...m,f];if(y.length>3){let v=y.shift(),C=o.current.get(v.id);C&&(clearTimeout(C),o.current.delete(v.id))}return y}),t.publish(_t.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 Fp=K(Ke(),1);function SN(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 Hp(t,e,a){let r=(0,Fp.useRef)(new Map);(0,Fp.useEffect)(()=>{if(!t?.events||!a)return;let n=SN(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 oa=K(Ke(),1),nA=K(Ee(),1),ux=(0,oa.createContext)({runtime:null,context:null});function Up({runtime:t,children:e}){let[a,r]=(0,oa.useState)(t?t.context.get():null);(0,oa.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(i=>{r(i)})):void 0,[t]);let n=(0,oa.useMemo)(()=>({runtime:t,context:a}),[t,a]);return(0,nA.jsx)(ux.Provider,{value:n,children:e})}function Cr(){let{runtime:t}=(0,oa.useContext)(ux);return t}function ic(){let{context:t}=(0,oa.useContext)(ux);return t}function zp(){return ic()?.page??null}function JI(){return ic()?.session??null}function eA(){return ic()?.viewport??null}function tA(t,e,a=[]){let r=Cr();(0,oa.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...a,e,t])}function aA(){return Cr()?.state??null}function rA(t,e){let a=Cr(),[r,n]=(0,oa.useState)({value:e,isFallback:!0,isLoading:!0});return(0,oa.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 re(t,e){return`${t}${Math.round(e*255).toString(16).padStart(2,"0")}`}var _N={colorPrimary:ne[3],colorPrimaryHover:ne[4],colorPrimaryMuted:ne[0],colorBackground:re(k[1],.95),colorBackgroundElevated:re(k[3],.95),colorBackgroundSubtle:re(k[0],.2),colorSurface:re(k[4],.8),colorSurfaceHover:re(k[5],.8),colorText:Sa.primary,colorTextSecondary:Sa.secondary,colorTextMuted:Sa.tertiary,colorTextInverse:k[1],colorBorder:Iy.primary,colorBorderSubtle:Iy.secondary,colorSuccess:Me[4],colorSuccessMuted:Me[0],colorWarning:Et[4],colorWarningMuted:Et[0],colorError:Ge[4],colorErrorMuted:Ge[0],colorInfo:ba[4],colorInfoMuted:ba[0],colorNotification:ne[4],colorNotificationMuted:re(ne[4],.4),glassBackground:re(k[1],.6),glassBackgroundHover:re(k[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"},CN={colorPrimary:ne[3],colorPrimaryHover:ne[2],colorPrimaryMuted:re(ne[5],.1),colorBackground:re(k[12],.95),colorBackgroundElevated:re(k[11],.95),colorBackgroundSubtle:re(k[0],.02),colorSurface:re(k[11],.6),colorSurfaceHover:re(k[10],.6),colorText:k[1],colorTextSecondary:k[6],colorTextMuted:k[8],colorTextInverse:k[12],colorBorder:re(k[0],.12),colorBorderSubtle:re(k[0],.06),colorSuccess:Me[4],colorSuccessMuted:re(Me[4],.12),colorWarning:Et[4],colorWarningMuted:re(Et[4],.12),colorError:Ge[4],colorErrorMuted:re(Ge[4],.12),colorInfo:ba[4],colorInfoMuted:re(ba[4],.12),colorNotification:ne[3],colorNotificationMuted:re(ne[3],.4),glassBackground:re(k[12],.7),glassBackgroundHover:re(k[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 wN(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var cx={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:re(k[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:Hf.primary.backgroundDefault,backgroundHover:Hf.primary.backgroundHover,color:Hf.primary.icon,size:"56px",shadow:`0 8px 32px ${re(k[0],.6)}`,borderRadius:"9999px"},tile:{background:re(k[1],.6),backgroundHover:re(k[1],.7),border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.3)",titleColor:Sa.primary,textColor:Sa.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:re(k[1],.6),textColor:Sa.primary,titleColor:Sa.primary,arrowColor:re(k[1],.6),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:re(k[0],.95),textColor:Sa.primary,textSecondaryColor:Sa.secondary,border:`1px solid ${k[5]}`,borderRadius:"12px",successColor:Me[4],warningColor:Et[4],errorColor:Ge[4],iconBackground:re(ne[3],.15),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[4]})`},content:{background:re(k[3],.8),backgroundHover:re(k[5],.6),border:`1px solid ${re(k[5],.5)}`,borderRadius:"8px",textColor:Sa.primary,textSecondaryColor:Sa.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:re(k[3],.8),searchColor:Sa.primary,chevronColor:"currentColor"}},dx={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:re(k[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:re(k[12],.7),backgroundHover:re(k[12],.8),border:"1px solid rgba(0, 0, 0, 0.06)",borderRadius:"14px",shadow:"0 2px 12px rgba(0, 0, 0, 0.12)",titleColor:k[1],textColor:k[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:re(k[12],.7),textColor:k[1],titleColor:k[1],arrowColor:re(k[12],.7),arrowSize:"8px",border:"none",borderRadius:"0",scrimOpacity:"0",highlightRing:`2px solid ${ne[3]}`},notification:{background:re(k[12],.95),textColor:k[1],textSecondaryColor:k[6],border:`1px solid ${re(k[0],.12)}`,borderRadius:"12px",successColor:Me[4],warningColor:Et[4],errorColor:Ge[4],iconBackground:re(ne[3],.1),progressGradient:`linear-gradient(90deg, ${ne[3]}, ${ne[2]})`},content:{background:re(k[12],.8),backgroundHover:re(k[11],.6),border:`1px solid ${k[11]}`,borderRadius:"8px",textColor:k[1],textSecondaryColor:k[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:k[12],searchColor:k[1],chevronColor:"currentColor"}};function fx(t){let e=t.mode==="light"?dx:cx;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 px(t,e){let a=e.mode??t.mode??"dark",r=a==="light"?dx:cx;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 LN=["canvas","launcher","tile","overlay","notification","content"];function hx(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 LN){let r=t[a];if(r)for(let[n,o]of Object.entries(r))o!==void 0&&(e[`--sc-${a}-${wN(n)}`]=o)}return e}var an=K(Ke(),1);var iA=K(Ee(),1),oA=(0,an.createContext)(null);function mx({children:t,themeConfig:e,workspaceTheme:a,shadowRoot:r}){let n=(0,an.useMemo)(()=>a?px(a,e??{}):fx(e??{}),[e,a]),o=(0,an.useMemo)(()=>hx(n),[n]);(0,an.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(`
|
|
468
468
|
`);s.textContent=`:host {
|
|
469
469
|
${l}
|
|
470
|
-
}`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,
|
|
470
|
+
}`},[r,o]);let i={config:n,mode:n.mode,cssVariables:o};return(0,iA.jsx)(oA.Provider,{value:i,children:t})}function gx(){let t=(0,an.useContext)(oA);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}var tt=K(Ke(),1);var lA=K(Ee(),1);function sA({emoji:t,size:e=18,color:a="currentColor"}){return(0,lA.jsx)(Rp,{emoji:t,size:e,color:a})}var ia=K(Ee(),1);function kN({widgetId:t,props:e}){let a=Cr(),r=(0,tt.useRef)(null),n=(0,tt.useRef)(null),o=a?.widgets,i=o?.has(t)??!1,s=(0,tt.useRef)(e);s.current=e;let[,l]=(0,tt.useReducer)(d=>d+1,0);(0,tt.useEffect)(()=>{if(!(!o||i))return o.subscribe(d=>{d.type==="registered"&&d.widgetId===t&&l()})},[o,t,i]),(0,tt.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 f=o.mount(t,d,s.current);return n.current=f,()=>{f.unmount(),n.current=null}},[o,t,i]);let u=JSON.stringify(e),c=(0,tt.useRef)(u);return(0,tt.useEffect)(()=>{c.current!==u&&(c.current=u,n.current?.update(s.current))},[u]),!o||!o.has(t)?(0,ia.jsxs)("div",{style:{padding:"0.75rem",fontSize:"0.8rem",color:"var(--sc-tile-text-color)",fontStyle:"italic"},children:["Widget not available: ",t]}):(0,ia.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,tt.useState)(0),c=Cr();(0,tt.useEffect)(()=>{c&&u(C=>C+1)},[c]);let d=(0,tt.useMemo)(()=>c?.widgets?.getRegistration?.(i),[c?.widgets,i]),f=(0,tt.useMemo)(()=>l||(d?.metadata?.icon??"+"),[l,d]),h=(0,tt.useMemo)(()=>o||d?.metadata?.subtitle,[o,d]),[S,x]=(0,tt.useState)(!1),b=(0,tt.useCallback)(()=>x(!0),[]),g=(0,tt.useCallback)(()=>x(!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},y={display:"flex",alignItems:"center",gap:"var(--sc-tile-gap, 0.25rem)",padding:"var(--sc-tile-header-padding, 0.375rem 0.75rem)",minHeight:"44px"},v={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return(0,ia.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:m,onMouseEnter:b,onMouseLeave:g,children:[(0,ia.jsxs)("div",{style:y,children:[(0,ia.jsx)("div",{style:v,children:(0,ia.jsx)(sA,{emoji:f,size:h?36:24})}),(0,ia.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,ia.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}),h&&(0,ia.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,ia.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,ia.jsx)("div",{style:{paddingTop:"var(--sc-tile-gap, 0.25rem)"},children:(0,ia.jsx)(kN,{widgetId:i,props:{...s,instanceId:t.id}})})})]})}var be=K(Ee(),1),uA="syntro-launcher-styles";function IN(t,e){if(t.querySelector(`#${uA}`))return;let a=document.createElement("style");a.id=uA,a.textContent=e,t.appendChild(a)}function yx({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:f,displayMode:h="standard"}){let[S,x]=(0,ft.useState)(!1),[b,g]=(0,ft.useState)(null),m=(0,ft.useRef)(null),y=Cr(),{shadowRoot:v,portalRoot:C}=oi(),{config:w}=gx(),{notifications:_,dismiss:L}=Np(y?.events??null,u);Hp(y,u,y?.apps);let A=(0,ft.useCallback)(G=>{y&&y.events.publish(_t.NOTIFICATION_CLICKED,{notificationId:G.id,tileId:G.tileId,itemId:G.itemId}),t||e(),y&&G.tileId&&y.events.publish(_t.NOTIFICATION_DEEP_LINK,{tileId:G.tileId,itemId:G.itemId}),L(G.id)},[y,t,e,L]),I=(0,ft.useMemo)(()=>`
|
|
471
471
|
@keyframes syntro-launcher-pulse {
|
|
472
472
|
0%, 100% {
|
|
473
473
|
box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 0 ${w.colorPrimary}66;
|
|
@@ -500,7 +500,7 @@ ${l}
|
|
|
500
500
|
.syntro-badge-ping { animation: syntro-badge-ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
|
|
501
501
|
.syntro-badge-glow { animation: syntro-badge-glow 2s ease-in-out infinite; }
|
|
502
502
|
.syntro-badge-bounce { animation: syntro-badge-bounce 2s ease-in-out infinite; }
|
|
503
|
-
`,[w.colorPrimary,w.colorPrimaryHover]);(0,It.useEffect)(()=>{t&&u.forEach(X=>{if(a?.trackRectangleViewed(X.id,"overlay"),g){let ue=El.tileViewed(X.id,"overlay");g.events.publish(ue.name,ue.props,ue.source)}})},[a,g,t,u]),(0,It.useEffect)(()=>{x(!0),i4(y,I)},[y,I]);let R=(0,It.useCallback)(()=>{let X=!t;if(X?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),g){let ue=X?El.canvasOpened("overlay"):El.canvasClosed("overlay");g.events.publish(ue.name,ue.props,ue.source)}e()},[t,a,g,e]);(0,It.useEffect)(()=>{if(!t)return;let X=ue=>{let Ot=ue.composedPath();Q.current&&!Ot.includes(Q.current)&&R()};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[t,R]);let U=(0,It.useCallback)(X=>{let ue=X.currentTarget.getBoundingClientRect();h.current={startX:X.clientX,startY:X.clientY,startElX:ue.left,startElY:ue.top,dragged:!1},X.currentTarget.setPointerCapture(X.pointerId)},[]),E=(0,It.useCallback)(X=>{let ue=h.current;if(!ue)return;let Ot=X.clientX-ue.startX,ao=X.clientY-ue.startY;(Math.abs(Ot)>5||Math.abs(ao)>5)&&(ue.dragged=!0),ue.dragged&&m({x:ue.startElX+Ot,y:ue.startElY+ao})},[]),N=(0,It.useCallback)(X=>{let ue=h.current;h.current=null,ue&&!ue.dragged&&R()},[R]),O=p==="focused",H=w.canvas.position==="right",Y=w.canvas.layout==="push",z=w.canvas.border??"none",Q=(0,It.useRef)(null),we=2147483600;(0,It.useEffect)(()=>{if(!Y)return;let X=document.documentElement,ue=H?"marginRight":"marginLeft",Ot=w.canvas.transitionDuration??"300ms",ao=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",$g=X.style.transition;if(X.style.transition=`${ue} ${Ot} ${ao}`,t){let Vg=Q.current?.offsetWidth??380;X.style[ue]=`${Vg}px`}else X.style[ue]="0px";return()=>{X.style[ue]="",X.style.transition=$g}},[Y,t,H,w.canvas.transitionDuration,w.canvas.transitionEasing]),(0,It.useEffect)(()=>{if(!Y||!t)return;let X=Q.current;if(!X)return;let ue=H?"marginRight":"marginLeft",Ot=new ResizeObserver(([ao])=>{document.documentElement.style[ue]=`${ao.contentRect.width}px`});return Ot.observe(X),()=>Ot.disconnect()},[Y,t,H]);let Me={display:"flex",flexDirection:"column",width:O?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let X=w.canvas.transitionDuration??"300ms",ue=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${X} ${ue}, opacity ${X} ease-out`:`transform ${X} ${ue}, opacity ${X} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let X=w.canvas.blur??"blur(24px)",ue=O&&X!=="none"?`${X} saturate(1.2)`:X;return{backdropFilter:ue,WebkitBackdropFilter:ue}})(),...(()=>{if(O||z&&z!=="none")return{};let X=w.canvas.transitionFade??"6%",ue=H?`linear-gradient(to right, transparent, black ${X})`:`linear-gradient(to left, transparent, black ${X})`;return{maskImage:ue,WebkitMaskImage:ue}})(),border:z,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":H?"translateX(120%)":"translateX(-120%)"},ha=(0,Ee.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:we},children:(0,Ee.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:H?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,Ee.jsxs)("div",{ref:Q,"data-shadow-canvas-id":"overlay-container",style:Me,children:[O&&f&&(0,Ee.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,Ee.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:f})}),(0,Ee.jsx)("div",{style:{flex:1,overflowY:"auto",padding:O?"0":"1rem"},children:c?(0,Ee.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:O?"1rem":"0"},children:"Loading..."}):d?(0,Ee.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:O?"1rem":"0"},children:["Failed to load: ",d]}):O?u.length>0?(0,Ee.jsx)(Rl,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,Ee.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(X=>(0,Ee.jsx)(Rl,{config:X,surface:"overlay",telemetry:a,style:{width:"100%"}},X.id))})}),l]}),(0,Ee.jsx)("div",{style:{flex:"1 1 auto"}})]})});return S?(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Mb.createPortal)((0,Ee.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:we+47},children:[(0,Ee.jsx)(Dh,{notifications:_,onDismiss:k,onClickNotification:A,position:w.canvas.position??"right"}),(0,Ee.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: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:h.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:h.current?.dragged?"grabbing":"pointer",touchAction:"none"},onPointerDown:U,onPointerMove:E,onPointerUp:N,onMouseEnter:X=>{h.current?.dragged||(X.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:X=>{h.current?.dragged||(X.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,Ee.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,Ee.jsx)("path",{d:"M18 6L6 18"}),(0,Ee.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,Ee.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,Ee.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,Ee.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,Ee.jsx)("path",{d:"M5 3v4"}),(0,Ee.jsx)("path",{d:"M3 5h4"}),(0,Ee.jsx)("path",{d:"M19 17v4"}),(0,Ee.jsx)("path",{d:"M17 19h4"})]}),!t&&_.length>0&&(0,Ee.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,Ee.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,Ee.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,Ee.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:_.length>99?"99+":_.length})]})]})]}),C),(0,Mb.createPortal)(ha,C)]}):null}var ca=ae(st(),1);var bE=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function Db({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,ca.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,ca.useRef)("[]"),l=(0,ca.useRef)(null),u=(0,ca.useCallback)(async()=>{let d=l.current;if(!d||!a)return;let f=d.tiles||[];f=await a.filterTiles(f),e&&(f=f.filter(p=>e.shouldRenderRectangle(p))),i(p=>({...p,tiles:bE(f)}))},[a,e]),c=(0,ca.useCallback)(async()=>{try{i(b=>({...b,isLoading:!0,error:void 0}));let d=await t();te("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))),te("SmartCanvas Config",`Tile count after filtering: ${f.length}`);let p=d.actions||[],S=JSON.stringify(p),x=S!==s.current;x&&(s.current=S),i(b=>({tiles:bE(f),actions:x?p: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(p=>({...p,isLoading:!1,error:f}))}},[e,t,a]);return(0,ca.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,ca.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,ca.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,ca.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,ca.useMemo)(()=>o,[o])}var Ml=ae(Fe(),1);function Nb({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:f="smart-canvas-overlay-uri",overlayFetchCredentials:p="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:h}){return u?(0,Ml.jsx)(qh,{runtime:u,children:(0,Ml.jsx)(SE,{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:f,overlayFetchCredentials:p,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:h})}):(0,Ml.jsx)(SE,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:p,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:h})}function SE({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:f="smart-canvas-overlay-uri",overlayFetchCredentials:p="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:m,workspaceTheme:h}){let[g,y]=(0,da.useState)(t.getState().open),C=$h(),[w,_]=(0,da.useState)(()=>typeof window<"u"?window.location.href:"/"),k=C?.url??w;(0,da.useEffect)(()=>{if(u||typeof window>"u")return;let Y=()=>_(window.location.href);window.addEventListener("popstate",Y),window.addEventListener("hashchange",Y);let z=history.pushState,Q=history.replaceState;return history.pushState=function(...we){z.apply(this,we),queueMicrotask(Y)},history.replaceState=function(...we){Q.apply(this,we),queueMicrotask(Y)},()=>{window.removeEventListener("popstate",Y),window.removeEventListener("hashchange",Y),history.pushState=z,history.replaceState=Q}},[u]);let A=(0,da.useMemo)(()=>e||qi({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),I=Db({fetcher:A,experiments:s,runtime:u,pageUrl:k}),R=I.tiles.length>0&&!I.error;(0,da.useEffect)(()=>t.subscribe(Y=>y(Y.open)),[t]),(0,da.useEffect)(()=>{!I.isLoading&&!R&&t.getState().open&&t.setOpen(!1)},[t,R,I.isLoading]);let U=(0,da.useRef)(m??null),E=(0,da.useRef)(!!m),N=(0,da.useRef)(0);(0,da.useEffect)(()=>{if(!u?.actions)return;if(E.current){I.actions.length>0&&(E.current=!1);return}let Y=++N.current,z=()=>Y!==N.current;return(async()=>{if(U.current){try{await U.current.revertAll()}catch(we){console.error("[SmartCanvasApp] Failed to revert actions:",we)}U.current=null}if(!z()&&I.actions.length>0)try{let we=await u.actions.applyBatch(I.actions);z()?await we.revertAll():U.current=we}catch(we){z()||console.error("[SmartCanvasApp] Failed to apply actions:",we)}})(),()=>{U.current&&(U.current.revertAll().catch(we=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",we)}),U.current=null)}},[u,I.actions,k]),(0,da.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:O}=$i(),H=I.theme;return(0,Ml.jsx)(Tb,{themeConfig:H,workspaceTheme:h,shadowRoot:O,children:!I.isLoading&&!R?null:(0,Ml.jsx)(Ob,{tiles:I.tiles,isLoading:I.isLoading,error:I.error,canvasTitle:I.canvasTitle,telemetry:l,launcherLabel:x??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:g,onToggle:()=>t.toggle(),displayMode:I.displayMode})})}var Bb=ae(Fe(),1),_E="smart-canvas",CE=`
|
|
503
|
+
`,[w.colorPrimary,w.colorPrimaryHover]);(0,ft.useEffect)(()=>{t&&u.forEach(G=>{if(a?.trackRectangleViewed(G.id,"overlay"),y){let ae=Ts.tileViewed(G.id,"overlay");y.events.publish(ae.name,ae.props,ae.source)}})},[a,y,t,u]),(0,ft.useEffect)(()=>{x(!0),IN(v,I)},[v,I]);let R=(0,ft.useCallback)(()=>{let G=!t;if(G?a?.trackCanvasOpened("overlay"):a?.trackCanvasClosed("overlay"),y){let ae=G?Ts.canvasOpened("overlay"):Ts.canvasClosed("overlay");y.events.publish(ae.name,ae.props,ae.source)}e()},[t,a,y,e]);(0,ft.useEffect)(()=>{if(!t)return;let G=ae=>{let yt=ae.composedPath();Z.current&&!yt.includes(Z.current)&&R()};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[t,R]);let F=(0,ft.useCallback)(G=>{let ae=G.currentTarget.getBoundingClientRect();m.current={startX:G.clientX,startY:G.clientY,startElX:ae.left,startElY:ae.top,dragged:!1},G.currentTarget.setPointerCapture(G.pointerId)},[]),E=(0,ft.useCallback)(G=>{let ae=m.current;if(!ae)return;let yt=G.clientX-ae.startX,Cn=G.clientY-ae.startY;(Math.abs(yt)>5||Math.abs(Cn)>5)&&(ae.dragged=!0),ae.dragged&&g({x:ae.startElX+yt,y:ae.startElY+Cn})},[]),D=(0,ft.useCallback)(G=>{let ae=m.current;m.current=null,ae&&!ae.dragged&&R()},[R]),O=h==="focused",N=w.canvas.position==="right",W=w.canvas.layout==="push",H=w.canvas.border??"none",Z=(0,ft.useRef)(null),he=2147483600;(0,ft.useEffect)(()=>{if(!W)return;let G=document.documentElement,ae=N?"marginRight":"marginLeft",yt=w.canvas.transitionDuration??"300ms",Cn=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)",Om=G.style.transition;if(G.style.transition=`${ae} ${yt} ${Cn}`,t){let Dm=Z.current?.offsetWidth??380;G.style[ae]=`${Dm}px`}else G.style[ae]="0px";return()=>{G.style[ae]="",G.style.transition=Om}},[W,t,N,w.canvas.transitionDuration,w.canvas.transitionEasing]),(0,ft.useEffect)(()=>{if(!W||!t)return;let G=Z.current;if(!G)return;let ae=N?"marginRight":"marginLeft",yt=new ResizeObserver(([Cn])=>{document.documentElement.style[ae]=`${Cn.contentRect.width}px`});return yt.observe(G),()=>yt.disconnect()},[W,t,N]);let Ce={display:"flex",flexDirection:"column",width:O?"40vw":w.canvas.width,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:0,transition:(()=>{let G=w.canvas.transitionDuration??"300ms",ae=w.canvas.transitionEasing??"cubic-bezier(0.16, 1, 0.3, 1)";return t?`transform ${G} ${ae}, opacity ${G} ease-out`:`transform ${G} ${ae}, opacity ${G} ease-in`})(),color:"var(--sc-overlay-text-color)",background:"var(--sc-canvas-background)",...(()=>{let G=w.canvas.blur??"blur(24px)",ae=O&&G!=="none"?`${G} saturate(1.2)`:G;return{backdropFilter:ae,WebkitBackdropFilter:ae}})(),...(()=>{if(O||H&&H!=="none")return{};let G=w.canvas.transitionFade??"6%",ae=N?`linear-gradient(to right, transparent, black ${G})`:`linear-gradient(to left, transparent, black ${G})`;return{maskImage:ae,WebkitMaskImage:ae}})(),border:H,borderRadius:"var(--sc-overlay-border-radius, 0)",boxShadow:"none",transform:t?"translateX(0)":N?"translateX(120%)":"translateX(-120%)"},Xt=(0,be.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:he},children:(0,be.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:N?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:"0"},children:[(0,be.jsxs)("div",{ref:Z,"data-shadow-canvas-id":"overlay-container",style:Ce,children:[O&&f&&(0,be.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,be.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"var(--sc-notification-text-secondary-color)"},children:f})}),(0,be.jsx)("div",{style:{flex:1,overflowY:"auto",padding:O?"0":"1rem"},children:c?(0,be.jsx)("div",{style:{color:"var(--sc-overlay-text-color)",padding:O?"1rem":"0"},children:"Loading..."}):d?(0,be.jsxs)("div",{style:{color:"var(--sc-notification-error-color)",padding:O?"1rem":"0"},children:["Failed to load: ",d]}):O?u.length>0?(0,be.jsx)(Ms,{config:u[0],surface:"overlay",telemetry:a,style:{width:"100%",height:"100%"}}):null:(0,be.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:u.map(G=>(0,be.jsx)(Ms,{config:G,surface:"overlay",telemetry:a,style:{width:"100%"}},G.id))})}),l]}),(0,be.jsx)("div",{style:{flex:"1 1 auto"}})]})});return S?(0,be.jsxs)(be.Fragment,{children:[(0,vx.createPortal)((0,be.jsxs)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:he+47},children:[(0,be.jsx)(Mp,{notifications:_,onDismiss:L,onClickNotification:A,position:w.canvas.position??"right"}),(0,be.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:N?"2.5rem":void 0,left:N?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:F,onPointerMove:E,onPointerUp:D,onMouseEnter:G=>{m.current?.dragged||(G.currentTarget.style.backgroundColor=w.launcher.backgroundHover??"var(--sc-launcher-background-hover)")},onMouseLeave:G=>{m.current?.dragged||(G.currentTarget.style.backgroundColor=w.launcher.background??"var(--sc-launcher-background)")},children:[t?(0,be.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,be.jsx)("path",{d:"M18 6L6 18"}),(0,be.jsx)("path",{d:"M6 6l12 12"})]}):n?(0,be.jsx)("img",{src:n,alt:"","aria-hidden":"true",style:{width:"60%",height:"60%",objectFit:"contain",pointerEvents:"none"}}):(0,be.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,be.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,be.jsx)("path",{d:"M5 3v4"}),(0,be.jsx)("path",{d:"M3 5h4"}),(0,be.jsx)("path",{d:"M19 17v4"}),(0,be.jsx)("path",{d:"M17 19h4"})]}),!t&&_.length>0&&(0,be.jsxs)("div",{style:{position:"absolute",top:-2,right:-2,pointerEvents:"none"},children:[(0,be.jsx)("span",{className:"syntro-badge-ping",style:{position:"absolute",inset:0,borderRadius:"9999px",background:`${w.colorPrimaryHover}66`}}),(0,be.jsx)("span",{className:"syntro-badge-glow",style:{position:"absolute",inset:-4,borderRadius:"9999px"}}),(0,be.jsx)("span",{className:"syntro-badge-bounce",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"9999px",background:w.colorPrimaryHover,color:"#ffffff",fontSize:11,fontWeight:700},children:_.length>99?"99+":_.length})]})]})]}),C),(0,vx.createPortal)(Xt,C)]}):null}var jt=K(Ke(),1);var cA=t=>[...t].sort((e,a)=>(a.priority??0)-(e.priority??0));function xx({fetcher:t,experiments:e,runtime:a,pageUrl:r,pollIntervalMs:n}){let[o,i]=(0,jt.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,jt.useRef)("[]"),l=(0,jt.useRef)(null),u=(0,jt.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:cA(f)}))},[a,e]),c=(0,jt.useCallback)(async()=>{try{i(b=>({...b,isLoading:!0,error:void 0}));let d=await t();Y("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))),Y("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:cA(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,jt.useEffect)(()=>{if(c(),e?.onFeaturesChanged)return e.onFeaturesChanged(()=>c())},[c,e,r]),(0,jt.useEffect)(()=>{if(a?.accumulator)return a.accumulator.subscribe(()=>{u()})},[a,u]),(0,jt.useEffect)(()=>{if(a?.context)return a.context.subscribe(()=>{u()})},[a,u]),(0,jt.useEffect)(()=>{if(!n)return;let d=setInterval(()=>{c()},n);return()=>clearInterval(d)},[c,n]),(0,jt.useMemo)(()=>o,[o])}var Os=K(Ee(),1);function bx({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:f="smart-canvas-overlay-uri",overlayFetchCredentials:h="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m}){return u?(0,Os.jsx)(Up,{runtime:u,children:(0,Os.jsx)(dA,{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:f,overlayFetchCredentials:h,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m})}):(0,Os.jsx)(dA,{controller:t,fetcher:e,configUri:a,configUriFeatureKey:r,configFeatureKey:n,fetchCredentials:o,pollIntervalMs:i,experiments:s,telemetry:l,overlayFetcher:c,overlayConfigUri:d,overlayConfigFeatureKey:f,overlayFetchCredentials:h,footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m})}function dA({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:f="smart-canvas-overlay-uri",overlayFetchCredentials:h="include",footerSlot:S,launcherLabel:x,canvasHost:b,initialBatchHandle:g,workspaceTheme:m}){let[y,v]=(0,Gt.useState)(t.getState().open),C=zp(),[w,_]=(0,Gt.useState)(()=>typeof window<"u"?window.location.href:"/"),L=C?.url??w;(0,Gt.useEffect)(()=>{if(u||typeof window>"u")return;let W=()=>_(window.location.href);window.addEventListener("popstate",W),window.addEventListener("hashchange",W);let H=history.pushState,Z=history.replaceState;return history.pushState=function(...he){H.apply(this,he),queueMicrotask(W)},history.replaceState=function(...he){Z.apply(this,he),queueMicrotask(W)},()=>{window.removeEventListener("popstate",W),window.removeEventListener("hashchange",W),history.pushState=H,history.replaceState=Z}},[u]);let A=(0,Gt.useMemo)(()=>e||ni({configUri:a,experiments:s,featureKey:r,configFeatureKey:n,credentials:o}),[e,a,s,r,n,o]),I=xx({fetcher:A,experiments:s,runtime:u,pageUrl:L}),R=I.tiles.length>0&&!I.error;(0,Gt.useEffect)(()=>t.subscribe(W=>v(W.open)),[t]),(0,Gt.useEffect)(()=>{!I.isLoading&&!R&&t.getState().open&&t.setOpen(!1)},[t,R,I.isLoading]);let F=(0,Gt.useRef)(g??null),E=(0,Gt.useRef)(!!g),D=(0,Gt.useRef)(0);(0,Gt.useEffect)(()=>{if(!u?.actions)return;if(E.current){I.actions.length>0&&(E.current=!1);return}let W=++D.current,H=()=>W!==D.current;return(async()=>{if(F.current){try{await F.current.revertAll()}catch(he){console.error("[SmartCanvasApp] Failed to revert actions:",he)}F.current=null}if(!H()&&I.actions.length>0)try{let he=await u.actions.applyBatch(I.actions);H()?await he.revertAll():F.current=he}catch(he){H()||console.error("[SmartCanvasApp] Failed to apply actions:",he)}})(),()=>{F.current&&(F.current.revertAll().catch(he=>{console.error("[SmartCanvasApp] Failed to revert actions on cleanup:",he)}),F.current=null)}},[u,I.actions,L]),(0,Gt.useEffect)(()=>{if(u)return u.events.subscribe({names:["canvas.requestOpen"]},()=>t.setOpen(!0))},[u,t]);let{shadowRoot:O}=oi(),N=I.theme;return(0,Os.jsx)(mx,{themeConfig:N,workspaceTheme:m,shadowRoot:O,children:!I.isLoading&&!R?null:(0,Os.jsx)(yx,{tiles:I.tiles,isLoading:I.isLoading,error:I.error,canvasTitle:I.canvasTitle,telemetry:l,launcherLabel:x??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:y,onToggle:()=>t.toggle(),displayMode:I.displayMode})})}var Sx=K(Ee(),1),fA="smart-canvas",pA=`
|
|
504
504
|
:host {
|
|
505
505
|
font: inherit;
|
|
506
506
|
color: inherit;
|
|
@@ -514,12 +514,12 @@ ${l}
|
|
|
514
514
|
*, *::before, *::after {
|
|
515
515
|
box-sizing: border-box;
|
|
516
516
|
}
|
|
517
|
-
`,sr,Ho,Uo,Bn,Pn,zo,Fn,Vh=class extends HTMLElement{constructor(){super();no(this,sr);no(this,Ho);no(this,Uo);no(this,Bn);no(this,Pn);no(this,zo,null);no(this,Fn,null);Nr(this,sr,this.attachShadow({mode:"open",delegatesFocus:!0})),Nr(this,Ho,document.createElement("div")),Ie(this,Ho).setAttribute("part","mount"),Ie(this,sr).appendChild(Ie(this,Ho)),Nr(this,Uo,document.createElement("div")),Ie(this,Uo).id="portalRoot",Ie(this,sr).appendChild(Ie(this,Uo)),Nr(this,Bn,document.createElement("div")),Ie(this,Bn).id="overlayContainer",Object.assign(Ie(this,Bn).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),Ie(this,sr).appendChild(Ie(this,Bn)),Nr(this,Pn,vb()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){Ie(this,zo)?.unmount(),Nr(this,zo,null)}getMountNode(){return Ie(this,Ho)}getController(){return Ie(this,Pn)}getPortalRoot(){return Ie(this,Uo)}getOverlayContainer(){return Ie(this,Bn)}getShadowRoot(){return Ie(this,sr)}open(){Ie(this,Pn).setOpen(!0)}close(){Ie(this,Pn).setOpen(!1)}toggle(){Ie(this,Pn).toggle()}setOverrideFetcher(a){Ie(this,Fn)&&(Nr(this,Fn,{...Ie(this,Fn),fetcher:a}),this.render())}mountReactApp(a){Nr(this,Fn,a),this.render()}render(){!this.isConnected||!Ie(this,Fn)||(Ie(this,zo)||Nr(this,zo,(0,wE.createRoot)(Ie(this,Ho))),Ie(this,zo).render((0,Bb.jsx)(yb,{shadowRoot:Ie(this,sr),portalRoot:Ie(this,Uo),overlayContainer:Ie(this,Bn),children:(0,Bb.jsx)(Nb,{...Ie(this,Fn),controller:Ie(this,Pn),canvasHost:this})})))}applyBaseStyles(){if(Ie(this,sr).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(CE),Ie(this,sr).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=CE,Ie(this,sr).appendChild(a)}}};sr=new WeakMap,Ho=new WeakMap,Uo=new WeakMap,Bn=new WeakMap,Pn=new WeakMap,zo=new WeakMap,Fn=new WeakMap;var Pb=()=>{typeof window>"u"||customElements.get(_E)||customElements.define(_E,Vh)};var jh=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=UA(b)}let a=null,r=null,n=null,{runtime:o}=t;async function i(b){!o?.actions||b.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(b))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=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,h)=>`[${h}] ${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&&jc(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=_h();Pb();let u=document.createElement("smart-canvas");if(YA(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`),GA(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,f=t.integrations?.telemetry,p=t.fetcher??qi({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=p);let S={fetcher:p,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:n,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,h]of Object.entries(b))u.style.setProperty(m,h)},getConfig:async()=>{if(r)try{let b=await r();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=>{r=b,u.setOverrideFetcher(b),o?.accumulator&&b().then(m=>{m?.tiles&&jc(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 jh(t)}});var $o=ae(st(),1);var qo=ae(Fe(),1);function s4({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,$o.useState)(0),o=(0,$o.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,$o.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,$o.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,$o.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,qo.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,qo.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,qo.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,qo.jsx)(Rl,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,qo.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,qo.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 Ol(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function l4(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=Ol(n),i=Ol(Dn);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${Dn}. 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${Dn}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:u4(r,n)}):{valid:!0,warnings:e,errors:a}}function u4(t,e){let a={...t};return Ol(e).major===1&&(a=c4(a)),a.schemaVersion=Dn,a}function c4(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 d4(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=Ol(a),n=Ol(Dn);return r.major<n.major||!e.schemaVersion}var LE={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function IE(){return LE}function Fb(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 ud(t,e,a){return a===2?Fb(Fb(t+e)+"")%1e4/1e4:a===1?Fb(e+t)%1e3/1e3:null}function f4(t){return t<=0?[]:new Array(t).fill(1/t)}function Gh(t,e){return t>=e[0]&&t<e[1]}function AE(t,e){let a=ud("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function EE(t,e){for(let a=0;a<e.length;a++)if(Gh(t,e[a]))return a;return-1}function Ub(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Zh(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=m4(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 p4(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 h4(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=>!p4(n[0],n[1],n[2]))}catch{return!1}}function m4(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=Ub(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return h4(r,a);return!1}catch{return!1}}function TE(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=f4(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 RE(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 ME(t){try{return t()}catch(e){return console.error(e),!1}}var Hb=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Vi(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||LE.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",Hb(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:Hb(n)},r,Hb(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function cd(t){return typeof t=="string"?t:JSON.stringify(t)}function ja(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 OE(){let t;try{t="1.6.5"}catch{t=""}return t}function DE(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 kE(t){return typeof t=="object"&&t!==null}function Wh(t){return t.urlPatterns&&t.variations.some(e=>kE(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>kE(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Xh(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 ea={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},Qr=IE(),Dl={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>Qr.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 Qr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new Qr.EventSource(`${t}/sub/${e}`,{headers:a}):new Qr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),y4()):document.visibilityState==="hidden"&&(t=window.setTimeout(v4,ea.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(Qr.localStorage=globalThis.localStorage)}catch{}var Nl=new Map,NE=!1,Hn=new Map,Yh=new Map,Bl=new Map,Pl=new Set;function PE(t){Object.assign(ea,t),ea.backgroundSync||Gb()}async function FE({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(ea.backgroundSync=!1),x4({instance:t,allowStale:r,timeout:e,skipCache:a})}function g4(t){let e=dd(t),a=Nl.get(e)||new Set;a.add(t),Nl.set(e,a)}function HE(t){Nl.forEach(e=>e.delete(t))}function v4(){Bl.forEach(t=>{t&&(t.state="idle",Vb(t))})}function y4(){Bl.forEach(t=>{t&&t.state==="idle"&&jb(t)})}async function BE(){try{if(!Qr.localStorage)return;await Qr.localStorage.setItem(ea.cacheKey,JSON.stringify(Array.from(Hn.entries())))}catch{}}async function x4({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=dd(t),o=qb(t),i=new Date,s=new Date(i.getTime()-ea.maxAge+ea.staleTTL);await b4();let l=!ea.disableCache&&!r?Hn.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&Pl.add(n),l.staleAt<i?zb(t):$b(t),{data:l.data,success:!0,source:"cache"}):await Xh(zb(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function dd(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function qb(t){let e=dd(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 b4(){if(!NE){NE=!0;try{if(Qr.localStorage){let t=await Qr.localStorage.getItem(ea.cacheKey);if(!ea.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{Hn.set(a,{...r,staleAt:new Date(r.staleAt)})}),UE()}}}catch{}if(!ea.disableIdleStreams){let t=Dl.startIdleListener();t&&(Dl.stopIdleListener=t)}}}function UE(){let t=Array.from(Hn.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,Hn.size-ea.maxEntries),Hn.size);for(let a=0;a<e;a++)Hn.delete(t[a].key)}function zE(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+ea.staleTTL),o=ea.disableCache?void 0:Hn.get(e);if(o&&r&&o.version===r){o.staleAt=n,BE();return}ea.disableCache||(Hn.set(e,{data:a,version:r,staleAt:n,sse:Pl.has(t)}),UE()),BE();let i=Nl.get(t);i&&i.forEach(s=>S4(s,a))}async function S4(t,e){await t.setPayload(e||t.getPayload())}async function zb(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=dd(t),i=qb(t),s=Yh.get(i);return s||(s=(n?Dl.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):Dl.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"&&Pl.add(o),u.json()}).then(u=>(zE(o,i,u),$b(t),Yh.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(Yh.delete(i),{data:null,source:"error",success:!1,error:u})),Yh.set(i,s)),s}function $b(t,e=!1){let a=dd(t),r=qb(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&Pl.add(a),ea.backgroundSync&&Pl.has(a)&&Qr.EventSource){if(Bl.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=Nl.get(a);u&&u.forEach(c=>{zb(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);zE(a,r,u)}s.errors=0}catch{qE(s)}},errors:0,state:"active"};Bl.set(a,s),jb(s)}}function qE(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);Vb(t),setTimeout(()=>{["idle","active"].includes(t.state)||jb(t)},Math.min(e,3e5))}}function Vb(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function jb(t){t.src=Dl.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=()=>qE(t),t.src.onopen=()=>{t.errors=0}}function _4(t,e){Vb(t),Bl.delete(e)}function Gb(){Pl.clear(),Bl.forEach(_4),Nl.clear(),Dl.stopIdleListener()}function Kh(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&$b(t,!0),g4(t)}}var C4=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Xb={revert:function(){}},tm=new Map,Yb=new Set;function w4(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function am(t){var e=tm.get(t);return e||(e={element:t,attributes:{}},tm.set(t,e)),e}function rm(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,w4(e)),i}function nm(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,$E()):t!==a&&(e.isDirty=!0,$E())}function k4(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),nm(H4(e),t)}function L4(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),nm(Array.from(e).filter(Boolean).join(" "),t)}function I4(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),nm(e,t)}function A4(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 E4(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=A4(r);e=n||e}),nm(e,t)}var T4=function(e){return e.innerHTML},R4=function(e,a){return e.innerHTML=a};function jE(t){var e=am(t);return e.html||(e.html=rm(t,"html",T4,R4,k4)),e.html}var M4=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},O4=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function GE(t){var e=am(t);return e.position||(e.position=rm(t,"position",M4,O4,E4)),e.position}var D4=function(e,a){return a?e.className=a:e.removeAttribute("class")},N4=function(e){return e.className};function ZE(t){var e=am(t);return e.classes||(e.classes=rm(t,"class",N4,D4,L4)),e.classes}var B4=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},P4=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function WE(t,e){var a=am(t);return a.attributes[e]||(a.attributes[e]=rm(t,e,B4(e),P4(e),I4)),a.attributes[e]}function F4(t,e){var a=tm.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 Qh;function H4(t){return Qh||(Qh=document.createElement("div")),Qh.innerHTML=t,Qh.innerHTML}function Jh(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||F4(t,e),a.setValue(t,r)}}function U4(t,e){t.html&&Jh(e,"html",t.html),t.classes&&Jh(e,"class",t.classes),t.position&&Jh(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){Jh(e,a,t.attributes[a])})}function $E(){tm.forEach(U4)}function z4(t,e){var a=null;t.kind==="html"?a=jE(e):t.kind==="class"?a=ZE(e):t.kind==="attribute"?a=WE(e,t.attribute):t.kind==="position"&&(a=GE(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function q4(t,e){var a=null;if(t.kind==="html"?a=jE(e):t.kind==="class"?a=ZE(e):t.kind==="attribute"?a=WE(e,t.attribute):t.kind==="position"&&(a=GE(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function XE(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),z4(t,r))})}}function $4(t){t.elements.forEach(function(e){return q4(t,e)}),t.elements.clear(),Yb.delete(t)}function VE(){Yb.forEach(XE)}var Zb;function V4(){typeof document>"u"||(Zb||(Zb=new MutationObserver(function(){VE()})),VE(),Zb.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}V4();function om(t){return typeof document>"u"?Xb:(Yb.add(t),XE(t),{revert:function(){$4(t)}})}function Wb(t,e){return om({kind:"html",elements:new Set,mutate:e,selector:t})}function YE(t,e){return om({kind:"position",elements:new Set,mutate:e,selector:t})}function fd(t,e){return om({kind:"class",elements:new Set,mutate:e,selector:t})}function em(t,e,a){return C4.test(e)?e==="class"||e==="className"?fd(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)})}):om({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):Xb}function j4(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 Wb(e,function(s){return s+(r??"")});if(a==="set")return Wb(e,function(){return r??""})}else if(n==="class"){if(a==="append")return fd(e,function(s){r&&s.add(r)});if(a==="remove")return fd(e,function(s){r&&s.delete(r)});if(a==="set")return fd(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return YE(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return em(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return em(e,n,function(){return r??""});if(a==="remove")return em(e,n,function(){return null})}return Xb}var G4={html:Wb,classes:fd,attribute:em,position:YE,declarative:j4},KE=G4;var Kb={};function Vo(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!eT(t,n,a))return!1;break;case"$nor":if(eT(t,n,a))return!1;break;case"$and":if(!K4(t,n,a))return!1;break;case"$not":if(Vo(t,n,a))return!1;break;default:if(!pd(n,Z4(t,r),a))return!1}return!0}function Z4(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 QE(t,e=!1){let a=`${t}${e?"/i":""}`;return Kb[a]||(Kb[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Kb[a]}function pd(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)||!tT(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!Y4(n,e,t[n],a))return!1;return!0}function tT(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function W4(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 X4(t,e,a){if(!Array.isArray(t))return!1;let r=tT(e)?n=>pd(e,n,a):n=>Vo(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function Fl(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 JE(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(pd(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function Y4(t,e,a,r){switch(t){case"$veq":return ja(e)===ja(a);case"$vne":return ja(e)!==ja(a);case"$vgt":return ja(e)>ja(a);case"$vgte":return ja(e)>=ja(a);case"$vlt":return ja(e)<ja(a);case"$vlte":return ja(e)<=ja(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)?Fl(e,a):!1;case"$ini":return Array.isArray(a)?Fl(e,a,!0):!1;case"$inGroup":return Fl(e,r[a]||[]);case"$notInGroup":return!Fl(e,r[a]||[]);case"$nin":return Array.isArray(a)?!Fl(e,a):!1;case"$nini":return Array.isArray(a)?!Fl(e,a,!0):!1;case"$not":return!pd(a,e,r);case"$size":return Array.isArray(e)?pd(a,e.length,r):!1;case"$elemMatch":return X4(e,a,r);case"$all":return Array.isArray(a)?JE(e,a,r):!1;case"$alli":return Array.isArray(a)?JE(e,a,r,!0):!1;case"$regex":try{return QE(a).test(e)}catch{return!1}case"$regexi":try{return QE(a,!0).test(e)}catch{return!1}case"$type":return W4(e)===a;default:return console.error("Unknown operator: "+t),!1}}function eT(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Vo(t,e[r],a))return!0;return!1}function K4(t,e,a){for(let r=0;r<e.length;r++)if(!Vo(t,e[r],a))return!1;return!0}var Q4="Feature Evaluated",J4="Experiment Viewed";function e3(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 t3(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 Hl(t){try{await t()}catch{}}function aT(t,e,a){if(t.user.trackedExperiments){let n=lm(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(Hl(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(Hl(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(Hl(()=>n(J4,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function a3(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;Hl(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;Hl(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;Hl(()=>r(Q4,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function im(t,e){if(e.stack.evaluatedFeatures.has(t))return jo(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=e3(e);if(a.has(t))return jo(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return jo(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=im(l.id,e);if(u.source==="cyclicPrerequisite")return jo(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!Vo(c,l.condition||{})){if(l.gate)return jo(e,t,null,"prerequisite");continue e}}if(o.filters&&oT(o.filters,e))continue;if("force"in o){if(o.condition&&!nT(o.condition,e)||!r3(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=>{!aT(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),jo(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}=sm(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return jo(e,t,s.value,"experiment",o.id,i,s)}}return jo(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function sm(t,e,a){let r=t.key,n=t.variations.length;if(n<2)return{result:nt(a,t,-1,!1,e)};if(a.global.enabled===!1||a.user.enabled===!1)return{result:nt(a,t,-1,!1,e)};if(t=n3(t,a),t.urlPatterns&&!Zh(a.user.url||"",t.urlPatterns))return{result:nt(a,t,-1,!1,e)};let o=RE(r,a.user.url||"",n);if(o!==null)return{result:nt(a,t,o,!1,e)};let i=t3(a);if(r in i){let b=i[r];return{result:nt(a,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:nt(a,t,-1,!1,e)};let{hashAttribute:s,hashValue:l}=ji(a,t.hashAttribute,a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:nt(a,t,-1,!1,e)};let u=-1,c=!1,d=!1;if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:m}=s3({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(oT(t.filters,a))return{result:nt(a,t,-1,!1,e)}}else if(t.namespace&&!AE(l,t.namespace))return{result:nt(a,t,-1,!1,e)};if(t.include&&!ME(t.include))return{result:nt(a,t,-1,!1,e)};if(t.condition&&!nT(t.condition,a))return{result:nt(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 h=im(m.id,a);if(h.source==="cyclicPrerequisite")return{result:nt(a,t,-1,!1,e)};let g={value:h.value};if(!Vo(g,m.condition||{}))return{result:nt(a,t,-1,!1,e)}}}if(t.groups&&!i3(t.groups,a))return{result:nt(a,t,-1,!1,e)}}if(t.url&&!o3(t.url,a))return{result:nt(a,t,-1,!1,e)};let f=ud(t.seed||r,l,t.hashVersion||1);if(f===null)return{result:nt(a,t,-1,!1,e)};if(!c){let b=t.ranges||TE(n,t.coverage===void 0?1:t.coverage,t.weights);u=EE(f,b)}if(d)return{result:nt(a,t,-1,!1,e,void 0,!0)};if(u<0)return{result:nt(a,t,-1,!1,e)};if("force"in t)return{result:nt(a,t,t.force===void 0?-1:t.force,!1,e)};if(a.global.qaMode||a.user.qaMode)return{result:nt(a,t,-1,!1,e)};if(t.status==="stopped")return{result:nt(a,t,-1,!1,e)};let p=nt(a,t,u,!0,e,f,c);if(a.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:m,doc:h}=u3(a,s,cd(l),{[Qb(t.key,t.bucketVersion)]:p.key});b&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[m]=h,a.user.saveStickyBucketAssignmentDoc(h))}let S=aT(a,t,p);S.length===0&&a.global.saveDeferredTrack&&a.global.saveDeferredTrack({experiment:t,result:p});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:p,trackingCall:x}}function jo(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"&&a3(t,e,s),s}function rT(t){return{...t.user.attributes,...t.user.attributeOverrides}}function nT(t,e){return Vo(rT(e),t,e.global.savedGroups||{})}function oT(t,e){return t.some(a=>{let{hashValue:r}=ji(e,a.attribute);if(!r)return!0;let n=ud(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>Gh(n,o))})}function r3(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=ji(t,a,r);if(!s)return!1;let l=ud(e,s,i||1);return l===null?!1:n?Gh(l,n):o!==void 0?l<=o:!0}function nt(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}=ji(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 n3(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=Ub(t.url))),t}function ji(t,e,a){let r=e||"id",n="",o=rT(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function o3(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 i3(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function s3({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=Qb(e,a),l=l3(t,r,n);if(o>0)for(let d=0;d<o;d++){let f=Qb(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 Qb(t,e){return e=e||0,`${t}__${e}`}function Jb(t,e){return`${t}||${e}`}function l3(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=ji(t,e),o=Jb(r,cd(n)),{hashAttribute:i,hashValue:s}=ji(t,a),l=s?Jb(i,cd(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 u3(t,e,a,r){let n=Jb(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 c3(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 iT(t,e,a){let r=e0(t,a);return e.getAllAssignments(r)}function e0(t,e){let a={};return c3(t,e).forEach(n=>{let{hashValue:o}=ji(t,n);a[n]=cd(o)}),a}async function sT(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Vi(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Vi(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Vi(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function lT(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 lm(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var Ul=typeof window<"u"&&typeof document<"u",d3=OE(),hd=class{constructor(e){if(e=e||{},this.version=d3,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),Ul&&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 sT(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,Kh(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&PE(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Kh(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return Kh(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 lT(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 FE({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 Vi(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 Vi(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,HE(this),e.destroyAllStreams&&Gb(),this.logs=[],Ul&&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}=sm(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=nt(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=sm(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=Wh(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?DE(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Zh(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(Ul)Promise.all([...i?[Xh(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||[],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&&Wh(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 im(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=>[lm(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()}setFeatureUsageCallback(e){this._options.onFeatureUsage=e}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(lm(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(Ul?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=Wh(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}:Ul?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!Ul)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(KE.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await iT(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=e0(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var f3="https://experiment.syntrologie.com",t0=class{constructor(e={}){B(this,"gb");B(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 hd({...e,apiHost:e.apiHost??f3,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 um(t={}){return new t0(t)}var uT="syntro_session_metrics",md=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 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(uT);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(uT,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function cm(t={}){return new md(t)}var v={};Zg(v,{BRAND:()=>F3,DIRTY:()=>Gi,EMPTY_PATH:()=>g3,INVALID:()=>re,NEVER:()=>_H,OK:()=>ta,ParseStatus:()=>Wt,Schema:()=>ge,ZodAny:()=>Wo,ZodArray:()=>$n,ZodBigInt:()=>Wi,ZodBoolean:()=>Xi,ZodBranded:()=>vd,ZodCatch:()=>is,ZodDate:()=>Yi,ZodDefault:()=>os,ZodDiscriminatedUnion:()=>pm,ZodEffects:()=>cr,ZodEnum:()=>rs,ZodError:()=>ka,ZodFirstPartyTypeKind:()=>oe,ZodFunction:()=>mm,ZodIntersection:()=>es,ZodIssueCode:()=>P,ZodLazy:()=>ts,ZodLiteral:()=>as,ZodMap:()=>Gl,ZodNaN:()=>Wl,ZodNativeEnum:()=>ns,ZodNever:()=>Tr,ZodNull:()=>Qi,ZodNullable:()=>tn,ZodNumber:()=>Zi,ZodObject:()=>La,ZodOptional:()=>lr,ZodParsedType:()=>Z,ZodPipeline:()=>yd,ZodPromise:()=>Xo,ZodReadonly:()=>ss,ZodRecord:()=>hm,ZodSchema:()=>ge,ZodSet:()=>Zl,ZodString:()=>Zo,ZodSymbol:()=>Vl,ZodTransformer:()=>cr,ZodTuple:()=>en,ZodType:()=>ge,ZodUndefined:()=>Ki,ZodUnion:()=>Ji,ZodUnknown:()=>qn,ZodVoid:()=>jl,addIssueToContext:()=>q,any:()=>Z3,array:()=>K3,bigint:()=>q3,boolean:()=>bT,coerce:()=>SH,custom:()=>vT,date:()=>$3,datetimeRegex:()=>mT,defaultErrorMap:()=>Un,discriminatedUnion:()=>tH,effect:()=>pH,enum:()=>cH,function:()=>sH,getErrorMap:()=>zl,getParsedType:()=>Jr,instanceof:()=>U3,intersection:()=>aH,isAborted:()=>dm,isAsync:()=>ql,isDirty:()=>fm,isValid:()=>Go,late:()=>H3,lazy:()=>lH,literal:()=>uH,makeIssue:()=>gd,map:()=>oH,nan:()=>z3,nativeEnum:()=>dH,never:()=>X3,null:()=>G3,nullable:()=>mH,number:()=>xT,object:()=>Q3,objectUtil:()=>a0,oboolean:()=>bH,onumber:()=>xH,optional:()=>hH,ostring:()=>yH,pipeline:()=>vH,preprocess:()=>gH,promise:()=>fH,quotelessJson:()=>p3,record:()=>nH,set:()=>iH,setErrorMap:()=>m3,strictObject:()=>J3,string:()=>yT,symbol:()=>V3,transformer:()=>pH,tuple:()=>rH,undefined:()=>j3,union:()=>eH,unknown:()=>W3,util:()=>Se,void:()=>Y3});var Se;(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})(Se||(Se={}));var a0;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(a0||(a0={}));var Z=Se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jr=t=>{switch(typeof t){case"undefined":return Z.undefined;case"string":return Z.string;case"number":return Number.isNaN(t)?Z.nan:Z.number;case"boolean":return Z.boolean;case"function":return Z.function;case"bigint":return Z.bigint;case"symbol":return Z.symbol;case"object":return Array.isArray(t)?Z.array:t===null?Z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.promise:typeof Map<"u"&&t instanceof Map?Z.map:typeof Set<"u"&&t instanceof Set?Z.set:typeof Date<"u"&&t instanceof Date?Z.date:Z.object;default:return Z.unknown}};var P=Se.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"]),p3=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ka=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,Se.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()}};ka.create=t=>new ka(t);var h3=(t,e)=>{let a;switch(t.code){case P.invalid_type:t.received===Z.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case P.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,Se.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:a=`Unrecognized key(s) in object: ${Se.joinValues(t.keys,", ")}`;break;case P.invalid_union:a="Invalid input";break;case P.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${Se.joinValues(t.options)}`;break;case P.invalid_enum_value:a=`Invalid enum value. Expected ${Se.joinValues(t.options)}, received '${t.received}'`;break;case P.invalid_arguments:a="Invalid function arguments";break;case P.invalid_return_type:a="Invalid function return type";break;case P.invalid_date:a="Invalid date";break;case P.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}"`:Se.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case P.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 P.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 P.custom:a="Invalid input";break;case P.invalid_intersection_types:a="Intersection results could not be merged";break;case P.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case P.not_finite:a="Number must be finite";break;default:a=e.defaultError,Se.assertNever(t)}return{message:a}},Un=h3;var cT=Un;function m3(t){cT=t}function zl(){return cT}var gd=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}},g3=[];function q(t,e){let a=zl(),r=gd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Un?void 0:Un].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 re;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 re;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}}},re=Object.freeze({status:"aborted"}),Gi=t=>({status:"dirty",value:t}),ta=t=>({status:"valid",value:t}),dm=t=>t.status==="aborted",fm=t=>t.status==="dirty",Go=t=>t.status==="valid",ql=t=>typeof Promise<"u"&&t instanceof Promise;var J;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(J||(J={}));var ur=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}},dT=(t,e)=>{if(Go(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 ka(t.common.issues);return this._error=a,this._error}}};function he(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 ge=class{get description(){return this._def.description}_getType(e){return Jr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:Jr(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:Jr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(ql(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:Jr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return dT(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return Go(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=>Go(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:Jr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(ql(n)?n:Promise.resolve(n));return dT(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:P.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 cr({schema:this,typeName:oe.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 lr.create(this,this._def)}nullable(){return tn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $n.create(this)}promise(){return Xo.create(this,this._def)}or(e){return Ji.create([this,e],this._def)}and(e){return es.create(this,e,this._def)}transform(e){return new cr({...he(this._def),schema:this,typeName:oe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new os({...he(this._def),innerType:this,defaultValue:a,typeName:oe.ZodDefault})}brand(){return new vd({typeName:oe.ZodBranded,type:this,...he(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new is({...he(this._def),innerType:this,catchValue:a,typeName:oe.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return yd.create(this,e)}readonly(){return ss.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},v3=/^c[^\s-]{8,}$/i,y3=/^[0-9a-z]+$/,x3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,b3=/^[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,S3=/^[a-z0-9_-]{21}$/i,_3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C3=/^[-+]?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)?)??$/,w3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",r0,L3=/^(?:(?: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])$/,I3=/^(?:(?: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])$/,A3=/^(([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]))$/,E3=/^(([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])$/,T3=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,R3=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pT="((\\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])))",M3=new RegExp(`^${pT}$`);function hT(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 O3(t){return new RegExp(`^${hT(t)}$`)}function mT(t){let e=`${pT}T${hT(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 D3(t,e){return!!((e==="v4"||!e)&&L3.test(t)||(e==="v6"||!e)&&A3.test(t))}function N3(t,e){if(!_3.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 B3(t,e){return!!((e==="v4"||!e)&&I3.test(t)||(e==="v6"||!e)&&E3.test(t))}var Zo=class t extends ge{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Z.string){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_type,expected:Z.string,received:o.parsedType}),re}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),q(n,{code:P.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),q(n,{code:P.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?q(n,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&q(n,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")w3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"email",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")r0||(r0=new RegExp(k3,"u")),r0.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"emoji",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")b3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"uuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")S3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"nanoid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")v3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")y3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid2",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")x3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ulid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),q(n,{validation:"url",code:P.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),q(n,{validation:"regex",code:P.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),q(n,{code:P.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),q(n,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?mT(o).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?M3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?O3(o).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:P.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?C3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"duration",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?D3(e.data,o.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ip",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?N3(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"jwt",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?B3(e.data,o.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cidr",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?T3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"base64",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?R3.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"base64url",code:P.invalid_string,message:o.message}),r.dirty()):Se.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:P.invalid_string,...J.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.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,...J.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,...J.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...J.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...J.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...J.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...J.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...J.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...J.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...J.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...J.errToObj(a)})}nonempty(e){return this.min(1,J.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}};Zo.create=t=>new Zo({checks:[],typeName:oe.ZodString,coerce:t?.coerce??!1,...he(t)});function P3(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 Zi=class t extends ge{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)!==Z.number){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_type,expected:Z.number,received:o.parsedType}),re}let r,n=new Wt;for(let o of this._def.checks)o.kind==="int"?Se.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:P.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),q(r,{code:P.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),q(r,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?P3(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),q(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:P.not_finite,message:o.message}),n.dirty()):Se.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,J.toString(a))}gt(e,a){return this.setLimit("min",e,!1,J.toString(a))}lte(e,a){return this.setLimit("max",e,!0,J.toString(a))}lt(e,a){return this.setLimit("max",e,!1,J.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:J.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:J.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.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"&&Se.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)}};Zi.create=t=>new Zi({checks:[],typeName:oe.ZodNumber,coerce:t?.coerce||!1,...he(t)});var Wi=class t extends ge{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)!==Z.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),q(r,{code:P.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),q(r,{code:P.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),q(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):Se.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return q(a,{code:P.invalid_type,expected:Z.bigint,received:a.parsedType}),re}gte(e,a){return this.setLimit("min",e,!0,J.toString(a))}gt(e,a){return this.setLimit("min",e,!1,J.toString(a))}lte(e,a){return this.setLimit("max",e,!0,J.toString(a))}lt(e,a){return this.setLimit("max",e,!1,J.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:J.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:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:J.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}};Wi.create=t=>new Wi({checks:[],typeName:oe.ZodBigInt,coerce:t?.coerce??!1,...he(t)});var Xi=class extends ge{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Z.boolean){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.boolean,received:r.parsedType}),re}return ta(e.data)}};Xi.create=t=>new Xi({typeName:oe.ZodBoolean,coerce:t?.coerce||!1,...he(t)});var Yi=class t extends ge{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Z.date){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_type,expected:Z.date,received:o.parsedType}),re}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return q(o,{code:P.invalid_date}),re}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),q(n,{code:P.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),q(n,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Se.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:J.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:J.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}};Yi.create=t=>new Yi({checks:[],coerce:t?.coerce||!1,typeName:oe.ZodDate,...he(t)});var Vl=class extends ge{_parse(e){if(this._getType(e)!==Z.symbol){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.symbol,received:r.parsedType}),re}return ta(e.data)}};Vl.create=t=>new Vl({typeName:oe.ZodSymbol,...he(t)});var Ki=class extends ge{_parse(e){if(this._getType(e)!==Z.undefined){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.undefined,received:r.parsedType}),re}return ta(e.data)}};Ki.create=t=>new Ki({typeName:oe.ZodUndefined,...he(t)});var Qi=class extends ge{_parse(e){if(this._getType(e)!==Z.null){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.null,received:r.parsedType}),re}return ta(e.data)}};Qi.create=t=>new Qi({typeName:oe.ZodNull,...he(t)});var Wo=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(e){return ta(e.data)}};Wo.create=t=>new Wo({typeName:oe.ZodAny,...he(t)});var qn=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ta(e.data)}};qn.create=t=>new qn({typeName:oe.ZodUnknown,...he(t)});var Tr=class extends ge{_parse(e){let a=this._getOrReturnCtx(e);return q(a,{code:P.invalid_type,expected:Z.never,received:a.parsedType}),re}};Tr.create=t=>new Tr({typeName:oe.ZodNever,...he(t)});var jl=class extends ge{_parse(e){if(this._getType(e)!==Z.undefined){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.void,received:r.parsedType}),re}return ta(e.data)}};jl.create=t=>new jl({typeName:oe.ZodVoid,...he(t)});var $n=class t extends ge{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==Z.array)return q(a,{code:P.invalid_type,expected:Z.array,received:a.parsedType}),re;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(q(a,{code:i?P.too_big:P.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&&(q(a,{code:P.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&&(q(a,{code:P.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 ur(a,i,a.path,s)))).then(i=>Wt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new ur(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:J.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:J.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:J.toString(a)}})}nonempty(e){return this.min(1,e)}};$n.create=(t,e)=>new $n({type:t,minLength:null,maxLength:null,exactLength:null,typeName:oe.ZodArray,...he(e)});function $l(t){if(t instanceof La){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=lr.create($l(r))}return new La({...t._def,shape:()=>e})}else return t instanceof $n?new $n({...t._def,type:$l(t.element)}):t instanceof lr?lr.create($l(t.unwrap())):t instanceof tn?tn.create($l(t.unwrap())):t instanceof en?en.create(t.items.map(e=>$l(e))):t}var La=class t extends ge{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=Se.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==Z.object){let u=this._getOrReturnCtx(e);return q(u,{code:P.invalid_type,expected:Z.object,received:u.parsedType}),re}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Tr&&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 ur(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Tr){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&&(q(n,{code:P.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 ur(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,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>Wt.mergeObjectSync(r,u)):Wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return J.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:J.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:oe.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 Se.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 Se.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return $l(this)}partial(e){let a={};for(let r of Se.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 Se.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof lr;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return gT(Se.objectKeys(this.shape))}};La.create=(t,e)=>new La({shape:()=>t,unknownKeys:"strip",catchall:Tr.create(),typeName:oe.ZodObject,...he(e)});La.strictCreate=(t,e)=>new La({shape:()=>t,unknownKeys:"strict",catchall:Tr.create(),typeName:oe.ZodObject,...he(e)});La.lazycreate=(t,e)=>new La({shape:t,unknownKeys:"strip",catchall:Tr.create(),typeName:oe.ZodObject,...he(e)});var Ji=class extends ge{_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 ka(s.ctx.common.issues));return q(a,{code:P.invalid_union,unionErrors:i}),re}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 ka(l));return q(a,{code:P.invalid_union,unionErrors:s}),re}}get options(){return this._def.options}};Ji.create=(t,e)=>new Ji({options:t,typeName:oe.ZodUnion,...he(e)});var zn=t=>t instanceof ts?zn(t.schema):t instanceof cr?zn(t.innerType()):t instanceof as?[t.value]:t instanceof rs?t.options:t instanceof ns?Se.objectValues(t.enum):t instanceof os?zn(t._def.innerType):t instanceof Ki?[void 0]:t instanceof Qi?[null]:t instanceof lr?[void 0,...zn(t.unwrap())]:t instanceof tn?[null,...zn(t.unwrap())]:t instanceof vd||t instanceof ss?zn(t.unwrap()):t instanceof is?zn(t._def.innerType):[],pm=class t extends ge{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==Z.object)return q(a,{code:P.invalid_type,expected:Z.object,received:a.parsedType}),re;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}):(q(a,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),re)}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=zn(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:oe.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...he(r)})}};function n0(t,e){let a=Jr(t),r=Jr(e);if(t===e)return{valid:!0,data:t};if(a===Z.object&&r===Z.object){let n=Se.objectKeys(e),o=Se.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=n0(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===Z.array&&r===Z.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=n0(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===Z.date&&r===Z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var es=class extends ge{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(dm(o)||dm(i))return re;let s=n0(o.value,i.value);return s.valid?((fm(o)||fm(i))&&a.dirty(),{status:a.value,value:s.data}):(q(r,{code:P.invalid_intersection_types}),re)};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}))}};es.create=(t,e,a)=>new es({left:t,right:e,typeName:oe.ZodIntersection,...he(a)});var en=class t extends ge{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.array)return q(r,{code:P.invalid_type,expected:Z.array,received:r.parsedType}),re;if(r.data.length<this._def.items.length)return q(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),re;!this._def.rest&&r.data.length>this._def.items.length&&(q(r,{code:P.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 ur(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})}};en.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new en({items:t,typeName:oe.ZodTuple,rest:null,...he(e)})};var hm=class t extends ge{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!==Z.object)return q(r,{code:P.invalid_type,expected:Z.object,received:r.parsedType}),re;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new ur(r,s,r.path,s)),value:i._parse(new ur(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 ge?new t({keyType:e,valueType:a,typeName:oe.ZodRecord,...he(r)}):new t({keyType:Zo.create(),valueType:e,typeName:oe.ZodRecord,...he(a)})}},Gl=class extends ge{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!==Z.map)return q(r,{code:P.invalid_type,expected:Z.map,received:r.parsedType}),re;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new ur(r,s,r.path,[u,"key"])),value:o._parse(new ur(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 re;(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 re;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};Gl.create=(t,e,a)=>new Gl({valueType:e,keyType:t,typeName:oe.ZodMap,...he(a)});var Zl=class t extends ge{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.set)return q(r,{code:P.invalid_type,expected:Z.set,received:r.parsedType}),re;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(q(r,{code:P.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&&(q(r,{code:P.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 re;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 ur(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:J.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:J.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Zl.create=(t,e)=>new Zl({valueType:t,minSize:null,maxSize:null,typeName:oe.ZodSet,...he(e)});var mm=class t extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==Z.function)return q(a,{code:P.invalid_type,expected:Z.function,received:a.parsedType}),re;function r(s,l){return gd({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,zl(),Un].filter(u=>!!u),issueData:{code:P.invalid_arguments,argumentsError:l}})}function n(s,l){return gd({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,zl(),Un].filter(u=>!!u),issueData:{code:P.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof Xo){let s=this;return ta(async function(...l){let u=new ka([]),c=await s._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(r(l,p)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(n(d,p)),u})})}else{let s=this;return ta(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new ka([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new ka([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:en.create(e).rest(qn.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||en.create([]).rest(qn.create()),returns:a||qn.create(),typeName:oe.ZodFunction,...he(r)})}},ts=class extends ge{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})}};ts.create=(t,e)=>new ts({getter:t,typeName:oe.ZodLazy,...he(e)});var as=class extends ge{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return q(a,{received:a.data,code:P.invalid_literal,expected:this._def.value}),re}return{status:"valid",value:e.data}}get value(){return this._def.value}};as.create=(t,e)=>new as({value:t,typeName:oe.ZodLiteral,...he(e)});function gT(t,e){return new rs({values:t,typeName:oe.ZodEnum,...he(e)})}var rs=class t extends ge{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return q(a,{expected:Se.joinValues(r),received:a.parsedType,code:P.invalid_type}),re}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 q(a,{received:a.data,code:P.invalid_enum_value,options:r}),re}return ta(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})}};rs.create=gT;var ns=class extends ge{_parse(e){let a=Se.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Z.string&&r.parsedType!==Z.number){let n=Se.objectValues(a);return q(r,{expected:Se.joinValues(n),received:r.parsedType,code:P.invalid_type}),re}if(this._cache||(this._cache=new Set(Se.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=Se.objectValues(a);return q(r,{received:r.data,code:P.invalid_enum_value,options:n}),re}return ta(e.data)}get enum(){return this._def.values}};ns.create=(t,e)=>new ns({values:t,typeName:oe.ZodNativeEnum,...he(e)});var Xo=class extends ge{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==Z.promise&&a.common.async===!1)return q(a,{code:P.invalid_type,expected:Z.promise,received:a.parsedType}),re;let r=a.parsedType===Z.promise?a.data:Promise.resolve(a.data);return ta(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};Xo.create=(t,e)=>new Xo({type:t,typeName:oe.ZodPromise,...he(e)});var cr=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oe.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=>{q(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 re;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?re:l.status==="dirty"?Gi(l.value):a.value==="dirty"?Gi(l.value):l});{if(a.value==="aborted")return re;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?re:s.status==="dirty"?Gi(s.value):a.value==="dirty"?Gi(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"?re:(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"?re:(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(!Go(i))return re;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=>Go(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):re);Se.assertNever(n)}};cr.create=(t,e,a)=>new cr({schema:t,typeName:oe.ZodEffects,effect:e,...he(a)});cr.createWithPreprocess=(t,e,a)=>new cr({schema:e,effect:{type:"preprocess",transform:t},typeName:oe.ZodEffects,...he(a)});var lr=class extends ge{_parse(e){return this._getType(e)===Z.undefined?ta(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lr.create=(t,e)=>new lr({innerType:t,typeName:oe.ZodOptional,...he(e)});var tn=class extends ge{_parse(e){return this._getType(e)===Z.null?ta(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tn.create=(t,e)=>new tn({innerType:t,typeName:oe.ZodNullable,...he(e)});var os=class extends ge{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===Z.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};os.create=(t,e)=>new os({innerType:t,typeName:oe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...he(e)});var is=class extends ge{_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 ql(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ka(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ka(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};is.create=(t,e)=>new is({innerType:t,typeName:oe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...he(e)});var Wl=class extends ge{_parse(e){if(this._getType(e)!==Z.nan){let r=this._getOrReturnCtx(e);return q(r,{code:P.invalid_type,expected:Z.nan,received:r.parsedType}),re}return{status:"valid",value:e.data}}};Wl.create=t=>new Wl({typeName:oe.ZodNaN,...he(t)});var F3=Symbol("zod_brand"),vd=class extends ge{_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}},yd=class t extends ge{_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"?re:o.status==="dirty"?(a.dirty(),Gi(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"?re: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:oe.ZodPipeline})}},ss=class extends ge{_parse(e){let a=this._def.innerType._parse(e),r=n=>(Go(n)&&(n.value=Object.freeze(n.value)),n);return ql(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};ss.create=(t,e)=>new ss({innerType:t,typeName:oe.ZodReadonly,...he(e)});function fT(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function vT(t,e={},a){return t?Wo.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=fT(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=fT(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):Wo.create()}var H3={object:La.lazycreate},oe;(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"})(oe||(oe={}));var U3=(t,e={message:`Input not instance of ${t.name}`})=>vT(a=>a instanceof t,e),yT=Zo.create,xT=Zi.create,z3=Wl.create,q3=Wi.create,bT=Xi.create,$3=Yi.create,V3=Vl.create,j3=Ki.create,G3=Qi.create,Z3=Wo.create,W3=qn.create,X3=Tr.create,Y3=jl.create,K3=$n.create,Q3=La.create,J3=La.strictCreate,eH=Ji.create,tH=pm.create,aH=es.create,rH=en.create,nH=hm.create,oH=Gl.create,iH=Zl.create,sH=mm.create,lH=ts.create,uH=as.create,cH=rs.create,dH=ns.create,fH=Xo.create,pH=cr.create,hH=lr.create,mH=tn.create,gH=cr.createWithPreprocess,vH=yd.create,yH=()=>yT().optional(),xH=()=>xT().optional(),bH=()=>bT().optional(),SH={string:(t=>Zo.create({...t,coerce:!0})),number:(t=>Zi.create({...t,coerce:!0})),boolean:(t=>Xi.create({...t,coerce:!0})),bigint:(t=>Wi.create({...t,coerce:!0})),date:(t=>Yi.create({...t,coerce:!0}))};var _H=re;var o0=v.union([v.object({type:v.literal("data"),key:v.string(),value:v.string().optional()}),v.object({type:v.literal("css"),value:v.string()}),v.object({type:v.literal("aria"),role:v.string().optional(),label:v.string().optional()}),v.object({type:v.literal("shadow-css"),value:v.string()}),v.object({type:v.literal("ref"),el:v.any()})]),ST=v.object({kind:v.literal("tooltip"),id:v.string(),anchor:o0,content:v.object({title:v.string().optional(),body:v.string()}),placement:v.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:v.number().optional(),blocking:v.boolean().optional(),trigger:v.enum(["immediate","hover","click"]).optional(),dismiss:v.object({onEsc:v.boolean().optional(),closeButton:v.boolean().optional(),timeoutMs:v.number().optional()}).optional()}),_T=v.object({kind:v.literal("highlight"),id:v.string(),anchor:o0,copy:v.string().optional(),ring:v.object({paddingPx:v.number().optional(),radiusPx:v.number().optional()}).optional(),scrim:v.object({opacity:v.number().optional()}).optional(),ringColor:v.string().optional(),blocking:v.boolean().optional(),dismiss:v.object({onClickOutside:v.boolean().optional(),onEsc:v.boolean().optional(),timeoutMs:v.number().optional()}).optional()}),gm=v.object({id:v.string(),version:v.number(),routes:v.array(v.string()).optional(),steps:v.array(v.union([ST,_T]))});function CH(t){return gm.parse(t)}var wH=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=bh({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 gm.parse(i)};var vm=ae(st(),1),CT=ae(Mu(),1);function kH({element:t,children:e}){let[a,r]=(0,vm.useState)(null);return(0,vm.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,CT.createPortal)(e,a):null}function LH(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var i0=class{constructor(){B(this,"sessionId");this.sessionId=LH(),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 ym(){return new i0}var T=typeof window<"u"?window:void 0,Yt=typeof globalThis<"u"?globalThis:T;typeof self>"u"&&(Yt.self=Yt),typeof File>"u"&&(Yt.File=function(){});var xR=Array.prototype,wT=xR.forEach,kT=xR.indexOf,Ga=Yt?.navigator,j=Yt?.document,Aa=Yt?.location,_0=Yt?.fetch,C0=Yt!=null&&Yt.XMLHttpRequest&&"withCredentials"in new Yt.XMLHttpRequest?Yt.XMLHttpRequest:void 0,LT=Yt?.AbortController,Ia=Ga?.userAgent,le=T??{},jn={DEBUG:!1,LIB_VERSION:"1.302.2"};function IT(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 AT(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){IT(o,r,n,i,s,"next",l)}function s(l){IT(o,r,n,i,s,"throw",l)}i(void 0)}))}}function K(){return K=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},K.apply(null,arguments)}function bR(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 IH=["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"],ET=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return IH.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},AH=["$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 _e(t,e){return t.indexOf(e)!==-1}var Ym=function(t){return t.trim()},w0=function(t){return t.replace(/^\$/,"")},EH=Array.isArray,SR=Object.prototype,_R=SR.hasOwnProperty,Km=SR.toString,Ve=EH||function(t){return Km.call(t)==="[object Array]"},ti=t=>typeof t=="function",Ft=t=>t===Object(t)&&!Ve(t),Ql=t=>{if(Ft(t)){for(var e in t)if(_R.call(t,e))return!1;return!0}return!1},V=t=>t===void 0,Rt=t=>Km.call(t)=="[object String]",k0=t=>Rt(t)&&t.trim().length===0,Xn=t=>t===null,Ue=t=>V(t)||Xn(t),on=t=>Km.call(t)=="[object Number]",ai=t=>Km.call(t)==="[object Boolean]",TH=t=>t instanceof FormData,RH=t=>_e(AH,t);function L0(t){return t===null||typeof t!="object"}function Em(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function CR(t){return!V(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var MH=[!0,"true",1,"1","yes"],s0=t=>_e(MH,t),OH=[!1,"false",0,"0","no"];function an(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),on(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),an(n||a,e,a,r))}var I0=class{constructor(e){this.t={},this.i=e.i,this.o=an(e.bucketSize,0,100,e.h),this.m=an(e.refillRate,0,this.o,e.h),this.S=an(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={}}},xm,TT,l0,DH=t=>t instanceof Error;function NH(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return l0&&a.length===TT||(TT=a.length,l0=a.reduce(((r,n)=>{xm||(xm={});var o=xm[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,xm[n]=[u,c];break}}return r}),{})),l0}}var A0=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 AT((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Ve(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)),K({},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 AT((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,K({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:NH(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 K({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},au="?";function E0(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?au:a,in_app:!0};return V(r)||(o.lineno=r),V(n)||(o.colno=n),o}var wR=(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]:au,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},BH=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,PH=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,FH=/\((\S*)(?::(\d+))(?::(\d+))\)/,HH=(t,e)=>{var a=BH.exec(t);if(a){var[,r,n,o]=a;return E0(e,r,au,+n,+o)}var i=PH.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=FH.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=wR(i[1]||au,i[2]);return E0(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},UH=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,zH=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,qH=(t,e)=>{var a=UH.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=zH.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]||au;return[o,n]=wR(o,n),E0(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},RT=/\(error: (.*)\)/,MT=50;function $H(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(`
|
|
518
|
-
`),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=RT.test(u)?u.replace(RT,"$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>=MT)break}}}return(function(p){if(!p.length)return[];var S=Array.from(p);return S.reverse(),S.slice(0,MT).map((x=>{return K({},x,{filename:x.filename||(b=S,b[b.length-1]||{}).filename,function:x.function||au});var b}))})(i)}}var T0=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=Rt(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 Em(e,"DOMException")}isDOMError(e){return Em(e,"DOMError")}},R0=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}},M0=class{constructor(){}match(e){return Em(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}}},VH=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,O0=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(VH);return n&&(a=n[1],r=n[2]),[a,r]}},jH=["fatal","error","warning","log","info","debug"];function kR(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 D0=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 CR(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: "+kR(e)}isSeverityLevel(e){return Rt(e)&&!k0(e)&&jH.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(DH(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},N0=class{match(e){return CR(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+kR(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},B0=class{match(e){return L0(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}}},P0=class{match(e){return Em(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return L0(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(L0(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}},LR=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(T&&(jn.DEBUG||le.POSTHOG_DEBUG||a)&&!V(T.console)&&T.console){for(var o=("__rrweb_original__"in T.console[n])?T.console[n].__rrweb_original__:T.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)=>LR(t+" "+n,o)};return r},G=LR("[PostHog.js]"),Mt=G.createLogger,GH=Mt("[ExternalScriptsLoader]"),OT=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return GH.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=j?.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(!j)return a("document not found");var l=j.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=j.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):j.body.appendChild(l)};j!=null&&j.body?s():j?.addEventListener("DOMContentLoaded",s)};le.__PosthogExtensions__=le.__PosthogExtensions__||{},le.__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);OT(t,o,a)},le.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);OT(t,r,a)};var Tm={};function ri(t,e,a){if(Ve(t)){if(wT&&t.forEach===wT)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)===Tm)return}}}function Ge(t,e,a){if(!Ue(t)){if(Ve(t))return ri(t,e,a);if(TH(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===Tm)return}else for(var n in t)if(_R.call(t,n)&&e.call(a,t[n],n)===Tm)return}}var xt=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 ri(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},ou=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 ri(a,(function(n){ri(n,(function(o){t.push(o)}))})),t};function Lm(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 DT=function(t){try{return t()}catch{return}},ZH=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){G.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),G.critical(n)}}},MS=function(t){var e={};return Ge(t,(function(a,r){(Rt(a)&&a.length>0||on(a))&&(e[r]=a)})),e};function WH(t,e){return a=t,r=o=>Rt(o)&&!Xn(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),Ve(i)?(l=[],ri(i,(u=>{l.push(o(u))}))):(l={},Ge(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var XH=["herokuapp.com","vercel.app","netlify.app"];function YH(t){var e=t?.hostname;if(!Rt(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of XH)if(a===r)return!1;return!0}function IR(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function At(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var AR="$people_distinct_id",Ad="__alias",Ed="__timers",NT="$autocapture_disabled_server_side",F0="$heatmaps_enabled_server_side",BT="$exception_capture_enabled_server_side",H0="$error_tracking_suppression_rules",PT="$error_tracking_capture_extension_exceptions",FT="$web_vitals_enabled_server_side",ER="$dead_clicks_enabled_server_side",HT="$web_vitals_allowed_metrics",u0="$session_recording_remote_config",Rm="$sesid",TR="$session_is_sampled",Jl="$enabled_feature_flags",Td="$early_access_features",U0="$feature_flag_details",Rd="$stored_person_properties",cs="$stored_group_properties",z0="$surveys",bm="$surveys_activated",Mm="$flag_call_reported",Gn="$user_state",q0="$client_session_props",$0="$capture_rate_limit",V0="$initial_campaign_params",j0="$initial_referrer_info",Om="$initial_person_info",Dm="$epp",RR="__POSTHOG_TOOLBAR__",xd="$posthog_cookieless",KH=[AR,Ad,"__cmpns",Ed,"$session_recording_enabled_server_side",F0,Rm,Jl,H0,Gn,Td,U0,cs,Rd,z0,Mm,q0,$0,V0,j0,Dm,Om];function UT(t){return t instanceof Element&&(t.id===RR||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Qm(t){return!!t&&t.nodeType===1}function ni(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function MR(t){return!!t&&t.nodeType===3}function OR(t){return!!t&&t.nodeType===11}function OS(t){return t?Ym(t).split(/\s+/):[]}function zT(t){var e=T?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function Nm(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 OS(e)}function DR(t){return Ue(t)?null:Ym(t).split(/(\s+)/).filter((e=>Fd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Vd(t){var e="";return G0(t)&&!HR(t)&&t.childNodes&&t.childNodes.length&&Ge(t.childNodes,(function(a){var r;MR(a)&&a.textContent&&(e+=(r=DR(a.textContent))!==null&&r!==void 0?r:"")})),Ym(e)}function NR(t){return V(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var DS=["a","button","form","input","select","textarea","label"];function BR(t,e){if(V(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 PR(t){var e=t.parentNode;return!(!e||!Qm(e))&&e}var QH=["next","previous","prev",">","<"],qT=10,$T=[".ph-no-rageclick",".ph-no-capture"];function JH(t,e){if(!T||NS(t))return!1;var a,r,n;if(ai(e)?(a=!!e&&$T,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:$T,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=FR(t,!1);return!(function(i,s){if(i===!1||V(i))return!1;var l;if(i===!0)l=QH;else{if(!Ve(i))return!1;if(i.length>qT)return G.error("[PostHog] content_ignorelist array cannot exceed "+qT+" 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)))}))})(r,o.map((i=>{var s;return{safeText:Vd(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!BR(o,a)}var NS=t=>!t||ni(t,"html")||!Qm(t),FR=(t,e)=>{if(!T||NS(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!ni(n,"body");)if(OR(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=PR(n);if(!o)break;if(e||DS.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=T.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function eU(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!T||NS(t)||(o=a)!=null&&o.url_allowlist&&!zT(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&zT(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}=FR(t,r);if(!(function(S,x){var b=x?.element_allowlist;if(V(b))return!0;var m,h=function(y){if(b.some((C=>y.tagName.toLowerCase()===C)))return{v:!0}};for(var g of S)if(m=h(g))return m.v;return!1})(d,a)||!BR(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var f=T.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=t.tagName.toLowerCase();switch(p){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&&(DS.indexOf(p)>-1||t.getAttribute("contenteditable")==="true")}}function G0(t){for(var e=t;e.parentNode&&!ni(e,"body");e=e.parentNode){var a=Nm(e);if(_e(a,"ph-sensitive")||_e(a,"ph-no-capture"))return!1}if(_e(Nm(t),"ph-include"))return!0;var r=t.type||"";if(Rt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(Rt(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 HR(t){return!!(ni(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ni(t,"select")||ni(t,"textarea")||t.getAttribute("contenteditable")==="true")}var UR="(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})",tU=new RegExp("^(?:"+UR+")$"),aU=new RegExp(UR),zR="\\d{3}-?\\d{2}-?\\d{4}",rU=new RegExp("^("+zR+")$"),nU=new RegExp("("+zR+")");function Fd(t,e){return e===void 0&&(e=!0),!(Ue(t)||Rt(t)&&(t=Ym(t),(e?tU:aU).test((t||"").replace(/[- ]/g,""))||(e?rU:nU).test(t)))}function qR(t){var e=Vd(t);return Fd(e=(e+" "+$R(t)).trim())?e:""}function $R(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ge(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=Vd(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+$R(a)).trim())}catch(o){G.error("[AutoCapture]",o)}})),e}function oU(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=K({},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 Lm(l).sort(((c,d)=>{var[f]=c,[p]=d;return f.localeCompare(p)})).forEach((c=>{var[d,f]=c;return u[VT(d.toString())]=VT(f.toString())})),i+=":",i+=Lm(u).map((c=>{var[d,f]=c;return d+'="'+f+'"'})).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:iU(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return Lm(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 VT(t){return t.replace(/"|\\"/g,'\\"')}function iU(t){var e=t.attr__class;return e?Ve(e)?e:OS(e):void 0}var Bm=class{constructor(e){this.disabled=e===!1;var a=Ft(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}},c0="$copy_autocapture",Wn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Pm=t=>{var e=j?.createElement("a");return V(e)?null:(e.href=t,e)},sU=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return Ge(t,(function(o,i){V(o)||V(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)},Fm=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(!Ve(a)||a.length<2)return"";var i=a[1];try{i=decodeURIComponent(i)}catch{G.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},jd=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 f=u[d].split("=");Ve(f)&&(e.includes(f[0])?c.push(f[0]+"="+a):c.push(u[d]))}var p=l;return s!=null&&(p+="?"+c.join("&")),o!=null&&(p+="#"+o),p},Hm=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},jT=Mt("[AutoCapture]");function d0(t,e){return e.length>t?e.slice(0,t)+"...":e}function lU(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Qm(e));return e}function uU(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};DS.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=d0(1024,qR(t)):o.$el_text=d0(1024,Vd(t)));var i=Nm(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),Ge(t.attributes,(function(c){var d;if((!HR(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&Fd(c.value)&&(d=c.name,!Rt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=OS(f).join(" ")),o["attr__"+c.name]=d0(1024,f)}}));for(var s=1,l=1,u=t;u=lU(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function cU(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!ni(c,"body");)OR(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,f=[],p={},S=!1,x=!1;if(Ge(u,(y=>{var C=G0(y);y.tagName.toLowerCase()==="a"&&(S=y.getAttribute("href"),S=C&&S&&Fd(S)&&S),_e(Nm(y),"ph-no-capture")&&(x=!0),f.push(uU(y,o,i,s));var w=(function(_){if(!G0(_))return{};var k={};return Ge(_.attributes,(function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var I=A.name.replace("data-ph-capture-attribute-",""),R=A.value;I&&R&&Fd(R)&&(k[I]=R)}})),k})(y);xt(p,w)})),x)return{props:{},explicitNoCapture:x};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=qR(t):f[0].$el_text=Vd(t)),S){var b,m;f[0].attr__href=S;var h=(b=Pm(S))==null?void 0:b.host,g=T==null||(m=T.location)==null?void 0:m.host;h&&g&&h!==g&&(d=S)}return{props:xt({$event_type:n.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:oU(f)},(a=f[0])!=null&&a.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},p)}}var Z0=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Bm(e.config.rageclick),this.I=null}get F(){var e,a,r=Ft(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(T&&j){var e=r=>{r=r||T?.event;try{this.M(r)}catch(n){jT.error("Failed to capture event",n)}};if(At(j,"submit",e,{capture:!0}),At(j,"change",e,{capture:!0}),At(j,"click",e,{capture:!0}),this.F.capture_copied_text){var a=r=>{r=r||T?.event,this.M(r,c0)};At(j,"copy",a,{capture:!0}),At(j,"cut",a,{capture:!0})}}}else jT.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({[NT]:!!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=j?.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[NT],n=this.T;if(Xn(n)&&!ai(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=NR(e);MR(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())&&JH(n,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=a===c0;if(n&&eU(n,e,this.F,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=cU(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===c0){var u,c=DR(T==null||(u=T.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 ti(j?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return on(t)&&isFinite(t)&&Math.floor(t)===t});var GT="0123456789abcdef",W0=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+GT.charAt(this.bytes[a]>>>4)+GT.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}},X0=class{constructor(){this.A=0,this.D=0,this.j=new Y0}generate(){var e=this.generateOrAbort();if(V(e)){this.A=0;var a=this.generateOrAbort();if(V(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 W0.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())}},ZT,VR=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};T&&!V(T.crypto)&&crypto.getRandomValues&&(VR=t=>crypto.getRandomValues(t));var Y0=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(VR(this.N),this.U=0),this.N[this.U++]}},ei=()=>dU().toString(),dU=()=>(ZT||(ZT=new X0)).generate(),bd="",fU=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function pU(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=j),bd)return bd;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+ei();!bd&&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",bd=u)}return bd})(t);if(!a){var r=(n=>{var o=n.match(fU);return o?o[0]:""})(t);r!==a&&G.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var nn={H:()=>!!j,B:function(t){G.error("cookieStore error: "+t)},q:function(t){if(j){try{for(var e=t+"=",a=j.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(nn.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(j)try{var o="",i="",s=pU(j.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&&G.warn("cookieStore warning: large cookie, len="+u.length),j.cookie=u,u}catch{return}},V:function(t,e){if(j!=null&&j.cookie)try{nn.G(t,"",-1,e)}catch{return}}},f0=null,it={H:function(){if(!Xn(f0))return f0;var t=!0;if(V(T))t=!1;else try{var e="__mplssupport__";it.G(e,"xyz"),it.q(e)!=='"xyz"'&&(t=!1),it.V(e)}catch{t=!1}return t||G.error("localStorage unsupported; falling back to cookie store"),f0=t,t},B:function(t){G.error("localStorage error: "+t)},q:function(t){try{return T?.localStorage.getItem(t)}catch(e){it.B(e)}return null},W:function(t){try{return JSON.parse(it.q(t))||{}}catch{}return null},G:function(t,e){try{T?.localStorage.setItem(t,JSON.stringify(e))}catch(a){it.B(a)}},V:function(t){try{T?.localStorage.removeItem(t)}catch(e){it.B(e)}}},hU=["distinct_id",Rm,TR,Dm,Om],Sm=K({},it,{W:function(t){try{var e={};try{e=nn.W(t)||{}}catch{}var a=xt(e,JSON.parse(it.q(t)||"{}"));return it.G(t,a),a}catch{}return null},G:function(t,e,a,r,n,o){try{it.G(t,e,void 0,void 0,o);var i={};hU.forEach((s=>{e[s]&&(i[s]=e[s])})),Object.keys(i).length&&nn.G(t,i,a,r,n,o)}catch(s){it.B(s)}},V:function(t,e){try{T?.localStorage.removeItem(t),nn.V(t,e)}catch(a){it.B(a)}}}),_m={},mU={H:function(){return!0},B:function(t){G.error("memoryStorage error: "+t)},q:function(t){return _m[t]||null},W:function(t){return _m[t]||null},G:function(t,e){_m[t]=e},V:function(t){delete _m[t]}},ls=null,Xt={H:function(){if(!Xn(ls))return ls;if(ls=!0,V(T))ls=!1;else try{var t="__support__";Xt.G(t,"xyz"),Xt.q(t)!=='"xyz"'&&(ls=!1),Xt.V(t)}catch{ls=!1}return ls},B:function(t){G.error("sessionStorage error: ",t)},q:function(t){try{return T?.sessionStorage.getItem(t)}catch(e){Xt.B(e)}return null},W:function(t){try{return JSON.parse(Xt.q(t))||null}catch{}return null},G:function(t,e){try{T?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Xt.B(a)}},V:function(t){try{T?.sessionStorage.removeItem(t)}catch(e){Xt.B(e)}}},Zn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),K0=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Zn.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Zn.DENIED||this.consent===Zn.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Zn.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 s0(e)?Zn.GRANTED:_e(OH,e)?Zn.DENIED:Zn.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?it:nn;var a=e==="localStorage"?nn:it;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(s0(a.q(this.X))),a.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!IR([Ga?.doNotTrack,Ga?.msDoNotTrack,le.doNotTrack],(e=>s0(e)))}},Cm=Mt("[Dead Clicks]"),gU=()=>!0,vU=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(ER)),r=t.instance.config.capture_dead_clicks;return ai(r)?r:!!Ft(r)||a},Um=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({[ER]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=le.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=le.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?Cm.error("failed to load script",n):e()}))}et(){var e;if(j){if(!this.tt&&(e=le.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=Ft(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=le.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(j),Cm.info("starting...")}}else Cm.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Cm.info("stopping..."))}},Sd=Mt("[ExceptionAutocapture]"),Q0=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(T&&this.isEnabled&&(o=le.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=le.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=le.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=le.__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){Sd.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((a=this._instance.persistence)==null||!a.props[BT]),this.F=this.ht(),this.vt=new I0({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:Sd}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ft(e)?a=K({},a,e):(V(e)?this.ut:e)&&(a=K({},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&&(Sd.info("enabled"),this.it(this.rt))}it(e){var a,r;(a=le.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=le.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Sd.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({[BT]: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)?Sd.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function WT(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return ti(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var J0=class{constructor(e){var a;this._instance=e,this.dt=(T==null||(a=T.location)==null?void 0:a.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(G.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,G.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(T&&T.history){var r=this;(e=T.history.pushState)!=null&&e.__posthog_wrapped__||WT(T.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("pushState")})),(a=T.history.replaceState)!=null&&a.__posthog_wrapped__||WT(T.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r.ft("replaceState")})),this.gt()}}ft(e){try{var a,r=T==null||(a=T.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){G.error("Error capturing "+e+" pageview",n)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};At(T,"popstate",e),this.ct=()=>{T&&T.removeEventListener("popstate",e)}}}},p0=Mt("[SegmentIntegration]");function yU(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()||ei();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(Gn,"identified")),n()},s=o.user();"then"in s&&ti(s.then)?s.then((l=>i(l))):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||p0.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()||(p0.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(p0.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 jR="posthog-js";function GR(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,f;if(!(o==="*"||o.includes(s.level))||!t.__loaded)return s;s.tags||(s.tags={});var p=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());s.tags["PostHog Person URL"]=p,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=>K({},m,{stacktrace:m.stacktrace?K({},m.stacktrace,{type:"raw",frames:(m.stacktrace.frames||[]).map((h=>K({},h,{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&&r&&(b.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(b),s}}var eS=class{constructor(e,a,r,n,o,i){this.name=jR,this.setupOnce=function(s){s(GR(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},xU=T!=null&&T.location?Hm(T.location.hash,"__posthog")||Hm(location.hash,"state"):null,XT="_postHogToolbarParams",YT=Mt("[Toolbar]"),Jo=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Jo||{}),tS=class{constructor(e){this.instance=e}_t(e){le.ph_toolbar_state=e}yt(){var e;return(e=le.ph_toolbar_state)!==null&&e!==void 0?e:Jo.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!T||!j)return!1;e=e??T.location,r=r??T.history;try{if(!a){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch{return!1}a=T?.localStorage}var n,o=xU||Hm(e.hash,"__posthog")||Hm(e.hash,"state"),i=o?DT((()=>JSON.parse(atob(decodeURIComponent(o)))))||DT((()=>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(XT)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}bt(e){var a=le.ph_load_toolbar||le.ph_load_editor;!Ue(a)&&ti(a)?a(e,this.instance):YT.warn("No toolbar load function found")}loadToolbar(e){var a=!(j==null||!j.getElementById(RR));if(!T||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=K({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(T.localStorage.setItem(XT,JSON.stringify(K({},n,{source:void 0}))),this.yt()===Jo.LOADED)this.bt(n);else if(this.yt()===Jo.UNINITIALIZED){var o;this._t(Jo.LOADING),(o=le.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return YT.error("[Toolbar] Failed to load",i),void this._t(Jo.UNINITIALIZED);this._t(Jo.LOADED),this.bt(n)})),At(T,"turbolinks:load",(()=>{this._t(Jo.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)}},bU=Mt("[TracingHeaders]"),aS=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var a,r;V(this.xt)&&((a=le.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),V(this.St)&&((r=le.__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=le.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=le.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return bU.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)}},dr="Mobile",zm="iOS",rn="Android",Hd="Tablet",ZR=rn+" "+Hd,WR="iPad",XR="Apple",YR=XR+" Watch",Ud="Safari",ru="BlackBerry",KR="Samsung",QR=KR+"Browser",JR=KR+" Internet",ds="Chrome",SU=ds+" OS",e2=ds+" "+zm,BS="Internet Explorer",t2=BS+" "+dr,PS="Opera",_U=PS+" Mini",FS="Edge",a2="Microsoft "+FS,eu="Firefox",r2=eu+" "+zm,zd="Nintendo",qd="PlayStation",tu="Xbox",n2=rn+" "+dr,o2=dr+" "+Ud,Md="Windows",rS=Md+" Phone",KT="Nokia",nS="Ouya",i2="Generic",CU=i2+" "+dr.toLowerCase(),s2=i2+" "+Hd.toLowerCase(),oS="Konqueror",fa="(\\d+(\\.\\d+)?)",h0=new RegExp("Version/"+fa),wU=new RegExp(tu,"i"),kU=new RegExp(qd+" \\w+","i"),LU=new RegExp(zd+" \\w+","i"),HS=new RegExp(ru+"|PlayBook|BB10","i"),IU={"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"},AU=(t,e)=>e&&_e(e,XR)||(function(a){return _e(a,Ud)&&!_e(a,ds)&&!_e(a,rn)})(t),l2=function(t,e){return e=e||"",_e(t," OPR/")&&_e(t,"Mini")?_U:_e(t," OPR/")?PS:HS.test(t)?ru:_e(t,"IE"+dr)||_e(t,"WPDesktop")?t2:_e(t,QR)?JR:_e(t,FS)||_e(t,"Edg/")?a2:_e(t,"FBIOS")?"Facebook "+dr:_e(t,"UCWEB")||_e(t,"UCBrowser")?"UC Browser":_e(t,"CriOS")?e2:_e(t,"CrMo")||_e(t,ds)?ds:_e(t,rn)&&_e(t,Ud)?n2:_e(t,"FxiOS")?r2:_e(t.toLowerCase(),oS.toLowerCase())?oS:AU(t,e)?_e(t,dr)?o2:Ud:_e(t,eu)?eu:_e(t,"MSIE")||_e(t,"Trident/")?BS:_e(t,"Gecko")?eu:""},EU={[t2]:[new RegExp("rv:"+fa)],[a2]:[new RegExp(FS+"?\\/"+fa)],[ds]:[new RegExp("("+ds+"|CrMo)\\/"+fa)],[e2]:[new RegExp("CriOS\\/"+fa)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+fa)],[Ud]:[h0],[o2]:[h0],[PS]:[new RegExp("(Opera|OPR)\\/"+fa)],[eu]:[new RegExp(eu+"\\/"+fa)],[r2]:[new RegExp("FxiOS\\/"+fa)],[oS]:[new RegExp("Konqueror[:/]?"+fa,"i")],[ru]:[new RegExp(ru+" "+fa),h0],[n2]:[new RegExp("android\\s"+fa,"i")],[JR]:[new RegExp(QR+"\\/"+fa)],[BS]:[new RegExp("(rv:|MSIE )"+fa)],Mozilla:[new RegExp("rv:"+fa)]},TU=function(t,e){var a=l2(t,e),r=EU[a];if(V(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},QT=[[new RegExp(tu+"; "+tu+" (.*?)[);]","i"),t=>[tu,t&&t[1]||""]],[new RegExp(zd,"i"),[zd,""]],[new RegExp(qd,"i"),[qd,""]],[HS,[ru,""]],[new RegExp(Md,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[rS,""];if(new RegExp(dr).test(e)&&!/IEMobile\b/.test(e))return[Md+" "+dr,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=IU[r]||"";return/arm/i.test(e)&&(n="RT"),[Md,n]}return[Md,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[zm,e.join(".")]}return[zm,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=V(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+rn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+rn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[rn,e.join(".")]}return[rn,""]}],[/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/,[SU,""]],[/Linux|debian/i,["Linux",""]]],JT=function(t){return LU.test(t)?zd:kU.test(t)?qd:wU.test(t)?tu:new RegExp(nS,"i").test(t)?nS:new RegExp("("+rS+"|WPDesktop)","i").test(t)?rS:/iPad/.test(t)?WR:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?YR:HS.test(t)?ru:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(KT,"i").test(t)?KT:/(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(dr).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)?rn:ZR:rn:new RegExp("(pda|"+dr+")","i").test(t)?CU:new RegExp(Hd,"i").test(t)&&!new RegExp(Hd+" pc","i").test(t)?s2:""},wm="https?://(.*)",iu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],RU=ou(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],iu),Gd="<masked>",MU=["li_fat_id"];function u2(t,e,a){if(!j)return{};var r,n=e?ou([],iu,a||[]):[],o=c2(jd(j.URL,n,Gd),t),i=(r={},Ge(MU,(function(s){var l=nn.q(s);r[s]=l||null})),r);return xt(i,o)}function c2(t,e){var a=RU.concat(e||[]),r={};return Ge(a,(function(n){var o=Fm(t,n);r[n]=o||null})),r}function d2(t){var e=(function(o){return o?o.search(wm+"google.([^/?]*)")===0?"google":o.search(wm+"bing.com")===0?"bing":o.search(wm+"yahoo.com")===0?"yahoo":o.search(wm+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!Xn(e)){r.$search_engine=e;var n=j?Fm(j.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function eR(){return navigator.language||navigator.userLanguage}function f2(){return j?.referrer||"$direct"}function p2(t,e){var a=t?ou([],iu,e||[]):[],r=Aa?.href.substring(0,1e3);return{r:f2().substring(0,1e3),u:r?jd(r,a,Gd):void 0}}function h2(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=Pm(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=Pm(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=c2(r);xt(n,i)}if(a){var s=d2(a);xt(n,s)}return n}function m2(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function OU(){try{return new Date().getTimezoneOffset()}catch{return}}function DU(t,e){if(!Ia)return{};var a,r,n,o=t?ou([],iu,e||[]):[],[i,s]=(function(l){for(var u=0;u<QT.length;u++){var[c,d]=QT[u],f=c.exec(l),p=f&&(ti(d)?d(f,l):d);if(p)return p}return["",""]})(Ia);return xt(MS({$os:i,$os_version:s,$browser:l2(Ia,navigator.vendor),$device:JT(Ia),$device_type:(r=Ia,n=JT(r),n===WR||n===ZR||n==="Kobo"||n==="Kindle Fire"||n===s2?Hd:n===zd||n===tu||n===qd||n===nS?"Console":n===YR?"Wearable":n?dr:"Desktop"),$timezone:m2(),$timezone_offset:OU()}),{$current_url:jd(Aa?.href,o,Gd),$host:Aa?.host,$pathname:Aa?.pathname,$raw_user_agent:Ia.length>1e3?Ia.substring(0,997)+"...":Ia,$browser_version:TU(Ia,navigator.vendor),$browser_language:eR(),$browser_language_prefix:(a=eR(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:T?.screen.height,$screen_width:T?.screen.width,$viewport_height:T?.innerHeight,$viewport_width:T?.innerWidth,$lib:"web",$lib_version:jn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Yo=Mt("[Web Vitals]"),tR=9e5,iS=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)=>K({},r,{["$web_vitals_"+n.name+"_event"]:K({},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(V(o))Yo.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Tt();V(i)||(Ue(r?.name)||Ue(r?.value)?Yo.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?Yo.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),V(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=V(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(K({},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=le.__PosthogExtensions__;V(s)||V(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):Yo.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((a=this._instance.persistence)==null||!a.props[FT]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=Ft(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return V(r)?((a=this._instance.persistence)==null?void 0:a.props[HT])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ft(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=Ft(this._instance.config.capture_performance)&&on(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:tR;return 0<e&&e<=6e4?tR:e}get isEnabled(){var e=Aa?.protocol;if(e!=="http:"&&e!=="https:")return Yo.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=Ft(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ai(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ai(a)?a:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Yo.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=Ft(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ft(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[FT]:a}),this._instance.persistence.register({[HT]:r})),this.Et=a,this.startIfEnabled()}it(e){var a,r;(a=le.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks&&e(),(r=le.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(n=>{n?Yo.error("failed to load script",n):e()}))}Tt(){var e=T?T.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?ou([],iu,r||[]):[];return jd(e,n,Gd)}Yo.error("Could not determine current URL")}},NU=Mt("[Heatmaps]");function aR(t){return Ft(t)&&"clientX"in t&&"clientY"in t&&on(t.clientX)&&on(t.clientY)}var sS=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[F0]),this.rageclicks=new Bm(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Ft(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 V(this.instance.config.capture_heatmaps)?V(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;NU.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({[F0]: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"})(j)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){T&&j&&(this.jt=this.Dt.bind(this),At(T,"beforeunload",this.jt),this.Lt=e=>this.At(e||T?.event),At(j,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||T?.event),At(j,"mousemove",this.Nt,{capture:!0}),this.zt=new Um(this.instance,gU,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),At(j,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;T&&j&&(this.jt&&T.removeEventListener("beforeunload",this.jt),this.Lt&&j.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&j.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&j.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&&Qm(c)&&!ni(c,"body");){if(c===u)return!1;if(_e(l,T?.getComputedStyle(c).position))return!0;c=PR(c)}return!1})(NR(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"),!UT(e.target)&&aR(e)){var n=this.qt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(K({},n,{type:"rageclick"})),this.Wt(n)}}Ut(e){!UT(e.target)&&aR(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(T){var a=T.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?ou([],iu,n||[]):[],i=jd(a,o,Gd);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Dt(){this.N&&!Ql(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},lS=class{constructor(e){this._instance=e}doPageView(e,a){var r,n=this.Gt(e,a);return this.Vt={pathname:(r=T?.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(!(V(i)||V(s)||V(l)||V(u)||V(c)||V(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:an(s/i,0,1,G),p=i<=1?1:an(l/i,0,1,G),S=u<=1?1:an(c/u,0,1,G),x=u<=1?1:an(d/u,0,1,G);n=xt(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:S,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:x})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},fr=Uint8Array,pa=Uint16Array,nu=Uint32Array,US=new fr([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]),zS=new fr([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]),rR=new fr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g2=function(t,e){for(var a=new pa(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new nu(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]},v2=g2(US,2),BU=v2[0],uS=v2[1];BU[28]=258,uS[258]=28;for(cS=g2(zS,0)[1],qm=new pa(32768),Ze=0;Ze<32768;++Ze)Ko=(43690&Ze)>>>1|(21845&Ze)<<1,Ko=(61680&(Ko=(52428&Ko)>>>2|(13107&Ko)<<2))>>>4|(3855&Ko)<<4,qm[Ze]=((65280&Ko)>>>8|(255&Ko)<<8)>>>1;var Ko,cS,qm,Ze,Nd=function(t,e,a){for(var r=t.length,n=0,o=new pa(e);n<r;++n)++o[t[n]-1];var i,s=new pa(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new pa(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,f=d|(1<<c)-1;d<=f;++d)i[qm[d]>>>l]=u}else for(i=new pa(r),n=0;n<r;++n)i[n]=qm[s[t[n]-1]++]>>>15-t[n];return i},fs=new fr(288);for(Ze=0;Ze<144;++Ze)fs[Ze]=8;for(Ze=144;Ze<256;++Ze)fs[Ze]=9;for(Ze=256;Ze<280;++Ze)fs[Ze]=7;for(Ze=280;Ze<288;++Ze)fs[Ze]=8;var $m=new fr(32);for(Ze=0;Ze<32;++Ze)$m[Ze]=5;var PU=Nd(fs,9,0),FU=Nd($m,5,0),y2=function(t){return(t/8>>0)+(7&t&&1)},x2=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof pa?pa:t instanceof nu?nu:fr)(a-e);return r.set(t.subarray(e,a)),r},Vn=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},_d=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},m0=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 fr(0),0];if(n==1){var i=new fr(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(C,w){return C.f-w.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 f=o[0].s;for(r=1;r<n;++r)o[r].s>f&&(f=o[r].s);var p=new pa(f+1),S=dS(a[c-1],p,0);if(S>e){r=0;var x=0,b=S-e,m=1<<b;for(o.sort((function(C,w){return p[w.s]-p[C.s]||C.f-w.f}));r<n;++r){var h=o[r].s;if(!(p[h]>e))break;x+=m-(1<<S-p[h]),p[h]=e}for(x>>>=b;x>0;){var g=o[r].s;p[g]<e?x-=1<<e-p[g]++-1:++r}for(;r>=0&&x;--r){var y=o[r].s;p[y]==e&&(--p[y],++x)}S=e}return[new fr(p),S]},dS=function(t,e,a){return t.s==-1?Math.max(dS(t.l,e,a+1),dS(t.r,e,a+1)):e[t.s]=a},nR=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new pa(++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]},Cd=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},fS=function(t,e,a){var r=a.length,n=y2(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)},oR=function(t,e,a,r,n,o,i,s,l,u,c){Vn(e,c++,a),++n[256];for(var d=m0(n,15),f=d[0],p=d[1],S=m0(o,15),x=S[0],b=S[1],m=nR(f),h=m[0],g=m[1],y=nR(x),C=y[0],w=y[1],_=new pa(19),k=0;k<h.length;++k)_[31&h[k]]++;for(k=0;k<C.length;++k)_[31&C[k]]++;for(var A=m0(_,7),I=A[0],R=A[1],U=19;U>4&&!I[rR[U-1]];--U);var E,N,O,H,Y=u+5<<3,z=Cd(n,fs)+Cd(o,$m)+i,Q=Cd(n,f)+Cd(o,x)+i+14+3*U+Cd(_,I)+(2*_[16]+3*_[17]+7*_[18]);if(Y<=z&&Y<=Q)return fS(e,c,t.subarray(l,l+u));if(Vn(e,c,1+(Q<z)),c+=2,Q<z){E=Nd(f,p,0),N=f,O=Nd(x,b,0),H=x;var we=Nd(I,R,0);for(Vn(e,c,g-257),Vn(e,c+5,w-1),Vn(e,c+10,U-4),c+=14,k=0;k<U;++k)Vn(e,c+3*k,I[rR[k]]);c+=3*U;for(var Me=[h,C],bt=0;bt<2;++bt){var ha=Me[bt];for(k=0;k<ha.length;++k){var X=31&ha[k];Vn(e,c,we[X]),c+=I[X],X>15&&(Vn(e,c,ha[k]>>>5&127),c+=ha[k]>>>12)}}}else E=PU,N=fs,O=FU,H=$m;for(k=0;k<s;++k)if(r[k]>255){X=r[k]>>>18&31,_d(e,c,E[X+257]),c+=N[X+257],X>7&&(Vn(e,c,r[k]>>>23&31),c+=US[X]);var ue=31&r[k];_d(e,c,O[ue]),c+=H[ue],ue>3&&(_d(e,c,r[k]>>>5&8191),c+=zS[ue])}else _d(e,c,E[r[k]]),c+=N[r[k]];return _d(e,c,E[256]),c+N[256]},HU=new nu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),UU=(function(){for(var t=new nu(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),zU=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,f=new fr(l+d+5*(1+Math.floor(d/7e3))+u),p=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=fS(p,S,o.subarray(x,b)):(p[x]=c,S=fS(p,S,o.subarray(x,d)))}else{for(var m=HU[i-1],h=m>>>13,g=8191&m,y=(1<<s)-1,C=new pa(32768),w=new pa(y+1),_=Math.ceil(s/3),k=2*_,A=function(Gg){return(o[Gg]^o[Gg+1]<<_^o[Gg+2]<<k)&y},I=new nu(25e3),R=new pa(288),U=new pa(32),E=0,N=0,O=(x=0,0),H=0,Y=0;x<d;++x){var z=A(x),Q=32767&x,we=w[z];if(C[Q]=we,w[z]=Q,H<=x){var Me=d-x;if((E>7e3||O>24576)&&Me>423){S=oR(o,p,0,I,R,U,N,O,Y,x-Y,S),O=E=N=0,Y=x;for(var bt=0;bt<286;++bt)R[bt]=0;for(bt=0;bt<30;++bt)U[bt]=0}var ha=2,X=0,ue=g,Ot=Q-we&32767;if(Me>2&&z==A(x-Ot))for(var ao=Math.min(h,Me)-1,$g=Math.min(32767,x),Vg=Math.min(258,Me);Ot<=$g&&--ue&&Q!=we;){if(o[x+ha]==o[x+ha-Ot]){for(var ro=0;ro<Vg&&o[x+ro]==o[x+ro-Ot];++ro);if(ro>ha){if(ha=ro,X=Ot,ro>ao)break;var PM=Math.min(Ot,ro-2),sC=0;for(bt=0;bt<PM;++bt){var jg=x-Ot+bt+32768&32767,lC=jg-C[jg]+32768&32767;lC>sC&&(sC=lC,we=jg)}}}Ot+=(Q=we)-(we=C[Q])+32768&32767}if(X){I[O++]=268435456|uS[ha]<<18|cS[X];var uC=31&uS[ha],cC=31&cS[X];N+=US[uC]+zS[cC],++R[257+uC],++U[cC],H=x+ha,++E}else I[O++]=o[x],++R[o[x]]}}S=oR(o,p,c,I,R,U,N,O,Y,x-Y,S)}return x2(f,0,l+y2(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)},g0=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function qU(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=UU[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=zU(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&&g0(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),g0(o,i-8,a.d()),g0(o,i-4,r),o}var $U=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
517
|
+
`,za,io,so,rn,nn,lo,on,qp=class extends HTMLElement{constructor(){super();Ln(this,za);Ln(this,io);Ln(this,so);Ln(this,rn);Ln(this,nn);Ln(this,lo,null);Ln(this,on,null);pr(this,za,this.attachShadow({mode:"open",delegatesFocus:!0})),pr(this,io,document.createElement("div")),ye(this,io).setAttribute("part","mount"),ye(this,za).appendChild(ye(this,io)),pr(this,so,document.createElement("div")),ye(this,so).id="portalRoot",ye(this,za).appendChild(ye(this,so)),pr(this,rn,document.createElement("div")),ye(this,rn).id="overlayContainer",Object.assign(ye(this,rn).style,{position:"fixed",inset:"0",zIndex:"2147483645",pointerEvents:"none"}),ye(this,za).appendChild(ye(this,rn)),pr(this,nn,ax()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){ye(this,lo)?.unmount(),pr(this,lo,null)}getMountNode(){return ye(this,io)}getController(){return ye(this,nn)}getPortalRoot(){return ye(this,so)}getOverlayContainer(){return ye(this,rn)}getShadowRoot(){return ye(this,za)}open(){ye(this,nn).setOpen(!0)}close(){ye(this,nn).setOpen(!1)}toggle(){ye(this,nn).toggle()}setOverrideFetcher(a){ye(this,on)&&(pr(this,on,{...ye(this,on),fetcher:a}),this.render())}mountReactApp(a){pr(this,on,a),this.render()}render(){!this.isConnected||!ye(this,on)||(ye(this,lo)||pr(this,lo,(0,hA.createRoot)(ye(this,io))),ye(this,lo).render((0,Sx.jsx)(rx,{shadowRoot:ye(this,za),portalRoot:ye(this,so),overlayContainer:ye(this,rn),children:(0,Sx.jsx)(bx,{...ye(this,on),controller:ye(this,nn),canvasHost:this})})))}applyBaseStyles(){if(ye(this,za).adoptedStyleSheets!==void 0){let a=new CSSStyleSheet;a.replaceSync(pA),ye(this,za).adoptedStyleSheets=[a]}else{let a=document.createElement("style");a.textContent=pA,ye(this,za).appendChild(a)}}};za=new WeakMap,io=new WeakMap,so=new WeakMap,rn=new WeakMap,nn=new WeakMap,lo=new WeakMap,on=new WeakMap;var _x=()=>{typeof window>"u"||customElements.get(fA)||customElements.define(fA,qp)};var $p=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=TI(b)}let a=null,r=null,n=null,{runtime:o}=t;async function i(b){!o?.actions||b.length===0||(n?.isApplied()&&await n.revertAll(),n=await o.actions.applyBatch(b))}async function s(){n?.isApplied()&&(await n.revertAll(),n=null)}if(t.fetcher)try{r=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((g,m)=>`[${m}] ${g.kind}${g.anchorId?` anchor="${g.anchorId.selector}"`:""}${g.label?` "${g.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&&$u(b.tiles,o.accumulator,b.actions)}catch(b){console.error("[SmartCanvas] Error fetching/applying initial config:",b)}e&&e();let l=bp();_x();let u=document.createElement("smart-canvas");if(UI(u.getOverlayContainer()),t.tokens)for(let[b,g]of Object.entries(t.tokens))u.style.setProperty(b,g);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`),PI(t.editorUrl).catch(console.error));let d=t.integrations?.experiments,f=t.integrations?.telemetry,h=t.fetcher??ni({configUri:t.configUri,experiments:d,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=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:n,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[g,m]of Object.entries(b))u.style.setProperty(g,m)},getConfig:async()=>{if(r)try{let b=await r();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=>{r=b,u.setOverrideFetcher(b),o?.accumulator&&b().then(g=>{g?.tiles&&$u(g.tiles,o.accumulator,g.actions)}).catch(()=>{})},registerTelemetryProperties:b=>{f?.register?.(b)},getSessionId:()=>f?.getSessionId?.(),startSessionRecording:()=>{f?.startSessionRecording?.()},track:(b,g)=>f?.track?(f.track(b,g),!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 $p(t)}});var co=K(Ke(),1);var uo=K(Ee(),1);function AN({tiles:t,intervalMs:e=7e3,telemetry:a}){let[r,n]=(0,co.useState)(0),o=(0,co.useMemo)(()=>[...t].sort((i,s)=>(i.priority??0)-(s.priority??0)),[t]);return(0,co.useEffect)(()=>{a?.trackCanvasOpened("wheel")},[a]),(0,co.useEffect)(()=>{if(o.length<=1)return;let i=setInterval(()=>{n(s=>(s+1)%o.length)},e);return()=>clearInterval(i)},[o,e]),(0,co.useEffect)(()=>{let i=o[r];i&&a?.trackRectangleViewed(i.id,"wheel")},[r,o,a]),o.length?(0,uo.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,uo.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(i=>(0,uo.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,uo.jsx)(Ms,{config:i,surface:"wheel",telemetry:a})},i.id))}),(0,uo.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:o.map((i,s)=>(0,uo.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 Ds(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function EN(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=Ds(n),i=Ds(tn);return o.major>i.major&&e.push(`Config schema v${n} is newer than SDK v${tn}. 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${tn}. Migrating config to current version.`),{valid:!0,warnings:e,errors:a,migratedConfig:TN(r,n)}):{valid:!0,warnings:e,errors:a}}function TN(t,e){let a={...t};return Ds(e).major===1&&(a=RN(a)),a.schemaVersion=tn,a}function RN(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 MN(t){if(!t||typeof t!="object")return!1;let e=t,a=e.schemaVersion||"1.0",r=Ds(a),n=Ds(tn);return r.major<n.major||!e.schemaVersion}var gA={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function vA(){return gA}function Cx(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 sc(t,e,a){return a===2?Cx(Cx(t+e)+"")%1e4/1e4:a===1?Cx(e+t)%1e3/1e3:null}function ON(t){return t<=0?[]:new Array(t).fill(1/t)}function Vp(t,e){return t>=e[0]&&t<e[1]}function yA(t,e){let a=sc("__"+e[0],t,1);return a===null?!1:a>=e[1]&&a<e[2]}function xA(t,e){for(let a=0;a<e.length;a++)if(Vp(t,e[a]))return a;return-1}function Lx(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function jp(t,e){if(!e.length)return!1;let a=!1,r=!1;for(let n=0;n<e.length;n++){let o=PN(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 DN(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 BN(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=>!DN(n[0],n[1],n[2]))}catch{return!1}}function PN(t,e,a){try{let r=new URL(t,"https://_");if(e==="regex"){let n=Lx(a);return n?n.test(r.href)||n.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return BN(r,a);return!1}catch{return!1}}function bA(t,e,a){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=ON(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 SA(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 _A(t){try{return t()}catch(e){return console.error(e),!1}}var wx=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function ii(t,e,a){if(e=e||"",a=a||globalThis.crypto&&globalThis.crypto.subtle||gA.SubtleCrypto,!a)throw new Error("No SubtleCrypto implementation found");try{let r=await a.importKey("raw",wx(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[n,o]=t.split("."),i=await a.decrypt({name:"AES-CBC",iv:wx(n)},r,wx(o));return new TextDecoder().decode(i)}catch{throw new Error("Failed to decrypt")}}function lc(t){return typeof t=="string"?t:JSON.stringify(t)}function wa(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 CA(){let t;try{t="1.6.4"}catch{t=""}return t}function wA(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 mA(t){return typeof t=="object"&&t!==null}function Gp(t){return t.urlPatterns&&t.variations.some(e=>mA(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>mA(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Wp(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 Nt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},wr=vA(),Bs={fetchFeaturesCall:({host:t,clientKey:e,headers:a})=>wr.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 wr.fetch(`${t}/api/eval/${e}`,n)},eventSourceCall:({host:t,clientKey:e,headers:a})=>a?new wr.EventSource(`${t}/sub/${e}`,{headers:a}):new wr.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let a=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),HN()):document.visibilityState==="hidden"&&(t=window.setTimeout(FN,Nt.idleStreamInterval))};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(wr.localStorage=globalThis.localStorage)}catch{}var Ps=new Map,LA=!1,sn=new Map,Zp=new Map,Ns=new Map,Fs=new Set;function IA(t){Object.assign(Nt,t),Nt.backgroundSync||Rx()}async function AA({instance:t,timeout:e,skipCache:a,allowStale:r,backgroundSync:n}){return n||(Nt.backgroundSync=!1),UN({instance:t,allowStale:r,timeout:e,skipCache:a})}function NN(t){let e=uc(t),a=Ps.get(e)||new Set;a.add(t),Ps.set(e,a)}function EA(t){Ps.forEach(e=>e.delete(t))}function FN(){Ns.forEach(t=>{t&&(t.state="idle",Ex(t))})}function HN(){Ns.forEach(t=>{t&&t.state==="idle"&&Tx(t)})}async function kA(){try{if(!wr.localStorage)return;await wr.localStorage.setItem(Nt.cacheKey,JSON.stringify(Array.from(sn.entries())))}catch{}}async function UN({instance:t,allowStale:e,timeout:a,skipCache:r}){let n=uc(t),o=Ix(t),i=new Date,s=new Date(i.getTime()-Nt.maxAge+Nt.staleTTL);await zN();let l=!Nt.disableCache&&!r?sn.get(o):void 0;return l&&(e||l.staleAt>i)&&l.staleAt>s?(l.sse&&Fs.add(n),l.staleAt<i?kx(t):Ax(t),{data:l.data,success:!0,source:"cache"}):await Wp(kx(t),a)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function uc(t){let[e,a]=t.getApiInfo();return`${e}||${a}`}function Ix(t){let e=uc(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 zN(){if(!LA){LA=!0;try{if(wr.localStorage){let t=await wr.localStorage.getItem(Nt.cacheKey);if(!Nt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([a,r])=>{sn.set(a,{...r,staleAt:new Date(r.staleAt)})}),TA()}}}catch{}if(!Nt.disableIdleStreams){let t=Bs.startIdleListener();t&&(Bs.stopIdleListener=t)}}}function TA(){let t=Array.from(sn.entries()).map(([a,r])=>({key:a,staleAt:r.staleAt.getTime()})).sort((a,r)=>a.staleAt-r.staleAt),e=Math.min(Math.max(0,sn.size-Nt.maxEntries),sn.size);for(let a=0;a<e;a++)sn.delete(t[a].key)}function RA(t,e,a){let r=a.dateUpdated||"",n=new Date(Date.now()+Nt.staleTTL),o=Nt.disableCache?void 0:sn.get(e);if(o&&r&&o.version===r){o.staleAt=n,kA();return}Nt.disableCache||(sn.set(e,{data:a,version:r,staleAt:n,sse:Fs.has(t)}),TA()),kA();let i=Ps.get(t);i&&i.forEach(s=>qN(s,a))}async function qN(t,e){await t.setPayload(e||t.getPayload())}async function kx(t){let{apiHost:e,apiRequestHeaders:a}=t.getApiHosts(),r=t.getClientKey(),n="isRemoteEval"in t&&t.isRemoteEval(),o=uc(t),i=Ix(t),s=Zp.get(i);return s||(s=(n?Bs.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:a}):Bs.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"&&Fs.add(o),u.json()}).then(u=>(RA(o,i,u),Ax(t),Zp.delete(i),{data:u,success:!0,source:"network"})).catch(u=>(Zp.delete(i),{data:null,source:"error",success:!1,error:u})),Zp.set(i,s)),s}function Ax(t,e=!1){let a=uc(t),r=Ix(t),{streamingHost:n,streamingHostRequestHeaders:o}=t.getApiHosts(),i=t.getClientKey();if(e&&Fs.add(a),Nt.backgroundSync&&Fs.has(a)&&wr.EventSource){if(Ns.has(a))return;let s={src:null,host:n,clientKey:i,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=Ps.get(a);u&&u.forEach(c=>{kx(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);RA(a,r,u)}s.errors=0}catch{MA(s)}},errors:0,state:"active"};Ns.set(a,s),Tx(s)}}function MA(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);Ex(t),setTimeout(()=>{["idle","active"].includes(t.state)||Tx(t)},Math.min(e,3e5))}}function Ex(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Tx(t){t.src=Bs.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=()=>MA(t),t.src.onopen=()=>{t.errors=0}}function $N(t,e){Ex(t),Ns.delete(e)}function Rx(){Fs.clear(),Ns.forEach($N),Ps.clear(),Bs.stopIdleListener()}function Xp(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Ax(t,!0),NN(t)}}var VN=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Dx={revert:function(){}},Jp=new Map,Bx=new Set;function jN(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function eh(t){var e=Jp.get(t);return e||(e={element:t,attributes:{}},Jp.set(t,e)),e}function th(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,jN(e)),i}function ah(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,OA()):t!==a&&(e.isDirty=!0,OA())}function GN(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),ah(iF(e),t)}function WN(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(a){return a.mutate(e)}),ah(Array.from(e).filter(Boolean).join(" "),t)}function ZN(t){var e=t.originalValue;t.mutations.forEach(function(a){return e=a.mutate(e)}),ah(e,t)}function XN(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 YN(t){var e=t.originalValue;t.mutations.forEach(function(a){var r=a.mutate(),n=XN(r);e=n||e}),ah(e,t)}var KN=function(e){return e.innerHTML},QN=function(e,a){return e.innerHTML=a};function BA(t){var e=eh(t);return e.html||(e.html=th(t,"html",KN,QN,GN)),e.html}var JN=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},eF=function(e,a){a.insertBeforeNode&&!a.parentNode.contains(a.insertBeforeNode)||a.parentNode.insertBefore(e,a.insertBeforeNode)};function PA(t){var e=eh(t);return e.position||(e.position=th(t,"position",JN,eF,YN)),e.position}var tF=function(e,a){return a?e.className=a:e.removeAttribute("class")},aF=function(e){return e.className};function NA(t){var e=eh(t);return e.classes||(e.classes=th(t,"class",aF,tF,WN)),e.classes}var rF=function(e){return function(a){var r;return(r=a.getAttribute(e))!=null?r:null}},nF=function(e){return function(a,r){return r!==null?a.setAttribute(e,r):a.removeAttribute(e)}};function FA(t,e){var a=eh(t);return a.attributes[e]||(a.attributes[e]=th(t,e,rF(e),nF(e),ZN)),a.attributes[e]}function oF(t,e){var a=Jp.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 Yp;function iF(t){return Yp||(Yp=document.createElement("div")),Yp.innerHTML=t,Yp.innerHTML}function Kp(t,e,a){if(a.isDirty){a.isDirty=!1;var r=a.virtualValue;a.mutations.length||oF(t,e),a.setValue(t,r)}}function sF(t,e){t.html&&Kp(e,"html",t.html),t.classes&&Kp(e,"class",t.classes),t.position&&Kp(e,"position",t.position),Object.keys(t.attributes).forEach(function(a){Kp(e,a,t.attributes[a])})}function OA(){Jp.forEach(sF)}function lF(t,e){var a=null;t.kind==="html"?a=BA(e):t.kind==="class"?a=NA(e):t.kind==="attribute"?a=FA(e,t.attribute):t.kind==="position"&&(a=PA(e)),a&&(a.mutations.push(t),a.mutationRunner(a))}function uF(t,e){var a=null;if(t.kind==="html"?a=BA(e):t.kind==="class"?a=NA(e):t.kind==="attribute"?a=FA(e,t.attribute):t.kind==="position"&&(a=PA(e)),!!a){var r=a.mutations.indexOf(t);r!==-1&&a.mutations.splice(r,1),a.mutationRunner(a)}}function HA(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),lF(t,r))})}}function cF(t){t.elements.forEach(function(e){return uF(t,e)}),t.elements.clear(),Bx.delete(t)}function DA(){Bx.forEach(HA)}var Mx;function dF(){typeof document>"u"||(Mx||(Mx=new MutationObserver(function(){DA()})),DA(),Mx.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}dF();function rh(t){return typeof document>"u"?Dx:(Bx.add(t),HA(t),{revert:function(){cF(t)}})}function Ox(t,e){return rh({kind:"html",elements:new Set,mutate:e,selector:t})}function UA(t,e){return rh({kind:"position",elements:new Set,mutate:e,selector:t})}function cc(t,e){return rh({kind:"class",elements:new Set,mutate:e,selector:t})}function Qp(t,e,a){return VN.test(e)?e==="class"||e==="className"?cc(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)})}):rh({kind:"attribute",attribute:e,elements:new Set,mutate:a,selector:t}):Dx}function fF(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 Ox(e,function(s){return s+(r??"")});if(a==="set")return Ox(e,function(){return r??""})}else if(n==="class"){if(a==="append")return cc(e,function(s){r&&s.add(r)});if(a==="remove")return cc(e,function(s){r&&s.delete(r)});if(a==="set")return cc(e,function(s){s.clear(),r&&s.add(r)})}else if(n==="position"){if(a==="set"&&o)return UA(e,function(){return{insertBeforeSelector:i,parentSelector:o}})}else{if(a==="append")return Qp(e,n,function(s){return s!==null?s+(r??""):r??""});if(a==="set")return Qp(e,n,function(){return r??""});if(a==="remove")return Qp(e,n,function(){return null})}return Dx}var pF={html:Ox,classes:cc,attribute:Qp,position:UA,declarative:fF},zA=pF;var Px={};function fo(t,e,a){a=a||{};for(let[r,n]of Object.entries(e))switch(r){case"$or":if(!VA(t,n,a))return!1;break;case"$nor":if(VA(t,n,a))return!1;break;case"$and":if(!yF(t,n,a))return!1;break;case"$not":if(fo(t,n,a))return!1;break;default:if(!dc(n,hF(t,r),a))return!1}return!0}function hF(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 qA(t,e=!1){let a=`${t}${e?"/i":""}`;return Px[a]||(Px[a]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Px[a]}function dc(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)||!jA(t))return JSON.stringify(e)===JSON.stringify(t);for(let n in t)if(!vF(n,e,t[n],a))return!1;return!0}function jA(t){let e=Object.keys(t);return e.length>0&&e.filter(a=>a[0]==="$").length===e.length}function mF(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 gF(t,e,a){if(!Array.isArray(t))return!1;let r=jA(e)?n=>dc(e,n,a):n=>fo(n,e,a);for(let n=0;n<t.length;n++)if(t[n]&&r(t[n]))return!0;return!1}function Hs(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 $A(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(dc(e[n],t[i],a,r)){o=!0;break}if(!o)return!1}return!0}function vF(t,e,a,r){switch(t){case"$veq":return wa(e)===wa(a);case"$vne":return wa(e)!==wa(a);case"$vgt":return wa(e)>wa(a);case"$vgte":return wa(e)>=wa(a);case"$vlt":return wa(e)<wa(a);case"$vlte":return wa(e)<=wa(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)?Hs(e,a):!1;case"$ini":return Array.isArray(a)?Hs(e,a,!0):!1;case"$inGroup":return Hs(e,r[a]||[]);case"$notInGroup":return!Hs(e,r[a]||[]);case"$nin":return Array.isArray(a)?!Hs(e,a):!1;case"$nini":return Array.isArray(a)?!Hs(e,a,!0):!1;case"$not":return!dc(a,e,r);case"$size":return Array.isArray(e)?dc(a,e.length,r):!1;case"$elemMatch":return gF(e,a,r);case"$all":return Array.isArray(a)?$A(e,a,r):!1;case"$alli":return Array.isArray(a)?$A(e,a,r,!0):!1;case"$regex":try{return qA(a).test(e)}catch{return!1}case"$regexi":try{return qA(a,!0).test(e)}catch{return!1}case"$type":return mF(e)===a;default:return console.error("Unknown operator: "+t),!1}}function VA(t,e,a){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(fo(t,e[r],a))return!0;return!1}function yF(t,e,a){for(let r=0;r<e.length;r++)if(!fo(t,e[r],a))return!1;return!0}var xF="Feature Evaluated",bF="Experiment Viewed";function SF(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 _F(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 Us(t){try{await t()}catch{}}function GA(t,e,a){if(t.user.trackedExperiments){let n=ih(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(Us(()=>n(e,a,t.user)))}if(t.user.trackingCallback){let n=t.user.trackingCallback;r.push(Us(()=>n(e,a)))}if(t.global.eventLogger){let n=t.global.eventLogger;r.push(Us(()=>n(bF,{experimentId:e.key,variationId:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue},t.user)))}return r}function CF(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;Us(()=>r(e,a,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;Us(()=>r(e,a))}if(t.global.eventLogger){let r=t.global.eventLogger;Us(()=>r(xF,{feature:e,source:a.source,value:a.value,ruleId:a.source==="defaultValue"?"$default":a.ruleId||"",variationId:a.experimentResult?a.experimentResult.key:""},t.user))}}function nh(t,e){if(e.stack.evaluatedFeatures.has(t))return po(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let a=SF(e);if(a.has(t))return po(e,t,a.get(t),"override");if(!e.global.features||!e.global.features[t])return po(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=nh(l.id,e);if(u.source==="cyclicPrerequisite")return po(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!fo(c,l.condition||{})){if(l.gate)return po(e,t,null,"prerequisite");continue e}}if(o.filters&&XA(o.filters,e))continue;if("force"in o){if(o.condition&&!ZA(o.condition,e)||!wF(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=>{!GA(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),po(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}=oh(i,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(i,s),s.inExperiment&&!s.passthrough)return po(e,t,s.value,"experiment",o.id,i,s)}}return po(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function oh(t,e,a){let r=t.key,n=t.variations.length;if(n<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=LF(t,a),t.urlPatterns&&!jp(a.user.url||"",t.urlPatterns))return{result:Ze(a,t,-1,!1,e)};let o=SA(r,a.user.url||"",n);if(o!==null)return{result:Ze(a,t,o,!1,e)};let i=_F(a);if(r in i){let b=i[r];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}=si(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:g}=AF({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=!!g}if(!c){if(t.filters){if(XA(t.filters,a))return{result:Ze(a,t,-1,!1,e)}}else if(t.namespace&&!yA(l,t.namespace))return{result:Ze(a,t,-1,!1,e)};if(t.include&&!_A(t.include))return{result:Ze(a,t,-1,!1,e)};if(t.condition&&!ZA(t.condition,a))return{result:Ze(a,t,-1,!1,e)};if(t.parentConditions){let b=new Set(a.stack.evaluatedFeatures);for(let g of t.parentConditions){a.stack.evaluatedFeatures=new Set(b);let m=nh(g.id,a);if(m.source==="cyclicPrerequisite")return{result:Ze(a,t,-1,!1,e)};let y={value:m.value};if(!fo(y,g.condition||{}))return{result:Ze(a,t,-1,!1,e)}}}if(t.groups&&!IF(t.groups,a))return{result:Ze(a,t,-1,!1,e)}}if(t.url&&!kF(t.url,a))return{result:Ze(a,t,-1,!1,e)};let f=sc(t.seed||r,l,t.hashVersion||1);if(f===null)return{result:Ze(a,t,-1,!1,e)};if(!c){let b=t.ranges||bA(n,t.coverage===void 0?1:t.coverage,t.weights);u=xA(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:g,doc:m}=TF(a,s,lc(l),{[Nx(t.key,t.bucketVersion)]:h.key});b&&(a.user.stickyBucketAssignmentDocs=a.user.stickyBucketAssignmentDocs||{},a.user.stickyBucketAssignmentDocs[g]=m,a.user.saveStickyBucketAssignmentDoc(m))}let S=GA(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 po(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"&&CF(t,e,s),s}function WA(t){return{...t.user.attributes,...t.user.attributeOverrides}}function ZA(t,e){return fo(WA(e),t,e.global.savedGroups||{})}function XA(t,e){return t.some(a=>{let{hashValue:r}=si(e,a.attribute);if(!r)return!0;let n=sc(a.seed,r,a.hashVersion||2);return n===null?!0:!a.ranges.some(o=>Vp(n,o))})}function wF(t,e,a,r,n,o,i){if(!n&&o===void 0)return!0;if(!n&&o===0)return!1;let{hashValue:s}=si(t,a,r);if(!s)return!1;let l=sc(e,s,i||1);return l===null?!1:n?Vp(l,n):o!==void 0?l<=o:!0}function Ze(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}=si(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 LF(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=Lx(t.url))),t}function si(t,e,a){let r=e||"id",n="",o=WA(t);return o[r]&&(n=o[r]),!n&&a&&(o[a]&&(n=o[a]),n&&(r=a)),{hashAttribute:r,hashValue:n}}function kF(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 IF(t,e){let a=e.global.groups||{};for(let r=0;r<t.length;r++)if(a[t[r]])return!0;return!1}function AF({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=Nx(e,a),l=EF(t,r,n);if(o>0)for(let d=0;d<o;d++){let f=Nx(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 Nx(t,e){return e=e||0,`${t}__${e}`}function Fx(t,e){return`${t}||${e}`}function EF(t,e,a){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:n}=si(t,e),o=Fx(r,lc(n)),{hashAttribute:i,hashValue:s}=si(t,a),l=s?Fx(i,lc(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 TF(t,e,a,r){let n=Fx(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 RF(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 YA(t,e,a){let r=Hx(t,a);return e.getAllAssignments(r)}function Hx(t,e){let a={};return RF(t,e).forEach(n=>{let{hashValue:o}=si(t,n);a[n]=lc(o)}),a}async function KA(t,e,a){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await ii(t.encryptedFeatures,e,a))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await ii(t.encryptedExperiments,e,a))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await ii(t.encryptedSavedGroups,e,a))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function QA(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 ih(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var zs=typeof window<"u"&&typeof document<"u",MF=CA(),fc=class{constructor(e){if(e=e||{},this.version=MF,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),zs&&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 KA(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,Xp(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&IA(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Xp(this,e),{success:!0,source:"init"};{let{data:a,...r}=await this._refresh({...e,allowStale:!0});return Xp(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 QA(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 AA({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 ii(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 ii(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,EA(this),e.destroyAllStreams&&Rx(),this.logs=[],zs&&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}=oh(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=Ze(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:i}=oh(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=Gp(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?wA(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(jp(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(zs)Promise.all([...i?[Wp(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||[],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&&Gp(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 nh(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=>[ih(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(ih(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(zs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let a=Gp(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}:zs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!zs)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(zA.declarative(r).revert)}),()=>{a.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let a=this._getEvalContext(),r=await YA(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=Hx(r,a);return e.getAllAssignmentsSync(n)}inDevMode(){return!!this._options.enableDevMode}};var OF="https://experiment.syntrologie.com",Ux=class{constructor(e={}){B(this,"gb");B(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 fc({...e,apiHost:e.apiHost??OF,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 sh(t={}){return new Ux(t)}var JA="syntro_session_metrics",pc=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 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(JA);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(JA,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function lh(t={}){return new pc(t)}var p={};KS(p,{BRAND:()=>oH,DIRTY:()=>li,EMPTY_PATH:()=>NF,INVALID:()=>J,NEVER:()=>$H,OK:()=>Ft,ParseStatus:()=>Mt,Schema:()=>le,ZodAny:()=>go,ZodArray:()=>dn,ZodBigInt:()=>ci,ZodBoolean:()=>di,ZodBranded:()=>mc,ZodCatch:()=>_i,ZodDate:()=>fi,ZodDefault:()=>Si,ZodDiscriminatedUnion:()=>dh,ZodEffects:()=>Va,ZodEnum:()=>xi,ZodError:()=>sa,ZodFirstPartyTypeKind:()=>ee,ZodFunction:()=>ph,ZodIntersection:()=>gi,ZodIssueCode:()=>P,ZodLazy:()=>vi,ZodLiteral:()=>yi,ZodMap:()=>Ws,ZodNaN:()=>Xs,ZodNativeEnum:()=>bi,ZodNever:()=>ur,ZodNull:()=>hi,ZodNullable:()=>Ir,ZodNumber:()=>ui,ZodObject:()=>la,ZodOptional:()=>qa,ZodParsedType:()=>j,ZodPipeline:()=>gc,ZodPromise:()=>vo,ZodReadonly:()=>Ci,ZodRecord:()=>fh,ZodSchema:()=>le,ZodSet:()=>Zs,ZodString:()=>mo,ZodSymbol:()=>js,ZodTransformer:()=>Va,ZodTuple:()=>kr,ZodType:()=>le,ZodUndefined:()=>pi,ZodUnion:()=>mi,ZodUnknown:()=>cn,ZodVoid:()=>Gs,addIssueToContext:()=>U,any:()=>hH,array:()=>yH,bigint:()=>uH,boolean:()=>cE,coerce:()=>qH,custom:()=>sE,date:()=>cH,datetimeRegex:()=>oE,defaultErrorMap:()=>ln,discriminatedUnion:()=>_H,effect:()=>DH,enum:()=>RH,function:()=>AH,getErrorMap:()=>qs,getParsedType:()=>Lr,instanceof:()=>sH,intersection:()=>CH,isAborted:()=>uh,isAsync:()=>$s,isDirty:()=>ch,isValid:()=>ho,late:()=>iH,lazy:()=>EH,literal:()=>TH,makeIssue:()=>hc,map:()=>kH,nan:()=>lH,nativeEnum:()=>MH,never:()=>gH,null:()=>pH,nullable:()=>PH,number:()=>uE,object:()=>xH,objectUtil:()=>zx,oboolean:()=>zH,onumber:()=>UH,optional:()=>BH,ostring:()=>HH,pipeline:()=>FH,preprocess:()=>NH,promise:()=>OH,quotelessJson:()=>DF,record:()=>LH,set:()=>IH,setErrorMap:()=>PF,strictObject:()=>bH,string:()=>lE,symbol:()=>dH,transformer:()=>DH,tuple:()=>wH,undefined:()=>fH,union:()=>SH,unknown:()=>mH,util:()=>fe,void:()=>vH});var fe;(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})(fe||(fe={}));var zx;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(zx||(zx={}));var j=fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Lr=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:t===null?j.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?j.promise:typeof Map<"u"&&t instanceof Map?j.map:typeof Set<"u"&&t instanceof Set?j.set:typeof Date<"u"&&t instanceof Date?j.date:j.object;default:return j.unknown}};var P=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"]),DF=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),sa=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,fe.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()}};sa.create=t=>new sa(t);var BF=(t,e)=>{let a;switch(t.code){case P.invalid_type:t.received===j.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case P.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,fe.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:a=`Unrecognized key(s) in object: ${fe.joinValues(t.keys,", ")}`;break;case P.invalid_union:a="Invalid input";break;case P.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${fe.joinValues(t.options)}`;break;case P.invalid_enum_value:a=`Invalid enum value. Expected ${fe.joinValues(t.options)}, received '${t.received}'`;break;case P.invalid_arguments:a="Invalid function arguments";break;case P.invalid_return_type:a="Invalid function return type";break;case P.invalid_date:a="Invalid date";break;case P.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 P.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 P.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 P.custom:a="Invalid input";break;case P.invalid_intersection_types:a="Intersection results could not be merged";break;case P.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case P.not_finite:a="Number must be finite";break;default:a=e.defaultError,fe.assertNever(t)}return{message:a}},ln=BF;var eE=ln;function PF(t){eE=t}function qs(){return eE}var hc=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}},NF=[];function U(t,e){let a=qs(),r=hc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===ln?void 0:ln].filter(n=>!!n)});t.common.issues.push(r)}var Mt=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 J;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 J;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}}},J=Object.freeze({status:"aborted"}),li=t=>({status:"dirty",value:t}),Ft=t=>({status:"valid",value:t}),uh=t=>t.status==="aborted",ch=t=>t.status==="dirty",ho=t=>t.status==="valid",$s=t=>typeof Promise<"u"&&t instanceof Promise;var X;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(X||(X={}));var $a=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}},tE=(t,e)=>{if(ho(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 sa(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 Lr(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:Lr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Mt,ctx:{common:e.parent.common,data:e.data,parsedType:Lr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if($s(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:Lr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return tE(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Lr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return ho(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=>ho(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:Lr(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await($s(n)?n:Promise.resolve(n));return tE(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:P.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 Va({schema:this,typeName:ee.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 qa.create(this,this._def)}nullable(){return Ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dn.create(this)}promise(){return vo.create(this,this._def)}or(e){return mi.create([this,e],this._def)}and(e){return gi.create(this,e,this._def)}transform(e){return new Va({...se(this._def),schema:this,typeName:ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new Si({...se(this._def),innerType:this,defaultValue:a,typeName:ee.ZodDefault})}brand(){return new mc({typeName:ee.ZodBranded,type:this,...se(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new _i({...se(this._def),innerType:this,catchValue:a,typeName:ee.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return gc.create(this,e)}readonly(){return Ci.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},FF=/^c[^\s-]{8,}$/i,HF=/^[0-9a-z]+$/,UF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zF=/^[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,qF=/^[a-z0-9_-]{21}$/i,$F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,VF=/^[-+]?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)?)??$/,jF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qx,WF=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,XF=/^(([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]))$/,YF=/^(([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])$/,KF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rE="((\\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])))",JF=new RegExp(`^${rE}$`);function nE(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 eH(t){return new RegExp(`^${nE(t)}$`)}function oE(t){let e=`${rE}T${nE(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 tH(t,e){return!!((e==="v4"||!e)&&WF.test(t)||(e==="v6"||!e)&&XF.test(t))}function aH(t,e){if(!$F.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 rH(t,e){return!!((e==="v4"||!e)&&ZF.test(t)||(e==="v6"||!e)&&YF.test(t))}var mo=class t extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==j.string){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:j.string,received:o.parsedType}),J}let r=new Mt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),U(n,{code:P.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),U(n,{code:P.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?U(n,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&U(n,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")jF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"email",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")qx||(qx=new RegExp(GF,"u")),qx.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"emoji",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")zF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"uuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")qF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"nanoid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")FF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"cuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")HF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"cuid2",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")UF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"ulid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),U(n,{validation:"url",code:P.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),U(n,{validation:"regex",code:P.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),U(n,{code:P.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),U(n,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),U(n,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?oE(o).test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:P.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?JF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:P.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?eH(o).test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:P.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?VF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"duration",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?tH(e.data,o.version)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"ip",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?aH(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"jwt",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?rH(e.data,o.version)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"cidr",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?KF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"base64",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?QF.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:"base64url",code:P.invalid_string,message:o.message}),r.dirty()):fe.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:P.invalid_string,...X.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...X.errToObj(e)})}url(e){return this._addCheck({kind:"url",...X.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...X.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...X.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...X.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...X.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...X.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...X.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...X.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...X.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...X.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...X.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,...X.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,...X.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...X.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...X.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...X.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...X.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...X.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...X.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...X.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...X.errToObj(a)})}nonempty(e){return this.min(1,X.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}};mo.create=t=>new mo({checks:[],typeName:ee.ZodString,coerce:t?.coerce??!1,...se(t)});function nH(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 ui=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)!==j.number){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:j.number,received:o.parsedType}),J}let r,n=new Mt;for(let o of this._def.checks)o.kind==="int"?fe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),U(r,{code:P.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),U(r,{code:P.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),U(r,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?nH(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_finite,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,X.toString(a))}gt(e,a){return this.setLimit("min",e,!1,X.toString(a))}lte(e,a){return this.setLimit("max",e,!0,X.toString(a))}lt(e,a){return this.setLimit("max",e,!1,X.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:X.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:X.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:X.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.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 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)}};ui.create=t=>new ui({checks:[],typeName:ee.ZodNumber,coerce:t?.coerce||!1,...se(t)});var ci=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)!==j.bigint)return this._getInvalidInput(e);let r,n=new Mt;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),U(r,{code:P.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),U(r,{code:P.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),U(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):fe.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return U(a,{code:P.invalid_type,expected:j.bigint,received:a.parsedType}),J}gte(e,a){return this.setLimit("min",e,!0,X.toString(a))}gt(e,a){return this.setLimit("min",e,!1,X.toString(a))}lte(e,a){return this.setLimit("max",e,!0,X.toString(a))}lt(e,a){return this.setLimit("max",e,!1,X.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:X.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:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:X.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}};ci.create=t=>new ci({checks:[],typeName:ee.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var di=class extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==j.boolean){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:j.boolean,received:r.parsedType}),J}return Ft(e.data)}};di.create=t=>new di({typeName:ee.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var fi=class t extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==j.date){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:j.date,received:o.parsedType}),J}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_date}),J}let r=new Mt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),U(n,{code:P.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),U(n,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):fe.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:X.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:X.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}};fi.create=t=>new fi({checks:[],coerce:t?.coerce||!1,typeName:ee.ZodDate,...se(t)});var js=class extends le{_parse(e){if(this._getType(e)!==j.symbol){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:j.symbol,received:r.parsedType}),J}return Ft(e.data)}};js.create=t=>new js({typeName:ee.ZodSymbol,...se(t)});var pi=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:j.undefined,received:r.parsedType}),J}return Ft(e.data)}};pi.create=t=>new pi({typeName:ee.ZodUndefined,...se(t)});var hi=class extends le{_parse(e){if(this._getType(e)!==j.null){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:j.null,received:r.parsedType}),J}return Ft(e.data)}};hi.create=t=>new hi({typeName:ee.ZodNull,...se(t)});var go=class extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Ft(e.data)}};go.create=t=>new go({typeName:ee.ZodAny,...se(t)});var cn=class extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ft(e.data)}};cn.create=t=>new cn({typeName:ee.ZodUnknown,...se(t)});var ur=class extends le{_parse(e){let a=this._getOrReturnCtx(e);return U(a,{code:P.invalid_type,expected:j.never,received:a.parsedType}),J}};ur.create=t=>new ur({typeName:ee.ZodNever,...se(t)});var Gs=class extends le{_parse(e){if(this._getType(e)!==j.undefined){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:j.void,received:r.parsedType}),J}return Ft(e.data)}};Gs.create=t=>new Gs({typeName:ee.ZodVoid,...se(t)});var dn=class t extends le{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==j.array)return U(a,{code:P.invalid_type,expected:j.array,received:a.parsedType}),J;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&(U(a,{code:i?P.too_big:P.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&&(U(a,{code:P.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&&(U(a,{code:P.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 $a(a,i,a.path,s)))).then(i=>Mt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new $a(a,i,a.path,s)));return Mt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:X.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:X.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:X.toString(a)}})}nonempty(e){return this.min(1,e)}};dn.create=(t,e)=>new dn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ee.ZodArray,...se(e)});function Vs(t){if(t instanceof la){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=qa.create(Vs(r))}return new la({...t._def,shape:()=>e})}else return t instanceof dn?new dn({...t._def,type:Vs(t.element)}):t instanceof qa?qa.create(Vs(t.unwrap())):t instanceof Ir?Ir.create(Vs(t.unwrap())):t instanceof kr?kr.create(t.items.map(e=>Vs(e))):t}var la=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)!==j.object){let u=this._getOrReturnCtx(e);return U(u,{code:P.invalid_type,expected:j.object,received:u.parsedType}),J}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof ur&&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 $a(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof ur){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&&(U(n,{code:P.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 $a(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,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>Mt.mergeObjectSync(r,u)):Mt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return X.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:X.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:ee.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 fe.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 fe.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return Vs(this)}partial(e){let a={};for(let r of fe.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 fe.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof qa;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return iE(fe.objectKeys(this.shape))}};la.create=(t,e)=>new la({shape:()=>t,unknownKeys:"strip",catchall:ur.create(),typeName:ee.ZodObject,...se(e)});la.strictCreate=(t,e)=>new la({shape:()=>t,unknownKeys:"strict",catchall:ur.create(),typeName:ee.ZodObject,...se(e)});la.lazycreate=(t,e)=>new la({shape:t,unknownKeys:"strip",catchall:ur.create(),typeName:ee.ZodObject,...se(e)});var mi=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 sa(s.ctx.common.issues));return U(a,{code:P.invalid_union,unionErrors:i}),J}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 sa(l));return U(a,{code:P.invalid_union,unionErrors:s}),J}}get options(){return this._def.options}};mi.create=(t,e)=>new mi({options:t,typeName:ee.ZodUnion,...se(e)});var un=t=>t instanceof vi?un(t.schema):t instanceof Va?un(t.innerType()):t instanceof yi?[t.value]:t instanceof xi?t.options:t instanceof bi?fe.objectValues(t.enum):t instanceof Si?un(t._def.innerType):t instanceof pi?[void 0]:t instanceof hi?[null]:t instanceof qa?[void 0,...un(t.unwrap())]:t instanceof Ir?[null,...un(t.unwrap())]:t instanceof mc||t instanceof Ci?un(t.unwrap()):t instanceof _i?un(t._def.innerType):[],dh=class t extends le{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==j.object)return U(a,{code:P.invalid_type,expected:j.object,received:a.parsedType}),J;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}):(U(a,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),J)}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=un(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:ee.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...se(r)})}};function $x(t,e){let a=Lr(t),r=Lr(e);if(t===e)return{valid:!0,data:t};if(a===j.object&&r===j.object){let n=fe.objectKeys(e),o=fe.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=$x(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===j.array&&r===j.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=$x(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===j.date&&r===j.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var gi=class extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(uh(o)||uh(i))return J;let s=$x(o.value,i.value);return s.valid?((ch(o)||ch(i))&&a.dirty(),{status:a.value,value:s.data}):(U(r,{code:P.invalid_intersection_types}),J)};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}))}};gi.create=(t,e,a)=>new gi({left:t,right:e,typeName:ee.ZodIntersection,...se(a)});var kr=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==j.array)return U(r,{code:P.invalid_type,expected:j.array,received:r.parsedType}),J;if(r.data.length<this._def.items.length)return U(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&r.data.length>this._def.items.length&&(U(r,{code:P.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 $a(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>Mt.mergeArray(a,i)):Mt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};kr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kr({items:t,typeName:ee.ZodTuple,rest:null,...se(e)})};var fh=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!==j.object)return U(r,{code:P.invalid_type,expected:j.object,received:r.parsedType}),J;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new $a(r,s,r.path,s)),value:i._parse(new $a(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Mt.mergeObjectAsync(a,n):Mt.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:ee.ZodRecord,...se(r)}):new t({keyType:mo.create(),valueType:e,typeName:ee.ZodRecord,...se(a)})}},Ws=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!==j.map)return U(r,{code:P.invalid_type,expected:j.map,received:r.parsedType}),J;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new $a(r,s,r.path,[u,"key"])),value:o._parse(new $a(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 J;(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 J;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};Ws.create=(t,e,a)=>new Ws({valueType:e,keyType:t,typeName:ee.ZodMap,...se(a)});var Zs=class t extends le{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==j.set)return U(r,{code:P.invalid_type,expected:j.set,received:r.parsedType}),J;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(U(r,{code:P.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&&(U(r,{code:P.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 J;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 $a(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:X.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:X.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Zs.create=(t,e)=>new Zs({valueType:t,minSize:null,maxSize:null,typeName:ee.ZodSet,...se(e)});var ph=class t extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==j.function)return U(a,{code:P.invalid_type,expected:j.function,received:a.parsedType}),J;function r(s,l){return hc({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,qs(),ln].filter(u=>!!u),issueData:{code:P.invalid_arguments,argumentsError:l}})}function n(s,l){return hc({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,qs(),ln].filter(u=>!!u),issueData:{code:P.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof vo){let s=this;return Ft(async function(...l){let u=new sa([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(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(n(d,h)),u})})}else{let s=this;return Ft(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new sa([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new sa([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:kr.create(e).rest(cn.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||kr.create([]).rest(cn.create()),returns:a||cn.create(),typeName:ee.ZodFunction,...se(r)})}},vi=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})}};vi.create=(t,e)=>new vi({getter:t,typeName:ee.ZodLazy,...se(e)});var yi=class extends le{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return U(a,{received:a.data,code:P.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}};yi.create=(t,e)=>new yi({value:t,typeName:ee.ZodLiteral,...se(e)});function iE(t,e){return new xi({values:t,typeName:ee.ZodEnum,...se(e)})}var xi=class t extends le{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return U(a,{expected:fe.joinValues(r),received:a.parsedType,code:P.invalid_type}),J}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 U(a,{received:a.data,code:P.invalid_enum_value,options:r}),J}return Ft(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})}};xi.create=iE;var bi=class extends le{_parse(e){let a=fe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==j.string&&r.parsedType!==j.number){let n=fe.objectValues(a);return U(r,{expected:fe.joinValues(n),received:r.parsedType,code:P.invalid_type}),J}if(this._cache||(this._cache=new Set(fe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=fe.objectValues(a);return U(r,{received:r.data,code:P.invalid_enum_value,options:n}),J}return Ft(e.data)}get enum(){return this._def.values}};bi.create=(t,e)=>new bi({values:t,typeName:ee.ZodNativeEnum,...se(e)});var vo=class extends le{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==j.promise&&a.common.async===!1)return U(a,{code:P.invalid_type,expected:j.promise,received:a.parsedType}),J;let r=a.parsedType===j.promise?a.data:Promise.resolve(a.data);return Ft(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};vo.create=(t,e)=>new vo({type:t,typeName:ee.ZodPromise,...se(e)});var Va=class extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ee.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=>{U(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 J;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?J:l.status==="dirty"?li(l.value):a.value==="dirty"?li(l.value):l});{if(a.value==="aborted")return J;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?J:s.status==="dirty"?li(s.value):a.value==="dirty"?li(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"?J:(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"?J:(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(!ho(i))return J;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=>ho(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):J);fe.assertNever(n)}};Va.create=(t,e,a)=>new Va({schema:t,typeName:ee.ZodEffects,effect:e,...se(a)});Va.createWithPreprocess=(t,e,a)=>new Va({schema:e,effect:{type:"preprocess",transform:t},typeName:ee.ZodEffects,...se(a)});var qa=class extends le{_parse(e){return this._getType(e)===j.undefined?Ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};qa.create=(t,e)=>new qa({innerType:t,typeName:ee.ZodOptional,...se(e)});var Ir=class extends le{_parse(e){return this._getType(e)===j.null?Ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ir.create=(t,e)=>new Ir({innerType:t,typeName:ee.ZodNullable,...se(e)});var Si=class extends le{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===j.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};Si.create=(t,e)=>new Si({innerType:t,typeName:ee.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var _i=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 $s(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sa(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new sa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};_i.create=(t,e)=>new _i({innerType:t,typeName:ee.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var Xs=class extends le{_parse(e){if(this._getType(e)!==j.nan){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:j.nan,received:r.parsedType}),J}return{status:"valid",value:e.data}}};Xs.create=t=>new Xs({typeName:ee.ZodNaN,...se(t)});var oH=Symbol("zod_brand"),mc=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}},gc=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"?J:o.status==="dirty"?(a.dirty(),li(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"?J: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:ee.ZodPipeline})}},Ci=class extends le{_parse(e){let a=this._def.innerType._parse(e),r=n=>(ho(n)&&(n.value=Object.freeze(n.value)),n);return $s(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};Ci.create=(t,e)=>new Ci({innerType:t,typeName:ee.ZodReadonly,...se(e)});function aE(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function sE(t,e={},a){return t?go.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=aE(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=aE(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):go.create()}var iH={object:la.lazycreate},ee;(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"})(ee||(ee={}));var sH=(t,e={message:`Input not instance of ${t.name}`})=>sE(a=>a instanceof t,e),lE=mo.create,uE=ui.create,lH=Xs.create,uH=ci.create,cE=di.create,cH=fi.create,dH=js.create,fH=pi.create,pH=hi.create,hH=go.create,mH=cn.create,gH=ur.create,vH=Gs.create,yH=dn.create,xH=la.create,bH=la.strictCreate,SH=mi.create,_H=dh.create,CH=gi.create,wH=kr.create,LH=fh.create,kH=Ws.create,IH=Zs.create,AH=ph.create,EH=vi.create,TH=yi.create,RH=xi.create,MH=bi.create,OH=vo.create,DH=Va.create,BH=qa.create,PH=Ir.create,NH=Va.createWithPreprocess,FH=gc.create,HH=()=>lE().optional(),UH=()=>uE().optional(),zH=()=>cE().optional(),qH={string:(t=>mo.create({...t,coerce:!0})),number:(t=>ui.create({...t,coerce:!0})),boolean:(t=>di.create({...t,coerce:!0})),bigint:(t=>ci.create({...t,coerce:!0})),date:(t=>fi.create({...t,coerce:!0}))};var $H=J;var Vx=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()})]),dE=p.object({kind:p.literal("tooltip"),id:p.string(),anchor:Vx,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()}),fE=p.object({kind:p.literal("highlight"),id:p.string(),anchor:Vx,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()}),hh=p.object({id:p.string(),version:p.number(),routes:p.array(p.string()).optional(),steps:p.array(p.union([dE,fE]))});function VH(t){return hh.parse(t)}var jH=({configUri:t,experiments:e,featureKey:a="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let n=yp({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 hh.parse(i)};var mh=K(Ke(),1),pE=K(kl(),1);function GH({element:t,children:e}){let[a,r]=(0,mh.useState)(null);return(0,mh.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),a?(0,pE.createPortal)(e,a):null}function WH(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<16;a++)e+=t[Math.floor(Math.random()*t.length)];return e}var jx=class{constructor(){B(this,"sessionId");this.sessionId=WH(),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 gh(){return new jx}var T=typeof window<"u"?window:void 0,Bt=typeof globalThis<"u"?globalThis:T;typeof self>"u"&&(Bt.self=Bt),typeof File>"u"&&(Bt.File=function(){});var uT=Array.prototype,hE=uT.forEach,mE=uT.indexOf,ka=Bt?.navigator,z=Bt?.document,Dt=Bt?.location,ub=Bt?.fetch,cb=Bt!=null&&Bt.XMLHttpRequest&&"withCredentials"in new Bt.XMLHttpRequest?Bt.XMLHttpRequest:void 0,gE=Bt?.AbortController,ua=ka?.userAgent,Q=T??{},hn={DEBUG:!1,LIB_VERSION:"1.341.0"};function vE(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 el(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var o=t.apply(e,a);function i(l){vE(o,r,n,i,s,"next",l)}function s(l){vE(o,r,n,i,s,"throw",l)}i(void 0)}))}}function V(){return V=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},V.apply(null,arguments)}function cT(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 ZH=["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"],yE=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var a=t.toLowerCase();return ZH.concat(e).some((r=>{var n=r.toLowerCase();return a.indexOf(n)!==-1}))},XH=["$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 Gh=function(t){return t.trim()},db=function(t){return t.replace(/^\$/,"")},YH=Array.isArray,dT=Object.prototype,fT=dT.hasOwnProperty,Wh=dT.toString,we=YH||function(t){return Wh.call(t)==="[object Array]"},Co=t=>typeof t=="function",gt=t=>t===Object(t)&&!we(t),tl=t=>{if(gt(t)){for(var e in t)if(fT.call(t,e))return!1;return!0}return!1},q=t=>t===void 0,vt=t=>Wh.call(t)=="[object String]",fb=t=>vt(t)&&t.trim().length===0,cr=t=>t===null,ge=t=>q(t)||cr(t),bn=t=>Wh.call(t)=="[object Number]"&&t==t,Qs=t=>bn(t)&&t>0,xn=t=>Wh.call(t)==="[object Boolean]",KH=t=>t instanceof FormData,QH=t=>pe(XH,t);function pb(t){return t===null||typeof t!="object"}function wh(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function pT(t){return!q(Event)&&(function(e,a){try{return e instanceof a}catch{return!1}})(t,Event)}var JH=[!0,"true",1,"1","yes"],Gx=t=>pe(JH,t),e3=[!1,"false",0,"0","no"];function Er(t,e,a,r,n){return e>a&&(r.warn("min cannot be greater than max."),e=a),bn(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),Er(n||a,e,a,r))}var hb=class{constructor(e){this.t={},this.i=e.i,this.o=Er(e.bucketSize,0,100,e.h),this.m=Er(e.refillRate,0,this.o,e.h),this.$=Er(e.refillInterval,0,864e5,e.h)}S(e,a){var r=a-e.lastAccess,n=Math.floor(r/this.$);if(n>0){var o=n*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+n*this.$}}consumeRateLimit(e){var a,r=Date.now(),n=String(e),o=this.t[n];return o?this.S(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={}}},ja="Mobile",Lh="iOS",yn="Android",Nc="Tablet",hT=yn+" "+Nc,mT="iPad",gT="Apple",vT=gT+" Watch",Fc="Safari",ol="BlackBerry",yT="Samsung",xT=yT+"Browser",bT=yT+" Internet",Ii="Chrome",t3=Ii+" OS",ST=Ii+" "+Lh,_0="Internet Explorer",_T=_0+" "+ja,C0="Opera",a3=C0+" Mini",w0="Edge",CT="Microsoft "+w0,rl="Firefox",wT=rl+" "+Lh,Hc="Nintendo",Uc="PlayStation",nl="Xbox",LT=yn+" "+ja,kT=ja+" "+Fc,kc="Windows",mb=kc+" Phone",xE="Nokia",gb="Ouya",IT="Generic",r3=IT+" "+ja.toLowerCase(),AT=IT+" "+Nc.toLowerCase(),vb="Konqueror",Wt="(\\d+(\\.\\d+)?)",Wx=new RegExp("Version/"+Wt),n3=new RegExp(nl,"i"),o3=new RegExp(Uc+" \\w+","i"),i3=new RegExp(Hc+" \\w+","i"),L0=new RegExp(ol+"|PlayBook|BB10","i"),s3={"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"},vh,bE,Zx,l3=(t,e)=>e&&pe(e,gT)||(function(a){return pe(a,Fc)&&!pe(a,Ii)&&!pe(a,yn)})(t),ET=function(t,e){return e=e||"",pe(t," OPR/")&&pe(t,"Mini")?a3:pe(t," OPR/")?C0:L0.test(t)?ol:pe(t,"IE"+ja)||pe(t,"WPDesktop")?_T:pe(t,xT)?bT:pe(t,w0)||pe(t,"Edg/")?CT:pe(t,"FBIOS")?"Facebook "+ja:pe(t,"UCWEB")||pe(t,"UCBrowser")?"UC Browser":pe(t,"CriOS")?ST:pe(t,"CrMo")||pe(t,Ii)?Ii:pe(t,yn)&&pe(t,Fc)?LT:pe(t,"FxiOS")?wT:pe(t.toLowerCase(),vb.toLowerCase())?vb:l3(t,e)?pe(t,ja)?kT:Fc:pe(t,rl)?rl:pe(t,"MSIE")||pe(t,"Trident/")?_0:pe(t,"Gecko")?rl:""},u3={[_T]:[new RegExp("rv:"+Wt)],[CT]:[new RegExp(w0+"?\\/"+Wt)],[Ii]:[new RegExp("("+Ii+"|CrMo)\\/"+Wt)],[ST]:[new RegExp("CriOS\\/"+Wt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Wt)],[Fc]:[Wx],[kT]:[Wx],[C0]:[new RegExp("(Opera|OPR)\\/"+Wt)],[rl]:[new RegExp(rl+"\\/"+Wt)],[wT]:[new RegExp("FxiOS\\/"+Wt)],[vb]:[new RegExp("Konqueror[:/]?"+Wt,"i")],[ol]:[new RegExp(ol+" "+Wt),Wx],[LT]:[new RegExp("android\\s"+Wt,"i")],[bT]:[new RegExp(xT+"\\/"+Wt)],[_0]:[new RegExp("(rv:|MSIE )"+Wt)],Mozilla:[new RegExp("rv:"+Wt)]},c3=function(t,e){var a=ET(t,e),r=u3[a];if(q(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},SE=[[new RegExp(nl+"; "+nl+" (.*?)[);]","i"),t=>[nl,t&&t[1]||""]],[new RegExp(Hc,"i"),[Hc,""]],[new RegExp(Uc,"i"),[Uc,""]],[L0,[ol,""]],[new RegExp(kc,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[mb,""];if(new RegExp(ja).test(e)&&!/IEMobile\b/.test(e))return[kc+" "+ja,""];var a=/Windows NT ([0-9.]+)/i.exec(e);if(a&&a[1]){var r=a[1],n=s3[r]||"";return/arm/i.test(e)&&(n="RT"),[kc,n]}return[kc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Lh,e.join(".")]}return[Lh,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=q(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+yn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+yn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[yn,e.join(".")]}return[yn,""]}],[/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/,[t3,""]],[/Linux|debian/i,["Linux",""]]],_E=function(t){return i3.test(t)?Hc:o3.test(t)?Uc:n3.test(t)?nl:new RegExp(gb,"i").test(t)?gb:new RegExp("("+mb+"|WPDesktop)","i").test(t)?mb:/iPad/.test(t)?mT:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?vT:L0.test(t)?ol:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(xE,"i").test(t)?xE:/(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(ja).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)?yn:hT:new RegExp("(pda|"+ja+")","i").test(t)?r3:new RegExp(Nc,"i").test(t)&&!new RegExp(Nc+" pc","i").test(t)?AT:""},d3=t=>t instanceof Error;function f3(t){var e=globalThis._posthogChunkIds;if(e){var a=Object.keys(e);return Zx&&a.length===bE||(bE=a.length,Zx=a.reduce(((r,n)=>{vh||(vh={});var o=vh[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,vh[n]=[u,c];break}}return r}),{})),Zx}}var yb=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 el((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&we(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)),V({},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 el((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,V({},a,{handled:!0}))),s}buildParsingContext(){return{chunkIdMap:f3(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 V({},a,{syntheticException:r==0?a.syntheticException:void 0,mechanism:e,apply:o=>n(o,r),next:o=>n(o,r+1)})}},il="?";function xb(t,e,a,r,n){var o={platform:t,filename:e,function:a==="<anonymous>"?il:a,in_app:!0};return q(r)||(o.lineno=r),q(n)||(o.colno=n),o}var TT=(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]:il,a?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},p3=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,h3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m3=/\((\S*)(?::(\d+))(?::(\d+))\)/,g3=(t,e)=>{var a=p3.exec(t);if(a){var[,r,n,o]=a;return xb(e,r,il,+n,+o)}var i=h3.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var s=m3.exec(i[2]);s&&(i[2]=s[1],i[3]=s[2],i[4]=s[3])}var[l,u]=TT(i[1]||il,i[2]);return xb(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},v3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,y3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,x3=(t,e)=>{var a=v3.exec(t);if(a){if(a[3]&&a[3].indexOf(" > eval")>-1){var r=y3.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]||il;return[o,n]=TT(o,n),xb(e,n,o,a[4]?+a[4]:void 0,a[5]?+a[5]:void 0)}},CE=/\(error: (.*)\)/,wE=50;function b3(){return(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 function(n,o){o===void 0&&(o=0);for(var i=[],s=n.split(`
|
|
518
|
+
`),l=o;l<s.length;l++){var u=s[l];if(!(u.length>1024)){var c=CE.test(u)?u.replace(CE,"$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>=wE)break}}}return(function(h){if(!h.length)return[];var S=Array.from(h);return S.reverse(),S.slice(0,wE).map((x=>{return V({},x,{filename:x.filename||(b=S,b[b.length-1]||{}).filename,function:x.function||il});var b}))})(i)}})("web:javascript",g3,x3)}var bb=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,a){var r=vt(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 wh(e,"DOMException")}isDOMError(e){return wh(e,"DOMError")}},Sb=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}},_b=class{constructor(){}match(e){return wh(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}}},S3=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Cb=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(S3);return n&&(a=n[1],r=n[2]),[a,r]}},_3=["fatal","error","warning","log","info","debug"];function RT(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 wb=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 pT(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: "+RT(e)}isSeverityLevel(e){return vt(e)&&!fb(e)&&_3.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(d3(r))return r}}getObjectClassName(e){try{var a=Object.getPrototypeOf(e);return a?a.constructor.name:void 0}catch{return}}},Lb=class{match(e){return pT(e)}coerce(e,a){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+RT(e),stack:(r=a.syntheticException)==null?void 0:r.stack,synthetic:!0}}},kb=class{match(e){return pb(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}}},Ib=class{match(e){return wh(e,"PromiseRejectionEvent")}coerce(e,a){var r,n=this.getUnhandledRejectionReason(e);return pb(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(pb(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}},MT=function(t,e){var{debugEnabled:a}=e===void 0?{}:e,r={k:function(n){if(T&&(hn.DEBUG||Q.POSTHOG_DEBUG||a)&&!q(T.console)&&T.console){for(var o=("__rrweb_original__"in T.console[n])?T.console[n].__rrweb_original__:T.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)=>MT(t+" "+n,o)};return r},$=MT("[PostHog.js]"),at=$.createLogger,C3=at("[ExternalScriptsLoader]"),LE=(t,e,a)=>{if(t.config.disable_external_dependency_loading)return C3.warn(e+" was requested but loading of external scripts is disabled."),a("Loading of external scripts is disabled");var r=z?.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(!z)return a("document not found");var l=z.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");if(t.config.external_scripts_inject_target==="head")z.head.appendChild(l);else{var u,c=z.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):z.body.appendChild(l)}};z!=null&&z.body?s():z?.addEventListener("DOMContentLoaded",s)};Q.__PosthogExtensions__=Q.__PosthogExtensions__||{},Q.__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);LE(t,o,a)},Q.__PosthogExtensions__.loadSiteApp=(t,e,a)=>{var r=t.requestRouter.endpointFor("api",e);LE(t,r,a)};var kh={};function wo(t,e,a){if(we(t)){if(hE&&t.forEach===hE)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)===kh)return}}}function Pe(t,e,a){if(!ge(t)){if(we(t))return wo(t,e,a);if(KH(t)){for(var r of t.entries())if(e.call(a,r[1],r[0])===kh)return}else for(var n in t)if(fT.call(t,n)&&e.call(a,t[n],n)===kh)return}}var ot=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 wo(a,(function(n){for(var o in n)n[o]!==void 0&&(t[o]=n[o])})),t},ll=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 wo(a,(function(n){wo(n,(function(o){t.push(o)}))})),t};function _h(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 kE=function(t){try{return t()}catch{return}},w3=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){$.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$.critical(n)}}},k0=function(t){var e={};return Pe(t,(function(a,r){(vt(a)&&a.length>0||bn(a))&&(e[r]=a)})),e};function L3(t,e){return a=t,r=o=>vt(o)&&!cr(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),we(i)?(l=[],wo(i,(u=>{l.push(o(u))}))):(l={},Pe(i,((u,c)=>{n.has(u)||(l[c]=o(u,c))}))),l);var l})(a);var a,r,n}var k3=["herokuapp.com","vercel.app","netlify.app"];function I3(t){var e=t?.hostname;if(!vt(e))return!1;var a=e.split(".").slice(-2).join(".");for(var r of k3)if(a===r)return!1;return!0}function OT(t,e){for(var a=0;a<t.length;a++)if(e(t[a]))return t[a]}function pt(t,e,a,r){var{capture:n=!1,passive:o=!0}=r??{};t?.addEventListener(e,a,{capture:n,passive:o})}var DT="$people_distinct_id",Ic="__alias",Ac="__timers",IE="$autocapture_disabled_server_side",Ab="$heatmaps_enabled_server_side",AE="$exception_capture_enabled_server_side",Eb="$error_tracking_suppression_rules",EE="$error_tracking_capture_extension_exceptions",TE="$web_vitals_enabled_server_side",BT="$dead_clicks_enabled_server_side",RE="$product_tours_enabled_server_side",ME="$web_vitals_allowed_metrics",Xx="$session_recording_remote_config",Ih="$sesid",PT="$session_is_sampled",al="$enabled_feature_flags",Ec="$early_access_features",Tb="$feature_flag_details",Tc="$stored_person_properties",ki="$stored_group_properties",Rb="$surveys",Ah="$flag_call_reported",mn="$user_state",Mb="$client_session_props",Ob="$capture_rate_limit",Db="$initial_campaign_params",Bb="$initial_referrer_info",Eh="$initial_person_info",Th="$epp",NT="__POSTHOG_TOOLBAR__",vc="$posthog_cookieless",A3=[DT,Ic,"__cmpns",Ac,"$session_recording_enabled_server_side",Ab,Ih,al,Eb,mn,Ec,Tb,ki,Tc,Rb,Ah,Mb,Ob,Db,Bb,Th,Eh,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function OE(t){return t instanceof Element&&(t.id===NT||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Zh(t){return!!t&&t.nodeType===1}function Lo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function FT(t){return!!t&&t.nodeType===3}function HT(t){return!!t&&t.nodeType===11}function I0(t){return t?Gh(t).split(/\s+/):[]}function DE(t){var e=T?.location.href;return!!(e&&t&&t.some((a=>e.match(a))))}function Rh(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 I0(e)}function UT(t){return ge(t)?null:Gh(t).split(/(\s+)/).filter((e=>zc(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function $c(t){var e="";return Pb(t)&&!jT(t)&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,(function(a){var r;FT(a)&&a.textContent&&(e+=(r=UT(a.textContent))!==null&&r!==void 0?r:"")})),Gh(e)}function zT(t){return q(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var A0=["a","button","form","input","select","textarea","label"];function qT(t,e){if(q(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 $T(t){var e=t.parentNode;return!(!e||!Zh(e))&&e}var E3=["next","previous","prev",">","<"],BE=10,PE=[".ph-no-rageclick",".ph-no-capture"];function T3(t,e){if(!T||E0(t))return!1;var a,r,n;if(xn(e)?(a=!!e&&PE,r=void 0):(a=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:PE,r=e?.content_ignorelist),a===!1)return!1;var{targetElementList:o}=VT(t,!1);return!(function(i,s){if(i===!1||q(i))return!1;var l;if(i===!0)l=E3;else{if(!we(i))return!1;if(i.length>BE)return $.error("[PostHog] content_ignorelist array cannot exceed "+BE+" 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)))}))})(r,o.map((i=>{var s;return{safeText:$c(i).toLowerCase(),ariaLabel:((s=i.getAttribute("aria-label"))==null?void 0:s.toLowerCase().trim())||""}})))&&!qT(o,a)}var E0=t=>!t||Lo(t,"html")||!Zh(t),VT=(t,e)=>{if(!T||E0(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var a=!1,r=[t],n=t;n.parentNode&&!Lo(n,"body");)if(HT(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=$T(n);if(!o)break;if(e||A0.indexOf(o.tagName.toLowerCase())>-1)a=!0;else{var i=T.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(a=!0)}r.push(o),n=o}return{parentIsUsefulElement:a,targetElementList:r}};function R3(t,e,a,r,n){var o,i,s,l;if(a===void 0&&(a=void 0),!T||E0(t)||(o=a)!=null&&o.url_allowlist&&!DE(a.url_allowlist)||(i=a)!=null&&i.url_ignorelist&&DE(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}=VT(t,r);if(!(function(S,x){var b=x?.element_allowlist;if(q(b))return!0;var g,m=function(v){if(b.some((C=>v.tagName.toLowerCase()===C)))return{v:!0}};for(var y of S)if(g=m(y))return g.v;return!1})(d,a)||!qT(d,(l=a)==null?void 0:l.css_selector_allowlist))return!1;var f=T.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(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&&(A0.indexOf(h)>-1||t.getAttribute("contenteditable")==="true")}}function Pb(t){for(var e=t;e.parentNode&&!Lo(e,"body");e=e.parentNode){var a=Rh(e);if(pe(a,"ph-sensitive")||pe(a,"ph-no-capture"))return!1}if(pe(Rh(t),"ph-include"))return!0;var r=t.type||"";if(vt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(vt(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 jT(t){return!!(Lo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Lo(t,"select")||Lo(t,"textarea")||t.getAttribute("contenteditable")==="true")}var GT="(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})",M3=new RegExp("^(?:"+GT+")$"),O3=new RegExp(GT),WT="\\d{3}-?\\d{2}-?\\d{4}",D3=new RegExp("^("+WT+")$"),B3=new RegExp("("+WT+")");function zc(t,e){return e===void 0&&(e=!0),!(ge(t)||vt(t)&&(t=Gh(t),(e?M3:O3).test((t||"").replace(/[- ]/g,""))||(e?D3:B3).test(t)))}function ZT(t){var e=$c(t);return zc(e=(e+" "+XT(t)).trim())?e:""}function XT(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Pe(t.childNodes,(function(a){var r;if(a&&((r=a.tagName)==null?void 0:r.toLowerCase())==="span")try{var n=$c(a);e=(e+" "+n).trim(),a.childNodes&&a.childNodes.length&&(e=(e+" "+XT(a)).trim())}catch(o){$.error("[AutoCapture]",o)}})),e}function P3(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=V({},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 _h(l).sort(((c,d)=>{var[f]=c,[h]=d;return f.localeCompare(h)})).forEach((c=>{var[d,f]=c;return u[NE(d.toString())]=NE(f.toString())})),i+=":",i+=_h(u).map((c=>{var[d,f]=c;return d+'="'+f+'"'})).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:N3(a),attr_id:a.attr__id,nth_child:a.nth_child,nth_of_type:a.nth_of_type,attributes:{}};return _h(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 NE(t){return t.replace(/"|\\"/g,'\\"')}function N3(t){var e=t.attr__class;return e?we(e)?e:I0(e):void 0}var Mh=class{constructor(e){this.disabled=e===!1;var a=gt(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}},Oh=t=>{var e=z?.createElement("a");return q(e)?null:(e.href=t,e)},F3=function(t,e){var a,r;e===void 0&&(e="&");var n=[];return Pe(t,(function(o,i){q(o)||q(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)},Dh=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(!we(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," ")},Vc=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 f=u[d].split("=");we(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},Bh=function(t,e){var a=t.match(new RegExp(e+"=([^&]*)"));return a?a[1]:null},Yx="$copy_autocapture",FE=at("[AutoCapture]");function Kx(t,e){return e.length>t?e.slice(0,t)+"...":e}function H3(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Zh(e));return e}function U3(t,e,a,r){var n=t.tagName.toLowerCase(),o={tag_name:n};A0.indexOf(n)>-1&&!a&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?o.$el_text=Kx(1024,ZT(t)):o.$el_text=Kx(1024,$c(t)));var i=Rh(t);i.length>0&&(o.classes=i.filter((function(c){return c!==""}))),Pe(t.attributes,(function(c){var d;if((!jT(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&zc(c.value)&&(d=c.name,!vt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=I0(f).join(" ")),o["attr__"+c.name]=Kx(1024,f)}}));for(var s=1,l=1,u=t;u=H3(u);)s++,u.tagName===t.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function z3(t,e){for(var a,r,{e:n,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!Lo(c,"body");)HT(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,(v=>{var C=Pb(v);v.tagName.toLowerCase()==="a"&&(S=v.getAttribute("href"),S=C&&S&&zc(S)&&S),pe(Rh(v),"ph-no-capture")&&(x=!0),f.push(U3(v,o,i,s));var w=(function(_){if(!Pb(_))return{};var L={};return Pe(_.attributes,(function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var I=A.name.replace("data-ph-capture-attribute-",""),R=A.value;I&&R&&zc(R)&&(L[I]=R)}})),L})(v);ot(h,w)})),x)return{props:{},explicitNoCapture:x};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=ZT(t):f[0].$el_text=$c(t)),S){var b,g;f[0].attr__href=S;var m=(b=Oh(S))==null?void 0:b.host,y=T==null||(g=T.location)==null?void 0:g.host;m&&y&&m!==y&&(d=S)}return{props:ot({$event_type:n.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:P3(f)},(a=f[0])!=null&&a.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},d&&n.type==="click"?{$external_click_url:d}:{},h)}}var Nb=class{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new Mh(e.config.rageclick),this.C=null}get R(){var e,a,r=gt(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}F(){if(this.isBrowserSupported()){if(T&&z){var e=r=>{r=r||T?.event;try{this.O(r)}catch(n){FE.error("Failed to capture event",n)}};if(pt(z,"submit",e,{capture:!0}),pt(z,"change",e,{capture:!0}),pt(z,"click",e,{capture:!0}),this.R.capture_copied_text){var a=r=>{r=r||T?.event,this.O(r,Yx)};pt(z,"copy",a,{capture:!0}),pt(z,"cut",a,{capture:!0})}}}else FE.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[IE]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var a,r=[];return(a=this.C)==null||a.forEach((n=>{var o=z?.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[IE],n=this.T;if(cr(n)&&!xn(r)&&!this.instance.M())return!1;var o=(a=this.T)!==null&&a!==void 0?a:!!r;return!!this.instance.config.autocapture&&!o}O(e,a){if(a===void 0&&(a="$autocapture"),this.isEnabled){var r,n=zT(e);FT(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())&&T3(n,this.instance.config.rageclick)&&this.O(e,"$rageclick");var o=a===Yx;if(n&&R3(n,e,this.R,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:s}=z3(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(s)return!1;var l=this.getElementSelectors(n);if(l&&l.length>0&&(i.$element_selectors=l),a===Yx){var u,c=UT(T==null||(u=T.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 Co(z?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return bn(t)&&isFinite(t)&&Math.floor(t)===t});var HE="0123456789abcdef",Fb=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+HE.charAt(this.bytes[a]>>>4)+HE.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}},Hb=class{constructor(){this.A=0,this.j=0,this.D=new Ub}generate(){var e=this.generateOrAbort();if(q(e)){this.A=0;var a=this.generateOrAbort();if(q(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.j++,this.j>4398046511103&&(this.A++,this.L())}return Fb.fromFieldsV7(this.A,Math.trunc(this.j/Math.pow(2,30)),this.j&Math.pow(2,30)-1,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}},UE,YT=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};T&&!q(T.crypto)&&crypto.getRandomValues&&(YT=t=>crypto.getRandomValues(t));var Ub=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(YT(this.N),this.U=0),this.N[this.U++]}},_o=()=>q3().toString(),q3=()=>(UE||(UE=new Hb)).generate(),yc="",$3=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function V3(t,e){if(e){var a=(function(n,o){if(o===void 0&&(o=z),yc)return yc;if(!o||["localhost","127.0.0.1"].includes(n))return"";for(var i=n.split("."),s=Math.min(i.length,8),l="dmn_chk_"+_o();!yc&&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",yc=u)}return yc})(t);if(!a){var r=(n=>{var o=n.match($3);return o?o[0]:""})(t);r!==a&&$.info("Warning: cookie subdomain discovery mismatch",r,a),a=r}return a?"; domain=."+a:""}return""}var Ar={H:()=>!!z,B:function(t){$.error("cookieStore error: "+t)},q:function(t){if(z){try{for(var e=t+"=",a=z.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(Ar.q(t))||{}}catch{}return e},G:function(t,e,a,r,n){if(z)try{var o="",i="",s=V3(z.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&&$.warn("cookieStore warning: large cookie, len="+u.length),z.cookie=u,u}catch{return}},V:function(t,e){if(z!=null&&z.cookie)try{Ar.G(t,"",-1,e)}catch{return}}},Qx=null,Ye={H:function(){if(!cr(Qx))return Qx;var t=!0;if(q(T))t=!1;else try{var e="__mplssupport__";Ye.G(e,"xyz"),Ye.q(e)!=='"xyz"'&&(t=!1),Ye.V(e)}catch{t=!1}return t||$.error("localStorage unsupported; falling back to cookie store"),Qx=t,t},B:function(t){$.error("localStorage error: "+t)},q:function(t){try{return T?.localStorage.getItem(t)}catch(e){Ye.B(e)}return null},W:function(t){try{return JSON.parse(Ye.q(t))||{}}catch{}return null},G:function(t,e){try{T?.localStorage.setItem(t,JSON.stringify(e))}catch(a){Ye.B(a)}},V:function(t){try{T?.localStorage.removeItem(t)}catch(e){Ye.B(e)}}},j3=["$device_id","distinct_id",Ih,PT,Th,Eh],yh={},G3={H:function(){return!0},B:function(t){$.error("memoryStorage error: "+t)},q:function(t){return yh[t]||null},W:function(t){return yh[t]||null},G:function(t,e){yh[t]=e},V:function(t){delete yh[t]}},wi=null,Ot={H:function(){if(!cr(wi))return wi;if(wi=!0,q(T))wi=!1;else try{var t="__support__";Ot.G(t,"xyz"),Ot.q(t)!=='"xyz"'&&(wi=!1),Ot.V(t)}catch{wi=!1}return wi},B:function(t){$.error("sessionStorage error: ",t)},q:function(t){try{return T?.sessionStorage.getItem(t)}catch(e){Ot.B(e)}return null},W:function(t){try{return JSON.parse(Ot.q(t))||null}catch{}return null},G:function(t,e){try{T?.sessionStorage.setItem(t,JSON.stringify(e))}catch(a){Ot.B(a)}},V:function(t){try{T?.sessionStorage.removeItem(t)}catch(e){Ot.B(e)}}},gn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),zb=class{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?gn.DENIED:this.K}isOptedOut(){return this.R.cookieless_mode==="always"||this.consent===gn.DENIED||this.consent===gn.PENDING&&(this.R.opt_out_capturing_by_default||this.R.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===gn.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.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 Gx(e)?gn.GRANTED:pe(e3,e)?gn.DENIED:gn.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ye:Ar;var a=e==="localStorage"?Ar:Ye;a.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Gx(a.q(this.X))),a.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!OT([ka?.doNotTrack,ka?.msDoNotTrack,Q.doNotTrack],(e=>Gx(e)))}},xh=at("[Dead Clicks]"),W3=()=>!0,Z3=t=>{var e,a=!((e=t.instance.persistence)==null||!e.get_property(BT)),r=t.instance.config.capture_dead_clicks;return xn(r)?r:!!gt(r)||a},Ph=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({[BT]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.initDeadClicksAutocapture&&e(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?xh.error("failed to load script",n):e()}))}et(){var e;if(z){if(!this.tt&&(e=Q.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var a=gt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};a.__onCapture=this.onCapture,this.tt=Q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,a),this.tt.start(z),xh.info("starting...")}}else xh.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,xh.info("stopping..."))}},xc=at("[ExceptionAutocapture]"),qb=class{constructor(e){var a,r,n;this.rt=()=>{var o;if(T&&this.isEnabled&&(o=Q.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=Q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=Q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=i(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){xc.error("failed to start",u),this.ut()}}},this._instance=e,this.ht=!((a=this._instance.persistence)==null||!a.props[AE]),this.dt=new hb({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:xc}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,a={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return gt(e)?a=V({},a,e):(q(e)?this.ht:e)&&(a=V({},a,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),a}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(xc.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.errorWrappingFunctions&&e(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return xc.error("failed to load script",n);e()}))}ut(){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.ht=!!a||!1,this._instance.persistence&&this._instance.persistence.register({[AE]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}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.dt.consumeRateLimit(n)?xc.info("Skipping exception capture because of client rate limiting.",{exception:n}):this._instance.exceptions.sendExceptionEvent(e)}};function zE(t,e,a){try{if(!(e in t))return()=>{};var r=t[e],n=a(r);return Co(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch{return()=>{}}}var $b=class{constructor(e){var a;this._instance=e,this.ct=(T==null||(a=T.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.ft&&this.ft(),this.ft=void 0,$.info("History API monitoring stopped")}monitorHistoryChanges(){var e,a;if(T&&T.history){var r=this;(e=T.history.pushState)!=null&&e.__posthog_wrapped__||zE(T.history,"pushState",(n=>function(o,i,s){n.call(this,o,i,s),r._t("pushState")})),(a=T.history.replaceState)!=null&&a.__posthog_wrapped__||zE(T.history,"replaceState",(n=>function(o,i,s){n.call(this,o,i,s),r._t("replaceState")})),this.bt()}}_t(e){try{var a,r=T==null||(a=T.location)==null?void 0:a.pathname;if(!r)return;r!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=r}catch(n){$.error("Error capturing "+e+" pageview",n)}}bt(){if(!this.ft){var e=()=>{this._t("popstate")};pt(T,"popstate",e),this.ft=()=>{T&&T.removeEventListener("popstate",e)}}}},Jx=at("[SegmentIntegration]");function X3(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()||_o();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(mn,"identified")),n()},s=o.user();"then"in s&&Co(s.then)?s.then(i):i(s)})(t,(()=>{a.register((r=>{Promise&&Promise.resolve||Jx.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()||(Jx.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Jx.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 KT="posthog-js";function QT(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,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((g=>V({},g,{stacktrace:g.stacktrace?V({},g.stacktrace,{type:"raw",frames:(g.stacktrace.frames||[]).map((m=>V({},m,{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&&r&&(b.$sentry_url=(n||"https://sentry.io/organizations/")+a+"/issues/?project="+r+"&query="+s.event_id),i&&t.exceptions.sendExceptionEvent(b),s}}var Vb=class{constructor(e,a,r,n,o,i){this.name=KT,this.setupOnce=function(s){s(QT(e,{organization:a,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}},Y3=T!=null&&T.location?Bh(T.location.hash,"__posthog")||Bh(location.hash,"state"):null,qE="_postHogToolbarParams",$E=at("[Toolbar]"),So=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(So||{}),jb=class{constructor(e){this.instance=e}yt(e){Q.ph_toolbar_state=e}wt(){var e;return(e=Q.ph_toolbar_state)!==null&&e!==void 0?e:So.UNINITIALIZED}maybeLoadToolbar(e,a,r){if(e===void 0&&(e=void 0),a===void 0&&(a=void 0),r===void 0&&(r=void 0),!T||!z)return!1;e=e??T.location,r=r??T.history;try{if(!a){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch{return!1}a=T?.localStorage}var n,o=Y3||Bh(e.hash,"__posthog")||Bh(e.hash,"state"),i=o?kE((()=>JSON.parse(atob(decodeURIComponent(o)))))||kE((()=>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(qE)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}xt(e){var a=Q.ph_load_toolbar||Q.ph_load_editor;!ge(a)&&Co(a)?a(e,this.instance):$E.warn("No toolbar load function found")}loadToolbar(e){var a=!(z==null||!z.getElementById(NT));if(!T||a)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=V({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(T.localStorage.setItem(qE,JSON.stringify(V({},n,{source:void 0}))),this.wt()===So.LOADED)this.xt(n);else if(this.wt()===So.UNINITIALIZED){var o;this.yt(So.LOADING),(o=Q.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return $E.error("[Toolbar] Failed to load",i),void this.yt(So.UNINITIALIZED);this.yt(So.LOADED),this.xt(n)})),pt(T,"turbolinks:load",(()=>{this.yt(So.UNINITIALIZED),this.loadToolbar(n)}))}return!0}Et(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)}},K3=at("[TracingHeaders]"),Gb=class{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var a,r;q(this.$t)&&((a=Q.__PosthogExtensions__)==null||(a=a.tracingHeadersPatchFns)==null||a._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),q(this.St)&&((r=Q.__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=Q.__PosthogExtensions__)!=null&&a.tracingHeadersPatchFns&&e(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return K3.error("failed to load script",n);e()}))}startIfEnabledOrStop(){var e,a;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.$t)==null||e.call(this),(a=this.St)==null||a.call(this),this.$t=void 0,this.St=void 0)}},bh="https?://(.*)",ul=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Q3=ll(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ul),jc="<masked>",J3=["li_fat_id"];function JT(t,e,a){if(!z)return{};var r,n=e?ll([],ul,a||[]):[],o=eR(Vc(z.URL,n,jc),t),i=(r={},Pe(J3,(function(s){var l=Ar.q(s);r[s]=l||null})),r);return ot(i,o)}function eR(t,e){var a=Q3.concat(e||[]),r={};return Pe(a,(function(n){var o=Dh(t,n);r[n]=o||null})),r}function tR(t){var e=(function(o){return o?o.search(bh+"google.([^/?]*)")===0?"google":o.search(bh+"bing.com")===0?"bing":o.search(bh+"yahoo.com")===0?"yahoo":o.search(bh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),a=e!="yahoo"?"q":"p",r={};if(!cr(e)){r.$search_engine=e;var n=z?Dh(z.referrer,a):"";n.length&&(r.ph_keyword=n)}return r}function VE(){return navigator.language||navigator.userLanguage}function aR(){return z?.referrer||"$direct"}function rR(t,e){var a=t?ll([],ul,e||[]):[],r=Dt?.href.substring(0,1e3);return{r:aR().substring(0,1e3),u:r?Vc(r,a,jc):void 0}}function nR(t){var e,{r:a,u:r}=t,n={$referrer:a,$referring_domain:a==null?void 0:a=="$direct"?"$direct":(e=Oh(a))==null?void 0:e.host};if(r){n.$current_url=r;var o=Oh(r);n.$host=o?.host,n.$pathname=o?.pathname;var i=eR(r);ot(n,i)}if(a){var s=tR(a);ot(n,s)}return n}function oR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function e4(){try{return new Date().getTimezoneOffset()}catch{return}}function t4(t,e){if(!ua)return{};var a,r,n,o=t?ll([],ul,e||[]):[],[i,s]=(function(l){for(var u=0;u<SE.length;u++){var[c,d]=SE[u],f=c.exec(l),h=f&&(Co(d)?d(f,l):d);if(h)return h}return["",""]})(ua);return ot(k0({$os:i,$os_version:s,$browser:ET(ua,navigator.vendor),$device:_E(ua),$device_type:(r=ua,n=_E(r),n===mT||n===hT||n==="Kobo"||n==="Kindle Fire"||n===AT?Nc:n===Hc||n===nl||n===Uc||n===gb?"Console":n===vT?"Wearable":n?ja:"Desktop"),$timezone:oR(),$timezone_offset:e4()}),{$current_url:Vc(Dt?.href,o,jc),$host:Dt?.host,$pathname:Dt?.pathname,$raw_user_agent:ua.length>1e3?ua.substring(0,997)+"...":ua,$browser_version:c3(ua,navigator.vendor),$browser_language:VE(),$browser_language_prefix:(a=VE(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:T?.screen.height,$screen_width:T?.screen.width,$viewport_height:T?.innerHeight,$viewport_width:T?.innerWidth,$lib:"web",$lib_version:hn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var yo=at("[Web Vitals]"),jE=9e5,Wb=class{constructor(e){var a;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,n)=>V({},r,{["$web_vitals_"+n.name+"_event"]:V({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=r=>{var n,o=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(q(o))yo.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Ct();q(i)||(ge(r?.name)||ge(r?.value)?yo.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?yo.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==i&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),q(this.N.url)&&(this.N.url=i),this.N.firstMetricTimestamp=q(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(V({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var r,n,o,i,s=Q.__PosthogExtensions__;q(s)||q(s.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:o,onINP:i}=s.postHogWebVitalsCallbacks),r&&n&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.It.bind(this)),this.P=!0):yo.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!((a=this._instance.persistence)==null||!a.props[TE]),this.startIfEnabled()}get allowedMetrics(){var e,a,r=gt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return ge(r)?((a=this._instance.persistence)==null?void 0:a.props[ME])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(gt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=gt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Rt(){var e=gt(this._instance.config.capture_performance)&&bn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:jE;return 0<e&&e<=6e4?jE:e}get isEnabled(){var e=Dt?.protocol;if(e!=="http:"&&e!=="https:")return yo.info("Web Vitals are disabled on non-http/https protocols"),!1;var a=gt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:xn(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return xn(a)?a:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(yo.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var a=gt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=gt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[TE]:a}),this._instance.persistence.register({[ME]:r})),this.kt=a,this.startIfEnabled()}it(e){var a,r;if((a=Q.__PosthogExtensions__)!=null&&a.postHogWebVitalsCallbacks)e();else{var n=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,n,(o=>{o?yo.error("failed to load script",o):e()}))}}Ct(){var e=T?T.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?ll([],ul,r||[]):[];return Vc(e,n,jc)}yo.error("Could not determine current URL")}},a4=at("[Heatmaps]");function GE(t){return gt(t)&&"clientX"in t&&"clientY"in t&&bn(t.clientX)&&bn(t.clientY)}var Zb=class{constructor(e){var a;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!((a=this.instance.persistence)==null||!a.props[Ab]),this.rageclicks=new Mh(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return gt(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 ge(this.instance.config.capture_heatmaps)?ge(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;a4.info("starting..."),this.Ot(),this.Mt()}else{var e;clearInterval((e=this.Ft)!==null&&e!==void 0?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var a=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ab]:a}),this.kt=a,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft=(function(e){return e?.visibilityState==="visible"})(z)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){T&&z&&(this.Nt=this.Lt.bind(this),pt(T,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||T?.event),pt(z,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||T?.event),pt(z,"mousemove",this.zt,{capture:!0}),this.Bt=new Ph(this.instance,W3,this.jt.bind(this)),this.Bt.startIfEnabled(),this.qt=this.Mt.bind(this),pt(z,"visibilitychange",this.qt),this.P=!0)}At(){var e;T&&z&&(this.Nt&&T.removeEventListener("beforeunload",this.Nt),this.Ut&&z.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&z.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&z.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),(e=this.Bt)==null||e.stop(),this.P=!1)}Gt(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&&Zh(c)&&!Lo(c,"body");){if(c===u)return!1;if(pe(l,T?.getComputedStyle(c).position))return!0;c=$T(c)}return!1})(zT(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:a}}Dt(e,a){var r;if(a===void 0&&(a="click"),!OE(e.target)&&GE(e)){var n=this.Gt(e,a);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vt(V({},n,{type:"rageclick"})),this.Vt(n)}}Ht(e){!OE(e.target)&&GE(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout((()=>{this.Vt(this.Gt(e,"mousemove"))}),500))}Vt(e){if(T){var a=T.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,o=r?ll([],ul,n||[]):[],i=Vc(a,o,jc);this.N=this.N||{},this.N[i]||(this.N[i]=[]),this.N[i].push(e)}}Lt(){this.N&&!tl(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Nh=class{constructor(e){this.Jt=(a,r,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&($.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:a,changeReason:n}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Jt)}destroy(){var e;(e=this.Xt)==null||e.call(this),this.Xt=void 0}doPageView(e,a){var r,n=this.Qt(e,a);return this.Kt={pathname:(r=T?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:a,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var a;return this.Qt(e,(a=this.Kt)==null?void 0:a.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Kt)==null?void 0:e.pageViewId}}Qt(e,a){var r=this.Kt;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(!(q(i)||q(s)||q(l)||q(u)||q(c)||q(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:Er(s/i,0,1,$),h=i<=1?1:Er(l/i,0,1,$),S=u<=1?1:Er(c/u,0,1,$),x=u<=1?1:Er(d/u,0,1,$);n=ot(n,{$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 r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}};var vn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),Ga=Uint8Array,Zt=Uint16Array,sl=Uint32Array,T0=new Ga([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]),R0=new Ga([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]),WE=new Ga([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iR=function(t,e){for(var a=new Zt(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];var n=new sl(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]},sR=iR(T0,2),r4=sR[0],Xb=sR[1];r4[28]=258,Xb[258]=28;for(Yb=iR(R0,0)[1],Fh=new Zt(32768),Ne=0;Ne<32768;++Ne)xo=(43690&Ne)>>>1|(21845&Ne)<<1,xo=(61680&(xo=(52428&xo)>>>2|(13107&xo)<<2))>>>4|(3855&xo)<<4,Fh[Ne]=((65280&xo)>>>8|(255&xo)<<8)>>>1;var xo,Yb,Fh,Ne,Dc=function(t,e,a){for(var r=t.length,n=0,o=new Zt(e);n<r;++n)++o[t[n]-1];var i,s=new Zt(e);for(n=0;n<e;++n)s[n]=s[n-1]+o[n-1]<<1;if(a){i=new Zt(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,f=d|(1<<c)-1;d<=f;++d)i[Fh[d]>>>l]=u}else for(i=new Zt(r),n=0;n<r;++n)i[n]=Fh[s[t[n]-1]++]>>>15-t[n];return i},Ai=new Ga(288);for(Ne=0;Ne<144;++Ne)Ai[Ne]=8;for(Ne=144;Ne<256;++Ne)Ai[Ne]=9;for(Ne=256;Ne<280;++Ne)Ai[Ne]=7;for(Ne=280;Ne<288;++Ne)Ai[Ne]=8;var Hh=new Ga(32);for(Ne=0;Ne<32;++Ne)Hh[Ne]=5;var n4=Dc(Ai,9,0),o4=Dc(Hh,5,0),lR=function(t){return(t/8>>0)+(7&t&&1)},uR=function(t,e,a){(a==null||a>t.length)&&(a=t.length);var r=new(t instanceof Zt?Zt:t instanceof sl?sl:Ga)(a-e);return r.set(t.subarray(e,a)),r},fn=function(t,e,a){a<<=7&e;var r=e/8>>0;t[r]|=a,t[r+1]|=a>>>8},bc=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},eb=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 Ga(0),0];if(n==1){var i=new Ga(a[0].s+1);return i[a[0].s]=1,[i,1]}a.sort((function(C,w){return C.f-w.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 f=o[0].s;for(r=1;r<n;++r)o[r].s>f&&(f=o[r].s);var h=new Zt(f+1),S=Kb(a[c-1],h,0);if(S>e){r=0;var x=0,b=S-e,g=1<<b;for(o.sort((function(C,w){return h[w.s]-h[C.s]||C.f-w.f}));r<n;++r){var m=o[r].s;if(!(h[m]>e))break;x+=g-(1<<S-h[m]),h[m]=e}for(x>>>=b;x>0;){var y=o[r].s;h[y]<e?x-=1<<e-h[y]++-1:++r}for(;r>=0&&x;--r){var v=o[r].s;h[v]==e&&(--h[v],++x)}S=e}return[new Ga(h),S]},Kb=function(t,e,a){return t.s==-1?Math.max(Kb(t.l,e,a+1),Kb(t.r,e,a+1)):e[t.s]=a},ZE=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new Zt(++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]},Sc=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},Qb=function(t,e,a){var r=a.length,n=lR(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)},XE=function(t,e,a,r,n,o,i,s,l,u,c){fn(e,c++,a),++n[256];for(var d=eb(n,15),f=d[0],h=d[1],S=eb(o,15),x=S[0],b=S[1],g=ZE(f),m=g[0],y=g[1],v=ZE(x),C=v[0],w=v[1],_=new Zt(19),L=0;L<m.length;++L)_[31&m[L]]++;for(L=0;L<C.length;++L)_[31&C[L]]++;for(var A=eb(_,7),I=A[0],R=A[1],F=19;F>4&&!I[WE[F-1]];--F);var E,D,O,N,W=u+5<<3,H=Sc(n,Ai)+Sc(o,Hh)+i,Z=Sc(n,f)+Sc(o,x)+i+14+3*F+Sc(_,I)+(2*_[16]+3*_[17]+7*_[18]);if(W<=H&&W<=Z)return Qb(e,c,t.subarray(l,l+u));if(fn(e,c,1+(Z<H)),c+=2,Z<H){E=Dc(f,h,0),D=f,O=Dc(x,b,0),N=x;var he=Dc(I,R,0);for(fn(e,c,y-257),fn(e,c+5,w-1),fn(e,c+10,F-4),c+=14,L=0;L<F;++L)fn(e,c+3*L,I[WE[L]]);c+=3*F;for(var Ce=[m,C],it=0;it<2;++it){var Xt=Ce[it];for(L=0;L<Xt.length;++L){var G=31&Xt[L];fn(e,c,he[G]),c+=I[G],G>15&&(fn(e,c,Xt[L]>>>5&127),c+=Xt[L]>>>12)}}}else E=n4,D=Ai,O=o4,N=Hh;for(L=0;L<s;++L)if(r[L]>255){G=r[L]>>>18&31,bc(e,c,E[G+257]),c+=D[G+257],G>7&&(fn(e,c,r[L]>>>23&31),c+=T0[G]);var ae=31&r[L];bc(e,c,O[ae]),c+=N[ae],ae>3&&(bc(e,c,r[L]>>>5&8191),c+=R0[ae])}else bc(e,c,E[r[L]]),c+=D[r[L]];return bc(e,c,E[256]),c+D[256]},i4=new sl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),s4=(function(){for(var t=new sl(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(1&a&&3988292384)^a>>>1;t[e]=a}return t})(),l4=function(t,e,a,r,n){return(function(o,i,s,l,u,c){var d=o.length,f=new Ga(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=Qb(h,S,o.subarray(x,b)):(h[x]=c,S=Qb(h,S,o.subarray(x,d)))}else{for(var g=i4[i-1],m=g>>>13,y=8191&g,v=(1<<s)-1,C=new Zt(32768),w=new Zt(v+1),_=Math.ceil(s/3),L=2*_,A=function(Pm){return(o[Pm]^o[Pm+1]<<_^o[Pm+2]<<L)&v},I=new sl(25e3),R=new Zt(288),F=new Zt(32),E=0,D=0,O=(x=0,0),N=0,W=0;x<d;++x){var H=A(x),Z=32767&x,he=w[H];if(C[Z]=he,w[H]=Z,N<=x){var Ce=d-x;if((E>7e3||O>24576)&&Ce>423){S=XE(o,h,0,I,R,F,D,O,W,x-W,S),O=E=D=0,W=x;for(var it=0;it<286;++it)R[it]=0;for(it=0;it<30;++it)F[it]=0}var Xt=2,G=0,ae=y,yt=Z-he&32767;if(Ce>2&&H==A(x-yt))for(var Cn=Math.min(m,Ce)-1,Om=Math.min(32767,x),Dm=Math.min(258,Ce);yt<=Om&&--ae&&Z!=he;){if(o[x+Xt]==o[x+Xt-yt]){for(var wn=0;wn<Dm&&o[x+wn]==o[x+wn-yt];++wn);if(wn>Xt){if(Xt=wn,G=yt,wn>Cn)break;var a2=Math.min(yt,wn-2),GS=0;for(it=0;it<a2;++it){var Bm=x-yt+it+32768&32767,WS=Bm-C[Bm]+32768&32767;WS>GS&&(GS=WS,he=Bm)}}}yt+=(Z=he)-(he=C[Z])+32768&32767}if(G){I[O++]=268435456|Xb[Xt]<<18|Yb[G];var ZS=31&Xb[Xt],XS=31&Yb[G];D+=T0[ZS]+R0[XS],++R[257+ZS],++F[XS],N=x+Xt,++E}else I[O++]=o[x],++R[o[x]]}}S=XE(o,h,c,I,R,F,D,O,W,x-W,S)}return uR(f,0,l+lR(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)},tb=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8};function u4(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=s4[255&u^l[c]]^u>>>8;s=u},d:function(){return 4294967295^s}}})(),r=t.length;a.p(t);var n,o=l4(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&&tb(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),tb(o,i-8,a.d()),tb(o,i-4,r),o}var c4=function(t){var e,a,r,n,o="";for(e=a=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
519
519
|
`).replace(/\r/g,`
|
|
520
|
-
`)).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),Xn(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},VU=!!C0||!!_0,iR="text/plain",Vm=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=K({},e),s=(r=o?.split("&").map((u=>{var c,[d,f]=u.split("="),p=a&&(c=i[d])!==null&&c!==void 0?c:f;return delete i[d],d+"="+p})))!==null&&r!==void 0?r:[],l=sU(i);return l&&s.push(l),n+"?"+s.join("&")},Od=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),v0=t=>{var{data:e,compression:a}=t;if(e){if(a===Wn.GZipJS){var r=qU((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new fr(l.length+(l.length>>>1)),f=0,p=function(m){d[f++]=m},S=0;S<c;++S){if(f+5>d.length){var x=new fr(f+8+(c-S<<1));x.set(d),d=x}var b=l.charCodeAt(S);b<128||u?p(b):b<2048?(p(192|b>>>6),p(128|63&b)):b>55295&&b<57344?(p(240|(b=65536+(1047552&b)|1023&l.charCodeAt(++S))>>>18),p(128|b>>>12&63),p(128|b>>>6&63),p(128|63&b)):(p(224|b>>>12),p(128|b>>>6&63),p(128|63&b))}return x2(d,0,f)})(Od(e)),{mtime:0}),n=new Blob([r],{type:iR});return{contentType:iR,body:n,estimatedSize:n.size}}if(a===Wn.Base64){var o=(function(l){var u,c,d,f,p,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,b=0,m="",h=[];if(!l)return l;l=$U(l);do u=(p=l.charCodeAt(x++)<<16|l.charCodeAt(x++)<<8|l.charCodeAt(x++))>>18&63,c=p>>12&63,d=p>>6&63,f=63&p,h[b++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(f);while(x<l.length);switch(m=h.join(""),l.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"="}return m})(Od(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Od(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Od(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Im=[];_0&&Im.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=v0(t))!==null&&e!==void 0?e:{},i=new Headers;Ge(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(LT){var u=new LT;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}_0(s,K({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 f={statusCode:c.status,text:d};if(c.status===200)try{f.json=JSON.parse(d)}catch(p){G.error(p)}t.callback==null||t.callback(f)})))).catch((c=>{G.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),C0&&Im.push({transport:"XHR",method:t=>{var e,a=new C0;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=v0(t))!==null&&e!==void 0?e:{};Ge(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)}}),Ga!=null&&Ga.sendBeacon&&Im.push({transport:"sendBeacon",method:t=>{var e=Vm(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=v0(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;Ga.sendBeacon(e,o)}catch{}}});var jm=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 sR(t,e,a){return Od({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var b2={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=>jm(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!jm(a,r))))),icontains:(t,e)=>e.map(km).some((a=>t.map(km).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(km).every((a=>t.map(km).every((r=>!a.includes(r)))))},km=t=>t.toLowerCase();function S2(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(V(o)||Xn(o))return!1;var i=[String(o)],s=b2[n.operator];return!!s&&s(n.values,i)}))}var y0=Mt("[Error tracking]"),pS=class{constructor(e){var a,r;this.Jt=[],this.Kt=new A0([new T0,new P0,new M0,new R0,new N0,new D0,new O0,new B0],$H("web:javascript",HH,qH)),this._instance=e,this.Jt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(H0))!==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({[H0]:this.Jt,[PT]:i})}get Yt(){var e,a=!!this._instance.get_property(PT),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 y0.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(a))return void y0.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(a))return void y0.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 Rt(o)&&o.length>0&&r.$exception_types.push(o),Rt(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=b2[o.operator],l=Ve(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!Ue(e)&&Ve(e)}},Rr=Mt("[FeatureFlags]"),wd=Mt("[FeatureFlags]",{debugEnabled:!0}),x0="$active_feature_flags",Xl="$override_feature_flags",lR="$feature_flag_payloads",kd="$override_feature_flag_payloads",uR="$feature_flag_request_id",cR="$feature_flag_evaluated_at",dR=t=>{var e={};for(var[a,r]of Lm(t||{}))r&&(e[a]=r);return e},jU=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]})))):Rr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},GU=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),hS=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||Rr.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(U0),a=this._instance.get_property(Xl),r=this._instance.get_property(kd);if(!r&&!a)return e||{};var n=xt({},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=V(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,f=V(c)?u.variant:typeof c=="string"?c:void 0,p=r?.[i],S=K({},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),p&&(S.metadata=K({},u?.metadata,{payload:p,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.ii||(Rr.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.ii=!0),n}getFlagVariants(){var e=this._instance.get_property(Jl),a=this._instance.get_property(Xl);if(!a)return e||{};for(var r=xt({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(Rr.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(lR),a=this._instance.get_property(kd);if(!a)return e||{};for(var r=xt({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.ii||(Rr.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:K({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Rd)||{}),group_properties:this._instance.get_property(cs)};(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=m2()),this.ri=!0,this._instance.ci({method:"POST",url:s,data:r,compression:this._instance.config.disable_compression?void 0:Wn.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(GU.FeatureFlags))Rr.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;r.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 r=this.getFlagVariants()[e],n=""+r,o=this._instance.get_property(uR)||void 0,i=this._instance.get_property(cR)||void 0,s=this._instance.get_property(Mm)||{};if((a.send_event||!("send_event"in a))&&(!(e in s)||!s[e].includes(n))){var l,u,c,d,f,p,S,x,b;Ve(s[e])?s[e].push(n):s[e]=[n],(l=this._instance.persistence)==null||l.register({[Mm]:s});var m=this.getFeatureFlagDetails(e),h={$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};V(m==null||(d=m.metadata)==null?void 0:d.version)||(h.$feature_flag_version=m.metadata.version);var g,y=(f=m==null||(p=m.reason)==null?void 0:p.description)!==null&&f!==void 0?f:m==null||(S=m.reason)==null?void 0:S.code;y&&(h.$feature_flag_reason=y),m!=null&&(x=m.metadata)!=null&&x.id&&(h.$feature_flag_id=m.metadata.id),V(m?.original_variant)&&V(m?.original_enabled)||(h.$feature_flag_original_response=V(m.original_variant)?m.original_enabled:m.original_variant),m!=null&&(b=m.metadata)!=null&&b.original_payload&&(h.$feature_flag_original_payload=m==null||(g=m.metadata)==null?void 0:g.original_payload),this._instance.capture("$feature_flag_called",h)}return r}Rr.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:Wn.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 V(r)?void 0:!!r}Rr.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=jU(i),f=d.flags,p=d.featureFlags,S=d.featureFlagPayloads;if(p){var x=i.requestId,b=i.evaluatedAt;if(Ve(p)){Rr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var m={};if(p)for(var h=0;h<p.length;h++)m[p[h]]=!0;s&&s.register({[x0]:p,[Jl]:m})}else{var g=p,y=S,C=f;i.errorsWhileComputingFlags&&(g=K({},l,g),y=K({},u,y),C=K({},c,C)),s&&s.register(K({[x0]:Object.keys(dR(g)),[Jl]:g||{},[lR]:y||{},[U0]:C||{}},x?{[uR]:x}:{},b?{[cR]:b}:{}))}}})(e,this._instance.persistence,r,n,o),this.pi(a)}}override(e,a){a===void 0&&(a=!1),Rr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Rr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Xl),this._instance.persistence.unregister(kd),this.pi(),wd.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(Xl),wd.info("Flag overrides cleared");else if(r.flags){if(Ve(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Xl]:n})}else this._instance.persistence.register({[Xl]:r.flags});wd.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(kd),wd.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[kd]:r.payloads}),wd.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(Td)||[]).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=K({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[x0]:Object.keys(dR(l)),[Jl]:l}),this.pi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Td),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(Td),(l=this._instance.persistence)==null||l.register({[Td]: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(Rd)||{};this._instance.register({[Rd]:K({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Rd)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(cs)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=K({},r[n],e[n]),delete e[n]})),this._instance.register({[cs]:K({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(cs)||{};this._instance.register({[cs]:K({},a,{[e]:{}})})}else this._instance.unregister(cs)}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}},ZU=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Bd=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&&G.info("Persistence loaded",e.persistence,K({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.wi}bi(e){ZU.indexOf(e.persistence.toLowerCase())===-1&&(G.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=e.persistence.toLowerCase();return a==="localstorage"&&it.H()?it:a==="localstorage+cookie"&&Sm.H()?Sm:a==="sessionstorage"&&Xt.H()?Xt:a==="memory"?mU:a==="cookie"?nn:Sm.H()?Sm:nn}properties(){var e={};return Ge(this.props,(function(a,r){if(r===Jl&&Ft(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,(Xn(i=KH)?l:kT&&i.indexOf===kT?i.indexOf(s)!=-1:(Ge(i,(function(u){if(l||(l=u===s))return Tm})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=xt({},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(Ft(e)){V(a)&&(a="None"),this.xi=V(r)?this.$i:r;var n=!1;if(Ge(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(Ft(e)){this.xi=V(a)?this.$i:a;var r=!1;if(Ge(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=u2(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Ql(MS(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=j?.referrer)?d2(e):{})}update_referrer_info(){var e;this.register_once({$referrer:f2(),$referring_domain:j!=null&&j.referrer&&((e=Pm(j.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[V0]||this.props[j0]||this.register_once({[Om]:p2(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Ge([j0,V0],(i=>{var s=this.props[i];s&&Ge(s,(function(l,u){e["$initial_"+w0(u)]=l}))}));var a,r,n=this.props[Om];if(n){var o=(a=h2(n),r={},Ge(a,(function(i,s){r["$initial_"+w0(s)]=i})),r);xt(e,o)}return e}safe_merge(e){return Ge(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[Ed]||{};r[e]=a,this.props[Ed]=r,this.save()}remove_event_timer(e){var a=(this.props[Ed]||{})[e];return V(a)||(delete this.props[Ed][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},Ld=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),AG=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),EG=(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})({}),TG=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),b0=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),RG=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),MG=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),OG=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Am=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),fR=(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})({}),_2=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),$d=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 Yl(t,e,a){if(Ue(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 mS=class{constructor(e){this.Pi=new $d,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(!V((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(!V((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"||!Yl(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=>Yl(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Yl((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=>Yl(u.text,a.text,a.text_matching||"exact")||Yl(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=[],f=/(?::|")text="(.*?)"/g;!Ue(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=>Yl(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||S2(a.properties.reduce(((r,n)=>{var o=Ve(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)}},Ne=Mt("[Surveys]"),gS="seenSurvey_",WU=(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},pR=t=>{var e=""+gS+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+gS+t.id+"_"+t.current_iteration),e},XU=[b0.Popover,b0.Widget,b0.API],YU={ignoreConditions:!1,ignoreDelay:!1,displayType:_2.Popover},vS=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,a){return!!e&&S2(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===Ld.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;V((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 mS(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,Ld.Activation),this.Bi=this.Gi(e,Ld.Cancellation))}onEvent(e,a){var r,n=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[bm])||[];if(Am.SHOWN===e&&a&&n.length>0){var o;Ne.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,Ld.Cancellation);l.length>0&&(Ne.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var d,f=n.indexOf(c.id);f>=0&&n.splice(f,1),(d=this._instance)==null||d.cancelPendingSurvey(c.id)})),this.Xi(n))}if(this.Hi.has(e)){Ne.info("survey event name matched",{event:e,eventPayload:a,surveys:this.Hi.get(e)});var u=this.Vi(e,a,Ld.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[bm])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var a;Ne.info("updating activated surveys",{activatedSurveys:e}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[bm]:[...new Set(e)]})}getSurveys(){var e,a=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[bm];return a||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},yS=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(Ue(a))return Ne.warn("Flags not loaded yet. Not loading surveys.");var r=Ve(a);this.Zi=r?a.length>0:a,Ne.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(gS)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)Ne.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ne.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ne.info("Not loading surveys in cookieless mode without consent.");else{var e=le?.__PosthogExtensions__;if(e){if(!V(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 Ne.error("PostHog Extensions not found.")}}re(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new vS(this._instance),Ne.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,a){Ne.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 Ne.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(z0);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 Ne.error(s),e([],{isLoaded:!1,error:s})}var l,u=n.json.surveys||[],c=u.filter((d=>(function(f){return!(!f.start_date||f.end_date)})(d)&&((function(f){var p;return!((p=f.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)})(d)||(function(f){var p;return!((p=f.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)})(d))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[z0]: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){Ne.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!Ue(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);Ne.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(Ue(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(Ue(this._surveyManager))return Ne.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 Ue(this._surveyManager)?(Ne.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(Ue(this._surveyManager))Ne.warn("init was not called");else{var n=typeof e=="string"?this.oe(e):e;if(n!=null&&n.id)if(XU.includes(n.type)){var o=j?.querySelector(a);if(o)return(r=n.appearance)!=null&&r.surveyPopupDelaySeconds?(Ne.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,s;Ne.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),Ne.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,o);Ne.warn("Survey element not found")}else Ne.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ne.warn("Survey not found")}}displaySurvey(e,a){var r;if(Ue(this._surveyManager))Ne.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=K({},n,{appearance:K({},n.appearance,{surveyPopupDelaySeconds:0})})),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void Ne.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==_2.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,a.selector)}else Ne.warn("Survey not found")}}cancelPendingSurvey(e){Ue(this._surveyManager)?Ne.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},hR=Mt("[RateLimiter]"),xS=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=>{hR.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void hR.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($0))!==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($0,i),{isRateLimited:s,remainingTokens:i.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},us=Mt("[RemoteConfig]"),bS=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=le._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var a,r;(a=le.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=le.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(us.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 us.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void us.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return us.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){us.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()):us.info("__preview_remote_config is disabled. Logging config instead",e):us.error("Failed to fetch remote config from PostHog.")}},SS=3e3,_S=class{constructor(e,a){this.he=!0,this.ve=[],this.de=an(a?.flush_interval_ms||SS,250,5e3,G.createLogger("flush interval"),SS),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(K({},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&&Ve(o.data)&&Ge(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 Ge(this.ve,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;V(e[o])&&(e[o]=K({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.ve=[],e}},KU=["retriesPerformedSoFar"],CS=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!V(T)&&"onLine"in T.navigator&&(this.be=T.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},At(T,"online",this.we),At(T,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=bR(e,KU);on(a)&&a>0&&(r.url=Vm(r.url,{retry_count:a})),this._instance.ci(K({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Se(K({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)"),G.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,V(T)||(this.we&&(T.removeEventListener("online",this.we),this.we=void 0),this.xe&&(T.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(K({},e,{transport:"sendBeacon"}))}catch(a){G.error(a)}this.ve=[]}},wS=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(){At(T,"scroll",this.ke,{capture:!0}),At(T,"scrollend",this.ke,{capture:!0}),At(T,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return T?.document.documentElement;var e=Ve(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=T?.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 T&&(T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return T&&(T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft)||0}},QU=t=>p2(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Gm=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({[q0]:s})}},this._instance=e,this.Ce=a,this.Fe=r,this.Ie=n||QU,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[q0]}getSetOnceProps(){var e,a=(e=this.Re())==null?void 0:e.props;return a?"r"in a?h2(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 Ge(MS(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+w0(r)]=a})),e}},S0=Mt("[SessionId]"),Zm=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 $d,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||ei,this.Ue=r||ei;var o=this.F.persistence_name||this.F.token,i=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*an(i,60,36e3,S0.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=Xt.W(this.He),l=Xt.W(this.Be);s&&!l?this.je=s:Xt.V(this.He),Xt.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){S0.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return V(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&&Xt.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Xt.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Xt.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({[Rm]:[a,e,r]}))}Ke(){var e=this.Fe.props[Rm];return Ve(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&&T&&(T.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Xt.V(this.Be)},At(T,"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=on(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(),S0.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 f=n===0||!e||l?r:n,p=i===0?new Date().getTime():i;return this.Ve(s),this.We(o,f,p),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:p,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)}},JU=["$set_once","$set"],Qo=Mt("[SiteApps]"),kS=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=le._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[f,p]of Object.entries(d))u[f]={id:c[f],type:f,properties:p};var{$set_once:S,$set:x}=e;return{event:K({},bR(e,JU),{properties:K({},e.properties,x?{$set:K({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},x)}:{},S?{$set_once:K({},(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&&(Qo.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,Qo.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){Qo.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){Qo.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){Qo.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 Qo.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;le["__$$ph_site_app_"+u]=o._instance,(c=le.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return Qo.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else Qo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},C2=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&ET(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>ET(n?.brand,e))))return!0}catch{}return!!t.webdriver},Dd=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),mR="i.posthog.com",LS=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("."+mR,".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]=Dd.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Dd.EU:this.er[this.apiHost]=Dd.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===Dd.CUSTOM)return this.apiHost+a;var r=mR+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},ez={icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!T&&jm(e.href,t),not_regex:(t,e)=>!!T&&!jm(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},IS=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);Rt(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(Ue(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=Fm(e?.search,"__experiment_id"),r=Fm(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!Ue(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var a;if(Ue(e.conditions)||Ue((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||ez[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return T?.location}static hr(e){var a;if(Ue(e.conditions)||Ue((a=e.conditions)==null?void 0:a.utm))return!0;var r=u2();if(r.utm_source){var n,o,i,s,l,u,c,d,f=(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,p=(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,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)==r.utm_term;return f&&S&&x&&p}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];G.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 Ga&&this._instance?C2(Ga,this._instance.config.custom_blocked_useragents):void 0}},tz=Mt("[PostHog ExternalIntegrations]"),az={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},AS=class{constructor(e){this._instance=e}it(e,a){var r;(r=le.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return tz.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=le.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(az[i],(()=>{var c;(c=le.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=le.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=le.__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)}}},ES="[SessionRecording]",Id=Mt(ES),Wm=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 Id.error("started without valid sessionManager"),new Error(ES+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(ES+' cannot be used with cookieless_mode="always"')}get cr(){var e,a=!((e=this._instance.get_property(u0))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return T&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.cr||(a=this.vr)==null||!a.isStarted){var r=!V(Object.assign)&&!V(Array.from);this.cr&&r?(this.gr(e),Id.info("starting")):this.stopRecording()}}gr(e){var a,r,n;this.cr&&(le!=null&&(a=le.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=le.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(n=le.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Id.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(TR)}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=Ue(s)?null:parseFloat(s);Ue(l)&&this.yr();var u=i?.minimumDurationMilliseconds;n.register({[u0]:K({enabled:!!i},i,{networkPayloadCapture:K({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:V(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:Id.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):Id.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(u0);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}_r(e){var a,r;if((a=le.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=le.__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))}},Pd={},TS=()=>{},Kl="posthog",w2=!VU&&Ia?.indexOf("MSIE")===-1&&Ia?.indexOf("Mozilla")===-1,gR=t=>{var e;return K({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:YH(j?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:TS,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:Aa&&Rt(Aa?.search)&&Aa.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:(T==null||(e=T.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;G.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:SS},error_tracking:{},_onCapture:TS,__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))},vR=t=>{var e={};V(t.process_person)||(e.person_profiles=t.process_person),V(t.xhr_headers)||(e.request_headers=t.xhr_headers),V(t.cookie_name)||(e.persistence_name=t.cookie_name),V(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),V(t.store_google)||(e.save_campaign_params=t.store_google),V(t.verbose)||(e.debug=t.verbose);var a=xt({},e,t);return Ve(t.property_blacklist)&&(V(t.property_denylist)?a.property_denylist=t.property_blacklist:Ve(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:G.error("Invalid value for property_denylist config: "+t.property_denylist)),a},RS=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){G.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Xm=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 RS,this.Sr=!1,this.version=jn.LIB_VERSION,this.Er=new $d,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=gR(),this.SentryIntegration=eS,this.sentryIntegration=e=>(function(a,r){var n=GR(a,r);return{name:jR,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 hS(this),this.toolbar=new tS(this),this.scrollManager=new wS(this),this.pageViewManager=new lS(this),this.surveys=new yS(this),this.experiments=new IS(this),this.exceptions=new pS(this),this.rateLimiter=new xS(this),this.requestRouter=new LS(this),this.consent=new K0(this),this.externalIntegrations=new AS(this),this.people={set:(e,a,r)=>{var n=Rt(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=Rt(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>G.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Kl){var n,o=(n=Pd[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),Pd[r]=o,Pd[Kl][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),V(e)||k0(e))return G.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(xt({},gR(a.defaults),vR(a),{name:r,token:e})),this.config.on_xhr_error&&G.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=a.disable_compression?void 0:Wn.GZipJS;var o=this.Cr();this.persistence=new Bd(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Bd(K({},this.config,{persistence:"sessionStorage"}),o);var i=K({},this.persistence.props),s=K({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new _S((h=>this.Or(h)),this.config.request_queue_config),this.Ar=new CS(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 Zm(this),this.sessionPropsManager=new Gm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(G.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(G.info("Initializing extensions synchronously"),this.Dr(l)),jn.DEBUG=jn.DEBUG||this.config.debug,jn.DEBUG&&G.info("Starting in debug mode",{this:this,config:a,thisC:K({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(ei()),f=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(Gn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this.jr()){var p,S,x=Object.keys(((p=a.bootstrap)==null?void 0:p.featureFlags)||{}).filter((h=>{var g;return!((g=a.bootstrap)==null||(g=g.featureFlags)==null||!g[h])})).reduce(((h,g)=>{var y;return h[g]=((y=a.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[g])||!1,h}),{}),b=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((h=>x[h])).reduce(((h,g)=>{var y,C;return(y=a.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[g]&&(h[g]=(C=a.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[g]),h}),{});this.featureFlags.receivedFeatureFlags({featureFlags:x,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:xd,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(ei());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(Gn,"anonymous")}return At(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?yU(this,(()=>this.Lr())):this.Lr(),ti(this.config._onCapture)&&this.config._onCapture!==TS&&(G.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(h=>this.config._onCapture(h.event,h)))),this.config.ip&&G.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 J0(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new aS(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new kS(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new Wm(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Z0(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new sS(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new iS(this)})),r.push((()=>{this.exceptionObserver=new Q0(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new Um(this,vU),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){G.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&&G.info("PostHog extensions initialized ("+n+"ms)")}fi(e){var a,r,n,o,i,s,l,u;if(!j||!j.body)return G.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=_e(e.supportedCompression,Wn.GZipJS)?Wn.GZipJS:_e(e.supportedCompression,Wn.Base64)?Wn.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){G.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new bS(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()&&ri(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&&(w2?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Vm(e.url,{ip:this.config.ip?1:0}),e.headers=K({},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=K({},a);i.timeout=i.timeout||6e4,i.url=Vm(i.url,{_:new Date().getTime().toString(),ver:jn.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Im.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=IR(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)})(K({},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=[];ri(e,(s=>{s&&(a=s[0],Ve(a)?o.push(s):ti(s)?s.call(this):Ve(s)&&a==="alias"?r.push(s):Ve(s)&&a.indexOf("capture")!==-1&&ti(this[a])?o.push(s):n.push(s))}));var i=function(s,l){ri(s,(function(u){if(Ve(u[0])){var c=l;Ge(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(!V(e)&&Rt(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&&!Rt(a?.$current_url)&&(G.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=ei(),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,f=this.qr(r?.$set_once);if(f&&(c.$set_once=f),(c=WH(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,V(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Am.DISMISSED||e===Am.SENT){var p=a?.[fR.SURVEY_ID],S=a?.[fR.SURVEY_ITERATION];d={id:p,current_iteration:S},localStorage.getItem(pR(d))||localStorage.setItem(pR(d),"true"),c.$set=K({},c.$set,{[WU({id:p,current_iteration:S},e===Am.SENT?"responded":"dismissed")]:!0})}var x=K({},c.properties.$set,c.$set);if(Ql(x)||this.setPersonPropertiesForFlags(x),!Ue(this.config.before_send)){var b=this.Wr(c);if(!b)return;c=b}this.Er.emit("eventCaptured",c);var m={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(m):this.Mr.enqueue(m),c}G.critical("This capture call is ignored due to client rate limiting.")}}else G.error("No event name provided to posthog.capture")}else G.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=K({},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=K({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!Rt(s.distinct_id)&&!on(s.distinct_id)||k0(s.distinct_id))&&G.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=DU(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&xt(s,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&xt(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(p=this.Ar)==null?void 0:p.length}catch(m){s.$sdk_debug_error_capturing_properties=String(m)}if(this.requestRouter.region===Dd.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=xt(s,u),e==="$pageview"&&j&&(s.title=j.title),!V(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}Ia&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=xt({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Ve(this.config.property_denylist)?Ge(this.config.property_denylist,(function(m){delete s[m]})):G.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&&(G.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 r=this.persistence.get_initial_props(),n=(a=this.sessionPropsManager)==null?void 0:a.getSetOnceProps(),o=xt({},r,n||{},e||{}),i=this.config.sanitize_properties;return i&&(G.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.Sr=!0,Ql(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=YU),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 G.uninitializedWarning("posthog.identify");if(on(e)&&(e=e.toString(),G.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()))G.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!==xd){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(Ad)&&(this.unregister(Ad),this.register({distinct_id:e}));var i=(this.persistence.get_property(Gn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(Gn,"identified"),this.setPersonPropertiesForFlags(K({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Tr=sR(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Mm))}}else G.critical('The string "'+xd+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else G.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,a){if((e||a)&&this.Vr("posthog.setPersonProperties")){var r=sR(this.get_distinct_id(),e,a);this.Tr!==r?(this.setPersonPropertiesForFlags(K({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Tr=r):G.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:K({},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 G.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(G.info("reset"),!this.__loaded)return G.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(Gn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:xd,$device_id:null},"");else{var s=this.config.get_device_id(ei());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(AR)?(G.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(V(a)&&(a=this.get_distinct_id()),e!==a?(this.Jr(Ad,e),this.capture("$create_alias",{alias:e,distinct_id:a})):(G.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var a=K({},this.config);if(Ft(e)){var r,n,o,i,s;xt(this.config,vR(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 Bd(K({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);ai(u)&&(this.config.debug=u),ai(this.config.debug)&&(this.config.debug?(jn.DEBUG=!0,it.H()&&it.G("ph_debug","true"),G.info("set_config",{config:e,oldConfig:a,newConfig:K({},this.config)})):(jn.DEBUG=!1,it.H()&&it.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(K({},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:Kl;return a!==Kl&&(a=Kl+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(Gn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(Gn))==="identified"}Gr(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ql(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ad])&&((a=this.persistence)==null||(a=a.props)==null||!a[Dm]))}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"?(G.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Dm,!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 Zm(this),this.persistence&&(this.sessionPropsManager=new Gm(this,this.sessionManager,this.persistence)),this.sessionRecording=new Wm(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(),(V(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 G.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:xd,$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())):G.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===Zn.GRANTED?"granted":e===Zn.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 Ga?C2(Ga,this.config.custom_blocked_useragents):void 0}Hr(){j&&(j.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:j.title},{send_instantly:!0}),this.kr&&(j.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),At(j,"visibilitychange",this.kr)))}debug(e){e===!1?(T?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(T?.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?(G.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=G,i=(a="advanced_disable_flags")in(e=l)&&!V(e[a]),s=r in e&&!V(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(Ue(this.config.before_send))return e;var a=Ve(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),Ue(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return RH(e.event)?G.warn(o+". This can cause unexpected behavior."):G.info(o),null}r.properties&&!Ql(r.properties)||G.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=ai(e)&&!e,r=it.H()&&it.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=ZH(t.prototype[e[a]])})(Xm,["identify"]);var yR,k2=(yR=Pd[Kl]=new Xm,(function(){function t(){t.done||(t.done=!0,w2=!1,Ge(Pd,(function(e){e._dom_loaded()})))}j!=null&&j.addEventListener?j.readyState==="complete"?t():At(j,"DOMContentLoaded",t,{capture:!1}):T&&G.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),yR);var qS=class{constructor(e={}){this.options=e;B(this,"client");B(this,"featureFlagsCallback");B(this,"captureCallback");B(this,"rrwebCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,this.rrwebCallback=e.onRRWebEvent,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),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"}`,n={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??"history_change",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:i=>{if(a&&this.featureFlagsCallback){i.onFeatureFlags(()=>{let l=this.getAllFeatureFlags();l&&this.featureFlagsCallback&&this.featureFlagsCallback(l)});let s=this.getAllFeatureFlags();s&&Object.keys(s).length>0&&this.featureFlagsCallback(s)}this.captureCallback&&i.on("eventCaptured",(...s)=>{let l=s[0],u=typeof l=="string"?l:l?.event,c=typeof l=="string"?void 0:l?.properties;typeof u=="string"&&this.captureCallback?.(u,c)})}},o=k2.init(e.apiKey,n,r);o&&(this.client=o),this.rrwebCallback&&this.client&&this.setupRRWebIntercept()}setupRRWebIntercept(e=30){let a=this.client?.sessionRecording;if(!a){e>0&&setTimeout(()=>this.setupRRWebIntercept(e-1),500);return}let r=null,n=a;for(let i of Object.getOwnPropertyNames(n)){let s=n[i];if(s&&typeof s=="object"&&typeof s.onRRwebEmit=="function"&&typeof s.start=="function"&&s!==a){r=s;break}}if(!r){e>0&&setTimeout(()=>this.setupRRWebIntercept(e-1),500);return}let o=r.onRRwebEmit.bind(r);r.onRRwebEmit=i=>{this.rrwebCallback?.({kind:"rrweb",...i}),o(i)},typeof window<"u"&&(window.__RRWEB_INTERCEPT_READY__=!0)}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 Jm(t={}){return new qS(t)}var $S=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{}}}},VS=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{}}}},jS=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 Zd=class{constructor(){B(this,"executors",new Map);for(let{kind:e,executor:a}of Dx)this.registerCore(e,a);for(let{kind:e,executor:a}of Xx)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",$S),this.registerCore("core:parallel",VS),this.registerCore("core:wait",jS)}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)}},sn=new Zd;function L2(t){return sn.get(t)}function eg(t){return sn.has(t)}function GS(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 ZS(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 WS(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>tg&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${tg}`,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 XS(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function YS(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(i_.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 KS(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 QS(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>ag&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${ag}`,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 JS(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 e_(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 t_(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=Mr(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 a_(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=Mr(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 r_(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 n_(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 o_(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=Mr(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`})}}var i_=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),tg=5e4,ag=50;function Mr(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(!eg(r)&&r!=="core:mountWidget"){let n=sn.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":Yn(t,e,a);break;case"overlays:badge":Yn(t,e,a),GS(t,e,a);break;case"overlays:tooltip":Yn(t,e,a),ZS(t,e,a);break;case"overlays:modal":n_(t,e,a);break;case"content:insertHtml":Yn(t,e,a),WS(t,e,a);break;case"content:setText":Yn(t,e,a),XS(t,e,a);break;case"content:setAttr":Yn(t,e,a),YS(t,e,a);break;case"content:addClass":case"content:removeClass":Yn(t,e,a),KS(t,e,a);break;case"content:setStyle":Yn(t,e,a),QS(t,e,a);break;case"core:mountWidget":JS(t,e,a);break;case"core:wait":e_(t,e,a);break;case"core:sequence":t_(t,e,a);break;case"core:parallel":a_(t,e,a);break;case"core:tour":o_(t,e,a);break;case"navigation:navigate":r_(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function Yn(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 Wd(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=Mr(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 rz=0;function rg(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=sn,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function f(){return`action-${++rz}`}function p(_,k){a&&a.publish(_,k)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:f,publishEvent:p,adaptiveId:i,applyAction:h,subscribeEvent:a?(_,k)=>a.subscribe({names:[_]},A=>k(A.props)):void 0,subscribeNavigation:l}}async function x(_,k){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let A=r.mount(_.slot,{type:"widget",widgetId:_.widget.widgetId,config:_.widget.props},{priority:_.widget.priority});return k.publishEvent("action.applied",{id:k.generateId(),kind:"core:mountWidget",slot:_.slot,widgetId:_.widget.widgetId}),{cleanup:()=>{A.unmount()},updateFn:I=>{if("widget"in I&&I.widget){let R=I.widget;R.props&&A.update({type:"widget",widgetId:_.widget.widgetId,config:R.props})}}}}async function b(_,k){if(_.kind==="core:mountWidget")return x(_,k);let A=s.get(_.kind);if(!A){let I="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${_.kind}".`,`Registered: [${I}]`),new Error(`No executor for action kind: ${_.kind}`)}return A(_,k)}function m(_,k,A,I){if(!u)return;let R=[],U=async()=>{let E=c.get(_);if(!E)return;let O=u.evaluateSync(A).value;if(E.state==="applied"&&!O){try{await E.cleanup()}catch(H){console.error(`[ActionEngine] Error reverting conditional action ${_}:`,H)}E.state="deferred",E.cleanup=()=>{},E.updateFn=void 0,p("action.deferred",{id:_,kind:k.kind})}else if(E.state==="deferred"&&O)try{let H=S(),Y=await b(k,H);E.state="applied",E.cleanup=Y.cleanup,E.updateFn=Y.updateFn,E.appliedTs=Date.now(),p("action.applied",{id:_,kind:k.kind,anchorId:"anchorId"in k?k.anchorId:void 0})}catch(H){console.error(`[ActionEngine] Error applying deferred action ${_}:`,H),E.state="failed"}};u.context&&R.push(u.context.subscribe(U)),u.accumulator&&R.push(u.accumulator.subscribe(U)),d.set(_,R)}async function h(_){let k=Mr(_);if(!k.valid){let O=k.errors.map(H=>H.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${_?.kind}":`,O,_),new Error(`Action validation failed: ${O}`)}let A=f(),I=_.triggerWhen;if(I&&u&&!u.evaluateSync(I).value){let H={id:A,action:_,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(A,H);let Y={id:A,action:_,async revert(){let z=c.get(A);if(!z)return;let Q=d.get(A);if(Q){for(let we of Q)we();d.delete(A)}z.state="reverted",c.delete(A)},isApplied(){return c.get(A)?.state==="applied"},async update(z){let Q=c.get(A);if(!Q||Q.state!=="applied")throw new Error("Cannot update action that is not applied");if(Q.updateFn)await Q.updateFn(z);else throw new Error(`Action kind ${_.kind} does not support updates`)},getState(){return c.get(A)?.state??"reverted"}};return m(A,_,I,Y),Y}let R=S(),U=await b(_,R),E={id:A,action:_,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:U.cleanup,updateFn:U.updateFn};c.set(A,E),p("action.applied",{id:A,kind:_.kind,anchorId:"anchorId"in _?_.anchorId:void 0});let N={id:A,action:_,async revert(){let O=c.get(A);if(!O||O.state!=="applied")return;let H=d.get(A);if(H){for(let Y of H)Y();d.delete(A)}try{await O.cleanup(),O.state="reverted",p("action.reverted",{id:A,kind:_.kind})}catch(Y){console.warn(`[ActionEngine] Cleanup error for ${_.kind} (${A}), ignoring:`,Y),O.state="reverted",p("action.reverted",{id:A,kind:_.kind})}finally{c.delete(A)}},isApplied(){return c.get(A)?.state==="applied"},async update(O){let H=c.get(A);if(!H||H.state!=="applied")throw new Error("Cannot update action that is not applied");if(H.updateFn)await H.updateFn(O);else throw new Error(`Action kind ${_.kind} does not support updates`)},getState(){return c.get(A)?.state??"reverted"}};return I&&u&&m(A,_,I,N),N}async function g(_){console.log(`[ActionEngine] applyBatch: ${_.length} action(s)`,_.map(E=>E.kind).join(", "));let k=Wd(_);if(!k.valid){let E=k.errors.map(N=>N.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${_.length} action(s):`,E,`
|
|
521
|
-
Actions:`,_.map((
|
|
522
|
-
`)),new Error(`Batch validation failed: ${E}`)}let A=f(),I=[],R=[];try{for(let E of _){let N=await h(E);I.push(N),R.push(N)}}catch(E){console.error(`[ActionEngine] Batch apply FAILED at action ${R.length+1}/${_.length}.`,`Successfully applied: ${R.length}. Rolling back...`,E);for(let N of R)try{await N.revert()}catch{}throw E}return{id:A,handles:I,async revertAll(){for(let E=I.length-1;E>=0;E--)try{await I[E].revert()}catch(N){console.error(`[ActionEngine] Error reverting action ${I[E].id}:`,N)}},isApplied(){return I.every(E=>E.isApplied())}}}function y(_){return Mr(_)}function C(){return Array.from(c.values()).map(_=>({id:_.id,action:_.action,adaptiveId:_.adaptiveId,appliedTs:_.appliedTs,state:_.state}))}function w(){for(let _ of d.values())for(let k of _)try{k()}catch{}d.clear();for(let _ of c.values())if(_.state==="applied")try{_.cleanup()}catch(k){console.error("[ActionEngine] Error during cleanup:",k)}c.clear()}return{apply:h,applyBatch:g,validate:y,getActive:C,destroy:w}}var D={};Zg(D,{BRAND:()=>Ez,DIRTY:()=>ps,EMPTY_PATH:()=>sz,INVALID:()=>ne,NEVER:()=>p5,OK:()=>aa,ParseStatus:()=>Kt,Schema:()=>ve,ZodAny:()=>si,ZodArray:()=>eo,ZodBigInt:()=>ms,ZodBoolean:()=>gs,ZodBranded:()=>Yd,ZodCatch:()=>Is,ZodDate:()=>vs,ZodDefault:()=>Ls,ZodDiscriminatedUnion:()=>ig,ZodEffects:()=>mr,ZodEnum:()=>ws,ZodError:()=>Ea,ZodFirstPartyTypeKind:()=>ie,ZodFunction:()=>lg,ZodIntersection:()=>Ss,ZodIssueCode:()=>F,ZodLazy:()=>_s,ZodLiteral:()=>Cs,ZodMap:()=>fu,ZodNaN:()=>hu,ZodNativeEnum:()=>ks,ZodNever:()=>Or,ZodNull:()=>xs,ZodNullable:()=>cn,ZodNumber:()=>hs,ZodObject:()=>Ta,ZodOptional:()=>pr,ZodParsedType:()=>W,ZodPipeline:()=>Kd,ZodPromise:()=>li,ZodReadonly:()=>As,ZodRecord:()=>sg,ZodSchema:()=>ve,ZodSet:()=>pu,ZodString:()=>ii,ZodSymbol:()=>cu,ZodTransformer:()=>mr,ZodTuple:()=>un,ZodType:()=>ve,ZodUndefined:()=>ys,ZodUnion:()=>bs,ZodUnknown:()=>Jn,ZodVoid:()=>du,addIssueToContext:()=>$,any:()=>Fz,array:()=>qz,bigint:()=>Oz,boolean:()=>P2,coerce:()=>f5,custom:()=>D2,date:()=>Dz,datetimeRegex:()=>M2,defaultErrorMap:()=>Kn,discriminatedUnion:()=>Gz,effect:()=>n5,enum:()=>t5,function:()=>Qz,getErrorMap:()=>su,getParsedType:()=>ln,instanceof:()=>Rz,intersection:()=>Zz,isAborted:()=>ng,isAsync:()=>lu,isDirty:()=>og,isValid:()=>oi,late:()=>Tz,lazy:()=>Jz,literal:()=>e5,makeIssue:()=>Xd,map:()=>Yz,nan:()=>Mz,nativeEnum:()=>a5,never:()=>Uz,null:()=>Pz,nullable:()=>i5,number:()=>B2,object:()=>$z,objectUtil:()=>s_,oboolean:()=>d5,onumber:()=>c5,optional:()=>o5,ostring:()=>u5,pipeline:()=>l5,preprocess:()=>s5,promise:()=>r5,quotelessJson:()=>nz,record:()=>Xz,set:()=>Kz,setErrorMap:()=>iz,strictObject:()=>Vz,string:()=>N2,symbol:()=>Nz,transformer:()=>n5,tuple:()=>Wz,undefined:()=>Bz,union:()=>jz,unknown:()=>Hz,util:()=>Ce,void:()=>zz});var Ce;(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})(Ce||(Ce={}));var s_;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(s_||(s_={}));var W=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ln=t=>{switch(typeof t){case"undefined":return W.undefined;case"string":return W.string;case"number":return Number.isNaN(t)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(t)?W.array:t===null?W.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?W.promise:typeof Map<"u"&&t instanceof Map?W.map:typeof Set<"u"&&t instanceof Set?W.set:typeof Date<"u"&&t instanceof Date?W.date:W.object;default:return W.unknown}};var F=Ce.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"]),nz=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ea=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,Ce.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()}};Ea.create=t=>new Ea(t);var oz=(t,e)=>{let a;switch(t.code){case F.invalid_type:t.received===W.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case F.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,Ce.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:a=`Unrecognized key(s) in object: ${Ce.joinValues(t.keys,", ")}`;break;case F.invalid_union:a="Invalid input";break;case F.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${Ce.joinValues(t.options)}`;break;case F.invalid_enum_value:a=`Invalid enum value. Expected ${Ce.joinValues(t.options)}, received '${t.received}'`;break;case F.invalid_arguments:a="Invalid function arguments";break;case F.invalid_return_type:a="Invalid function return type";break;case F.invalid_date:a="Invalid date";break;case F.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}"`:Ce.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case F.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 F.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 F.custom:a="Invalid input";break;case F.invalid_intersection_types:a="Intersection results could not be merged";break;case F.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case F.not_finite:a="Number must be finite";break;default:a=e.defaultError,Ce.assertNever(t)}return{message:a}},Kn=oz;var I2=Kn;function iz(t){I2=t}function su(){return I2}var Xd=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}},sz=[];function $(t,e){let a=su(),r=Xd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Kn?void 0:Kn].filter(n=>!!n)});t.common.issues.push(r)}var Kt=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 ne;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 ne;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}}},ne=Object.freeze({status:"aborted"}),ps=t=>({status:"dirty",value:t}),aa=t=>({status:"valid",value:t}),ng=t=>t.status==="aborted",og=t=>t.status==="dirty",oi=t=>t.status==="valid",lu=t=>typeof Promise<"u"&&t instanceof Promise;var ee;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ee||(ee={}));var hr=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}},A2=(t,e)=>{if(oi(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 Ea(t.common.issues);return this._error=a,this._error}}};function me(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 ve=class{get description(){return this._def.description}_getType(e){return ln(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:ln(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Kt,ctx:{common:e.parent.common,data:e.data,parsedType:ln(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let a=this._parse(e);if(lu(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:ln(e)},n=this._parseSync({data:e,path:r.path,parent:r});return A2(r,n)}"~validate"(e){let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ln(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:a});return oi(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=>oi(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:ln(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(lu(n)?n:Promise.resolve(n));return A2(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:F.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 mr({schema:this,typeName:ie.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 pr.create(this,this._def)}nullable(){return cn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eo.create(this)}promise(){return li.create(this,this._def)}or(e){return bs.create([this,e],this._def)}and(e){return Ss.create(this,e,this._def)}transform(e){return new mr({...me(this._def),schema:this,typeName:ie.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let a=typeof e=="function"?e:()=>e;return new Ls({...me(this._def),innerType:this,defaultValue:a,typeName:ie.ZodDefault})}brand(){return new Yd({typeName:ie.ZodBranded,type:this,...me(this._def)})}catch(e){let a=typeof e=="function"?e:()=>e;return new Is({...me(this._def),innerType:this,catchValue:a,typeName:ie.ZodCatch})}describe(e){let a=this.constructor;return new a({...this._def,description:e})}pipe(e){return Kd.create(this,e)}readonly(){return As.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},lz=/^c[^\s-]{8,}$/i,uz=/^[0-9a-z]+$/,cz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,dz=/^[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,fz=/^[a-z0-9_-]{21}$/i,pz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hz=/^[-+]?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)?)??$/,mz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",l_,vz=/^(?:(?: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])$/,yz=/^(?:(?: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])$/,xz=/^(([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]))$/,bz=/^(([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])$/,Sz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,T2="((\\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])))",Cz=new RegExp(`^${T2}$`);function R2(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 wz(t){return new RegExp(`^${R2(t)}$`)}function M2(t){let e=`${T2}T${R2(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 kz(t,e){return!!((e==="v4"||!e)&&vz.test(t)||(e==="v6"||!e)&&xz.test(t))}function Lz(t,e){if(!pz.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 Iz(t,e){return!!((e==="v4"||!e)&&yz.test(t)||(e==="v6"||!e)&&bz.test(t))}var ii=class t extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==W.string){let o=this._getOrReturnCtx(e);return $(o,{code:F.invalid_type,expected:W.string,received:o.parsedType}),ne}let r=new Kt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:F.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),$(n,{code:F.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?$(n,{code:F.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&$(n,{code:F.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")mz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"email",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")l_||(l_=new RegExp(gz,"u")),l_.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"emoji",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")dz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"uuid",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")fz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"nanoid",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")lz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"cuid",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")uz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"cuid2",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")cz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"ulid",code:F.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),$(n,{validation:"url",code:F.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),$(n,{validation:"regex",code:F.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),$(n,{code:F.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),$(n,{code:F.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),$(n,{code:F.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?M2(o).test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:F.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Cz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:F.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?wz(o).test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:F.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?hz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"duration",code:F.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?kz(e.data,o.version)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"ip",code:F.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Lz(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"jwt",code:F.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Iz(e.data,o.version)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"cidr",code:F.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Sz.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"base64",code:F.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?_z.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:"base64url",code:F.invalid_string,message:o.message}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:e.data}}_regex(e,a,r){return this.refinement(n=>e.test(n),{validation:a,code:F.invalid_string,...ee.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ee.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ee.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ee.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ee.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ee.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ee.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ee.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ee.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ee.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ee.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ee.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ee.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ee.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,...ee.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,...ee.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ee.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...ee.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a?.position,...ee.errToObj(a?.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...ee.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...ee.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...ee.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...ee.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...ee.errToObj(a)})}nonempty(e){return this.min(1,ee.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}};ii.create=t=>new ii({checks:[],typeName:ie.ZodString,coerce:t?.coerce??!1,...me(t)});function Az(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 hs=class t extends ve{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)!==W.number){let o=this._getOrReturnCtx(e);return $(o,{code:F.invalid_type,expected:W.number,received:o.parsedType}),ne}let r,n=new Kt;for(let o of this._def.checks)o.kind==="int"?Ce.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:F.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),$(r,{code:F.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),$(r,{code:F.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?Az(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),$(r,{code:F.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),$(r,{code:F.not_finite,message:o.message}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,ee.toString(a))}gt(e,a){return this.setLimit("min",e,!1,ee.toString(a))}lte(e,a){return this.setLimit("max",e,!0,ee.toString(a))}lt(e,a){return this.setLimit("max",e,!1,ee.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ee.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ee.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:ee.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:ee.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ee.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ee.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"&&Ce.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)}};hs.create=t=>new hs({checks:[],typeName:ie.ZodNumber,coerce:t?.coerce||!1,...me(t)});var ms=class t extends ve{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)!==W.bigint)return this._getInvalidInput(e);let r,n=new Kt;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),$(r,{code:F.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),$(r,{code:F.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),$(r,{code:F.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):Ce.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return $(a,{code:F.invalid_type,expected:W.bigint,received:a.parsedType}),ne}gte(e,a){return this.setLimit("min",e,!0,ee.toString(a))}gt(e,a){return this.setLimit("min",e,!1,ee.toString(a))}lte(e,a){return this.setLimit("max",e,!0,ee.toString(a))}lt(e,a){return this.setLimit("max",e,!1,ee.toString(a))}setLimit(e,a,r,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:ee.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:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:ee.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}};ms.create=t=>new ms({checks:[],typeName:ie.ZodBigInt,coerce:t?.coerce??!1,...me(t)});var gs=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==W.boolean){let r=this._getOrReturnCtx(e);return $(r,{code:F.invalid_type,expected:W.boolean,received:r.parsedType}),ne}return aa(e.data)}};gs.create=t=>new gs({typeName:ie.ZodBoolean,coerce:t?.coerce||!1,...me(t)});var vs=class t extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==W.date){let o=this._getOrReturnCtx(e);return $(o,{code:F.invalid_type,expected:W.date,received:o.parsedType}),ne}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return $(o,{code:F.invalid_date}),ne}let r=new Kt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:F.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),$(n,{code:F.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ce.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:ee.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:ee.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}};vs.create=t=>new vs({checks:[],coerce:t?.coerce||!1,typeName:ie.ZodDate,...me(t)});var cu=class extends ve{_parse(e){if(this._getType(e)!==W.symbol){let r=this._getOrReturnCtx(e);return $(r,{code:F.invalid_type,expected:W.symbol,received:r.parsedType}),ne}return aa(e.data)}};cu.create=t=>new cu({typeName:ie.ZodSymbol,...me(t)});var ys=class extends ve{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return $(r,{code:F.invalid_type,expected:W.undefined,received:r.parsedType}),ne}return aa(e.data)}};ys.create=t=>new ys({typeName:ie.ZodUndefined,...me(t)});var xs=class extends ve{_parse(e){if(this._getType(e)!==W.null){let r=this._getOrReturnCtx(e);return $(r,{code:F.invalid_type,expected:W.null,received:r.parsedType}),ne}return aa(e.data)}};xs.create=t=>new xs({typeName:ie.ZodNull,...me(t)});var si=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return aa(e.data)}};si.create=t=>new si({typeName:ie.ZodAny,...me(t)});var Jn=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return aa(e.data)}};Jn.create=t=>new Jn({typeName:ie.ZodUnknown,...me(t)});var Or=class extends ve{_parse(e){let a=this._getOrReturnCtx(e);return $(a,{code:F.invalid_type,expected:W.never,received:a.parsedType}),ne}};Or.create=t=>new Or({typeName:ie.ZodNever,...me(t)});var du=class extends ve{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return $(r,{code:F.invalid_type,expected:W.void,received:r.parsedType}),ne}return aa(e.data)}};du.create=t=>new du({typeName:ie.ZodVoid,...me(t)});var eo=class t extends ve{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),n=this._def;if(a.parsedType!==W.array)return $(a,{code:F.invalid_type,expected:W.array,received:a.parsedType}),ne;if(n.exactLength!==null){let i=a.data.length>n.exactLength.value,s=a.data.length<n.exactLength.value;(i||s)&&($(a,{code:i?F.too_big:F.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&&($(a,{code:F.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&&($(a,{code:F.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 hr(a,i,a.path,s)))).then(i=>Kt.mergeArray(r,i));let o=[...a.data].map((i,s)=>n.type._parseSync(new hr(a,i,a.path,s)));return Kt.mergeArray(r,o)}get element(){return this._def.type}min(e,a){return new t({...this._def,minLength:{value:e,message:ee.toString(a)}})}max(e,a){return new t({...this._def,maxLength:{value:e,message:ee.toString(a)}})}length(e,a){return new t({...this._def,exactLength:{value:e,message:ee.toString(a)}})}nonempty(e){return this.min(1,e)}};eo.create=(t,e)=>new eo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ie.ZodArray,...me(e)});function uu(t){if(t instanceof Ta){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=pr.create(uu(r))}return new Ta({...t._def,shape:()=>e})}else return t instanceof eo?new eo({...t._def,type:uu(t.element)}):t instanceof pr?pr.create(uu(t.unwrap())):t instanceof cn?cn.create(uu(t.unwrap())):t instanceof un?un.create(t.items.map(e=>uu(e))):t}var Ta=class t extends ve{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=Ce.objectKeys(e);return this._cached={shape:e,keys:a},this._cached}_parse(e){if(this._getType(e)!==W.object){let u=this._getOrReturnCtx(e);return $(u,{code:F.invalid_type,expected:W.object,received:u.parsedType}),ne}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Or&&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 hr(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Or){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&&($(n,{code:F.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 hr(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,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>Kt.mergeObjectSync(r,u)):Kt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ee.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:ee.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:ie.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 Ce.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 Ce.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new t({...this._def,shape:()=>a})}deepPartial(){return uu(this)}partial(e){let a={};for(let r of Ce.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 Ce.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof pr;)o=o._def.innerType;a[r]=o}return new t({...this._def,shape:()=>a})}keyof(){return O2(Ce.objectKeys(this.shape))}};Ta.create=(t,e)=>new Ta({shape:()=>t,unknownKeys:"strip",catchall:Or.create(),typeName:ie.ZodObject,...me(e)});Ta.strictCreate=(t,e)=>new Ta({shape:()=>t,unknownKeys:"strict",catchall:Or.create(),typeName:ie.ZodObject,...me(e)});Ta.lazycreate=(t,e)=>new Ta({shape:t,unknownKeys:"strip",catchall:Or.create(),typeName:ie.ZodObject,...me(e)});var bs=class extends ve{_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 Ea(s.ctx.common.issues));return $(a,{code:F.invalid_union,unionErrors:i}),ne}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 Ea(l));return $(a,{code:F.invalid_union,unionErrors:s}),ne}}get options(){return this._def.options}};bs.create=(t,e)=>new bs({options:t,typeName:ie.ZodUnion,...me(e)});var Qn=t=>t instanceof _s?Qn(t.schema):t instanceof mr?Qn(t.innerType()):t instanceof Cs?[t.value]:t instanceof ws?t.options:t instanceof ks?Ce.objectValues(t.enum):t instanceof Ls?Qn(t._def.innerType):t instanceof ys?[void 0]:t instanceof xs?[null]:t instanceof pr?[void 0,...Qn(t.unwrap())]:t instanceof cn?[null,...Qn(t.unwrap())]:t instanceof Yd||t instanceof As?Qn(t.unwrap()):t instanceof Is?Qn(t._def.innerType):[],ig=class t extends ve{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==W.object)return $(a,{code:F.invalid_type,expected:W.object,received:a.parsedType}),ne;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}):($(a,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ne)}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=Qn(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:ie.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:n,...me(r)})}};function u_(t,e){let a=ln(t),r=ln(e);if(t===e)return{valid:!0,data:t};if(a===W.object&&r===W.object){let n=Ce.objectKeys(e),o=Ce.objectKeys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(let s of o){let l=u_(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(a===W.array&&r===W.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=u_(i,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return a===W.date&&r===W.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ss=class extends ve{_parse(e){let{status:a,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(ng(o)||ng(i))return ne;let s=u_(o.value,i.value);return s.valid?((og(o)||og(i))&&a.dirty(),{status:a.value,value:s.data}):($(r,{code:F.invalid_intersection_types}),ne)};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}))}};Ss.create=(t,e,a)=>new Ss({left:t,right:e,typeName:ie.ZodIntersection,...me(a)});var un=class t extends ve{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.array)return $(r,{code:F.invalid_type,expected:W.array,received:r.parsedType}),ne;if(r.data.length<this._def.items.length)return $(r,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ne;!this._def.rest&&r.data.length>this._def.items.length&&($(r,{code:F.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 hr(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>Kt.mergeArray(a,i)):Kt.mergeArray(a,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};un.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new un({items:t,typeName:ie.ZodTuple,rest:null,...me(e)})};var sg=class t extends ve{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!==W.object)return $(r,{code:F.invalid_type,expected:W.object,received:r.parsedType}),ne;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new hr(r,s,r.path,s)),value:i._parse(new hr(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Kt.mergeObjectAsync(a,n):Kt.mergeObjectSync(a,n)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof ve?new t({keyType:e,valueType:a,typeName:ie.ZodRecord,...me(r)}):new t({keyType:ii.create(),valueType:e,typeName:ie.ZodRecord,...me(a)})}},fu=class extends ve{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!==W.map)return $(r,{code:F.invalid_type,expected:W.map,received:r.parsedType}),ne;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],u)=>({key:n._parse(new hr(r,s,r.path,[u,"key"])),value:o._parse(new hr(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 ne;(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 ne;(u.status==="dirty"||c.status==="dirty")&&a.dirty(),s.set(u.value,c.value)}return{status:a.value,value:s}}}};fu.create=(t,e,a)=>new fu({valueType:e,keyType:t,typeName:ie.ZodMap,...me(a)});var pu=class t extends ve{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.set)return $(r,{code:F.invalid_type,expected:W.set,received:r.parsedType}),ne;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&($(r,{code:F.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&&($(r,{code:F.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 ne;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 hr(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:ee.toString(a)}})}max(e,a){return new t({...this._def,maxSize:{value:e,message:ee.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};pu.create=(t,e)=>new pu({valueType:t,minSize:null,maxSize:null,typeName:ie.ZodSet,...me(e)});var lg=class t extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==W.function)return $(a,{code:F.invalid_type,expected:W.function,received:a.parsedType}),ne;function r(s,l){return Xd({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,su(),Kn].filter(u=>!!u),issueData:{code:F.invalid_arguments,argumentsError:l}})}function n(s,l){return Xd({data:s,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,su(),Kn].filter(u=>!!u),issueData:{code:F.invalid_return_type,returnTypeError:l}})}let o={errorMap:a.common.contextualErrorMap},i=a.data;if(this._def.returns instanceof li){let s=this;return aa(async function(...l){let u=new Ea([]),c=await s._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(r(l,p)),u}),d=await Reflect.apply(i,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(n(d,p)),u})})}else{let s=this;return aa(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Ea([r(l,u.error)]);let c=Reflect.apply(i,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Ea([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:un.create(e).rest(Jn.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||un.create([]).rest(Jn.create()),returns:a||Jn.create(),typeName:ie.ZodFunction,...me(r)})}},_s=class extends ve{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})}};_s.create=(t,e)=>new _s({getter:t,typeName:ie.ZodLazy,...me(e)});var Cs=class extends ve{_parse(e){if(e.data!==this._def.value){let a=this._getOrReturnCtx(e);return $(a,{received:a.data,code:F.invalid_literal,expected:this._def.value}),ne}return{status:"valid",value:e.data}}get value(){return this._def.value}};Cs.create=(t,e)=>new Cs({value:t,typeName:ie.ZodLiteral,...me(e)});function O2(t,e){return new ws({values:t,typeName:ie.ZodEnum,...me(e)})}var ws=class t extends ve{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return $(a,{expected:Ce.joinValues(r),received:a.parsedType,code:F.invalid_type}),ne}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 $(a,{received:a.data,code:F.invalid_enum_value,options:r}),ne}return aa(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})}};ws.create=O2;var ks=class extends ve{_parse(e){let a=Ce.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==W.string&&r.parsedType!==W.number){let n=Ce.objectValues(a);return $(r,{expected:Ce.joinValues(n),received:r.parsedType,code:F.invalid_type}),ne}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=Ce.objectValues(a);return $(r,{received:r.data,code:F.invalid_enum_value,options:n}),ne}return aa(e.data)}get enum(){return this._def.values}};ks.create=(t,e)=>new ks({values:t,typeName:ie.ZodNativeEnum,...me(e)});var li=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==W.promise&&a.common.async===!1)return $(a,{code:F.invalid_type,expected:W.promise,received:a.parsedType}),ne;let r=a.parsedType===W.promise?a.data:Promise.resolve(a.data);return aa(r.then(n=>this._def.type.parseAsync(n,{path:a.path,errorMap:a.common.contextualErrorMap})))}};li.create=(t,e)=>new li({type:t,typeName:ie.ZodPromise,...me(e)});var mr=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ie.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=>{$(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 ne;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?ne:l.status==="dirty"?ps(l.value):a.value==="dirty"?ps(l.value):l});{if(a.value==="aborted")return ne;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?ne:s.status==="dirty"?ps(s.value):a.value==="dirty"?ps(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"?ne:(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"?ne:(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(!oi(i))return ne;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=>oi(i)?Promise.resolve(n.transform(i.value,o)).then(s=>({status:a.value,value:s})):ne);Ce.assertNever(n)}};mr.create=(t,e,a)=>new mr({schema:t,typeName:ie.ZodEffects,effect:e,...me(a)});mr.createWithPreprocess=(t,e,a)=>new mr({schema:e,effect:{type:"preprocess",transform:t},typeName:ie.ZodEffects,...me(a)});var pr=class extends ve{_parse(e){return this._getType(e)===W.undefined?aa(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pr.create=(t,e)=>new pr({innerType:t,typeName:ie.ZodOptional,...me(e)});var cn=class extends ve{_parse(e){return this._getType(e)===W.null?aa(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cn.create=(t,e)=>new cn({innerType:t,typeName:ie.ZodNullable,...me(e)});var Ls=class extends ve{_parse(e){let{ctx:a}=this._processInputParams(e),r=a.data;return a.parsedType===W.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:a.path,parent:a})}removeDefault(){return this._def.innerType}};Ls.create=(t,e)=>new Ls({innerType:t,typeName:ie.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...me(e)});var Is=class extends ve{_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 lu(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ea(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ea(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Is.create=(t,e)=>new Is({innerType:t,typeName:ie.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...me(e)});var hu=class extends ve{_parse(e){if(this._getType(e)!==W.nan){let r=this._getOrReturnCtx(e);return $(r,{code:F.invalid_type,expected:W.nan,received:r.parsedType}),ne}return{status:"valid",value:e.data}}};hu.create=t=>new hu({typeName:ie.ZodNaN,...me(t)});var Ez=Symbol("zod_brand"),Yd=class extends ve{_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}},Kd=class t extends ve{_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"?ne:o.status==="dirty"?(a.dirty(),ps(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"?ne: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:ie.ZodPipeline})}},As=class extends ve{_parse(e){let a=this._def.innerType._parse(e),r=n=>(oi(n)&&(n.value=Object.freeze(n.value)),n);return lu(a)?a.then(n=>r(n)):r(a)}unwrap(){return this._def.innerType}};As.create=(t,e)=>new As({innerType:t,typeName:ie.ZodReadonly,...me(e)});function E2(t,e){let a=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof a=="string"?{message:a}:a}function D2(t,e={},a){return t?si.create().superRefine((r,n)=>{let o=t(r);if(o instanceof Promise)return o.then(i=>{if(!i){let s=E2(e,r),l=s.fatal??a??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let i=E2(e,r),s=i.fatal??a??!0;n.addIssue({code:"custom",...i,fatal:s})}}):si.create()}var Tz={object:Ta.lazycreate},ie;(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"})(ie||(ie={}));var Rz=(t,e={message:`Input not instance of ${t.name}`})=>D2(a=>a instanceof t,e),N2=ii.create,B2=hs.create,Mz=hu.create,Oz=ms.create,P2=gs.create,Dz=vs.create,Nz=cu.create,Bz=ys.create,Pz=xs.create,Fz=si.create,Hz=Jn.create,Uz=Or.create,zz=du.create,qz=eo.create,$z=Ta.create,Vz=Ta.strictCreate,jz=bs.create,Gz=ig.create,Zz=Ss.create,Wz=un.create,Xz=sg.create,Yz=fu.create,Kz=pu.create,Qz=lg.create,Jz=_s.create,e5=Cs.create,t5=ws.create,a5=ks.create,r5=li.create,n5=mr.create,o5=pr.create,i5=cn.create,s5=mr.createWithPreprocess,l5=Kd.create,u5=()=>N2().optional(),c5=()=>B2().optional(),d5=()=>P2().optional(),f5={string:(t=>ii.create({...t,coerce:!0})),number:(t=>hs.create({...t,coerce:!0})),boolean:(t=>gs.create({...t,coerce:!0})),bigint:(t=>ms.create({...t,coerce:!0})),date:(t=>vs.create({...t,coerce:!0}))};var p5=ne;var h5=D.object({selector:D.string(),route:D.union([D.string(),D.array(D.string())])}).strict(),ug=D.object({type:D.literal("page_url"),url:D.string()}),cg=D.object({type:D.literal("route"),routeId:D.string()}),dg=D.object({type:D.literal("anchor_visible"),anchorId:D.string(),state:D.enum(["visible","present","absent"])}),fg=D.object({type:D.literal("event_occurred"),eventName:D.string(),withinMs:D.number().optional()}),pg=D.object({type:D.literal("state_equals"),key:D.string(),value:D.unknown()}),hg=D.object({type:D.literal("viewport"),minWidth:D.number().optional(),maxWidth:D.number().optional(),minHeight:D.number().optional(),maxHeight:D.number().optional()}),mg=D.object({type:D.literal("session_metric"),key:D.string(),operator:D.enum(["gte","lte","eq","gt","lt"]),threshold:D.number()}),gg=D.object({type:D.literal("dismissed"),key:D.string(),inverted:D.boolean().optional()}),vg=D.object({type:D.literal("cooldown_active"),key:D.string(),inverted:D.boolean().optional()}),yg=D.object({type:D.literal("frequency_limit"),key:D.string(),limit:D.number(),inverted:D.boolean().optional()}),mu=D.object({equals:D.union([D.string(),D.number(),D.boolean()]).optional(),contains:D.string().optional()}),gu=D.object({events:D.array(D.string()).min(1),match:D.record(D.string(),mu).optional()}),xg=D.object({type:D.literal("event_count"),key:D.string(),operator:D.enum(["gte","lte","eq","gt","lt"]),count:D.number().int().min(0),withinMs:D.number().positive().optional(),counter:gu.optional()}),to=D.discriminatedUnion("type",[ug,cg,dg,fg,pg,hg,mg,gg,vg,yg,xg]),vu=D.object({conditions:D.array(to),value:D.unknown()}),yu=D.object({type:D.literal("rules"),rules:D.array(vu),default:D.unknown()}),xu=D.object({type:D.literal("score"),field:D.string(),threshold:D.number(),above:D.unknown(),below:D.unknown()}),bu=D.object({type:D.literal("model"),modelId:D.string(),inputs:D.array(D.string()),outputMapping:D.record(D.string(),D.unknown()),default:D.unknown()}),Su=D.object({type:D.literal("external"),endpoint:D.string(),method:D.enum(["GET","POST"]).optional(),default:D.unknown(),timeoutMs:D.number().optional()}),_u=D.discriminatedUnion("type",[yu,xu,bu,Su]),Qd=_u.nullable().optional(),m5=D.object({events:D.array(D.string()),urlContains:D.string().optional(),props:D.record(D.union([D.string(),D.number(),D.boolean()])).optional()}),g5=D.object({title:D.string().optional(),body:D.string().optional(),icon:D.string().optional()}).nullable().optional();var c_=v.object({include:v.array(v.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:v.array(v.string()).optional().describe("URL patterns where this tile should NOT appear. Evaluated before include.")}),Jd=v.object({routes:c_,onlyIfPopulated:v.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 v5(t){return to.safeParse(t)}function y5(t){return _u.safeParse(t)}function x5(t){return Jd.safeParse(t)}var b5=[{defName:"matchOp",schema:mu},{defName:"counterDef",schema:gu},{defName:"activationConfig",schema:Jd},{defName:"routeFilter",schema:c_},{defName:"ruleStrategy",schema:yu},{defName:"scoreStrategy",schema:xu},{defName:"modelStrategy",schema:bu},{defName:"externalStrategy",schema:Su},{defName:"rule",schema:vu},{defName:"condition",schema:to}];var d_=v.object({tileId:v.string(),itemId:v.string().optional()}).strict(),S5=v.object({on:v.string(),title:v.string(),body:v.string().optional(),icon:v.string().optional(),ttl:v.number().optional(),cooldown:v.number().optional(),deepLink:d_.optional()}).strict(),_5=v.object({id:v.string(),title:v.string().optional(),subtitle:v.string().optional(),icon:v.string().optional(),priority:v.number().optional(),widget:v.string(),props:v.record(v.unknown()).optional(),activation:Jd.optional(),notifications:v.array(S5).optional()}).strict(),C5=v.object({position:v.enum(["left","right"]).optional(),layout:v.enum(["overlay","push"]).optional(),background:v.string().optional(),blur:v.string().optional(),border:v.string().optional(),width:v.string().optional(),transitionDuration:v.string().optional(),transitionEasing:v.string().optional(),transitionFade:v.string().optional()}),w5=v.object({background:v.string().optional(),backgroundHover:v.string().optional(),color:v.string().optional(),size:v.string().optional(),shadow:v.string().optional(),borderRadius:v.string().optional()}),k5=v.object({background:v.string().optional(),backgroundHover:v.string().optional(),border:v.string().optional(),borderRadius:v.string().optional(),shadow:v.string().optional(),titleColor:v.string().optional(),textColor:v.string().optional(),iconBackground:v.string().optional(),iconShadow:v.string().optional(),headerPadding:v.string().optional(),bodyPadding:v.string().optional(),gap:v.string().optional()}),L5=v.object({background:v.string().optional(),textColor:v.string().optional(),titleColor:v.string().optional(),arrowColor:v.string().optional(),arrowSize:v.string().optional(),border:v.string().optional(),borderRadius:v.string().optional(),scrimOpacity:v.string().optional(),highlightRing:v.string().optional()}),I5=v.object({background:v.string().optional(),textColor:v.string().optional(),textSecondaryColor:v.string().optional(),border:v.string().optional(),borderRadius:v.string().optional(),successColor:v.string().optional(),warningColor:v.string().optional(),errorColor:v.string().optional(),iconBackground:v.string().optional(),progressGradient:v.string().optional()}),A5=v.object({background:v.string().optional(),backgroundHover:v.string().optional(),border:v.string().optional(),borderRadius:v.string().optional(),textColor:v.string().optional(),textSecondaryColor:v.string().optional(),itemDivider:v.string().optional(),itemGap:v.string().optional(),itemPadding:v.string().optional(),itemFontSize:v.string().optional(),bodyPadding:v.string().optional(),bodyFontSize:v.string().optional(),categoryPadding:v.string().optional(),categoryGap:v.string().optional(),categoryFontSize:v.string().optional(),searchBackground:v.string().optional(),searchColor:v.string().optional(),chevronColor:v.string().optional()}),E5=v.object({mode:v.enum(["dark","light"]).optional(),fontFamily:v.string().optional(),colorPrimary:v.string().optional(),colorPrimaryHover:v.string().optional(),borderRadius:v.string().optional(),canvas:C5.optional(),launcher:w5.optional(),tile:k5.optional(),overlay:L5.optional(),notification:I5.optional(),content:A5.optional()}).strict(),T5=v.object({enabled:v.boolean().optional(),label:v.string().optional(),icon:v.string().optional(),position:v.string().optional(),animate:v.boolean().optional(),animationStyle:v.enum(["pulse","bounce","glow"]).optional(),notificationCount:v.number().optional()}).strict(),$7=v.object({schemaVersion:v.string().optional(),fetchedAt:v.string().datetime(),configVersion:v.string().optional(),canvasTitle:v.string().optional(),tiles:v.array(_5),actions:v.array(v.any()),theme:E5.optional(),launcher:T5.optional(),meta:v.object({verificationSteps:v.array(v.union([v.string(),v.object({text:v.string(),check:to.optional()})])).optional()}).passthrough().optional()}).strict();var Ht={triggerWhen:Qd},Za=v.object({selector:v.string(),route:v.union([v.string(),v.array(v.string())])}).strict(),f_=v.object({color:v.string().optional(),scrimOpacity:v.number().min(0).max(1).optional(),paddingPx:v.number().optional(),radiusPx:v.number().optional()}).strict(),p_=v.enum(["top-left","top-right","bottom-left","bottom-right"]),h_=v.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),Sg=v.object({label:v.string(),actionId:v.string(),primary:v.boolean().optional()}).strict(),m_=v.object({title:v.string().optional(),body:v.string(),ctaButtons:v.array(Sg).optional()}).strict(),g_=v.object({title:v.string().optional(),body:v.string()}).strict(),v_=v.enum(["before","after","prepend","append","replace"]),y_=v.enum(["immediate","hover","click"]),x_=v.object({widgetId:v.string(),props:v.record(v.unknown()).optional(),priority:v.number().optional()}).strict(),b_=v.object({id:v.string(),action:v.any(),route:v.string().optional(),onAction:v.record(v.string()).optional()}).passthrough(),S_=v.enum(["auto","smooth","instant"]),bg=v.enum(["start","center","end","nearest"]),__=v.object({kind:v.literal("content:setText"),anchorId:Za,text:v.string(),label:v.string().optional()}).extend(Ht).strict(),C_=v.object({kind:v.literal("content:setAttr"),anchorId:Za,attr:v.string(),value:v.string(),label:v.string().optional()}).extend(Ht).strict(),w_=v.object({kind:v.literal("content:addClass"),anchorId:Za,className:v.string(),label:v.string().optional()}).extend(Ht).strict(),k_=v.object({kind:v.literal("content:removeClass"),anchorId:Za,className:v.string(),label:v.string().optional()}).extend(Ht).strict(),L_=v.object({kind:v.literal("content:setStyle"),anchorId:Za,styles:v.record(v.string()),label:v.string().optional()}).extend(Ht).strict(),I_=v.object({kind:v.literal("content:insertHtml"),anchorId:Za,html:v.string(),position:v_,deepLink:d_.optional(),label:v.string().optional()}).extend(Ht).strict(),A_=v.object({kind:v.literal("overlays:highlight"),anchorId:Za,style:f_.optional(),duration:v.number().optional(),label:v.string().optional()}).extend(Ht).strict(),E_=v.object({kind:v.literal("overlays:pulse"),anchorId:Za,duration:v.number().optional(),label:v.string().optional()}).extend(Ht).strict(),T_=v.object({kind:v.literal("overlays:badge"),anchorId:Za,content:v.string(),position:p_.optional(),label:v.string().optional()}).extend(Ht).strict(),R_=v.object({kind:v.literal("overlays:tooltip"),anchorId:Za,content:m_,trigger:y_.optional(),placement:h_.optional(),waitFor:v.string().optional(),label:v.string().optional()}).extend(Ht).strict(),M_=v.object({kind:v.literal("overlays:modal"),content:g_,size:v.enum(["sm","md","lg"]).optional(),blocking:v.boolean().optional(),scrim:v.object({opacity:v.number().min(0).max(1).optional()}).strict().optional(),dismiss:v.object({onEsc:v.boolean().optional(),closeButton:v.boolean().optional(),timeoutMs:v.number().min(0).optional()}).strict().optional(),ctaButtons:v.array(Sg).optional(),waitFor:v.string().optional(),label:v.string().optional()}).extend(Ht).strict(),O_=v.object({kind:v.literal("navigation:scrollTo"),anchorId:Za,behavior:S_.optional(),block:bg.optional(),inline:bg.optional(),label:v.string().optional()}).extend(Ht).strict(),D_=v.object({kind:v.literal("navigation:navigate"),url:v.string(),target:v.enum(["_self","_blank"]).optional(),label:v.string().optional()}).extend(Ht).strict(),N_=v.object({kind:v.literal("core:mountWidget"),slot:v.string(),widget:x_,label:v.string().optional()}).extend(Ht).strict(),B_=v.object({kind:v.literal("core:wait"),durationMs:v.number().min(0).optional(),event:v.string().optional(),label:v.string().optional()}).extend(Ht).strict(),P_=v.object({kind:v.literal("core:sequence"),actions:v.array(v.any()),label:v.string().optional()}).extend(Ht).strict(),F_=v.object({kind:v.literal("core:parallel"),actions:v.array(v.any()),waitFor:v.enum(["all","any"]).optional(),label:v.string().optional()}).extend(Ht).strict(),H_=v.object({kind:v.literal("core:tour"),tourId:v.string(),steps:v.array(b_).min(1),startStep:v.string().optional(),autoStart:v.boolean().optional(),label:v.string().optional()}).extend(Ht).passthrough(),F2=[{defName:"setText",schema:__},{defName:"setAttr",schema:C_},{defName:"addClass",schema:w_},{defName:"removeClass",schema:k_},{defName:"setStyle",schema:L_},{defName:"insertHtml",schema:I_},{defName:"highlight",schema:A_},{defName:"pulse",schema:E_},{defName:"badge",schema:T_},{defName:"tooltip",schema:R_},{defName:"modal",schema:M_},{defName:"scrollTo",schema:O_},{defName:"navigate",schema:D_},{defName:"mountWidget",schema:N_},{defName:"wait",schema:B_},{defName:"sequence",schema:P_},{defName:"parallel",schema:F_},{defName:"tour",schema:H_}];function _g(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(b){if(!e)return null;try{return e.matches(b)?e:e.querySelector(b)}catch{return null}}function l(){for(let[b,m]of r){let h=s(b);if(h){for(let g of m)clearTimeout(g.timer),g.resolve(h);r.delete(b)}}for(let[b,m]of n){let h=s(b);if(h){for(let g of m)g.cancelled||g.cb(h);n.delete(b)}}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(b,m){let h=r.get(b);h&&(h.delete(m),h.size===0&&r.delete(b)),r.size===0&&n.size===0&&c()}function f(b,m){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let h=s(b);if(h)return Promise.resolve(h);let g=m??a;return new Promise((y,C)=>{let w={resolve:y,reject:C,timer:setTimeout(()=>{d(b,w),C(new Error(`waitFor("${b}") timed out after ${g}ms`))},g)},_=r.get(b);_||(_=new Set,r.set(b,_)),_.add(w),u()})}function p(b,m){if(i)return()=>{};let h=s(b);if(h)return m(h),()=>{};let g={cb:m,cancelled:!1},y=n.get(b);return y||(y=new Set,n.set(b,y)),y.add(g),u(),()=>{g.cancelled=!0;let C=n.get(b);C&&(C.delete(g),C.size===0&&n.delete(b)),r.size===0&&n.size===0&&c()}}function S(){let b=0;for(let m of r.values())b+=m.size;return b}function x(){i=!0,c();let b=new Error("AnchorResolver destroyed");for(let m of r.values())for(let h of m)clearTimeout(h.timer),h.reject(b);r.clear(),n.clear()}return{resolve:s,waitFor:f,onAppear:p,pendingCount:S,destroy:x}}function R5(){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 U_(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(H2(a,r))return}if(e.include){for(let r of e.include)if(H2(a,r))return r;return}return a}function H2(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 ef=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=R5(),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=U_(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=U_(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=U_(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 Cg(t){return new ef(t)}var U2=v.object({url:v.string(),routeId:v.string().optional(),title:v.string().optional(),locale:v.string().optional()}),z2=v.object({url:v.string(),ts:v.number()}),q2=v.object({sessionId:v.string(),startTs:v.number(),pageHistory:v.array(z2).optional()}),$2=v.object({width:v.number(),height:v.number()}),V2=v.object({x:v.number(),y:v.number(),w:v.number(),h:v.number()}),j2=v.object({anchorId:v.string(),present:v.boolean(),visible:v.boolean().optional(),boundingBox:V2.optional()}),G2=v.record(v.string(),v.union([v.number(),v.string(),v.boolean(),v.undefined()])),Z2=v.object({page:U2,session:q2,viewport:$2,anchors:v.array(j2).optional(),augmented:G2.optional()});function M5(t){return Z2.safeParse(t)}function z_(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=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(!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 q_(t,e){let a=[];for(let r of t.conditions){let n=z_(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function tf(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=q_(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 af(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 W2(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 $_(t,e,a={}){let r=W2(e,a);switch(t.type){case"rules":return tf(t,r);case"score":return af(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 V_(t,e,a={}){let r=W2(e,a);switch(t.type){case"rules":return tf(t,r);case"score":return af(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 wg(t){return{evaluate:(e,a)=>$_(e,a,t),evaluateSync:(e,a)=>V_(e,a,t)}}function kg(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 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 n)try{d()}catch(f){console.error("[EventAccumulator] Subscriber error:",f)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let f=`ev:${u}`,p=r.get(f);if(p){d&&!p.needsTimestamps&&(p.needsTimestamps=!0);return}r.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 p=Date.now()-c;return f.timestamps.filter(S=>S>=p).length},subscribe(u){return n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}var X2="app:",O5="syntro:",D5=/^[a-z][a-z0-9_]*$/;function Lg(t){if(!t)return{valid:!1,reason:"Event name cannot be empty"};if(t.startsWith(O5))return{valid:!1,reason:'"syntro:" prefix is reserved for internal SDK events'};if(!t.startsWith(X2))return{valid:!1,reason:`Custom events must start with "app:" prefix. Got: "${t}"`};let e=t.slice(X2.length).split(":");if(e.length<2)return{valid:!1,reason:`Event name must have at least 2 segments after "app:" (app:{category}:{action}). Got: "${t}"`};for(let a of e)if(!D5.test(a))return{valid:!1,reason:`Segment "${a}" must be lowercase alphanumeric + underscores. Got: "${t}"`};return{valid:!0}}function N5(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null}function Y2(t,e,a=0){if(a>=e)return!1;for(let r of Object.values(t))if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!Y2(r,e,a+1))return!1;return!0}function Ig(t){if(t===void 0)return{valid:!0};if(t===null||typeof t!="object"||Array.isArray(t))return{valid:!1,reason:"Props must be a plain object"};if(!Y2(t,2))return{valid:!1,reason:"Props nesting depth exceeds 2 levels"};let e=[];for(let[a,r]of Object.entries(t))r!==null&&typeof r=="object"||N5(r)||e.push(a);return e.length>0?{valid:!0,stripped:e}:{valid:!0}}function Ag(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 rf=class{constructor(e={}){B(this,"subscriptions",new Set);B(this,"history",[]);B(this,"maxHistorySize");B(this,"debug");B(this,"emitHistory");B(this,"posthogCapture");B(this,"testMode");this.maxHistorySize=e.maxHistorySize??100,this.debug=e.debug??!1,this.emitHistory=e.history??null,this.posthogCapture=e.posthogCapture??null,this.testMode=e.testMode??!1}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:ht};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(Ag(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}emit(e,a){let r=Lg(e);if(!r.valid)return console.warn(`[EventBus] emit() rejected: ${r.reason}`),this.debug?{delivered:!1,matchedRules:[],posthogCaptured:!1,listenersNotified:0}:void 0;let n=Ig(a);if(!n.valid)return console.warn(`[EventBus] emit() rejected props: ${n.reason}`),this.debug?{delivered:!1,matchedRules:[],posthogCaptured:!1,listenersNotified:0}:void 0;let o={ts:Date.now(),name:e,source:"custom",props:a,schemaVersion:ht};this.history.push(o),this.history.length>this.maxHistorySize&&this.history.shift();let i=0;for(let l of this.subscriptions)if(Ag(o,l.filter))try{l.callback(o),i++}catch(u){console.error("[EventBus] Subscriber error:",u),i++}let s=!1;if(this.posthogCapture&&!this.testMode)try{this.posthogCapture(e,a),s=!0}catch(l){console.error("[EventBus] PostHog capture error:",l)}if(this.emitHistory&&this.emitHistory.record({name:e,props:a,source:"custom",timestamp:o.ts,matchedRules:[]}),this.debug)return console.debug("[EventBus] emit()",{name:e,props:a,listenersNotified:i,posthogCaptured:s}),{delivered:!0,matchedRules:[],posthogCaptured:s,listenersNotified:i}}setPosthogCapture(e){this.posthogCapture=e}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>Ag(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=>Ag(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 Cu(t={}){return new rf(t)}var wu=class{constructor(e=100){B(this,"entries",[]);B(this,"maxSize");this.maxSize=e}record(e){this.entries.push(e),this.maxSize>0&&this.entries.length>this.maxSize&&this.entries.shift()}getAll(){return[...this.entries]}clear(){this.entries=[]}};var j_=v.enum(["posthog","canvas","derived"]),K2=v.object({ts:v.number(),name:v.string(),source:j_,props:v.record(v.string(),v.unknown()).optional(),schemaVersion:v.string()}),Q2=v.object({names:v.array(v.string()).optional(),patterns:v.array(v.string()).optional(),sources:v.array(j_).optional()});function B5(t){return K2.safeParse(t)}function P5(t){return Q2.safeParse(t)}var ku=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 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 G_="cooldown:";function J2(t){return{set(e,a){let r=G_+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=G_+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=G_+e;t.remove(a)}}}var nf="dismissed:";function eM(t,e){return{mark(a,r=!1){let n=nf+a;(r?e:t).set(n,!0)},isDismissed(a){let r=nf+a;return t.has(r)||e.has(r)},clear(a){let r=nf+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(nf)&&t.remove(a);for(let a of e.keys())a.startsWith(nf)&&e.remove(a)}}}var Z_="freq:";function tM(t){function e(a){let r=Z_+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=Z_+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=Z_+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var F5="syntro";function W_(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 of(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 sf=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??F5;let a=r=>typeof r=="object"&&r!==null&&typeof r.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?W_(window.sessionStorage,this.namespace):of(this.namespace),this.user=a(window.localStorage)?W_(window.localStorage,this.namespace):of(this.namespace)):(this.session=of(this.namespace),this.user=of(this.namespace)),this.dismissals=eM(this.session,this.user),this.cooldowns=J2(this.user),this.frequency=tM(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?W_(sessionStorage,a):of(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function Eg(t={}){return new sf(t)}function oM(t){let e=pt(t),a=parseFloat(e.width)||0,r=parseFloat(e.height)||0,n=kt(t),o=n?t.offsetWidth:a,i=n?t.offsetHeight:r,s=$r(a)!==o||$r(r)!==i;return s&&(a=o,r=i),{width:a,height:r,$:s}}function Y_(t){return ft(t)?t:t.contextElement}function Lu(t){let e=Y_(t);if(!kt(e))return ct(1);let a=e.getBoundingClientRect(),{width:r,height:n,$:o}=oM(e),i=(o?$r(a.width):a.width)/r,s=(o?$r(a.height):a.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var H5=ct(0);function iM(t){let e=dt(t);return!Di()||!e.visualViewport?H5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function U5(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==dt(t)?!1:e}function Es(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);let n=t.getBoundingClientRect(),o=Y_(t),i=ct(1);e&&(r?ft(r)&&(i=Lu(r)):i=Lu(t));let s=U5(o,a,r)?iM(o):ct(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 f=dt(o),p=r&&ft(r)?dt(r):r,S=f,x=Ni(S);for(;x&&r&&p!==S;){let b=Lu(x),m=x.getBoundingClientRect(),h=pt(x),g=m.left+(x.clientLeft+parseFloat(h.paddingLeft))*b.x,y=m.top+(x.clientTop+parseFloat(h.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=g,u+=y,S=dt(x),x=Ni(S)}}return jr({width:c,height:d,x:l,y:u})}function Tg(t,e){let a=Wr(t).scrollLeft;return e?e.left+a:Es(yt(t)).left+a}function sM(t,e){let a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Tg(t,a),n=a.top+e.scrollTop;return{x:r,y:n}}function z5(t){let{elements:e,rect:a,offsetParent:r,strategy:n}=t,o=n==="fixed",i=yt(r),s=e?Mn(e.floating):!1;if(r===i||s&&o)return a;let l={scrollLeft:0,scrollTop:0},u=ct(1),c=ct(0),d=kt(r);if((d||!d&&!o)&&((Sr(r)!=="body"||Zr(i))&&(l=Wr(r)),kt(r))){let p=Es(r);u=Lu(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}let f=i&&!d&&!o?sM(i,l):ct(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 q5(t){return Array.from(t.getClientRects())}function $5(t){let e=yt(t),a=Wr(t),r=t.ownerDocument.body,n=Jt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Jt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),i=-a.scrollLeft+Tg(t),s=-a.scrollTop;return pt(r).direction==="rtl"&&(i+=Jt(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:i,y:s}}var aM=25;function V5(t,e){let a=dt(t),r=yt(t),n=a.visualViewport,o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(n){o=n.width,i=n.height;let c=Di();(!c||c&&e==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}let u=Tg(r);if(u<=0){let c=r.ownerDocument,d=c.body,f=getComputedStyle(d),p=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(r.clientWidth-d.clientWidth-p);S<=aM&&(o-=S)}else u<=aM&&(o+=u);return{width:o,height:i,x:s,y:l}}var j5=new Set(["absolute","fixed"]);function G5(t,e){let a=Es(t,!0,e==="fixed"),r=a.top+t.clientTop,n=a.left+t.clientLeft,o=kt(t)?Lu(t):ct(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 rM(t,e,a){let r;if(e==="viewport")r=V5(t,a);else if(e==="document")r=$5(yt(t));else if(ft(e))r=G5(e,a);else{let n=iM(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return jr(r)}function lM(t,e){let a=sa(t);return a===e||!ft(a)||ir(a)?!1:pt(a).position==="fixed"||lM(a,e)}function Z5(t,e){let a=e.get(t);if(a)return a;let r=Gr(t,[],!1).filter(s=>ft(s)&&Sr(s)!=="body"),n=null,o=pt(t).position==="fixed",i=o?sa(t):t;for(;ft(i)&&!ir(i);){let s=pt(i),l=Oi(i);!l&&s.position==="fixed"&&(n=null),(o?!l&&!n:!l&&s.position==="static"&&!!n&&j5.has(n.position)||Zr(i)&&!l&&lM(t,i))?r=r.filter(c=>c!==i):n=s,i=sa(i)}return e.set(t,r),r}function W5(t){let{element:e,boundary:a,rootBoundary:r,strategy:n}=t,i=[...a==="clippingAncestors"?Mn(e)?[]:Z5(e,this._c):[].concat(a),r],s=i[0],l=i.reduce((u,c)=>{let d=rM(e,c,n);return u.top=Jt(d.top,u.top),u.right=or(d.right,u.right),u.bottom=or(d.bottom,u.bottom),u.left=Jt(d.left,u.left),u},rM(e,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function X5(t){let{width:e,height:a}=oM(t);return{width:e,height:a}}function Y5(t,e,a){let r=kt(e),n=yt(e),o=a==="fixed",i=Es(t,!0,o,e),s={scrollLeft:0,scrollTop:0},l=ct(0);function u(){l.x=Tg(n)}if(r||!r&&!o)if((Sr(e)!=="body"||Zr(n))&&(s=Wr(e)),r){let p=Es(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else n&&u();o&&!r&&n&&u();let c=n&&!r&&!o?sM(n,s):ct(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 X_(t){return pt(t).position==="static"}function nM(t,e){if(!kt(t)||pt(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return yt(t)===a&&(a=a.ownerDocument.body),a}function uM(t,e){let a=dt(t);if(Mn(t))return a;if(!kt(t)){let n=sa(t);for(;n&&!ir(n);){if(ft(n)&&!X_(n))return n;n=sa(n)}return a}let r=nM(t,e);for(;r&&Jp(r)&&X_(r);)r=nM(r,e);return r&&ir(r)&&X_(r)&&!Oi(r)?a:r||eh(t)||a}var K5=async function(t){let e=this.getOffsetParent||uM,a=this.getDimensions,r=await a(t.floating);return{reference:Y5(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Q5(t){return pt(t).direction==="rtl"}var J5={convertOffsetParentRelativeRectToViewportRelativeRect:z5,getDocumentElement:yt,getClippingRect:W5,getOffsetParent:uM,getElementRects:K5,getClientRects:q5,getDimensions:X5,getScale:Lu,isElement:ft,isRTL:Q5};function cM(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function eq(t,e){let a=null,r,n=yt(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:f,height:p}=u;if(s||e(),!f||!p)return;let S=Vr(d),x=Vr(n.clientWidth-(c+f)),b=Vr(n.clientHeight-(d+p)),m=Vr(c),g={rootMargin:-S+"px "+-x+"px "+-b+"px "+-m+"px",threshold:Jt(0,or(1,l))||1},y=!0;function C(w){let _=w[0].intersectionRatio;if(_!==l){if(!y)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!cM(u,t.getBoundingClientRect())&&i(),y=!1}try{a=new IntersectionObserver(C,{...g,root:n.ownerDocument})}catch{a=new IntersectionObserver(C,g)}a.observe(t)}return i(!0),o}function dM(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=Y_(t),c=n||o?[...u?Gr(u):[],...Gr(e)]:[];c.forEach(m=>{n&&m.addEventListener("scroll",a,{passive:!0}),o&&m.addEventListener("resize",a)});let d=u&&s?eq(u,a):null,f=-1,p=null;i&&(p=new ResizeObserver(m=>{let[h]=m;h&&h.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=p)==null||g.observe(e)})),a()}),u&&!l&&p.observe(u),p.observe(e));let S,x=l?Es(t):null;l&&b();function b(){let m=Es(t);x&&!cM(x,m)&&a(),x=m,S=requestAnimationFrame(b)}return a(),()=>{var m;c.forEach(h=>{n&&h.removeEventListener("scroll",a),o&&h.removeEventListener("resize",a)}),d?.(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(S)}}var fM=Yp;var pM=Kp,hM=Xp;var mM=(t,e,a)=>{let r=new Map,n={platform:J5,...a},o={...n.platform,_c:r};return Wp(t,e,{...n,platform:o})};function Iu(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function lf(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var K_={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"}},Au={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:[]},gM={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function Rg(t,e,a){let r=K_[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 Mg(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[fM(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(hM()),a.shift!==!1&&n.push(pM({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",dM(e,t,async()=>{let{x:i,y:s,strategy:l}=await mM(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function Og(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 Dg(t,e){return e==="none"||Au[e].length===0?null:t.animate(Au[e],gM)}function Ng(t,e){if(e==="none"||Au[e].length===0)return Promise.resolve();let a=[...Au[e]].reverse(),r=t.animate(a,gM);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function Bg(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 Pg(t){switch(Iu(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 vM(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(),f=c.startsWith("on"),p=(c==="href"||c==="src")&&d.startsWith("javascript:");(f||p)&&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 tq=0;function Fg(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-${++tq}`}function c(y,C){a&&a.publish(y,C)}function d(y){let C=l.get(y);if(C){let w=b(y);for(let _ of C)try{_(w)}catch(k){console.error("[Surfaces] State callback error:",k)}}}let f=new Map;function p(y,C,w){switch(C.type){case"html":y.innerHTML=vM(C.content);return;case"widget":{if(o?.has(C.widgetId)){let _=o.mount(C.widgetId,y,C.config);return w&&f.set(w,_),()=>{_.unmount(),w&&f.delete(w)}}console.warn(`[Surfaces] Widget not found: ${C.widgetId}`),y.innerHTML=`<div data-widget-id="${C.widgetId}" data-widget-missing="true">Widget: ${C.widgetId}</div>`;return}case"custom":return C.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,C,w){let _=u(),k=Iu(y),A=w?.priority??0,I=w?.animation??n,R=w?.exclusive??!0,U=i.get(y);if(U&&R){if(U.options.priority>A)throw new Error(`Slot ${y} is occupied by higher priority content (${U.options.priority} > ${A})`);x(U)}let E=Bg(y,_);E.style.zIndex=String(Pg(y));let N;if(k==="static")Rg(E,y,w?.constraints),e.appendChild(E);else if(k==="inline"){let z=lf(y);if(!z)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let Q=r({selector:z,route:"**"});if(!Q)throw new Error(`Anchor not found for inline slot: ${z}`);N=Og(E,Q)}else if(k==="adjacent"){let z=lf(y);if(!z)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let Q=r({selector:z,route:"**"});if(!Q)throw new Error(`Anchor not found for adjacent slot: ${z}`);e.appendChild(E),N=Mg(E,Q,w?.position??{placement:"bottom"})}let O=p(E,C,_);Dg(E,I);let H={id:_,slot:y,content:C,options:{priority:A,exclusive:R,animation:I,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:E,cleanup:()=>{N?.(),O?.()},mountedAt:Date.now()};return i.set(y,H),s.set(y,(s.get(y)??0)+1),c("surface.mounted",{slot:y,id:_,adaptiveId:w?.adaptiveId}),d(y),{id:_,update(z){let Q=i.get(y);if(!Q||Q.id!==_)throw new Error("Mount no longer active");let we=f.get(_);if(we){if(z.type==="widget"){we.update(z.config),Q.content=z;return}we.unmount(),f.delete(_)}Q.container.innerHTML="";let Me=p(Q.container,z,_);if(Q.content=z,Me){let bt=Q.cleanup;Q.cleanup=()=>{bt?.(),Me()}}},setOptions(z){let Q=i.get(y);if(!Q||Q.id!==_)throw new Error("Mount no longer active");z.priority!==void 0&&(Q.options.priority=z.priority),z.animation!==void 0&&(Q.options.animation=z.animation),z.constraints&&k==="static"&&(z.constraints.maxWidth&&(Q.container.style.maxWidth=z.constraints.maxWidth),z.constraints.maxHeight&&(Q.container.style.maxHeight=z.constraints.maxHeight),z.constraints.minWidth&&(Q.container.style.minWidth=z.constraints.minWidth),z.constraints.minHeight&&(Q.container.style.minHeight=z.constraints.minHeight)),d(y)},async unmount(){let z=i.get(y);!z||z.id!==_||await x(z)},isMounted(){return i.get(y)?.id===_},getContainer(){let z=i.get(y);return z?.id===_?z.container:null}}}async function x(y){y.container.isConnected&&await Ng(y.container,y.options.animation);try{y.cleanup?.()}catch(C){console.warn("[Surfaces] Cleanup error during unmount, ignoring:",C)}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 C=i.get(y);return{slot:y,occupied:!!C,currentPriority:C?.options.priority,currentAdaptiveId:C?.options.adaptiveId,mountCount:s.get(y)??0,currentMountId:C?.id}}function m(y,C){let w=l.get(y);return w||(w=new Set,l.set(y,w)),w.add(C),()=>{w?.delete(C),w?.size===0&&l.delete(y)}}function h(y,C){let w=i.get(y);return w?C!==void 0?C>=w.options.priority:!1:!0}function g(){for(let y of i.values())try{y.cleanup?.(),y.container.remove()}catch(C){console.error("[Surfaces] Error during cleanup:",C)}i.clear(),l.clear()}return{mount:S,getState:b,onStateChange:m,canMount:h,destroy:g}}var uf=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,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&&(a.isConnected&&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},f=n.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(r){console.error("[WidgetRegistry] Listener error:",r)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},Hg=new uf;var J_="2.0.0";function aq(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(Q_(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(Q_(r,n))return!0;return!1}return!0}function Q_(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 yM(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>{let o=n;if(/^https?:\/\//.test(o))try{o=new URL(o).pathname}catch{}return Q_(a,o)})}function Ug(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??Hg,s=t.executors??sn,l=t.apps??wl,u=new ku,c=Cg({telemetry:e,routes:r,navigation:u}),d=t.events??Cu(),f=Eg({namespace:o}),p=kg({eventBus:d,stateStore:f}),S=wg({state:f,events:d,sessionMetrics:a,accumulator:p}),x=KA(),b=_g(),m=_=>yM(_)?b.resolve(_.selector):null,h=async(_,k)=>{if(!yM(_))return null;try{return await b.waitFor(_.selector,k)}catch{return null}},g=Fg({overlayRoot:x,eventBus:d,anchorResolver:m,widgetRegistry:i}),y=rg({overlayRoot:x,eventBus:d,surfaces:g,anchorResolver:m,waitForAnchor:h,executorRegistry:s,subscribeNavigation:_=>u.subscribe(_),runtime:{evaluateSync:_=>S.evaluateSync(_,c.get()),context:c,accumulator:p}}),C;if(a){a.increment("page_views");let _=typeof window<"u"?window.location.pathname:"/";C=u.subscribe((k,A)=>{if(A!=="replaceState")try{let I=new URL(k).pathname;I!==_&&(_=I,a.increment("page_views"))}catch{}})}let w={telemetry:e,context:c,events:d,state:f,sessionMetrics:a,actions:y,surfaces:g,widgets:i,executors:s,apps:l,accumulator:p,anchorResolver:b,navigation:u,version:J_,mode:n,async evaluate(_){return S.evaluate(_,c.get())},evaluateSync(_){return S.evaluateSync(_,c.get())},async filterTiles(_){let k=c.get().page.url,A=[];for(let I of _){let R=I.activation;if(!R){A.push(I);continue}if(aq(k,R.routes)){if(R.onlyIfPopulated){let U=I.props?.actions??[];if(U.length>0&&!U.some(N=>N.triggerWhen?S.evaluateSync(N.triggerWhen,c.get()).value:!0))continue}A.push(I)}}return A},setRoutes(_){c.setRoutes(_)},destroy(){l.unbind().catch(_=>{console.error("[Runtime] Error unbinding apps registry:",_)}),C?.(),b.destroy(),p.destroy(),u.destroy(),c.destroy(),y.destroy(),g.destroy()}};return l.bind(w),i.bindRuntime(w),w}var xM=v.object({value:v.unknown(),expiresAt:v.number().optional()}),bM=v.object({count:v.number(),resetAt:v.number().optional()});function rq(t){return xM.safeParse(t)}function nq(t){return bM.safeParse(t)}var eC="syn_";function Eu(t){if(!t.startsWith(eC))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(eC.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 zg(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return eC+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 _M="syntro_segment_attributes";function CM(){if(typeof window>"u")return{};try{let t=localStorage.getItem(_M);if(t){let e=JSON.parse(t);return te("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){_a("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function wM(t){if(!(typeof window>"u"))try{localStorage.setItem(_M,JSON.stringify(t)),te("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){_a("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function kM(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 tC(){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{let e=navigator.userAgent;e.includes("Edg/")?t.browser="Edge":e.includes("OPR/")||e.includes("Opera")?t.browser="Opera":e.includes("Chrome/")&&!e.includes("Chromium")?t.browser="Chrome":e.includes("Safari/")&&!e.includes("Chrome")?t.browser="Safari":e.includes("Firefox/")&&(t.browser="Firefox"),e.includes("Windows")?t.os="Windows":e.includes("iPhone")||e.includes("iPad")?t.os="iOS":e.includes("Mac OS X")||e.includes("Macintosh")?t.os="macOS":e.includes("Android")?t.os="Android":e.includes("Linux")&&(t.os="Linux")}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname,t.page_host=window.location.hostname,window.location.search&&(t.page_query=window.location.search)}catch{}return t}var SM="syntro_geo",LM="https://geo.syntrologie.com";async function aC(t){if(typeof window>"u")return{};try{let e=localStorage.getItem(SM);if(e){let a=JSON.parse(e);return te("Syntro Bootstrap","Geo: using cached data:",a),a}}catch{}try{let e=await fetch(t,{signal:AbortSignal.timeout(2e3)});if(e.ok){let a=await e.json(),r={};for(let[n,o]of Object.entries(a))typeof o=="string"&&o&&(r[n]=o);try{localStorage.setItem(SM,JSON.stringify(r))}catch{}return te("Syntro Bootstrap","Geo: fetched from worker:",r),r}}catch{}return{}}var IM={growthbook:t=>um({...t,autoInit:!0})};function AM(t,e){let a=IM[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(IM).join(", ")}`);return a(e)}var oq=["cdn.syntrologie.com","localhost","127.0.0.1"];function iq(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):oq.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 rC=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,!iq(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 sq(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 sq(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 EM(t){return new rC(t)}var lq="syntro_exp",uq="syntro_var",nC=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 n=new URLSearchParams(window.location.search),o=n.get(lq),i=n.get(uq);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:vh(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 TM(t){return new nC(t)}var cq="https://cdn.syntrologie.com/configs",RM={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return EM({baseUrl:t.baseUrl??cq,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return TM({featureKey:t.featureKey})}};function MM(t,e={}){let a=RM[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(RM).join(", ")}`);return a(e)}var OM={posthog:t=>Jm(t),noop:()=>ym()};function DM(t,e){let a=OM[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(OM).join(", ")}`);return a(e)}async function NM(t){gb(),te("Syntro Bootstrap","====== INIT ======"),te("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=_h();if(console.log(`[DIAG] Mode detection: sdkMode=${e}`),console.log("[DIAG] editorSource:",Vc()),console.log("[DIAG] editorConf:",Sh()),te("Syntro Bootstrap","SDK mode:",e??"normal"),!e&&typeof window<"u"){let E=!!window.__SYNTRO_EDITOR_PARAMS__,N=!!window.__SYNTRO_AUDIT_LEGEND__,O=!!window.__SYNTRO_REVIEW_DATA__;if(E||N||O){let H=[E&&"__SYNTRO_EDITOR_PARAMS__",N&&"__SYNTRO_AUDIT_LEGEND__",O&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${H.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 N=Sh()?.syntro_token;N?.startsWith("syn_")&&(a=N,te("Syntro Bootstrap",`\u2713 Using syntro_token from editor_conf (${e} mode)`))}let r;if(a)if(a.startsWith("syn_"))te("Syntro Bootstrap","Token starts with syn_, decoding..."),r=Eu(a),gb(r.d);else if(e)te("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${e} mode)`);else throw yh("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),yh("Syntro Bootstrap","Token received:",a),new Error("Invalid Syntro token: must start with 'syn_'");else if(e)te("Syntro Bootstrap",`\u2713 No token, but ${e} mode - proceeding`);else throw yh("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=gr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||gr("VITE_SYNTRO_EXPERIMENT_HOST")||r?.eh,o=gr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||gr("VITE_SYNTRO_TELEMETRY_HOST")||r?.th,i=gr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||gr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,s=r?.g||gr("NEXT_PUBLIC_SYNTRO_GEO_HOST")||gr("VITE_SYNTRO_GEO_HOST")||LM,l=CM(),u=tC(),c={...u,...l};te("Syntro Bootstrap","Phase 1: Browser metadata:",u),te("Syntro Bootstrap","Phase 1: Cached segment attributes:",l);let d=aC(s),f,p=t.debug||t.testMode,S=Cu({debug:t.debug,history:p?new wu(t.testMode?0:100):void 0,testMode:t.testMode});console.log("[Syntro Bootstrap] EventBus created");let x=Sb({elementResolver:typeof window<"u"?(E,N)=>{let O=document.elementFromPoint(E,N);if(!O)return null;let H={tag_name:O.tagName.toLowerCase()};O.id&&(H.attr__id=O.id),O.className&&typeof O.className=="string"&&(H.classes=O.className.split(" ").filter(Boolean));for(let Y of O.attributes)Y.name.startsWith("data-")&&(H[`attr__${Y.name}`]=Y.value);return H}:void 0});x.onEvent(E=>S.publishEvent(E)),typeof window<"u"&&(setInterval(()=>x.tick(Date.now()),1e3),document.addEventListener("click",E=>{let N=[],O=E.target;for(;O&&O!==document.body;){let H={tag_name:O.tagName.toLowerCase()};for(let Y of O.attributes)(Y.name.startsWith("data-")||Y.name==="id"||Y.name==="class"||Y.name==="aria-label")&&(H[`attr__${Y.name}`]=Y.value);N.push(H),O=O.parentElement}x.enrichClickAttributes(Date.now(),N)},!0));let b=E=>{te("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let N=kM(E);if(te("Syntro Bootstrap","Segment flags from PostHog:",N),wM(N),f){let O=h?.getAll?.()??{},H={...u,...O,...N};te("Syntro Bootstrap","Updating GrowthBook with attributes:",H),f.setAttributes?.(H)}},m;if(r?.t){let E=r.t==="noop"?"noop":"posthog";m=DM(E,{apiKey:r.t,apiHost:o,enableFeatureFlags:!0,sessionRecording:!r.d,onFeatureFlagsLoaded:b,onCapture:(O,H)=>{x.ingest({kind:"posthog",event:O,properties:H,timestamp:Date.now()})},onRRWebEvent:O=>{x.ingest(O)}}),console.log(`[Syntro Bootstrap] Telemetry client created (${E}) with EventBus wiring`);let N=m;S.setPosthogCapture((O,H)=>{N.track?.(O,H)})}let h;r?.e&&(f=AM("growthbook",{clientKey:r.e,apiHost:n,attributes:c,onExperimentViewed:m?.trackExperiment?(E,N,O)=>{m.trackExperiment(E,N,O)}:void 0})),h=cm({experiments:f,onMetricChange:(E,N)=>{te("Syntro Bootstrap",`Session metric changed: ${E} = ${N}`)}}),te("Syntro Bootstrap","SessionMetricTracker created");let g="production";e==="editor"?g="editor":e==="audit"?g="audit":gr("NODE_ENV")==="development"&&(g="development");let y=Ug({telemetry:m,sessionMetrics:h,mode:g,events:S});te("Syntro Bootstrap","Runtime created:",{version:y.version,mode:y.mode,hasContext:!!y.context,hasEvents:!!y.events,hasState:!!y.state}),te("Syntro Bootstrap","Core app executors already registered");let C=t.cdnBase||gr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||gr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",w=sh({cdnBase:C,registry:y.apps,onLoadStart:E=>{te("Syntro Bootstrap",`Loading app from CDN: ${E}`)},onLoadEnd:(E,N,O)=>{N?te("Syntro Bootstrap",`App loaded successfully: ${E}`):_a("Syntro Bootstrap",`Failed to load app: ${E}`,O)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:y.apps,runtime:y,version:y.version},te("Syntro Bootstrap","Global SynOS object exposed"));let _=y.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${_.length} apps in registry:`,_.map(E=>`${E.manifest.id}(${E.state})`).join(", "));for(let E of _)if(E.state==="registered")try{await y.apps.activate(E.manifest.id),console.log(`[DIAG] Activated: ${E.manifest.id} \u2192 widgets: [${y.widgets.list().join(", ")}]`)}catch(N){console.error(`[DIAG] FAILED to activate: ${E.manifest.id}`,N),_a("Syntro Bootstrap",`Failed to auto-activate built-in app: ${E.manifest.id}`,N)}if(console.log(`[DIAG] Activation complete. Total widgets: [${y.widgets.list().join(", ")}]`),f?.refreshFeatures)try{await f.refreshFeatures(),te("Syntro Bootstrap","GrowthBook features loaded")}catch(E){_a("Syntro Bootstrap","Failed to load GrowthBook features:",E)}let k=await d;if(f&&Object.keys(k).length>0){let E={...u,...k};te("Syntro Bootstrap","Merging geo data into GrowthBook attributes:",k),f.setAttributes?.(E)}let A;if(t.fetcher)A=t.fetcher;else if(r?.f){let E=MM(r.f,r.o??{});A=async()=>{let N=await E.fetch();return{...N.config,tiles:N.config.tiles??[]}}}else f&&(A=qi({experiments:f}));let I=new Set,R=A?async()=>{let E=await A();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${E.tiles?.length??0},`,`actions=${E.actions?.length??0},`,`theme=${E.theme?.name??"none"}`),E.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",E.actions.map((H,Y)=>`[${Y}] ${H.kind}${H.anchorId?` anchor="${H.anchorId.selector}"`:""}${H.label?` "${H.label}"`:""}`).join(", "));let N=E,O=w.getRequiredApps(N);return O.length>0?console.log("[Syntro Bootstrap] Required external apps:",O.join(", ")):te("Syntro Bootstrap","No external apps required (all executors are built-in)"),O.length>0&&await w.loadAppsForConfig(N).then(async Y=>{let z=Y.filter(Me=>Me.success),Q=Y.filter(Me=>!Me.success);z.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${z.map(Me=>Me.appId).join(", ")}`);let we=Q.filter(Me=>!I.has(Me.appId));we.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",we.map(Me=>`${Me.appId} (${Me.error})`).join(", ")),we.forEach(Me=>I.add(Me.appId)));for(let Me of O)if(y.apps.has(Me))try{await y.apps.activate(Me),console.log(`[Syntro Bootstrap] App activated: ${Me}`)}catch(bt){console.error(`[Syntro Bootstrap] Failed to activate app: ${Me}`,bt)}else console.error(`[Syntro Bootstrap] App "${Me}" required by config but NOT registered.`,`Available apps: [${Array.from(y.apps.list?.()??[]).join(", ")}]`)}),E}:void 0;return{canvas:await jh({...t.canvas,fetcher:R,integrations:{experiments:f,telemetry:m},editorUrl:i,runtime:y}),runtime:y,experiments:f,telemetry:m,sessionMetrics:h,appLoader:w}}async function dq(t){try{return await NM(t)}catch(e){let a=e instanceof Error?e.message:String(e);console.warn("[Syntrologie] SDK initialization failed:",a),typeof document<"u"&&document.getElementById("syntrologie-anti-flicker")?.remove();return}}function fq(t,e={}){if(typeof window>"u")return;let a=window.SynOS?.runtime;a?.events?.publish&&a.events.publish({name:t,source:"custom",props:e})}var oC={init:dq,encodeToken:zg,decodeToken:Eu,events:{emit:fq}};typeof window<"u"&&(window.Syntro=oC);var iC="2026-04-01T12:18:57.338Z (c4dbb76d6a)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${iC}`);let t=window.SynOS,e=t?.appRegistry||wl;window.SynOS={...t,appRegistry:e,_runtimeBuild:iC,React:BM.default,ReactDOM:{...pq,createPortal:qg.createPortal,flushSync:qg.flushSync}},FA(e)}return VM(hq);})();
|
|
520
|
+
`)).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),cr(s)||(a>e&&(o+=t.substring(e,a)),o+=s,e=a=n+1)}return a>e&&(o+=t.substring(e,t.length)),o},d4=!!cb||!!ub,YE="text/plain",Uh=function(t,e,a){var r;a===void 0&&(a=!0);var[n,o]=t.split("?"),i=V({},e),s=(r=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&&r!==void 0?r:[],l=F3(i);return l&&s.push(l),n+"?"+s.join("&")},Rc=(t,e)=>JSON.stringify(t,((a,r)=>typeof r=="bigint"?r.toString():r),e),ab=t=>{var{data:e,compression:a}=t;if(e){if(a===vn.GZipJS){var r=u4((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new Ga(l.length+(l.length>>>1)),f=0,h=function(g){d[f++]=g},S=0;S<c;++S){if(f+5>d.length){var x=new Ga(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 uR(d,0,f)})(Rc(e)),{mtime:0}),n=new Blob([r],{type:YE});return{contentType:YE,body:n,estimatedSize:n.size}}if(a===vn.Base64){var o=(function(l){var u,c,d,f,h,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,b=0,g="",m=[];if(!l)return l;l=c4(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,m[b++]=S.charAt(u)+S.charAt(c)+S.charAt(d)+S.charAt(f);while(x<l.length);switch(g=m.join(""),l.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g})(Rc(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Rc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Rc(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Ch=[];ub&&Ch.push({transport:"fetch",method:t=>{var e,a,{contentType:r,body:n,estimatedSize:o}=(e=ab(t))!==null&&e!==void 0?e:{},i=new Headers;Pe(t.headers,(function(c,d){i.append(d,c)})),r&&i.append("Content-Type",r);var s=t.url,l=null;if(gE){var u=new gE;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}ub(s,V({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 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))}}),cb&&Ch.push({transport:"XHR",method:t=>{var e,a=new cb;a.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=(e=ab(t))!==null&&e!==void 0?e:{};Pe(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)}}),ka!=null&&ka.sendBeacon&&Ch.push({transport:"sendBeacon",method:t=>{var e=Uh(t.url,{beacon:"1"});try{var a,{contentType:r,body:n}=(a=ab(t))!==null&&a!==void 0?a:{},o=typeof n=="string"?new Blob([n],{type:r}):n;ka.sendBeacon(e,o)}catch{}}});var zh=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 KE(t,e,a){return Rc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:a})}var cR={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=>zh(a,r))))),not_regex:(t,e)=>e.every((a=>t.every((r=>!zh(a,r))))),icontains:(t,e)=>e.map(Sh).some((a=>t.map(Sh).some((r=>a.includes(r))))),not_icontains:(t,e)=>e.map(Sh).every((a=>t.map(Sh).every((r=>!a.includes(r))))),gt:(t,e)=>e.some((a=>{var r=parseFloat(a);return!isNaN(r)&&t.some((n=>r>parseFloat(n)))})),lt:(t,e)=>e.some((a=>{var r=parseFloat(a);return!isNaN(r)&&t.some((n=>r<parseFloat(n)))}))},Sh=t=>t.toLowerCase();function dR(t,e){return!t||Object.entries(t).every((a=>{var[r,n]=a,o=e?.[r];if(q(o)||cr(o))return!1;var i=[String(o)],s=cR[n.operator];return!!s&&s(n.values,i)}))}var rb=at("[Error tracking]"),Jb=class{constructor(e){var a,r;this.Zt=[],this.ti=new yb([new bb,new Ib,new _b,new Sb,new Lb,new wb,new Cb,new kb],b3()),this._instance=e,this.Zt=(a=(r=this._instance.persistence)==null?void 0:r.get_property(Eb))!==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.Zt=o,this._instance.persistence&&this._instance.persistence.register({[Eb]:this.Zt,[EE]:i})}get ii(){var e,a=!!this._instance.get_property(EE),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??a)!==null&&e!==void 0&&e}buildProperties(e,a){return this.ti.buildFromUnknown(e,{syntheticException:a?.syntheticException,mechanism:{handled:a?.handled}})}sendExceptionEvent(e){var a=e.$exception_list;if(this.ei(a)){if(this.ri(a))return void rb.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(a))return void rb.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(a))return void rb.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(e.length===0)return!1;var a=e.reduce(((r,n)=>{var{type:o,value:i}=n;return vt(o)&&o.length>0&&r.$exception_types.push(o),vt(i)&&i.length>0&&r.$exception_values.push(i),r}),{$exception_types:[],$exception_values:[]});return this.Zt.some((r=>{var n=r.values.map((o=>{var i,s=cR[o.operator],l=we(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)}))}si(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://")))}ni(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}ei(e){return!ge(e)&&we(e)}},La=at("[FeatureFlags]"),_c=at("[FeatureFlags]",{debugEnabled:!0}),nb="$active_feature_flags",Ys="$override_feature_flags",QE="$feature_flag_payloads",Cc="$override_feature_flag_payloads",JE="$feature_flag_request_id",eT="$feature_flag_evaluated_at",tT=t=>{var e={};for(var[a,r]of _h(t||{}))r&&(e[a]=r);return e},f4=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]})))):La.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},p4=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),e0=class{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,a=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(La.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),a!=null&&a.length?a.filter((r=>{var n=r&&typeof r=="string"&&r.trim().length>0;return n||La.error("Invalid evaluation context found:",r,"Expected non-empty string"),n})):[]}pi(){return this.fi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.gi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.mi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Tb),a=this._instance.get_property(Ys),r=this._instance.get_property(Cc);if(!r&&!a)return e||{};var n=ot({},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=q(c)?(s=u?.enabled)!==null&&s!==void 0&&s:!!c,f=q(c)?u.variant:typeof c=="string"?c:void 0,h=r?.[i],S=V({},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=V({},u?.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),n[i]=S}return this.oi||(La.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.oi=!0),n}getFlagVariants(){var e=this._instance.get_property(al),a=this._instance.get_property(Ys);if(!a)return e||{};for(var r=ot({},e),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.oi||(La.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:a,finalFlags:r}),this.oi=!0),r}getFlagPayloads(){var e=this._instance.get_property(QE),a=this._instance.get_property(Cc);if(!a)return e||{};for(var r=ot({},e||{}),n=Object.keys(a),o=0;o<n.length;o++)r[n[o]]=a[n[o]];return this.oi||(La.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:a,finalPayloads:r}),this.oi=!0),r}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.gi||(this.gi=setTimeout((()=>{this.mi()}),5))}bi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}mi(e){var a;if(this.bi(),!this._instance.M())if(this.li)this.hi=!0;else{var r=this._instance.config.token,n=this._instance.get_property("$device_id"),o={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:V({},((a=this._instance.persistence)==null?void 0:a.get_initial_props())||{},this._instance.get_property(Tc)||{}),group_properties:this._instance.get_property(ki)};cr(n)||q(n)||(o.$device_id=n),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.pi()&&(o.evaluation_contexts=this.fi());var i=this._instance.config.__preview_remote_config,s=i?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",s+l);i&&(o.timezone=oR()),this.li=!0,this._instance._send_request({method:"POST",url:u,data:o,compression:this._instance.config.disable_compression?void 0:vn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var d,f,h=!0;if(c.statusCode===200&&(this.hi||(this.$anon_distinct_id=void 0),h=!1),this.li=!1,this.di||(this.di=!0,this._instance.yi((f=c.json)!==null&&f!==void 0?f:{})),!o.disable_flags||this.hi)if(this.vi=!h,c.json&&(d=c.json.quotaLimited)!=null&&d.includes(p4.FeatureFlags))La.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 S;o.disable_flags||this.receivedFeatureFlags((S=c.json)!==null&&S!==void 0?S:{},h),this.hi&&(this.hi=!1,this.mi())}}})}}getFeatureFlag(e,a){var r;if(a===void 0&&(a={}),this.ai||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlagResult(e,a);return(r=n?.variant)!==null&&r!==void 0?r:n?.enabled}La.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var a=this.getFeatureFlagResult(e,{send_event:!1});return a?.payload}getFeatureFlagResult(e,a){if(a===void 0&&(a={}),this.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),n=e in r,o=r[e],i=this.getFlagPayloads()[e],s=String(o),l=this._instance.get_property(JE)||void 0,u=this._instance.get_property(eT)||void 0,c=this._instance.get_property(Ah)||{};if((a.send_event||!("send_event"in a))&&(!(e in c)||!c[e].includes(s))){var d,f,h,S,x,b,g,m,y;we(c[e])?c[e].push(s):c[e]=[s],(d=this._instance.persistence)==null||d.register({[Ah]:c});var v=this.getFeatureFlagDetails(e),C={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:i||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((f=this._instance.config.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[e])||null,$feature_flag_bootstrapped_payload:((h=this._instance.config.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.vi};q(v==null||(S=v.metadata)==null?void 0:S.version)||(C.$feature_flag_version=v.metadata.version);var w,_=(x=v==null||(b=v.reason)==null?void 0:b.description)!==null&&x!==void 0?x:v==null||(g=v.reason)==null?void 0:g.code;_&&(C.$feature_flag_reason=_),v!=null&&(m=v.metadata)!=null&&m.id&&(C.$feature_flag_id=v.metadata.id),q(v?.original_variant)&&q(v?.original_enabled)||(C.$feature_flag_original_response=q(v.original_variant)?v.original_enabled:v.original_variant),v!=null&&(y=v.metadata)!=null&&y.original_payload&&(C.$feature_flag_original_payload=v==null||(w=v.metadata)==null?void 0:w.original_payload),this._instance.capture("$feature_flag_called",C)}if(n){var L=i;if(!q(i))try{L=JSON.parse(i)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:L}}}else La.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,a){var r=this._instance.config.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.pi()&&(n.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:n,compression:this._instance.config.disable_compression?void 0:vn.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.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,a);return q(r)?void 0:!!r}La.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.ai=!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=f4(i),f=d.flags,h=d.featureFlags,S=d.featureFlagPayloads;if(h){var x=i.requestId,b=i.evaluatedAt;if(we(h)){La.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var g={};if(h)for(var m=0;m<h.length;m++)g[h[m]]=!0;s&&s.register({[nb]:h,[al]:g})}else{var y=h,v=S,C=f;if(i.errorsWhileComputingFlags)if(f){var w=new Set(Object.keys(f).filter((_=>{var L;return!((L=f[_])!=null&&L.failed)})));y=V({},l,Object.fromEntries(Object.entries(y).filter((_=>{var[L]=_;return w.has(L)})))),v=V({},u,Object.fromEntries(Object.entries(v||{}).filter((_=>{var[L]=_;return w.has(L)})))),C=V({},c,Object.fromEntries(Object.entries(C||{}).filter((_=>{var[L]=_;return w.has(L)}))))}else y=V({},l,y),v=V({},u,v),C=V({},c,C);s&&s.register(V({[nb]:Object.keys(tT(y)),[al]:y||{},[QE]:v||{},[Tb]:C||{}},x?{[JE]:x}:{},b?{[eT]:b}:{}))}}})(e,this._instance.persistence,r,n,o),this.wi(a)}}override(e,a){a===void 0&&(a=!1),La.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:a})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return La.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Ys),this._instance.persistence.unregister(Cc),this.wi(),_c.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var a,r=e;if(this.oi=!!((a=r.suppressWarning)!==null&&a!==void 0&&a),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Ys),_c.info("Flag overrides cleared");else if(r.flags){if(we(r.flags)){for(var n={},o=0;o<r.flags.length;o++)n[r.flags[o]]=!0;this._instance.persistence.register({[Ys]:n})}else this._instance.persistence.register({[Ys]:r.flags});_c.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Cc),_c.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Cc]:r.payloads}),_c.info("Payload overrides set",{payloads:r.payloads}))),void this.wi()}this.wi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:a,flagVariants:r}=this.xi();e(a,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,a,r){var n,o=(this._instance.get_property(Ec)||[]).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=V({},this.getFlagVariants(),{[e]:a});(n=this._instance.persistence)==null||n.register({[nb]:Object.keys(tT(l)),[al]:l}),this.wi()}getEarlyAccessFeatures(e,a,r){a===void 0&&(a=!1);var n=this._instance.get_property(Ec),o=r?"&"+r.map((i=>"stage="+i)).join("&"):"";if(n&&!a)return e(n);this._instance._send_request({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(Ec),(l=this._instance.persistence)==null||l.register({[Ec]:u}),e(u)}}})}xi(){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)),{})}}wi(e){var{flags:a,flagVariants:r}=this.xi();this.featureFlagEventHandlers.forEach((n=>n(a,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(Tc)||{};this._instance.register({[Tc]:V({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Tc)}setGroupPropertiesForFlags(e,a){a===void 0&&(a=!0);var r=this._instance.get_property(ki)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=V({},r[n],e[n]),delete e[n]})),this._instance.register({[ki]:V({},r,e)}),a&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var a=this._instance.get_property(ki)||{};this._instance.register({[ki]:V({},a,{[e]:{}})})}else this._instance.unregister(ki)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.bi(),this.oi=!1}},h4=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Bc=class{constructor(e,a){this.R=e,this.props={},this.Ei=!1,this.$i=(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.Si(e),this.load(),e.debug&&$.info("Persistence loaded",e.persistence,V({},this.props)),this.update_config(e,e,a),this.save()}isDisabled(){return!!this.ki}Si(e){h4.indexOf(e.persistence.toLowerCase())===-1&&($.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var a=(function(n){n===void 0&&(n=[]);var o=[...j3,...n];return V({},Ye,{W:function(i){try{var s={};try{s=Ar.W(i)||{}}catch{}var l=ot(s,JSON.parse(Ye.q(i)||"{}"));return Ye.G(i,l),l}catch{}return null},G:function(i,s,l,u,c,d){try{Ye.G(i,s,void 0,void 0,d);var f={};o.forEach((h=>{s[h]&&(f[h]=s[h])})),Object.keys(f).length&&Ar.G(i,f,l,u,c,d)}catch(h){Ye.B(h)}},V:function(i,s){try{T?.localStorage.removeItem(i),Ar.V(i,s)}catch(l){Ye.B(l)}}})})(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&Ye.H()?Ye:r==="localstorage+cookie"&&a.H()?a:r==="sessionstorage"&&Ot.H()?Ot:r==="memory"?G3:r==="cookie"?Ar:a.H()?a:Ar}properties(){var e={};return Pe(this.props,(function(a,r){if(r===al&>(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,(cr(i=A3)?l:mE&&i.indexOf===mE?i.indexOf(s)!=-1:(Pe(i,(function(u){if(l||(l=u===s))return kh})),l))||(e[r]=a);var i,s,l})),e}load(){if(!this.ki){var e=this.Y.W(this.$i);e&&(this.props=ot({},e))}}save(){this.ki||this.Y.G(this.$i,this.props,this.Pi,this.Ti,this.Ii,this.R.debug)}remove(){this.Y.V(this.$i,!1),this.Y.V(this.$i,!0)}clear(){this.remove(),this.props={}}register_once(e,a,r){if(gt(e)){q(a)&&(a="None"),this.Pi=q(r)?this.Ci:r;var n=!1;if(Pe(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(gt(e)){this.Pi=q(a)?this.Ci:a;var r=!1;if(Pe(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.Ei){var e=JT(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);tl(k0(e))||this.register(e),this.Ei=!0}}update_search_keyword(){var e;this.register((e=z?.referrer)?tR(e):{})}update_referrer_info(){var e;this.register_once({$referrer:aR(),$referring_domain:z!=null&&z.referrer&&((e=Oh(z.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Db]||this.props[Bb]||this.register_once({[Eh]:rR(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Pe([Bb,Db],(i=>{var s=this.props[i];s&&Pe(s,(function(l,u){e["$initial_"+db(u)]=l}))}));var a,r,n=this.props[Eh];if(n){var o=(a=nR(n),r={},Pe(a,(function(i,s){r["$initial_"+db(s)]=i})),r);ot(e,o)}return e}safe_merge(e){return Pe(this.props,(function(a,r){r in e||(e[r]=a)})),e}update_config(e,a,r){if(this.Ci=this.Pi=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||!((i,s)=>{if(i.length!==s.length)return!1;var l=[...i].sort(),u=[...s].sort();return l.every(((c,d)=>c===u[d]))})(e.cookie_persisted_properties||[],a.cookie_persisted_properties||[])){var n=this.Si(e),o=this.props;this.clear(),this.Y=n,this.props=o,this.save()}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_event_timer(e,a){var r=this.props[Ac]||{};r[e]=a,this.props[Ac]=r,this.save()}remove_event_timer(e){var a=(this.props[Ac]||{})[e];return q(a)||(delete this.props[Ac][e],this.save()),a}get_property(e){return this.props[e]}set_property(e,a){this.props[e]=a,this.save()}},aT=at("[Product Tours]"),ob="ph_product_tours",t0=class{constructor(e){this.Ri=null,this.Fi=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[RE]:!(e==null||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,a;this.Ri||(e=this._instance).config.disable_product_tours||(a=e.persistence)==null||!a.get_property(RE)||this.it((()=>this.Oi()))}it(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.generateProductTours?e():(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(n=>{n?aT.error("Could not load product tours script",n):e()}))}Oi(){var e;!this.Ri&&(e=Q.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ri=Q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,a){if(a===void 0&&(a=!1),!we(this.Fi)||a){var r=this._instance.persistence;if(r){var n=r.props[ob];if(we(n)&&!a)return this.Fi=n,void e(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var i=o.statusCode;if(i!==200||!o.json){var s="Product Tours API could not be loaded, status: "+i;return aT.error(s),void e([],{isLoaded:!1,error:s})}var l=we(o.json.product_tours)?o.json.product_tours:[];this.Fi=l,r&&r.register({[ob]:l}),e(l,{isLoaded:!0})}})}else e(this.Fi,{isLoaded:!0})}getActiveProductTours(e){ge(this.Ri)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e)}showProductTour(e){var a;(a=this.Ri)==null||a.showTourById(e)}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it((()=>{var a;this.Oi(),(a=this.Ri)==null||a.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ri)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ri)==null||e.nextStep()}previousStep(){var e;(e=this.Ri)==null||e.previousStep()}clearCache(){var e;this.Fi=null,(e=this._instance.persistence)==null||e.unregister(ob)}resetTour(e){var a;(a=this.Ri)==null||a.resetTour(e)}resetAllTours(){var e;(e=this.Ri)==null||e.resetAllTours()}cancelPendingTour(e){var a;(a=this.Ri)==null||a.cancelPendingTour(e)}},wc=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),I8=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),A8=(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})({}),E8=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),ib=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),T8=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),R8=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),M8=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Mc=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t})({}),sb=(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.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t})({}),a0=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),De=at("[Surveys]"),fR="seenSurvey_",m4=(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},rT=t=>((e,a)=>{var r=""+e+a.id;return a.current_iteration&&a.current_iteration>0&&(r=""+e+a.id+"_"+a.current_iteration),r})(fR,t),g4=[ib.Popover,ib.Widget,ib.API],v4={ignoreConditions:!1,ignoreDelay:!1,displayType:a0.Popover},qc=class{constructor(){this.Mi={},this.Mi={}}on(e,a){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(a),()=>{this.Mi[e]=this.Mi[e].filter((r=>r!==a))}}emit(e,a){for(var r of this.Mi[e]||[])r(a);for(var n of this.Mi["*"]||[])n(e,a)}};function Ks(t,e,a){if(ge(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 r0=class{constructor(e){this.Ai=new qc,this.ji=(a,r)=>this.Di(a,r)&&this.Li(a,r)&&this.Ni(a,r)&&this.Ui(a,r),this.Di=(a,r)=>r==null||!r.event||a?.event===r?.event,this._instance=e,this.zi=new Set,this.Hi=new Set}init(){var e;if(!q((e=this._instance)==null?void 0:e._addCaptureHook)){var a;(a=this._instance)==null||a._addCaptureHook(((r,n)=>{this.on(r,n)}))}}register(e){var a,r;if(!q((a=this._instance)==null?void 0:a._addCaptureHook)&&(e.forEach((i=>{var s,l;(s=this.Hi)==null||s.add(i),(l=i.steps)==null||l.forEach((u=>{var c;(c=this.zi)==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.zi.has(e)||this.zi.has(a?.event))&&this.Hi&&((r=this.Hi)==null?void 0:r.size)>0&&this.Hi.forEach((n=>{this.Bi(a,n)&&this.Ai.emit("actionCaptured",n.name)}))}qi(e){this.onAction("actionCaptured",(a=>e(a)))}Bi(e,a){if(a?.steps==null)return!1;for(var r of a.steps)if(this.ji(e,r))return!0;return!1}onAction(e,a){return this.Ai.on(e,a)}Li(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"||!Ks(n,a.url,a.url_matching||"contains"))return!1}return!0}Ni(e,a){return!!this.Wi(e,a)&&!!this.Gi(e,a)&&!!this.Vi(e,a)}Wi(e,a){var r;if(a==null||!a.href)return!0;var n=this.Ji(e);if(n.length>0)return n.some((s=>Ks(s.href,a.href,a.href_matching||"exact")));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Ks((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",a.href,a.href_matching||"exact")}Gi(e,a){var r;if(a==null||!a.text)return!0;var n=this.Ji(e);if(n.length>0)return n.some((u=>Ks(u.text,a.text,a.text_matching||"exact")||Ks(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=[],f=/(?::|")text="(.*?)"/g;!ge(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=>Ks(u,i,s))))}Vi(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}Ji(e){var a;return(e==null||(a=e.properties)==null?void 0:a.$elements)==null?[]:e?.properties.$elements}Ui(e,a){return a==null||!a.properties||a.properties.length===0||dR(a.properties.reduce(((r,n)=>{var o=we(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)}},n0=class{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,a){return!!e&&dR(e.propertyFilters,a?.properties)}Zi(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}te(e,a,r){var n=(r===wc.Activation?this.Ki:this.Yi).get(e),o=[];return this.ie((i=>{o=i.filter((s=>n?.includes(s.id)))})),o.filter((i=>{var s,l=(s=i.conditions)==null||(s=s[r])==null||(s=s.values)==null?void 0:s.find((u=>u.name===e));return this.Qi(l,a)}))}register(e){var a;q((a=this._instance)==null?void 0:a._addCaptureHook)||(this.ee(e),this.re(e))}re(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.se==null&&(this.se=new r0(this._instance),this.se.init(),this.se.qi((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.se)==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.Xi.get(u.name);c&&c.push(r.id),this.Xi.set(u.name,c||[r.id])}})))})))}ee(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._addCaptureHook(((o,i)=>{this.onEvent(o,i)})),this.Ki=this.Zi(e,wc.Activation),this.Yi=this.Zi(e,wc.Cancellation))}onEvent(e,a){var r,n=this.ne(),o=this.oe(),i=this.ae(),s=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[o])||[];if(i===e&&a&&s.length>0){var l,u;n.info("event matched, removing item from activated items",{event:e,eventPayload:a,existingActivatedItems:s});var c=(a==null||(l=a.properties)==null?void 0:l.$survey_id)||(a==null||(u=a.properties)==null?void 0:u.$product_tour_id);if(c){var d=s.indexOf(c);d>=0&&(s.splice(d,1),this.le(s))}}else{if(this.Yi.has(e)){var f=this.te(e,a,wc.Cancellation);f.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:f.map((S=>S.id))}),f.forEach((S=>{var x=s.indexOf(S.id);x>=0&&s.splice(x,1),this.ue(S.id)})),this.le(s))}if(this.Ki.has(e)){n.info("event name matched",{event:e,eventPayload:a,items:this.Ki.get(e)});var h=this.te(e,a,wc.Activation);this.le(s.concat(h.map((S=>S.id))||[]))}}}onAction(e){var a,r=this.oe(),n=((a=this._instance)==null||(a=a.persistence)==null?void 0:a.props[r])||[];this.Xi.has(e)&&this.le(n.concat(this.Xi.get(e)||[]))}le(e){var a,r=this.ne(),n=this.oe(),o=[...new Set(e)].filter((i=>!this.he(i)));r.info("updating activated items",{activatedItems:o}),(a=this._instance)==null||(a=a.persistence)==null||a.register({[n]:o})}getActivatedIds(){var e,a=this.oe(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[a];return r||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}},o0=class extends n0{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return Mc.SHOWN}ie(e){var a;(a=this._instance)==null||a.getSurveys(e)}ue(e){var a;(a=this._instance)==null||a.cancelPendingSurvey(e)}ne(){return De}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},i0=class{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var a=e.surveys;if(ge(a))return De.warn("Flags not loaded yet. Not loading surveys.");var r=we(a);this.ve=r?a.length>0:a,De.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],a=0;a<localStorage.length;a++){var r=localStorage.key(a);(r!=null&&r.startsWith(fR)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)De.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)De.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())De.info("Not loading surveys in cookieless mode without consent.");else{var e=Q?.__PosthogExtensions__;if(e){if(!q(this.ve)||this._instance.config.advanced_enable_surveys){var a=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var r=e.generateSurveys;if(r)return void this.ge(r,a);var n=e.loadExternalDependency;if(!n)return void this._e("PostHog loadExternalDependency extension not found.");n(this._instance,"surveys",(o=>{o||!e.generateSurveys?this._e("Could not load surveys script",o):this.ge(e.generateSurveys,a)}))}catch(o){throw this._e("Error initializing surveys",o),o}finally{this.ce=!1}}}else De.error("PostHog Extensions not found.")}}ge(e,a){this._surveyManager=e(this._instance,a),this._surveyEventReceiver=new o0(this._instance),De.info("Surveys loaded successfully"),this.me({isLoaded:!0})}_e(e,a){De.error(e,a),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter((a=>a!==e))}}getSurveys(e,a){if(a===void 0&&(a=!1),this._instance.config.disable_surveys)return De.info("Disabled. Not loading surveys."),e([]);var r,n=this._instance.get_property(Rb);if(n&&!a)return e(n,{isLoaded:!0});typeof Promise<"u"&&this.pe?this.pe.then((o=>{var{surveys:i,context:s}=o;return e(i,s)})):(typeof Promise<"u"&&(this.pe=new Promise((o=>{r=o}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:o=>{var i;this.pe=null;var s=o.statusCode;if(s!==200||!o.json){var l="Surveys API could not be loaded, status: "+s;De.error(l);var u={isLoaded:!1,error:l};return e([],u),void(r==null||r({surveys:[],context:u}))}var c,d=o.json.surveys||[],f=d.filter((S=>(function(x){return!(!x.start_date||x.end_date)})(S)&&((function(x){var b;return!((b=x.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(S)||(function(x){var b;return!((b=x.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(S))));f.length>0&&((c=this._surveyEventReceiver)==null||c.register(f)),(i=this._instance.persistence)==null||i.register({[Rb]:d});var h={isLoaded:!0};e(d,h),r?.({surveys:d,context:h})}}))}me(e){for(var a of this.fe)try{if(!e.isLoaded)return a([],e);this.getSurveys(a)}catch(r){De.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,a){if(a===void 0&&(a=!1),!ge(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,a);De.warn("init was not called")}be(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}ye(e){if(ge(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var a=typeof e=="string"?this.be(e):e;return a?this._surveyManager.checkSurveyEligibility(a):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ge(this._surveyManager))return De.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var a=this.ye(e);return{visible:a.eligible,disabledReason:a.reason}}canRenderSurveyAsync(e,a){return ge(this._surveyManager)?(De.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.ye(i);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),a)}))}renderSurvey(e,a,r){var n;if(ge(this._surveyManager))De.warn("init was not called");else{var o=typeof e=="string"?this.be(e):e;if(o!=null&&o.id)if(g4.includes(o.type)){var i=z?.querySelector(a);if(i)return(n=o.appearance)!=null&&n.surveyPopupDelaySeconds?(De.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,l;De.info("Rendering survey "+o.id+" with delay of "+((s=o.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(o,i,r),De.info("Survey "+o.id+" rendered")}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,i,r);De.warn("Survey element not found")}else De.warn("Surveys of type "+o.type+" cannot be rendered in the app");else De.warn("Survey not found")}}displaySurvey(e,a){var r;if(ge(this._surveyManager))De.warn("init was not called");else{var n=this.be(e);if(n){var o=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&a.ignoreDelay&&(o=V({},n,{appearance:V({},n.appearance,{surveyPopupDelaySeconds:0})})),a.displayType!==a0.Popover&&a.initialResponses&&De.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),a.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void De.warn("Survey is not eligible to be displayed: ",i.disabledReason)}a.displayType!==a0.Inline?this._surveyManager.handlePopoverSurvey(o,a):this.renderSurvey(o,a.selector,a.properties)}else De.warn("Survey not found")}}cancelPendingSurvey(e){ge(this._surveyManager)?De.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}},pn=at("[Conversations]"),s0=class{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.Ee=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var a=e.conversations;ge(a)||(xn(a)?this.we=a:(this.we=a.enabled,this.Ee=a),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.we=void 0,this.Ee=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Q?.__PosthogExtensions__;if(e&&!q(this.we)&&this.we)if(this.Ee&&this.Ee.token){this.xe=!0;try{var a=e.initConversations;if(a)return this.$e(a),void(this.xe=!1);var r=e.loadExternalDependency;if(!r)return void this.Se("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(n=>{n||!e.initConversations?this.Se("Could not load conversations script",n):this.$e(e.initConversations),this.xe=!1}))}catch(n){this.Se("Error initializing conversations",n),this.xe=!1}}else pn.error("Conversations enabled but missing token in remote config.")}}$e(e){if(this.Ee)try{this._conversationsManager=e(this.Ee,this._instance),pn.info("Conversations loaded successfully")}catch(a){this.Se("Error completing conversations initialization",a)}else pn.error("Cannot complete initialization: remote config is null")}Se(e,a){pn.error(e,a),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():pn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.we===!0&&!cr(this._conversationsManager)}isVisible(){var e,a;return(e=(a=this._conversationsManager)==null?void 0:a.isVisible())!==null&&e!==void 0&&e}sendMessage(e,a,r){var n=this;return el((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,a,r):(pn.warn("Conversations not available yet."),null)}))()}getMessages(e,a){var r=this;return el((function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,a):(pn.warn("Conversations not available yet."),null)}))()}markAsRead(e){var a=this;return el((function*(){return a._conversationsManager?a._conversationsManager.markAsRead(e):(pn.warn("Conversations not available yet."),null)}))()}getTickets(e){var a=this;return el((function*(){return a._conversationsManager?a._conversationsManager.getTickets(e):(pn.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,a;return(e=(a=this._conversationsManager)==null?void 0:a.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,a;return(e=(a=this._conversationsManager)==null?void 0:a.getWidgetSessionId())!==null&&e!==void 0?e:null}},l0=class{constructor(e){var a;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&(a=this._instance.config.logs)!=null&&a.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var a,r=(a=e.logs)==null?void 0:a.captureConsoleLogs;!ge(r)&&r&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=at("[logs]"),a=Q?.__PosthogExtensions__;if(a){var r=a.loadExternalDependency;r?r(this._instance,"logs",(n=>{var o;n||(o=a.logs)==null||!o.initializeLogs?e.error("Could not load logs script",n):(a.logs.initializeLogs(this._instance),this.Pe=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}},nT=at("[RateLimiter]"),u0=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=a=>{var r=a.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((n=>{nT.info((n||"events")+" is quota limited."),this.serverLimits[n]=new Date().getTime()+6e4}))}catch(n){return void nT.warn('could not rate limit - continuing. Error: "'+n?.message+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var a,r,n;e===void 0&&(e=!1);var{captureEventsBurstLimit:o,captureEventsPerSecond:i}=this,s=new Date().getTime(),l=(a=(r=this.instance.persistence)==null?void 0:r.get_property(Ob))!==null&&a!==void 0?a:{tokens:o,last:s};l.tokens+=(s-l.last)/1e3*i,l.last=s,l.tokens>o&&(l.tokens=o);var u=l.tokens<1;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+i+" events per second and "+o+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(n=this.instance.persistence)==null||n.set_property(Ob,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var a=this.serverLimits[e||"events"]||!1;return a!==!1&&new Date().getTime()<a}},Li=at("[RemoteConfig]"),c0=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Te(e){var a,r;(a=Q.__PosthogExtensions__)!=null&&a.loadExternalDependency?(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Li.error("PostHog Extensions not found. Cannot load remote config."),e())}Ie(e){this._instance._send_request({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 Li.info("Using preloaded remote config",this.remoteConfig),void this.yi(this.remoteConfig);if(this._instance.M())return void Li.warn("Remote config is disabled. Falling back to local config.");this.Te((e=>{if(!e)return Li.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ie((a=>{this.yi(a)}));this.yi(e)}))}catch(e){Li.error("Error loading remote config",e)}}yi(e){e?this._instance.config.__preview_remote_config?(this._instance.yi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Li.info("__preview_remote_config is disabled. Logging config instead",e):Li.error("Failed to fetch remote config from PostHog.")}},d0=3e3,f0=class{constructor(e,a){this.Ce=!0,this.Re=[],this.Fe=Er(a?.flush_interval_ms||d0,250,5e3,$.createLogger("flush interval"),d0),this.Oe=e}enqueue(e){this.Re.push(e),this.Me||this.Ae()}unload(){this.je();var e=this.Re.length>0?this.De():{},a=Object.values(e);[...a.filter((r=>r.url.indexOf("/e")===0)),...a.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Oe(V({},r,{transport:"sendBeacon"}))}))}enable(){this.Ce=!1,this.Ae()}Ae(){var e=this;this.Ce||(this.Me=setTimeout((()=>{if(this.je(),this.Re.length>0){var a=this.De(),r=function(){var o=a[n],i=new Date().getTime();o.data&&we(o.data)&&Pe(o.data,(s=>{s.offset=Math.abs(s.timestamp-i),delete s.timestamp})),e.Oe(o)};for(var n in a)r()}}),this.Fe))}je(){clearTimeout(this.Me),this.Me=void 0}De(){var e={};return Pe(this.Re,(a=>{var r,n=a,o=(n?n.batchKey:null)||n.url;q(e[o])&&(e[o]=V({},n,{data:[]})),(r=e[o].data)==null||r.push(n.data)})),this.Re=[],e}},y4=["retriesPerformedSoFar"],p0=class{constructor(e){this.Le=!1,this.Ne=3e3,this.Re=[],this._instance=e,this.Re=[],this.Ue=!0,!q(T)&&"onLine"in T.navigator&&(this.Ue=T.navigator.onLine,this.ze=()=>{this.Ue=!0,this.Lt()},this.He=()=>{this.Ue=!1},pt(T,"online",this.ze),pt(T,"offline",this.He))}get length(){return this.Re.length}retriableRequest(e){var{retriesPerformedSoFar:a}=e,r=cT(e,y4);Qs(a)&&(r.url=Uh(r.url,{retry_count:a})),this._instance._send_request(V({},r,{callback:n=>{n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(a??0)<10?this.Be(V({retriesPerformedSoFar:a},r)):r.callback==null||r.callback(n)}}))}Be(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.Re.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),$.warn(o),this.Le||(this.Le=!0,this.qe())}qe(){if(this.We&&clearTimeout(this.We),this.Re.length===0)return this.Le=!1,void(this.We=void 0);this.We=setTimeout((()=>{this.Ue&&this.Re.length>0&&this.Lt(),this.qe()}),this.Ne)}Lt(){var e=Date.now(),a=[],r=this.Re.filter((o=>o.retryAt<e||(a.push(o),!1)));if(this.Re=a,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.We&&(clearTimeout(this.We),this.We=void 0),this.Le=!1,q(T)||(this.ze&&(T.removeEventListener("online",this.ze),this.ze=void 0),this.He&&(T.removeEventListener("offline",this.He),this.He=void 0)),this.Re))try{this._instance._send_request(V({},e,{transport:"sendBeacon"}))}catch(a){$.error(a)}this.Re=[]}},h0=class{constructor(e){this.Ge=()=>{var a,r,n,o;this.Ve||(this.Ve={});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.Ve.lastScrollY=Math.ceil(s),this.Ve.maxScrollY=Math.max(s,(a=this.Ve.maxScrollY)!==null&&a!==void 0?a:0),this.Ve.maxScrollHeight=Math.max(l,(r=this.Ve.maxScrollHeight)!==null&&r!==void 0?r:0),this.Ve.lastContentY=u,this.Ve.maxContentY=Math.max(u,(n=this.Ve.maxContentY)!==null&&n!==void 0?n:0),this.Ve.maxContentHeight=Math.max(c,(o=this.Ve.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Ve}resetContext(){var e=this.Ve;return setTimeout(this.Ge,0),e}startMeasuringScrollPosition(){pt(T,"scroll",this.Ge,{capture:!0}),pt(T,"scrollend",this.Ge,{capture:!0}),pt(T,"resize",this.Ge)}scrollElement(){if(!this._instance.config.scroll_root_selector)return T?.document.documentElement;var e=we(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=T?.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 T&&(T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return T&&(T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft)||0}},x4=t=>rR(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),qh=class{constructor(e,a,r,n){this.Je=o=>{var i=this.Ke();if(!i||i.sessionId!==o){var s={sessionId:o,props:this.Ye(this._instance)};this.Xe.register({[Mb]:s})}},this._instance=e,this.Qe=a,this.Xe=r,this.Ye=n||x4,this.Qe.onSessionId(this.Je)}Ke(){return this.Xe.props[Mb]}getSetOnceProps(){var e,a=(e=this.Ke())==null?void 0:e.props;return a?"r"in a?nR(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(k0(this.getSetOnceProps()),((a,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+db(r)]=a})),e}},lb=at("[SessionId]"),$h=class{on(e,a){return this.Ze.on(e,a)}constructor(e,a,r){var n;if(this.tr=[],this.ir=void 0,this.Ze=new qc,this.er=(c,d)=>!(!Qs(c)||!Qs(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.R=e.config,this.Xe=e.persistence,this.rr=void 0,this.sr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.nr=a||_o,this.ar=r||_o;var o=this.R.persistence_name||this.R.token,i=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Er(i,60,36e3,lb.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+o+"_window_id",this.hr="ph_"+o+"_primary_window_exists",this.dr()){var s=Ot.W(this.ur),l=Ot.W(this.hr);s&&!l?this.rr=s:Ot.V(this.ur),Ot.G(this.hr,!0)}if((n=this.R.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.R.bootstrap.sessionID);this.vr(this.R.bootstrap.sessionID,new Date().getTime(),u)}catch(c){lb.error("Invalid sessionID in bootstrap",c)}this.cr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return q(this.tr)&&(this.tr=[]),this.tr.push(e),this.sr&&e(this.sr,this.rr),()=>{this.tr=this.tr.filter((a=>a!==e))}}dr(){return this.R.persistence!=="memory"&&!this.Xe.ki&&Ot.H()}pr(e){e!==this.rr&&(this.rr=e,this.dr()&&Ot.G(this.ur,e))}gr(){return this.rr?this.rr:this.dr()?Ot.W(this.ur):null}vr(e,a,r){e===this.sr&&a===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=a,this.sr=e,this.Xe.register({[Ih]:[a,e,r]}))}_r(){var e=this.Xe.props[Ih];return we(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.vr(null,null,null)}destroy(){clearTimeout(this.mr),this.mr=void 0,this.ir&&T&&(T.removeEventListener("beforeunload",this.ir,{capture:!1}),this.ir=void 0),this.tr=[]}cr(){this.ir=()=>{this.dr()&&Ot.V(this.hr)},pt(T,"beforeunload",this.ir,{capture:!1})}checkAndGetSessionAndWindowId(e,a){if(e===void 0&&(e=!1),a===void 0&&(a=null),this.R.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._r(),s=this.gr(),l=Qs(i)&&Math.abs(r-i)>864e5,u=!1,c=!o,d=!c&&!e&&this.er(r,n);c||d||l?(o=this.nr(),s=this.ar(),lb.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),i=r,u=!0):s||(s=this.ar(),u=!0);var f=Qs(n)&&e&&!l?n:r,h=Qs(i)?i:new Date().getTime();return this.pr(s),this.vr(o,f,h),e||this.lr(),u&&this.tr.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:n}}lr(){clearTimeout(this.mr),this.mr=setTimeout((()=>{var[e]=this._r();if(this.er(new Date().getTime(),e)){var a=this.sr;this.resetSessionId(),this.Ze.emit("forcedIdleReset",{idleSessionId:a})}}),1.1*this.sessionTimeoutMs)}},b4=["$set_once","$set"],bo=at("[SiteApps]"),m0=class{constructor(e){this._instance=e,this.br=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}yr(e,a){if(a){var r=this.globalsForEvent(a);this.br.push(r),this.br.length>1e3&&(this.br=this.br.slice(10))}}get siteAppLoaders(){var e;return(e=Q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.yr.bind(this));this.wr=()=>{e(),this.br=[],this.wr=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[f,h]of Object.entries(d))u[f]={id:c[f],type:f,properties:h};var{$set_once:S,$set:x}=e;return{event:V({},cT(e,b4),{properties:V({},e.properties,x?{$set:V({},(a=(r=e.properties)==null?void 0:r.$set)!==null&&a!==void 0?a:{},x)}:{},S?{$set_once:V({},(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.br.length&&(bo.info("Processing "+this.br.length+" events for site app with id "+e.id),this.br.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.wr)==null||s.call(this))},n=!1,o=s=>{a.errored=!s,a.loaded=!0,bo.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){bo.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(n&&a.loaded)try{r()}catch(s){bo.error("Error while processing buffered events PostHog app with config id "+e.id,s),a.errored=!0}}Er(){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)}$r(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){bo.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.Er(),void this._instance.on("eventCaptured",(u=>this.$r(u)))):void bo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.wr)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(u){var c;Q["__$$ph_site_app_"+u]=o._instance,(c=Q.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(d=>{if(d)return bo.error("Error while initializing PostHog app with config id "+u,d)}))};for(var{id:s,url:l}of e.siteApps)i(s)}else bo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},pR=function(t,e){if(!t)return!1;var a=t.userAgent;if(a&&yE(a,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((n=>yE(n?.brand,e))))return!0}catch{}return!!t.webdriver},Oc=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),oT="i.posthog.com",g0=class{constructor(e){this.Sr={},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("."+oT,".posthog.com")),a==="https://app.posthog.com"?"https://us.posthog.com":a}get region(){return this.Sr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=Oc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=Oc.EU:this.Sr[this.apiHost]=Oc.CUSTOM),this.Sr[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===Oc.CUSTOM)return this.apiHost+a;var r=oT+a;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},S4={icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!T&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!T&&zh(e.href,t),not_regex:(t,e)=>!!T&&!zh(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},v0=class t{constructor(e){var a=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),a.getWebExperiments((n=>{t.kr("retrieved web experiments from the server"),a.Pr=new Map,n.forEach((o=>{if(o.feature_flag_key){var i;a.Pr&&(t.kr("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=a.Pr)==null||i.set(o.feature_flag_key,o));var s=a._instance.getFeatureFlag(o.feature_flag_key);vt(s)&&o.variants[s]&&a.Tr(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.Ir(u)&&a.Tr(o.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.kr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ge(this.Pr))return this.Pr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.kr("applying feature flags",e),e.forEach((a=>{var r;if(this.Pr&&(r=this.Pr)!=null&&r.has(a)){var n,o=this._instance.getFeatureFlag(a),i=(n=this.Pr)==null?void 0:n.get(a);o&&i!=null&&i.variants[o]&&this.Tr(i.name,o,i.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var a=Dh(e?.search,"__experiment_id"),r=Dh(e?.search,"__experiment_variant");a&&r&&(t.kr("previewing web experiments "+a+" && "+r),this.getWebExperiments((n=>{this.Cr(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._send_request({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)}})}Cr(e,a,r){var n=r.filter((o=>o.id===e));n&&n.length>0&&(t.kr("Previewing web experiment ["+n[0].name+"] with variant ["+a+"]"),this.Tr(n[0].name,a,n[0].variants[a].transforms))}static Ir(e){return!ge(e.conditions)&&t.Rr(e)&&t.Fr(e)}static Rr(e){var a;if(ge(e.conditions)||ge((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||S4[(n=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,i))}static getWindowLocation(){return T?.location}static Fr(e){var a;if(ge(e.conditions)||ge((a=e.conditions)==null?void 0:a.utm))return!0;var r=JT();if(r.utm_source){var n,o,i,s,l,u,c,d,f=(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,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)==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,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)==r.utm_term;return f&&S&&x&&h}return!1}static kr(e){for(var a=arguments.length,r=new Array(a>1?a-1:0),n=1;n<a;n++)r[n-1]=arguments[n];$.info("[WebExperiments] "+e,r)}Tr(e,a,r){this._is_bot()?t.kr("Refusing to render web experiment since the viewer is a likely bot"):a!=="control"?r.forEach((n=>{if(n.selector){var o;t.kr("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.kr("Control variants leave the page unmodified.")}_is_bot(){return ka&&this._instance?pR(ka,this._instance.config.custom_blocked_useragents):void 0}},_4=at("[PostHog ExternalIntegrations]"),C4={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},y0=class{constructor(e){this._instance=e}it(e,a){var r;(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return _4.error("failed to load script",n);a()}))}startIfEnabledOrStop(){var e=this,a=function(i){var s,l,u;!n||(s=Q.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[i]||e.it(C4[i],(()=>{var c;(c=Q.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.start(e._instance)})),!n&&(l=Q.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=Q.__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)}}},x0="[SessionRecording]",Lc=at(x0),Vh=class{get started(){var e;return!((e=this.Or)==null||!e.isStarted)}get status(){return this.Or?this.Or.status:this.Mr&&!this.Ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Mr=!1,this.jr=void 0,this._instance=e,!this._instance.sessionManager)throw Lc.error("started without valid sessionManager"),new Error(x0+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(x0+' cannot be used with cookieless_mode="always"')}get Ar(){var e,a=!((e=this._instance.get_property(Xx))==null||!e.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return T&&a&&r&&!n}startIfEnabledOrStop(e){var a;if(!this.Ar||(a=this.Or)==null||!a.isStarted){var r=!q(Object.assign)&&!q(Array.from);this.Ar&&r?(this.Dr(e),Lc.info("starting")):this.stopRecording()}}Dr(e){var a,r,n;this.Ar&&(Q!=null&&(a=Q.__PosthogExtensions__)!=null&&(a=a.rrweb)!=null&&a.record&&(r=Q.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Lr(e):(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.Nr,(o=>{if(o)return Lc.error("could not load recorder",o);this.Lr(e)})))}stopRecording(){var e,a;(e=this.jr)==null||e.call(this),this.jr=void 0,(a=this.Or)==null||a.stop()}Ur(){var e;(e=this._instance.persistence)==null||e.unregister(PT)}zr(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=ge(s)?null:parseFloat(s);ge(l)&&this.Ur();var u=i?.minimumDurationMilliseconds;n.register({[Xx]:V({enabled:!!i},i,{networkPayloadCapture:V({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:q(u)?null:u,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};o(),(a=this.jr)==null||a.call(this),this.jr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.zr(e),this.Mr=!0,this.startIfEnabledOrStop()):this.Mr=!0:Lc.info("skipping remote config with no sessionRecording",e)}log(e,a){var r;a===void 0&&(a="log"),(r=this.Or)!=null&&r.log?this.Or.log(e,a):Lc.warn("log called before recorder was ready")}get Nr(){var e,a,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Xx);return(r==null||(a=r.scriptConfig)==null?void 0:a.script)||"lazy-recorder"}Lr(e){var a,r;if((a=Q.__PosthogExtensions__)==null||!a.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Or||(this.Or=(r=Q.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.Or._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Or.start(e)}onRRwebEmit(e){var a;(a=this.Or)==null||a.onRRwebEmit==null||a.onRRwebEmit(e)}overrideLinkedFlag(){var e,a;this.Or||(a=this._instance.persistence)==null||a.register({$replay_override_linked_flag:!0}),(e=this.Or)==null||e.overrideLinkedFlag()}overrideSampling(){var e,a;this.Or||(a=this._instance.persistence)==null||a.register({$replay_override_sampling:!0}),(e=this.Or)==null||e.overrideSampling()}overrideTrigger(e){var a,r;this.Or||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(a=this.Or)==null||a.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Or)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,a){var r;return!((r=this.Or)==null||!r.tryAddCustomEvent(e,a))}},Pc={},b0=()=>{},Js="posthog",hR=!d4&&ua?.indexOf("MSIE")===-1&&ua?.indexOf("Mozilla")===-1,iT=t=>{var e;return V({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:I3(z?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:b0,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:Dt&&vt(Dt?.search)&&Dt.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_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(T==null||(e=T.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;$.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:d0},error_tracking:{},_onCapture:b0,__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}:{},external_scripts_inject_target:a&&a>="2026-01-30"?"head":"body",internal_or_test_user_hostname:a&&a>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},sT=t=>{var e={};q(t.process_person)||(e.person_profiles=t.process_person),q(t.xhr_headers)||(e.request_headers=t.xhr_headers),q(t.cookie_name)||(e.persistence_name=t.cookie_name),q(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),q(t.store_google)||(e.save_campaign_params=t.store_google),q(t.verbose)||(e.debug=t.verbose);var a=ot({},e,t);return we(t.property_blacklist)&&(q(t.property_denylist)?a.property_denylist=t.property_blacklist:we(t.property_denylist)?a.property_denylist=[...t.property_blacklist,...t.property_denylist]:$.error("Invalid value for property_denylist config: "+t.property_denylist)),a},S0=class{constructor(){this.__forceAllowLocalhost=!1}get Hr(){return this.__forceAllowLocalhost}set Hr(e){$.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},jh=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 S0,this.Br=!1,this.version=hn.LIB_VERSION,this.qr=new qc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=iT(),this.SentryIntegration=Vb,this.sentryIntegration=e=>(function(a,r){var n=QT(a,r);return{name:KT,processEvent:o=>n(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new e0(this),this.toolbar=new jb(this),this.scrollManager=new h0(this),this.pageViewManager=new Nh(this),this.surveys=new i0(this),this.conversations=new s0(this),this.logs=new l0(this),this.experiments=new v0(this),this.exceptions=new Jb(this),this.rateLimiter=new u0(this),this.requestRouter=new g0(this),this.consent=new zb(this),this.externalIntegrations=new y0(this),this.people={set:(e,a,r)=>{var n=vt(e)?{[e]:a}:e;this.setPersonProperties(n),r?.({})},set_once:(e,a,r)=>{var n=vt(e)?{[e]:a}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",(e=>$.info('send "'+e?.event+'"',e)))}init(e,a,r){if(r&&r!==Js){var n,o=(n=Pc[r])!==null&&n!==void 0?n:new t;return o._init(e,a,r),Pc[r]=o,Pc[Js][r]=o,o}return this._init(e,a,r)}_init(e,a,r){var n;if(a===void 0&&(a={}),q(e)||fb(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.Kr(a.debug),this.Yr=a,this.Xr=[],a.person_profiles&&(this.Vr=a.person_profiles),this.set_config(ot({},iT(a.defaults),sT(a),{name:r,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:vn.GZipJS;var o=this.Qr();this.persistence=new Bc(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Bc(V({},this.config,{persistence:"sessionStorage"}),o);var i=V({},this.persistence.props),s=V({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zr=new f0((m=>this.ts(m)),this.config.request_queue_config),this.es=new p0(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 $h(this),this.sessionPropsManager=new qh(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.rs(l)}),0)):($.info("Initializing extensions synchronously"),this.rs(l)),hn.DEBUG=hn.DEBUG||this.config.debug,hn.DEBUG&&$.info("Starting in debug mode",{this:this,config:a,thisC:V({},this.config),p:i,s}),((n=a.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,c,d=this.config.get_device_id(_o()),f=(u=a.bootstrap)!=null&&u.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_property(mn,(c=a.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this.ss()){var h,S,x=Object.keys(((h=a.bootstrap)==null?void 0:h.featureFlags)||{}).filter((m=>{var y;return!((y=a.bootstrap)==null||(y=y.featureFlags)==null||!y[m])})).reduce(((m,y)=>{var v;return m[y]=((v=a.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[y])||!1,m}),{}),b=Object.keys(((S=a.bootstrap)==null?void 0:S.featureFlagPayloads)||{}).filter((m=>x[m])).reduce(((m,y)=>{var v,C;return(v=a.bootstrap)!=null&&(v=v.featureFlagPayloads)!=null&&v[y]&&(m[y]=(C=a.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[y]),m}),{});this.featureFlags.receivedFeatureFlags({featureFlags:x,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:vc,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(_o());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(mn,"anonymous")}return pt(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),a.segment?X3(this,(()=>this.ns())):this.ns(),Co(this.config._onCapture)&&this.config._onCapture!==b0&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),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}rs(e){var a=performance.now();this.historyAutocapture=new $b(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Gb(this).startIfEnabledOrStop()})),r.push((()=>{var n;this.siteApps=new m0(this),(n=this.siteApps)==null||n.init()})),e||r.push((()=>{this.sessionRecording=new Vh(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Nb(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new t0(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Zb(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Wb(this)})),r.push((()=>{this.exceptionObserver=new qb(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new Ph(this,Z3),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.os){var n=this.os;this.os=void 0,this.yi(n)}})),this.ls(r,a)}ls(e,a){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-a>=30&&e.length>0)return void setTimeout((()=>{this.ls(e,a)}),0);var r=e.shift();if(r)try{r()}catch(o){$.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&&$.info("PostHog extensions initialized ("+n+"ms)")}yi(e){var a,r,n,o,i,s,l,u,c;if(!z||!z.body)return $.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.yi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=pe(e.supportedCompression,vn.GZipJS)?vn.GZipJS:pe(e.supportedCompression,vn.Base64)?vn.Base64:void 0),(a=e.analytics)!=null&&a.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"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),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(s=this.productTours)==null||s.onRemoteConfig(e),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(e),(u=this.exceptionObserver)==null||u.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}ns(){try{this.config.loaded(this)}catch(r){$.critical("`loaded` function failed",r)}if(this.us(),this.config.internal_or_test_user_hostname&&Dt!=null&&Dt.hostname){var e=Dt.hostname,a=this.config.internal_or_test_user_hostname;(typeof a=="string"?e===a:a.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.hs()}),1),new c0(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&wo(this.__request_queue,(e=>this.ts(e))),this.__request_queue=[],this.us()}_handle_unload(){var e,a;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),(e=this.Zr)==null||e.unload(),(a=this.es)==null||a.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(hR?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Uh(e.url,{ip:this.config.ip?1:0}),e.headers=V({},this.config.request_headers,e.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=V({},a);i.timeout=i.timeout||6e4,i.url=Uh(i.url,{_:new Date().getTime().toString(),ver:hn.LIB_VERSION,compression:i.compression});var s=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Ch.filter((c=>!i.disableTransport||!c.transport||!i.disableTransport.includes(c.transport))),u=(n=(o=OT(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)})(V({},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)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var a,r=[],n=[],o=[];wo(e,(s=>{s&&(a=s[0],we(a)?o.push(s):Co(s)?s.call(this):we(s)&&a==="alias"?r.push(s):we(s)&&a.indexOf("capture")!==-1&&Co(this[a])?o.push(s):n.push(s))}));var i=function(s,l){wo(s,(function(u){if(we(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(r,this),i(n,this),i(o,this)}ss(){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.Zr){if(this.is_capturing())if(!q(e)&&vt(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&&!vt(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=r?.timestamp||s,u=_o(),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,f=e!=="$groupidentify",h=this.vs(r?.$set_once,f);if(h&&(c.$set_once=h),(c=L3(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,q(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s),e===Mc.DISMISSED||e===Mc.SENT){var S=a?.[sb.SURVEY_ID],x=a?.[sb.SURVEY_ITERATION];d={id:S,current_iteration:x},localStorage.getItem(rT(d))||localStorage.setItem(rT(d),"true"),c.$set=V({},c.$set,{[m4({id:S,current_iteration:x},e===Mc.SENT?"responded":"dismissed")]:!0})}else e===Mc.SHOWN&&(c.$set=V({},c.$set,{[sb.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var b=V({},c.properties.$set,c.$set);if(tl(b)||this.setPersonPropertiesForFlags(b),!ge(this.config.before_send)){var g=this.cs(c);if(!g)return;c=g}this.qr.emit("eventCaptured",c);var m={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.ts(m):this.Zr.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")}_addCaptureHook(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=V({},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=V({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!vt(s.distinct_id)&&!bn(s.distinct_id)||fb(s.distinct_id))&&$.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var u,c=t4(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&ot(s,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&ot(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(h=this.es)==null?void 0:h.length}catch(g){s.$sdk_debug_error_capturing_properties=String(g)}if(this.requestRouter.region===Oc.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=ot(s,u),e==="$pageview"&&z&&(s.title=z.title),!q(i)){var S=r.getTime()-i;s.$duration=parseFloat((S/1e3).toFixed(3))}ua&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=ot({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),we(this.config.property_denylist)?Pe(this.config.property_denylist,(function(g){delete s[g]})):$.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.fs();return s.$process_person_profile=b,b&&!o&&this.ps("_calculate_event_properties"),s}vs(e,a){var r;if(a===void 0&&(a=!0),!this.persistence||!this.fs()||this.Br)return e;var n=this.persistence.get_initial_props(),o=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),i=ot({},n,o||{},e||{}),s=this.config.sanitize_properties;return s&&($.error("sanitize_properties is deprecated. Use before_send instead"),i=s(i,"$set_once")),a&&(this.Br=!0),tl(i)?void 0:i}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)}gs(e,a){this.register({[e]:a})}getFeatureFlag(e,a){return this.featureFlags.getFeatureFlag(e,a)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,a){return this.featureFlags.getFeatureFlagResult(e,a)}isFeatureEnabled(e,a){return this.featureFlags.isFeatureEnabled(e,a)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,a,r){var n=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},o=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},i=V({},n,e),s=V({},o,a),l={};for(var[u,c]of Object.entries(i)){var d=typeof c=="string";l[u]={key:u,enabled:!!d||!!c,variant:d?c:void 0,reason:void 0,metadata:q(s?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:s[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}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.qr.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=v4),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 $.uninitializedWarning("posthog.identify");if(bn(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!==vc){if(this.ps("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(Ic)&&(this.unregister(Ic),this.register({distinct_id:e}));var i=(this.persistence.get_property(mn)||"anonymous")==="anonymous";e!==n&&i?(this.persistence.set_property(mn,"identified"),this.setPersonPropertiesForFlags(V({},r||{},a||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:a||{},$set_once:r||{}}),this.Jr=KE(e,a,r),this.featureFlags.setAnonymousDistinctId(n)):(a||r)&&this.setPersonProperties(a,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Ah))}}else $.critical('The string "'+vc+'" 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.ps("posthog.setPersonProperties")){var r=KE(this.get_distinct_id(),e,a);this.Jr!==r?(this.setPersonPropertiesForFlags(V({},a||{},e||{})),this.capture("$set",{$set:e||{},$set_once:a||{}}),this.Jr=r):$.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,a,r){if(e&&a){var n=this.getGroups();n[e]!==a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:V({},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 $.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.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,a)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var a,r,n,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(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(n=this.persistence)==null||n.set_property(mn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Jr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:vc,$device_id:null},"");else{var s=this.config.get_device_id(_o());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(DT)?($.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?(q(a)&&(a=this.get_distinct_id()),e!==a?(this.gs(Ic,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=V({},this.config);if(gt(e)){var r,n,o,i,s,l,u;ot(this.config,sT(e));var c=this.Qr();(r=this.persistence)==null||r.update_config(this.config,a,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Bc(V({},this.config,{persistence:"sessionStorage"}),c);var d=this.Kr(this.config.debug);xn(d)&&(this.config.debug=d),xn(this.config.debug)&&(this.config.debug?(hn.DEBUG=!0,Ye.H()&&Ye.G("ph_debug","true"),$.info("set_config",{config:e,oldConfig:a,newConfig:V({},this.config)})):(hn.DEBUG=!1,Ye.H()&&Ye.V("ph_debug"))),(n=this.exceptionObserver)==null||n.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(i=this.autocapture)==null||i.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),(u=this.externalIntegrations)==null||u.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(V({},n,a))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}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:Js;return a!==Js&&(a=Js+"."+a),a}_isIdentified(){var e,a;return((e=this.persistence)==null?void 0:e.get_property(mn))==="identified"||((a=this.sessionPersistence)==null?void 0:a.get_property(mn))==="identified"}fs(){var e,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&tl(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ic])&&((a=this.persistence)==null||(a=a.props)==null||!a[Th]))}ds(){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.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ps("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ps(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.gs(Th,!0),!0)}Qr(){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}_s(){var e,a,r,n,o=this.Qr();return((e=this.persistence)==null?void 0:e.ki)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((a=this.sessionPersistence)==null?void 0:a.ki)!==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,o;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=new $h(this),this.pageViewManager=new Nh(this),this.persistence&&(this.sessionPropsManager=new qh(this,this.sessionManager,this.persistence)),this.sessionRecording=new Vh(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(q(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((o=e?.captureEventName)!==null&&o!==void 0?o:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()}else $.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,a,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:vc,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.hs())):$.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===gn.GRANTED?"granted":e===gn.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._s()}_is_bot(){return ka?pR(ka,this.config.custom_blocked_useragents):void 0}hs(){z&&(z.visibilityState==="visible"?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:z.title},{send_instantly:!0}),this.Gr&&(z.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),pt(z,"visibilitychange",this.Gr)))}debug(e){e===!1?(T?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(T?.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}))}M(){var e,a,r,n,o,i,s,l=this.Yr||{};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):(r="advanced_disable_decide",n=!1,o=$,i=(a="advanced_disable_flags")in(e=l)&&!ge(e[a]),s=r in e&&!ge(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)}cs(e){if(ge(this.config.before_send))return e;var a=we(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of a){if(r=n(r),ge(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return QH(e.event)?$.warn(o+". This can cause unexpected behavior."):$.info(o),null}r.properties&&!tl(r.properties)||$.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Kt)==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)})}Kr(e){var a=xn(e)&&!e,r=Ye.H()&&Ye.q("ph_debug")==="true";return!a&&(!!r||e)}};(function(t,e){for(var a=0;a<e.length;a++)t.prototype[e[a]]=w3(t.prototype[e[a]])})(jh,["identify"]);var lT;var mR=(lT=Pc[Js]=new jh,(function(){function t(){t.done||(t.done=!0,hR=!1,Pe(Pc,(function(e){e._dom_loaded()})))}z!=null&&z.addEventListener?z.readyState==="complete"?t():pt(z,"DOMContentLoaded",t,{capture:!1}):T&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),lT);var M0=class{constructor(e={}){this.options=e;B(this,"client");B(this,"featureFlagsCallback");B(this,"captureCallback");B(this,"rrwebCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,this.rrwebCallback=e.onRRWebEvent,!this.client&&e.consent&&e.requireExplicitConsent&&typeof window<"u"&&e.apiKey){let a=e.consent;a.getStatus()==="granted"&&this.initPostHog(),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"}`,n={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??"history_change",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:i=>{if(a&&this.featureFlagsCallback){i.onFeatureFlags(()=>{let l=this.getAllFeatureFlags();l&&this.featureFlagsCallback&&this.featureFlagsCallback(l)});let s=this.getAllFeatureFlags();s&&Object.keys(s).length>0&&this.featureFlagsCallback(s)}this.captureCallback&&i.on("eventCaptured",(...s)=>{let l=s[0],u=typeof l=="string"?l:l?.event,c=typeof l=="string"?void 0:l?.properties;typeof u=="string"&&this.captureCallback?.(u,c)})}},o=mR.init(e.apiKey,n,r);o&&(this.client=o),this.rrwebCallback&&this.client&&this.setupRRWebIntercept()}setupRRWebIntercept(e=30){let a=this.client?.sessionRecording;if(!a){e>0&&setTimeout(()=>this.setupRRWebIntercept(e-1),500);return}let r=null,n=a;for(let i of Object.getOwnPropertyNames(n)){let s=n[i];if(s&&typeof s=="object"&&typeof s.onRRwebEmit=="function"&&typeof s.start=="function"&&s!==a){r=s;break}}if(!r){e>0&&setTimeout(()=>this.setupRRWebIntercept(e-1),500);return}let o=r.onRRwebEmit.bind(r);r.onRRwebEmit=i=>{this.rrwebCallback?.({kind:"rrweb",...i}),o(i)},typeof window<"u"&&(window.__RRWEB_INTERCEPT_READY__=!0)}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 Xh(t={}){return new M0(t)}var O0=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{}}}},D0=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{}}}},B0=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 Gc=class{constructor(){B(this,"executors",new Map);for(let{kind:e,executor:a}of Cy)this.registerCore(e,a);for(let{kind:e,executor:a}of Dy)this.registerCore(e,a);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:sequence",O0),this.registerCore("core:parallel",D0),this.registerCore("core:wait",B0)}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)}},Tr=new Gc;function gR(t){return Tr.get(t)}function Yh(t){return Tr.has(t)}function P0(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 N0(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 F0(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>Kh&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${Kh}`,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 H0(t,e,a){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function U0(t,e,a){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(Y0.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 z0(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 q0(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>Qh&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${Qh}`,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 $0(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 V0(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 j0(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=dr(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 G0(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=dr(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 W0(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 Z0(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 X0(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=dr(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`})}}var Y0=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),Kh=5e4,Qh=50;function dr(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(!Yh(r)&&r!=="core:mountWidget"){let n=Tr.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":Sn(t,e,a);break;case"overlays:badge":Sn(t,e,a),P0(t,e,a);break;case"overlays:tooltip":Sn(t,e,a),N0(t,e,a);break;case"overlays:modal":Z0(t,e,a);break;case"content:insertHtml":Sn(t,e,a),F0(t,e,a);break;case"content:setText":Sn(t,e,a),H0(t,e,a);break;case"content:setAttr":Sn(t,e,a),U0(t,e,a);break;case"content:addClass":case"content:removeClass":Sn(t,e,a),z0(t,e,a);break;case"content:setStyle":Sn(t,e,a),q0(t,e,a);break;case"core:mountWidget":$0(t,e,a);break;case"core:wait":V0(t,e,a);break;case"core:sequence":j0(t,e,a);break;case"core:parallel":G0(t,e,a);break;case"core:tour":X0(t,e,a);break;case"navigation:navigate":W0(t,e,a);break}return{valid:e.length===0,errors:e,warnings:a}}function Sn(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 Wc(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=dr(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 w4=0;function Jh(t){let{overlayRoot:e,eventBus:a,surfaces:r,anchorResolver:n,waitForAnchor:o,adaptiveId:i,executorRegistry:s=Tr,subscribeNavigation:l,runtime:u}=t,c=new Map,d=new Map;function f(){return`action-${++w4}`}function h(_,L){a&&a.publish(_,L)}function S(){return{overlayRoot:e,resolveAnchor:n,waitForAnchor:o,generateId:f,publishEvent:h,adaptiveId:i,applyAction:m,subscribeEvent:a?(_,L)=>a.subscribe({names:[_]},A=>L(A.props)):void 0,subscribeNavigation:l}}async function x(_,L){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let A=r.mount(_.slot,{type:"widget",widgetId:_.widget.widgetId,config:_.widget.props},{priority:_.widget.priority});return L.publishEvent("action.applied",{id:L.generateId(),kind:"core:mountWidget",slot:_.slot,widgetId:_.widget.widgetId}),{cleanup:()=>{A.unmount()},updateFn:I=>{if("widget"in I&&I.widget){let R=I.widget;R.props&&A.update({type:"widget",widgetId:_.widget.widgetId,config:R.props})}}}}async function b(_,L){if(_.kind==="core:mountWidget")return x(_,L);let A=s.get(_.kind);if(!A){let I="list"in s?s.list():"(list unavailable)";throw console.error(`[ActionEngine] No executor for kind="${_.kind}".`,`Registered: [${I}]`),new Error(`No executor for action kind: ${_.kind}`)}return A(_,L)}function g(_,L,A,I){if(!u)return;let R=[],F=async()=>{let E=c.get(_);if(!E)return;let O=u.evaluateSync(A).value;if(E.state==="applied"&&!O){try{await E.cleanup()}catch(N){console.error(`[ActionEngine] Error reverting conditional action ${_}:`,N)}E.state="deferred",E.cleanup=()=>{},E.updateFn=void 0,h("action.deferred",{id:_,kind:L.kind})}else if(E.state==="deferred"&&O)try{let N=S(),W=await b(L,N);E.state="applied",E.cleanup=W.cleanup,E.updateFn=W.updateFn,E.appliedTs=Date.now(),h("action.applied",{id:_,kind:L.kind,anchorId:"anchorId"in L?L.anchorId:void 0})}catch(N){console.error(`[ActionEngine] Error applying deferred action ${_}:`,N),E.state="failed"}};u.context&&R.push(u.context.subscribe(F)),u.accumulator&&R.push(u.accumulator.subscribe(F)),d.set(_,R)}async function m(_){let L=dr(_);if(!L.valid){let O=L.errors.map(N=>N.message).join("; ");throw console.error(`[ActionEngine] Validation failed for action kind="${_?.kind}":`,O,_),new Error(`Action validation failed: ${O}`)}let A=f(),I=_.triggerWhen;if(I&&u&&!u.evaluateSync(I).value){let N={id:A,action:_,adaptiveId:i,appliedTs:Date.now(),state:"deferred",cleanup:()=>{}};c.set(A,N);let W={id:A,action:_,async revert(){let H=c.get(A);if(!H)return;let Z=d.get(A);if(Z){for(let he of Z)he();d.delete(A)}H.state="reverted",c.delete(A)},isApplied(){return c.get(A)?.state==="applied"},async update(H){let Z=c.get(A);if(!Z||Z.state!=="applied")throw new Error("Cannot update action that is not applied");if(Z.updateFn)await Z.updateFn(H);else throw new Error(`Action kind ${_.kind} does not support updates`)},getState(){return c.get(A)?.state??"reverted"}};return g(A,_,I,W),W}let R=S(),F=await b(_,R),E={id:A,action:_,adaptiveId:i,appliedTs:Date.now(),state:"applied",cleanup:F.cleanup,updateFn:F.updateFn};c.set(A,E),h("action.applied",{id:A,kind:_.kind,anchorId:"anchorId"in _?_.anchorId:void 0});let D={id:A,action:_,async revert(){let O=c.get(A);if(!O||O.state!=="applied")return;let N=d.get(A);if(N){for(let W of N)W();d.delete(A)}try{await O.cleanup(),O.state="reverted",h("action.reverted",{id:A,kind:_.kind})}catch(W){console.warn(`[ActionEngine] Cleanup error for ${_.kind} (${A}), ignoring:`,W),O.state="reverted",h("action.reverted",{id:A,kind:_.kind})}finally{c.delete(A)}},isApplied(){return c.get(A)?.state==="applied"},async update(O){let N=c.get(A);if(!N||N.state!=="applied")throw new Error("Cannot update action that is not applied");if(N.updateFn)await N.updateFn(O);else throw new Error(`Action kind ${_.kind} does not support updates`)},getState(){return c.get(A)?.state??"reverted"}};return I&&u&&g(A,_,I,D),D}async function y(_){console.log(`[ActionEngine] applyBatch: ${_.length} action(s)`,_.map(E=>E.kind).join(", "));let L=Wc(_);if(!L.valid){let E=L.errors.map(D=>D.message).join("; ");throw console.error(`[ActionEngine] Batch validation FAILED for ${_.length} action(s):`,E,`
|
|
521
|
+
Actions:`,_.map((D,O)=>` [${O}] ${D.kind} ${D.anchorId?`anchor="${D.anchorId.selector}"`:""} ${D.label?`label="${D.label}"`:""}`).join(`
|
|
522
|
+
`)),new Error(`Batch validation failed: ${E}`)}let A=f(),I=[],R=[];try{for(let E of _){let D=await m(E);I.push(D),R.push(D)}}catch(E){console.error(`[ActionEngine] Batch apply FAILED at action ${R.length+1}/${_.length}.`,`Successfully applied: ${R.length}. Rolling back...`,E);for(let D of R)try{await D.revert()}catch{}throw E}return{id:A,handles:I,async revertAll(){for(let E=I.length-1;E>=0;E--)try{await I[E].revert()}catch(D){console.error(`[ActionEngine] Error reverting action ${I[E].id}:`,D)}},isApplied(){return I.every(E=>E.isApplied())}}}function v(_){return dr(_)}function C(){return Array.from(c.values()).map(_=>({id:_.id,action:_.action,adaptiveId:_.adaptiveId,appliedTs:_.appliedTs,state:_.state}))}function w(){for(let _ of d.values())for(let L of _)try{L()}catch{}d.clear();for(let _ of c.values())if(_.state==="applied")try{_.cleanup()}catch(L){console.error("[ActionEngine] Error during cleanup:",L)}c.clear()}return{apply:m,applyBatch:y,validate:v,getActive:C,destroy:w}}var L4=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),em=p.object({type:p.literal("page_url"),url:p.string()}),tm=p.object({type:p.literal("route"),routeId:p.string()}),am=p.object({type:p.literal("anchor_visible"),anchorId:p.string(),state:p.enum(["visible","present","absent"])}),rm=p.object({type:p.literal("event_occurred"),eventName:p.string(),withinMs:p.number().optional()}),nm=p.object({type:p.literal("state_equals"),key:p.string(),value:p.unknown()}),om=p.object({type:p.literal("viewport"),minWidth:p.number().optional(),maxWidth:p.number().optional(),minHeight:p.number().optional(),maxHeight:p.number().optional()}),im=p.object({type:p.literal("session_metric"),key:p.string(),operator:p.enum(["gte","lte","eq","gt","lt"]),threshold:p.number()}),sm=p.object({type:p.literal("dismissed"),key:p.string(),inverted:p.boolean().optional()}),lm=p.object({type:p.literal("cooldown_active"),key:p.string(),inverted:p.boolean().optional()}),um=p.object({type:p.literal("frequency_limit"),key:p.string(),limit:p.number(),inverted:p.boolean().optional()}),cl=p.object({equals:p.union([p.string(),p.number(),p.boolean()]).optional(),contains:p.string().optional()}),dl=p.object({events:p.array(p.string()).min(1),match:p.record(p.string(),cl).optional()}),cm=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:dl.optional()}),_n=p.discriminatedUnion("type",[em,tm,am,rm,nm,om,im,sm,lm,um,cm]),fl=p.object({conditions:p.array(_n),value:p.unknown()}),pl=p.object({type:p.literal("rules"),rules:p.array(fl),default:p.unknown()}),hl=p.object({type:p.literal("score"),field:p.string(),threshold:p.number(),above:p.unknown(),below:p.unknown()}),ml=p.object({type:p.literal("model"),modelId:p.string(),inputs:p.array(p.string()),outputMapping:p.record(p.string(),p.unknown()),default:p.unknown()}),gl=p.object({type:p.literal("external"),endpoint:p.string(),method:p.enum(["GET","POST"]).optional(),default:p.unknown(),timeoutMs:p.number().optional()}),vl=p.discriminatedUnion("type",[pl,hl,ml,gl]),Zc=vl.nullable().optional(),k4=p.object({events:p.array(p.string()),urlContains:p.string().optional(),props:p.record(p.union([p.string(),p.number(),p.boolean()])).optional()}),I4=p.object({title:p.string().optional(),body:p.string().optional(),icon:p.string().optional()}).nullable().optional();var K0=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.")}),Xc=p.object({routes:K0,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 A4(t){return _n.safeParse(t)}function E4(t){return vl.safeParse(t)}function T4(t){return Xc.safeParse(t)}var R4=[{defName:"matchOp",schema:cl},{defName:"counterDef",schema:dl},{defName:"activationConfig",schema:Xc},{defName:"routeFilter",schema:K0},{defName:"ruleStrategy",schema:pl},{defName:"scoreStrategy",schema:hl},{defName:"modelStrategy",schema:ml},{defName:"externalStrategy",schema:gl},{defName:"rule",schema:fl},{defName:"condition",schema:_n}];var Q0=p.object({tileId:p.string(),itemId:p.string().optional()}).strict(),M4=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:Q0.optional()}).strict(),O4=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:Xc.optional(),notifications:p.array(M4).optional()}).strict(),D4=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()}),B4=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()}),P4=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()}),N4=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()}),F4=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()}),H4=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()}),U4=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:D4.optional(),launcher:B4.optional(),tile:P4.optional(),overlay:N4.optional(),notification:F4.optional(),content:H4.optional()}).strict(),z4=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(),g9=p.object({schemaVersion:p.string().optional(),fetchedAt:p.string().datetime(),configVersion:p.string().optional(),canvasTitle:p.string().optional(),tiles:p.array(O4),actions:p.array(p.any()),theme:U4.optional(),launcher:z4.optional(),meta:p.object({verificationSteps:p.array(p.union([p.string(),p.object({text:p.string(),check:_n.optional()})])).optional()}).passthrough().optional()}).strict();var Ct={triggerWhen:Zc},Ia=p.object({selector:p.string(),route:p.union([p.string(),p.array(p.string())])}).strict(),J0=p.object({color:p.string().optional(),scrimOpacity:p.number().min(0).max(1).optional(),paddingPx:p.number().optional(),radiusPx:p.number().optional()}).strict(),eS=p.enum(["top-left","top-right","bottom-left","bottom-right"]),tS=p.enum(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),fm=p.object({label:p.string(),actionId:p.string(),primary:p.boolean().optional()}).strict(),aS=p.object({title:p.string().optional(),body:p.string(),ctaButtons:p.array(fm).optional()}).strict(),rS=p.object({title:p.string().optional(),body:p.string()}).strict(),nS=p.enum(["before","after","prepend","append","replace"]),oS=p.enum(["immediate","hover","click"]),iS=p.object({widgetId:p.string(),props:p.record(p.unknown()).optional(),priority:p.number().optional()}).strict(),sS=p.object({id:p.string(),action:p.any(),route:p.string().optional(),onAction:p.record(p.string()).optional()}).passthrough(),lS=p.enum(["auto","smooth","instant"]),dm=p.enum(["start","center","end","nearest"]),uS=p.object({kind:p.literal("content:setText"),anchorId:Ia,text:p.string(),label:p.string().optional()}).extend(Ct).strict(),cS=p.object({kind:p.literal("content:setAttr"),anchorId:Ia,attr:p.string(),value:p.string(),label:p.string().optional()}).extend(Ct).strict(),dS=p.object({kind:p.literal("content:addClass"),anchorId:Ia,className:p.string(),label:p.string().optional()}).extend(Ct).strict(),fS=p.object({kind:p.literal("content:removeClass"),anchorId:Ia,className:p.string(),label:p.string().optional()}).extend(Ct).strict(),pS=p.object({kind:p.literal("content:setStyle"),anchorId:Ia,styles:p.record(p.string()),label:p.string().optional()}).extend(Ct).strict(),hS=p.object({kind:p.literal("content:insertHtml"),anchorId:Ia,html:p.string(),position:nS,deepLink:Q0.optional(),label:p.string().optional()}).extend(Ct).strict(),mS=p.object({kind:p.literal("overlays:highlight"),anchorId:Ia,style:J0.optional(),duration:p.number().optional(),label:p.string().optional()}).extend(Ct).strict(),gS=p.object({kind:p.literal("overlays:pulse"),anchorId:Ia,duration:p.number().optional(),label:p.string().optional()}).extend(Ct).strict(),vS=p.object({kind:p.literal("overlays:badge"),anchorId:Ia,content:p.string(),position:eS.optional(),label:p.string().optional()}).extend(Ct).strict(),yS=p.object({kind:p.literal("overlays:tooltip"),anchorId:Ia,content:aS,trigger:oS.optional(),placement:tS.optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(Ct).strict(),xS=p.object({kind:p.literal("overlays:modal"),content:rS,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(fm).optional(),waitFor:p.string().optional(),label:p.string().optional()}).extend(Ct).strict(),bS=p.object({kind:p.literal("navigation:scrollTo"),anchorId:Ia,behavior:lS.optional(),block:dm.optional(),inline:dm.optional(),label:p.string().optional()}).extend(Ct).strict(),SS=p.object({kind:p.literal("navigation:navigate"),url:p.string(),target:p.enum(["_self","_blank"]).optional(),label:p.string().optional()}).extend(Ct).strict(),_S=p.object({kind:p.literal("core:mountWidget"),slot:p.string(),widget:iS,label:p.string().optional()}).extend(Ct).strict(),CS=p.object({kind:p.literal("core:wait"),durationMs:p.number().min(0).optional(),event:p.string().optional(),label:p.string().optional()}).extend(Ct).strict(),wS=p.object({kind:p.literal("core:sequence"),actions:p.array(p.any()),label:p.string().optional()}).extend(Ct).strict(),LS=p.object({kind:p.literal("core:parallel"),actions:p.array(p.any()),waitFor:p.enum(["all","any"]).optional(),label:p.string().optional()}).extend(Ct).strict(),kS=p.object({kind:p.literal("core:tour"),tourId:p.string(),steps:p.array(sS).min(1),startStep:p.string().optional(),autoStart:p.boolean().optional(),label:p.string().optional()}).extend(Ct).passthrough(),vR=[{defName:"setText",schema:uS},{defName:"setAttr",schema:cS},{defName:"addClass",schema:dS},{defName:"removeClass",schema:fS},{defName:"setStyle",schema:pS},{defName:"insertHtml",schema:hS},{defName:"highlight",schema:mS},{defName:"pulse",schema:gS},{defName:"badge",schema:vS},{defName:"tooltip",schema:yS},{defName:"modal",schema:xS},{defName:"scrollTo",schema:bS},{defName:"navigate",schema:SS},{defName:"mountWidget",schema:_S},{defName:"wait",schema:CS},{defName:"sequence",schema:wS},{defName:"parallel",schema:LS},{defName:"tour",schema:kS}];function pm(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(b){if(!e)return null;try{return e.matches(b)?e:e.querySelector(b)}catch{return null}}function l(){for(let[b,g]of r){let m=s(b);if(m){for(let y of g)clearTimeout(y.timer),y.resolve(m);r.delete(b)}}for(let[b,g]of n){let m=s(b);if(m){for(let y of g)y.cancelled||y.cb(m);n.delete(b)}}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(b,g){let m=r.get(b);m&&(m.delete(g),m.size===0&&r.delete(b)),r.size===0&&n.size===0&&c()}function f(b,g){if(i)return Promise.reject(new Error("AnchorResolver destroyed"));let m=s(b);if(m)return Promise.resolve(m);let y=g??a;return new Promise((v,C)=>{let w={resolve:v,reject:C,timer:setTimeout(()=>{d(b,w),C(new Error(`waitFor("${b}") timed out after ${y}ms`))},y)},_=r.get(b);_||(_=new Set,r.set(b,_)),_.add(w),u()})}function h(b,g){if(i)return()=>{};let m=s(b);if(m)return g(m),()=>{};let y={cb:g,cancelled:!1},v=n.get(b);return v||(v=new Set,n.set(b,v)),v.add(y),u(),()=>{y.cancelled=!0;let C=n.get(b);C&&(C.delete(y),C.size===0&&n.delete(b)),r.size===0&&n.size===0&&c()}}function S(){let b=0;for(let g of r.values())b+=g.size;return b}function x(){i=!0,c();let b=new Error("AnchorResolver destroyed");for(let g of r.values())for(let m of g)clearTimeout(m.timer),m.reject(b);r.clear(),n.clear()}return{resolve:s,waitFor:f,onAppear:h,pendingCount:S,destroy:x}}function q4(){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 IS(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(yR(a,r))return}if(e.include){for(let r of e.include)if(yR(a,r))return r;return}return a}function yR(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 Yc=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=q4(),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=IS(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=IS(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=IS(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 hm(t){return new Yc(t)}var xR=p.object({url:p.string(),routeId:p.string().optional(),title:p.string().optional(),locale:p.string().optional()}),bR=p.object({url:p.string(),ts:p.number()}),SR=p.object({sessionId:p.string(),startTs:p.number(),pageHistory:p.array(bR).optional()}),_R=p.object({width:p.number(),height:p.number()}),CR=p.object({x:p.number(),y:p.number(),w:p.number(),h:p.number()}),wR=p.object({anchorId:p.string(),present:p.boolean(),visible:p.boolean().optional(),boundingBox:CR.optional()}),LR=p.record(p.string(),p.union([p.number(),p.string(),p.boolean(),p.undefined()])),kR=p.object({page:xR,session:SR,viewport:_R,anchors:p.array(wR).optional(),augmented:LR.optional()});function $4(t){return kR.safeParse(t)}function AS(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=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(!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 ES(t,e){let a=[];for(let r of t.conditions){let n=AS(r,e);if(a.push({condition:r,result:n}),!n)return{matched:!1,conditionResults:a}}return{matched:!0,conditionResults:a}}function Kc(t,e){for(let a=0;a<t.rules.length;a++){let r=t.rules[a],{matched:n,conditionResults:o}=ES(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 Qc(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 IR(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 TS(t,e,a={}){let r=IR(e,a);switch(t.type){case"rules":return Kc(t,r);case"score":return Qc(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 RS(t,e,a={}){let r=IR(e,a);switch(t.type){case"rules":return Kc(t,r);case"score":return Qc(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 mm(t){return{evaluate:(e,a)=>TS(e,a,t),evaluateSync:(e,a)=>RS(e,a,t)}}function gm(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 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 n)try{d()}catch(f){console.error("[EventAccumulator] Subscriber error:",f)}}function l(){o||r.size===0||(o=e.subscribe(s))}return{register(u,c,d=!1){let f=`ev:${u}`,h=r.get(f);if(h){d&&!h.needsTimestamps&&(h.needsTimestamps=!0);return}r.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 n.add(u),()=>{n.delete(u)}},destroy(){o&&(o(),o=null),r.clear(),n.clear()}}}var AR="app:",V4="syntro:",j4=/^[a-z][a-z0-9_]*$/;function vm(t){if(!t)return{valid:!1,reason:"Event name cannot be empty"};if(t.startsWith(V4))return{valid:!1,reason:'"syntro:" prefix is reserved for internal SDK events'};if(!t.startsWith(AR))return{valid:!1,reason:`Custom events must start with "app:" prefix. Got: "${t}"`};let e=t.slice(AR.length).split(":");if(e.length<2)return{valid:!1,reason:`Event name must have at least 2 segments after "app:" (app:{category}:{action}). Got: "${t}"`};for(let a of e)if(!j4.test(a))return{valid:!1,reason:`Segment "${a}" must be lowercase alphanumeric + underscores. Got: "${t}"`};return{valid:!0}}function G4(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null}function ER(t,e,a=0){if(a>=e)return!1;for(let r of Object.values(t))if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!ER(r,e,a+1))return!1;return!0}function ym(t){if(t===void 0)return{valid:!0};if(t===null||typeof t!="object"||Array.isArray(t))return{valid:!1,reason:"Props must be a plain object"};if(!ER(t,2))return{valid:!1,reason:"Props nesting depth exceeds 2 levels"};let e=[];for(let[a,r]of Object.entries(t))r!==null&&typeof r=="object"||G4(r)||e.push(a);return e.length>0?{valid:!0,stripped:e}:{valid:!0}}function xm(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 Jc=class{constructor(e={}){B(this,"subscriptions",new Set);B(this,"history",[]);B(this,"maxHistorySize");B(this,"debug");B(this,"emitHistory");B(this,"posthogCapture");B(this,"testMode");this.maxHistorySize=e.maxHistorySize??100,this.debug=e.debug??!1,this.emitHistory=e.history??null,this.posthogCapture=e.posthogCapture??null,this.testMode=e.testMode??!1}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:et};this.publishEvent(n)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let a of this.subscriptions)if(xm(e,a.filter))try{a.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}emit(e,a){let r=vm(e);if(!r.valid)return console.warn(`[EventBus] emit() rejected: ${r.reason}`),this.debug?{delivered:!1,matchedRules:[],posthogCaptured:!1,listenersNotified:0}:void 0;let n=ym(a);if(!n.valid)return console.warn(`[EventBus] emit() rejected props: ${n.reason}`),this.debug?{delivered:!1,matchedRules:[],posthogCaptured:!1,listenersNotified:0}:void 0;let o={ts:Date.now(),name:e,source:"custom",props:a,schemaVersion:et};this.history.push(o),this.history.length>this.maxHistorySize&&this.history.shift();let i=0;for(let l of this.subscriptions)if(xm(o,l.filter))try{l.callback(o),i++}catch(u){console.error("[EventBus] Subscriber error:",u),i++}let s=!1;if(this.posthogCapture&&!this.testMode)try{this.posthogCapture(e,a),s=!0}catch(l){console.error("[EventBus] PostHog capture error:",l)}if(this.emitHistory&&this.emitHistory.record({name:e,props:a,source:"custom",timestamp:o.ts,matchedRules:[]}),this.debug)return console.debug("[EventBus] emit()",{name:e,props:a,listenersNotified:i,posthogCaptured:s}),{delivered:!0,matchedRules:[],posthogCaptured:s,listenersNotified:i}}setPosthogCapture(e){this.posthogCapture=e}getRecent(e,a){let r=this.history;return e&&(r=r.filter(n=>xm(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=>xm(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 yl(t={}){return new Jc(t)}var xl=class{constructor(e=100){B(this,"entries",[]);B(this,"maxSize");this.maxSize=e}record(e){this.entries.push(e),this.maxSize>0&&this.entries.length>this.maxSize&&this.entries.shift()}getAll(){return[...this.entries]}clear(){this.entries=[]}};var MS=p.enum(["posthog","canvas","derived"]),TR=p.object({ts:p.number(),name:p.string(),source:MS,props:p.record(p.string(),p.unknown()).optional(),schemaVersion:p.string()}),RR=p.object({names:p.array(p.string()).optional(),patterns:p.array(p.string()).optional(),sources:p.array(MS).optional()});function W4(t){return TR.safeParse(t)}function Z4(t){return RR.safeParse(t)}var bl=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 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 OS="cooldown:";function MR(t){return{set(e,a){let r=OS+e,n=Date.now()+a;t.set(r,n)},isActive(e){return this.remaining(e)>0},remaining(e){let a=OS+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=OS+e;t.remove(a)}}}var ed="dismissed:";function OR(t,e){return{mark(a,r=!1){let n=ed+a;(r?e:t).set(n,!0)},isDismissed(a){let r=ed+a;return t.has(r)||e.has(r)},clear(a){let r=ed+a;t.remove(r),e.remove(r)},clearAll(){for(let a of t.keys())a.startsWith(ed)&&t.remove(a);for(let a of e.keys())a.startsWith(ed)&&e.remove(a)}}}var DS="freq:";function DR(t){function e(a){let r=DS+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=DS+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=DS+a;t.remove(r)},hasReachedLimit(a,r){return this.count(a)>=r}}}var X4="syntro";function BS(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 td(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 ad=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??X4;let a=r=>typeof r=="object"&&r!==null&&typeof r.setItem=="function";typeof window<"u"?(this.session=a(window.sessionStorage)?BS(window.sessionStorage,this.namespace):td(this.namespace),this.user=a(window.localStorage)?BS(window.localStorage,this.namespace):td(this.namespace)):(this.session=td(this.namespace),this.user=td(this.namespace)),this.dismissals=OR(this.session,this.user),this.cooldowns=MR(this.user),this.frequency=DR(this.session)}ns(e){let a=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(a)){let r=typeof window<"u"&&typeof sessionStorage<"u"?BS(sessionStorage,a):td(a);this.namespacedStorages.set(a,r)}return this.namespacedStorages.get(a)}};function bm(t={}){return new ad(t)}function Sl(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function rd(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var PS={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"}},_l={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:[]},BR={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function Sm(t,e,a){let r=PS[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 _m(t,e,a){let r=a.placement==="auto"?"bottom":a.placement,n=[Yf(a.offset?{mainAxis:a.offset.y,crossAxis:a.offset.x}:8)];return a.flip!==!1&&n.push(Qf()),a.shift!==!1&&n.push(Kf({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Xf(e,t,async()=>{let{x:i,y:s,strategy:l}=await Jf(e,t,{placement:r,middleware:n});Object.assign(t.style,{position:l,left:`${i}px`,top:`${s}px`})})}function Cm(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 wm(t,e){return e==="none"||_l[e].length===0?null:t.animate(_l[e],BR)}function Lm(t,e){if(e==="none"||_l[e].length===0)return Promise.resolve();let a=[..._l[e]].reverse(),r=t.animate(a,BR);return new Promise(n=>{r.onfinish=()=>n(),r.oncancel=()=>n()})}function km(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 Im(t){switch(Sl(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 PR(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(),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=(r.firstChild,a.innerHTML)}var Y4=0;function Am(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-${++Y4}`}function c(v,C){a&&a.publish(v,C)}function d(v){let C=l.get(v);if(C){let w=b(v);for(let _ of C)try{_(w)}catch(L){console.error("[Surfaces] State callback error:",L)}}}let f=new Map;function h(v,C,w){switch(C.type){case"html":v.innerHTML=PR(C.content);return;case"widget":{if(o?.has(C.widgetId)){let _=o.mount(C.widgetId,v,C.config);return w&&f.set(w,_),()=>{_.unmount(),w&&f.delete(w)}}console.warn(`[Surfaces] Widget not found: ${C.widgetId}`),v.innerHTML=`<div data-widget-id="${C.widgetId}" data-widget-missing="true">Widget: ${C.widgetId}</div>`;return}case"custom":return C.mount(v);case"react":v.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function S(v,C,w){let _=u(),L=Sl(v),A=w?.priority??0,I=w?.animation??n,R=w?.exclusive??!0,F=i.get(v);if(F&&R){if(F.options.priority>A)throw new Error(`Slot ${v} is occupied by higher priority content (${F.options.priority} > ${A})`);x(F)}let E=km(v,_);E.style.zIndex=String(Im(v));let D;if(L==="static")Sm(E,v,w?.constraints),e.appendChild(E);else if(L==="inline"){let H=rd(v);if(!H)throw new Error(`Invalid inline slot: ${v}`);if(!r)throw new Error("Anchor resolver required for inline slots");let Z=r({selector:H,route:"**"});if(!Z)throw new Error(`Anchor not found for inline slot: ${H}`);D=Cm(E,Z)}else if(L==="adjacent"){let H=rd(v);if(!H)throw new Error(`Invalid adjacent slot: ${v}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let Z=r({selector:H,route:"**"});if(!Z)throw new Error(`Anchor not found for adjacent slot: ${H}`);e.appendChild(E),D=_m(E,Z,w?.position??{placement:"bottom"})}let O=h(E,C,_);wm(E,I);let N={id:_,slot:v,content:C,options:{priority:A,exclusive:R,animation:I,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:E,cleanup:()=>{D?.(),O?.()},mountedAt:Date.now()};return i.set(v,N),s.set(v,(s.get(v)??0)+1),c("surface.mounted",{slot:v,id:_,adaptiveId:w?.adaptiveId}),d(v),{id:_,update(H){let Z=i.get(v);if(!Z||Z.id!==_)throw new Error("Mount no longer active");let he=f.get(_);if(he){if(H.type==="widget"){he.update(H.config),Z.content=H;return}he.unmount(),f.delete(_)}Z.container.innerHTML="";let Ce=h(Z.container,H,_);if(Z.content=H,Ce){let it=Z.cleanup;Z.cleanup=()=>{it?.(),Ce()}}},setOptions(H){let Z=i.get(v);if(!Z||Z.id!==_)throw new Error("Mount no longer active");H.priority!==void 0&&(Z.options.priority=H.priority),H.animation!==void 0&&(Z.options.animation=H.animation),H.constraints&&L==="static"&&(H.constraints.maxWidth&&(Z.container.style.maxWidth=H.constraints.maxWidth),H.constraints.maxHeight&&(Z.container.style.maxHeight=H.constraints.maxHeight),H.constraints.minWidth&&(Z.container.style.minWidth=H.constraints.minWidth),H.constraints.minHeight&&(Z.container.style.minHeight=H.constraints.minHeight)),d(v)},async unmount(){let H=i.get(v);!H||H.id!==_||await x(H)},isMounted(){return i.get(v)?.id===_},getContainer(){let H=i.get(v);return H?.id===_?H.container:null}}}async function x(v){v.container.isConnected&&await Lm(v.container,v.options.animation);try{v.cleanup?.()}catch(C){console.warn("[Surfaces] Cleanup error during unmount, ignoring:",C)}try{v.container.remove()}catch{}i.delete(v.slot),c("surface.unmounted",{slot:v.slot,id:v.id}),d(v.slot)}function b(v){let C=i.get(v);return{slot:v,occupied:!!C,currentPriority:C?.options.priority,currentAdaptiveId:C?.options.adaptiveId,mountCount:s.get(v)??0,currentMountId:C?.id}}function g(v,C){let w=l.get(v);return w||(w=new Set,l.set(v,w)),w.add(C),()=>{w?.delete(C),w?.size===0&&l.delete(v)}}function m(v,C){let w=i.get(v);return w?C!==void 0?C>=w.options.priority:!1:!0}function y(){for(let v of i.values())try{v.cleanup?.(),v.container.remove()}catch(C){console.error("[Surfaces] Error during cleanup:",C)}i.clear(),l.clear()}return{mount:S,getState:b,onStateChange:g,canMount:m,destroy:y}}var nd=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,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&&(a.isConnected&&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},f=n.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(r){console.error("[WidgetRegistry] Listener error:",r)}}destroy(){for(let[e,a]of this.mountedWidgets.entries())a.cleanup?.(),a.container.innerHTML="";this.mountedWidgets.clear()}},Em=new nd;var FS="2.0.0";function K4(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(NS(r,n))return!1}if(e.include&&e.include.length>0){for(let n of e.include)if(NS(r,n))return!0;return!1}return!0}function NS(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 NR(t){let a=(typeof window<"u"?window.location.pathname:"/").replace(/\/$/,"")||"/";return(Array.isArray(t.route)?t.route:[t.route]).some(n=>{let o=n;if(/^https?:\/\//.test(o))try{o=new URL(o).pathname}catch{}return NS(a,o)})}function Tm(t={}){let{telemetry:e,sessionMetrics:a,routes:r,mode:n="production",namespace:o}=t,i=t.widgets??Em,s=t.executors??Tr,l=t.apps??Ls,u=new bl,c=hm({telemetry:e,routes:r,navigation:u}),d=t.events??yl(),f=bm({namespace:o}),h=gm({eventBus:d,stateStore:f}),S=mm({state:f,events:d,sessionMetrics:a,accumulator:h}),x=zI(),b=pm(),g=_=>NR(_)?b.resolve(_.selector):null,m=async(_,L)=>{if(!NR(_))return null;try{return await b.waitFor(_.selector,L)}catch{return null}},y=Am({overlayRoot:x,eventBus:d,anchorResolver:g,widgetRegistry:i}),v=Jh({overlayRoot:x,eventBus:d,surfaces:y,anchorResolver:g,waitForAnchor:m,executorRegistry:s,subscribeNavigation:_=>u.subscribe(_),runtime:{evaluateSync:_=>S.evaluateSync(_,c.get()),context:c,accumulator:h}}),C;if(a){a.increment("page_views");let _=typeof window<"u"?window.location.pathname:"/";C=u.subscribe((L,A)=>{if(A!=="replaceState")try{let I=new URL(L).pathname;I!==_&&(_=I,a.increment("page_views"))}catch{}})}let w={telemetry:e,context:c,events:d,state:f,sessionMetrics:a,actions:v,surfaces:y,widgets:i,executors:s,apps:l,accumulator:h,anchorResolver:b,navigation:u,version:FS,mode:n,async evaluate(_){return S.evaluate(_,c.get())},evaluateSync(_){return S.evaluateSync(_,c.get())},async filterTiles(_){let L=c.get().page.url,A=[];for(let I of _){let R=I.activation;if(!R){A.push(I);continue}if(K4(L,R.routes)){if(R.onlyIfPopulated){let F=I.props?.actions??[];if(F.length>0&&!F.some(D=>D.triggerWhen?S.evaluateSync(D.triggerWhen,c.get()).value:!0))continue}A.push(I)}}return A},setRoutes(_){c.setRoutes(_)},destroy(){l.unbind().catch(_=>{console.error("[Runtime] Error unbinding apps registry:",_)}),C?.(),b.destroy(),h.destroy(),u.destroy(),c.destroy(),v.destroy(),y.destroy()}};return l.bind(w),i.bindRuntime(w),w}var FR=p.object({value:p.unknown(),expiresAt:p.number().optional()}),HR=p.object({count:p.number(),resetAt:p.number().optional()});function Q4(t){return FR.safeParse(t)}function J4(t){return HR.safeParse(t)}var HS="syn_";function Cl(t){if(!t.startsWith(HS))throw new Error("Invalid Syntro token: must start with 'syn_'");let a=t.slice(HS.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 Rm(t){let e=JSON.stringify(t),a=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return HS+a}function Wa(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 zR="syntro_segment_attributes";function qR(){if(typeof window>"u")return{};try{let t=localStorage.getItem(zR);if(t){let e=JSON.parse(t);return Y("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){na("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function $R(t){if(!(typeof window>"u"))try{localStorage.setItem(zR,JSON.stringify(t)),Y("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){na("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function VR(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 US(){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{let e=navigator.userAgent;e.includes("Edg/")?t.browser="Edge":e.includes("OPR/")||e.includes("Opera")?t.browser="Opera":e.includes("Chrome/")&&!e.includes("Chromium")?t.browser="Chrome":e.includes("Safari/")&&!e.includes("Chrome")?t.browser="Safari":e.includes("Firefox/")&&(t.browser="Firefox"),e.includes("Windows")?t.os="Windows":e.includes("iPhone")||e.includes("iPad")?t.os="iOS":e.includes("Mac OS X")||e.includes("Macintosh")?t.os="macOS":e.includes("Android")?t.os="Android":e.includes("Linux")&&(t.os="Linux")}catch{}try{t.page_url=window.location.href,t.page_path=window.location.pathname,t.page_host=window.location.hostname,window.location.search&&(t.page_query=window.location.search)}catch{}return t}var UR="syntro_geo",jR="https://geo.syntrologie.com";async function zS(t){if(typeof window>"u")return{};try{let e=localStorage.getItem(UR);if(e){let a=JSON.parse(e);return Y("Syntro Bootstrap","Geo: using cached data:",a),a}}catch{}try{let e=await fetch(t,{signal:AbortSignal.timeout(2e3)});if(e.ok){let a=await e.json(),r={};for(let[n,o]of Object.entries(a))typeof o=="string"&&o&&(r[n]=o);try{localStorage.setItem(UR,JSON.stringify(r))}catch{}return Y("Syntro Bootstrap","Geo: fetched from worker:",r),r}}catch{}return{}}var GR={growthbook:t=>sh({...t,autoInit:!0})};function WR(t,e){let a=GR[t];if(!a)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(GR).join(", ")}`);return a(e)}var eU=["cdn.syntrologie.com","localhost","127.0.0.1"];function tU(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):eU.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 qS=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,!tU(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 aU(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 aU(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 ZR(t){return new qS(t)}var rU="syntro_exp",nU="syntro_var",$S=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 n=new URLSearchParams(window.location.search),o=n.get(rU),i=n.get(nU);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:mp(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 XR(t){return new $S(t)}var oU="https://cdn.syntrologie.com/configs",YR={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return ZR({baseUrl:t.baseUrl??oU,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return XR({featureKey:t.featureKey})}};function KR(t,e={}){let a=YR[t];if(!a)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(YR).join(", ")}`);return a(e)}var QR={posthog:t=>Xh(t),noop:()=>gh()};function JR(t,e){let a=QR[t];if(!a)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(QR).join(", ")}`);return a(e)}async function e2(t){tx(),Y("Syntro Bootstrap","====== INIT ======"),Y("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=bp();if(console.log(`[DIAG] Mode detection: sdkMode=${e}`),console.log("[DIAG] editorSource:",qu()),console.log("[DIAG] editorConf:",xp()),Y("Syntro Bootstrap","SDK mode:",e??"normal"),!e&&typeof window<"u"){let E=!!window.__SYNTRO_EDITOR_PARAMS__,D=!!window.__SYNTRO_AUDIT_LEGEND__,O=!!window.__SYNTRO_REVIEW_DATA__;if(E||D||O){let N=[E&&"__SYNTRO_EDITOR_PARAMS__",D&&"__SYNTRO_AUDIT_LEGEND__",O&&"__SYNTRO_REVIEW_DATA__"].filter(Boolean);console.warn(`[Syntro Bootstrap] \u26A0 Mode detection returned null but mode-specific globals found: ${N.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 D=xp()?.syntro_token;D?.startsWith("syn_")&&(a=D,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=Cl(a),tx(r.d);else if(e)Y("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${e} mode)`);else throw gp("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit/review mode!"),gp("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 gp("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=Wa("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||Wa("VITE_SYNTRO_EXPERIMENT_HOST")||r?.eh,o=Wa("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||Wa("VITE_SYNTRO_TELEMETRY_HOST")||r?.th,i=Wa("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||Wa("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,s=r?.g||Wa("NEXT_PUBLIC_SYNTRO_GEO_HOST")||Wa("VITE_SYNTRO_GEO_HOST")||jR,l=qR(),u=US(),c={...u,...l};Y("Syntro Bootstrap","Phase 1: Browser metadata:",u),Y("Syntro Bootstrap","Phase 1: Cached segment attributes:",l);let d=zS(s),f,h=t.debug||t.testMode,S=yl({debug:t.debug,history:h?new xl(t.testMode?0:100):void 0,testMode:t.testMode});console.log("[Syntro Bootstrap] EventBus created");let x=ix({elementResolver:typeof window<"u"?(E,D)=>{let O=document.elementFromPoint(E,D);if(!O)return null;let N={tag_name:O.tagName.toLowerCase()};O.id&&(N.attr__id=O.id),O.className&&typeof O.className=="string"&&(N.classes=O.className.split(" ").filter(Boolean));for(let W of O.attributes)W.name.startsWith("data-")&&(N[`attr__${W.name}`]=W.value);return N}:void 0});x.onEvent(E=>S.publishEvent(E)),typeof window<"u"&&(setInterval(()=>x.tick(Date.now()),1e3),document.addEventListener("click",E=>{let D=[],O=E.target;for(;O&&O!==document.body;){let N={tag_name:O.tagName.toLowerCase()};for(let W of O.attributes)(W.name.startsWith("data-")||W.name==="id"||W.name==="class"||W.name==="aria-label")&&(N[`attr__${W.name}`]=W.value);D.push(N),O=O.parentElement}x.enrichClickAttributes(Date.now(),D)},!0));let b=E=>{Y("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let D=VR(E);if(Y("Syntro Bootstrap","Segment flags from PostHog:",D),$R(D),f){let O=m?.getAll?.()??{},N={...u,...O,...D};Y("Syntro Bootstrap","Updating GrowthBook with attributes:",N),f.setAttributes?.(N)}},g;if(r?.t){let E=r.t==="noop"?"noop":"posthog";g=JR(E,{apiKey:r.t,apiHost:o,enableFeatureFlags:!0,sessionRecording:!r.d,onFeatureFlagsLoaded:b,onCapture:(O,N)=>{x.ingest({kind:"posthog",event:O,properties:N,timestamp:Date.now()})},onRRWebEvent:O=>{x.ingest(O)}}),console.log(`[Syntro Bootstrap] Telemetry client created (${E}) with EventBus wiring`);let D=g;S.setPosthogCapture((O,N)=>{D.track?.(O,N)})}let m;r?.e&&(f=WR("growthbook",{clientKey:r.e,apiHost:n,attributes:c,onExperimentViewed:g?.trackExperiment?(E,D,O)=>{g.trackExperiment(E,D,O)}:void 0})),m=lh({experiments:f,onMetricChange:(E,D)=>{Y("Syntro Bootstrap",`Session metric changed: ${E} = ${D}`)}}),Y("Syntro Bootstrap","SessionMetricTracker created");let y="production";e==="editor"?y="editor":e==="audit"?y="audit":Wa("NODE_ENV")==="development"&&(y="development");let v=Tm({telemetry:g,sessionMetrics:m,mode:y,events:S});Y("Syntro Bootstrap","Runtime created:",{version:v.version,mode:v.mode,hasContext:!!v.context,hasEvents:!!v.events,hasState:!!v.state}),Y("Syntro Bootstrap","Core app executors already registered");let C=t.cdnBase||Wa("NEXT_PUBLIC_SYNTRO_CDN_BASE")||Wa("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",w=op({cdnBase:C,registry:v.apps,onLoadStart:E=>{Y("Syntro Bootstrap",`Loading app from CDN: ${E}`)},onLoadEnd:(E,D,O)=>{D?Y("Syntro Bootstrap",`App loaded successfully: ${E}`):na("Syntro Bootstrap",`Failed to load app: ${E}`,O)}});typeof window<"u"&&(window.SynOS={...window.SynOS,appRegistry:v.apps,runtime:v,version:v.version},Y("Syntro Bootstrap","Global SynOS object exposed"));let _=v.apps.list?.()??[];console.log(`[DIAG] Activation loop: ${_.length} apps in registry:`,_.map(E=>`${E.manifest.id}(${E.state})`).join(", "));for(let E of _)if(E.state==="registered")try{await v.apps.activate(E.manifest.id),console.log(`[DIAG] Activated: ${E.manifest.id} \u2192 widgets: [${v.widgets.list().join(", ")}]`)}catch(D){console.error(`[DIAG] FAILED to activate: ${E.manifest.id}`,D),na("Syntro Bootstrap",`Failed to auto-activate built-in app: ${E.manifest.id}`,D)}if(console.log(`[DIAG] Activation complete. Total widgets: [${v.widgets.list().join(", ")}]`),f?.refreshFeatures)try{await f.refreshFeatures(),Y("Syntro Bootstrap","GrowthBook features loaded")}catch(E){na("Syntro Bootstrap","Failed to load GrowthBook features:",E)}let L=await d;if(f&&Object.keys(L).length>0){let E={...u,...L};Y("Syntro Bootstrap","Merging geo data into GrowthBook attributes:",L),f.setAttributes?.(E)}let A;if(t.fetcher)A=t.fetcher;else if(r?.f){let E=KR(r.f,r.o??{});A=async()=>{let D=await E.fetch();return{...D.config,tiles:D.config.tiles??[]}}}else f&&(A=ni({experiments:f}));let I=new Set,R=A?async()=>{let E=await A();console.log("[Syntro Bootstrap] Config fetched:",`tiles=${E.tiles?.length??0},`,`actions=${E.actions?.length??0},`,`theme=${E.theme?.name??"none"}`),E.actions?.length>0&&console.log("[Syntro Bootstrap] Actions in config:",E.actions.map((N,W)=>`[${W}] ${N.kind}${N.anchorId?` anchor="${N.anchorId.selector}"`:""}${N.label?` "${N.label}"`:""}`).join(", "));let D=E,O=w.getRequiredApps(D);return O.length>0?console.log("[Syntro Bootstrap] Required external apps:",O.join(", ")):Y("Syntro Bootstrap","No external apps required (all executors are built-in)"),O.length>0&&await w.loadAppsForConfig(D).then(async W=>{let H=W.filter(Ce=>Ce.success),Z=W.filter(Ce=>!Ce.success);H.length>0&&console.log(`[Syntro Bootstrap] Apps loaded from CDN: ${H.map(Ce=>Ce.appId).join(", ")}`);let he=Z.filter(Ce=>!I.has(Ce.appId));he.length>0&&(console.error("[Syntro Bootstrap] Apps FAILED to load from CDN:",he.map(Ce=>`${Ce.appId} (${Ce.error})`).join(", ")),he.forEach(Ce=>I.add(Ce.appId)));for(let Ce of O)if(v.apps.has(Ce))try{await v.apps.activate(Ce),console.log(`[Syntro Bootstrap] App activated: ${Ce}`)}catch(it){console.error(`[Syntro Bootstrap] Failed to activate app: ${Ce}`,it)}else console.error(`[Syntro Bootstrap] App "${Ce}" required by config but NOT registered.`,`Available apps: [${Array.from(v.apps.list?.()??[]).join(", ")}]`)}),E}:void 0;return{canvas:await $p({...t.canvas,fetcher:R,integrations:{experiments:f,telemetry:g},editorUrl:i,runtime:v}),runtime:v,experiments:f,telemetry:g,sessionMetrics:m,appLoader:w}}async function iU(t){try{return await e2(t)}catch(e){let a=e instanceof Error?e.message:String(e);console.warn("[Syntrologie] SDK initialization failed:",a),typeof document<"u"&&document.getElementById("syntrologie-anti-flicker")?.remove();return}}function sU(t,e={}){if(typeof window>"u")return;let a=window.SynOS?.runtime;a?.events?.publish&&a.events.publish({name:t,source:"custom",props:e})}var VS={init:iU,encodeToken:Rm,decodeToken:Cl,events:{emit:sU}};typeof window<"u"&&(window.Syntro=VS);var jS="2026-04-02T03:06:04.779Z (97626af337)";if(typeof window<"u"){console.log(`[Syntro Runtime] Build: ${jS}`);let t=window.SynOS,e=t?.appRegistry||Ls;window.SynOS={...t,appRegistry:e,_runtimeBuild:jS,React:t2.default,ReactDOM:{...lU,createPortal:Mm.createPortal,flushSync:Mm.flushSync}},AI(e)}return u2(uU);})();
|
|
523
523
|
/*! Bundled license information:
|
|
524
524
|
|
|
525
525
|
react/cjs/react.production.js:
|