@syntrologie/runtime-sdk 2.1.0-canary.1 → 2.1.0-canary.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CAPABILITIES.md +273 -22
- package/README.md +87 -0
- package/dist/RuntimeProvider.d.ts +1 -1
- package/dist/RuntimeProvider.js.map +1 -1
- package/dist/SmartCanvasApp.d.ts +4 -4
- package/dist/SmartCanvasApp.js +4 -4
- package/dist/SmartCanvasApp.js.map +1 -1
- package/dist/SmartCanvasElement.d.ts +2 -2
- package/dist/SmartCanvasElement.js +1 -1
- package/dist/SmartCanvasElement.js.map +1 -1
- package/dist/SmartCanvasPortal.js.map +1 -1
- package/dist/actions/ActionEngine.js +2 -4
- package/dist/actions/ActionEngine.js.map +1 -1
- package/dist/actions/executors/index.d.ts +1 -1
- package/dist/actions/executors/index.js +1 -1
- package/dist/actions/executors/index.js.map +1 -1
- package/dist/actions/executors/tour.js +3 -3
- package/dist/actions/executors/tour.js.map +1 -1
- package/dist/actions/validation.js +1 -1
- package/dist/actions/validation.js.map +1 -1
- package/dist/adaptives/adaptive-chatbot/index.js.map +7 -0
- package/dist/adaptives/faq/index.js +11 -0
- package/dist/adaptives/faq/index.js.map +7 -0
- package/dist/adaptives/nav/index.js.map +7 -0
- package/dist/api.d.ts +4 -4
- package/dist/api.js +4 -7
- package/dist/api.js.map +1 -1
- package/dist/apps/AppContext.js +3 -5
- package/dist/apps/AppContext.js.map +1 -1
- package/dist/apps/AppLoader.d.ts +1 -1
- package/dist/apps/AppLoader.js +2 -2
- package/dist/apps/AppLoader.js.map +1 -1
- package/dist/apps/AppRegistry.js.map +1 -1
- package/dist/apps/examples/gamification-app.example.d.ts +8 -8
- package/dist/apps/examples/gamification-app.example.js.map +1 -1
- package/dist/apps/types.d.ts +1 -1
- package/dist/blocks/data/ComparisonBlock.js +9 -9
- package/dist/blocks/data/ComparisonBlock.js.map +1 -1
- package/dist/blocks/data/StatsBlock.js +12 -14
- package/dist/blocks/data/StatsBlock.js.map +1 -1
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/index.js +3 -4
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/interactive/ChecklistBlock.js +12 -12
- package/dist/blocks/interactive/ChecklistBlock.js.map +1 -1
- package/dist/blocks/interactive/RatingBlock.js +12 -14
- package/dist/blocks/interactive/RatingBlock.js.map +1 -1
- package/dist/blocks/notification/NotificationBlock.js +24 -24
- package/dist/blocks/notification/NotificationBlock.js.map +1 -1
- package/dist/bootstrap.d.ts +5 -5
- package/dist/bootstrap.js +23 -30
- package/dist/bootstrap.js.map +1 -1
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -2
- package/dist/components/ShadowCanvasOverlay.js +25 -24
- package/dist/components/ShadowCanvasOverlay.js.map +1 -1
- package/dist/components/TileCard.d.ts +2 -2
- package/dist/components/TileCard.js +24 -23
- package/dist/components/TileCard.js.map +1 -1
- package/dist/components/TileWheel.d.ts +1 -1
- package/dist/components/TileWheel.js +23 -1
- package/dist/components/TileWheel.js.map +1 -1
- package/dist/configFetcher.d.ts +1 -1
- package/dist/configFetcher.js +36 -38
- package/dist/configFetcher.js.map +1 -1
- package/dist/context/ContextManager.d.ts +1 -1
- package/dist/context/ContextManager.js +4 -3
- package/dist/context/ContextManager.js.map +1 -1
- package/dist/context/schema.d.ts +8 -8
- package/dist/context/schema.js +1 -1
- package/dist/context/schema.js.map +1 -1
- package/dist/decisions/engine.d.ts +2 -2
- package/dist/decisions/engine.js.map +1 -1
- package/dist/decisions/schema.d.ts +34 -34
- package/dist/decisions/schema.js +1 -1
- package/dist/decisions/schema.js.map +1 -1
- package/dist/editorLoader.d.ts +19 -9
- package/dist/editorLoader.js +93 -96
- package/dist/editorLoader.js.map +1 -1
- package/dist/events/normalizers/canvas.d.ts +1 -1
- package/dist/events/normalizers/canvas.js.map +1 -1
- package/dist/events/schema.d.ts +4 -4
- package/dist/events/schema.js +1 -1
- package/dist/events/schema.js.map +1 -1
- package/dist/experiments/adapters/growthbook.d.ts +1 -1
- package/dist/experiments/adapters/growthbook.js +1 -1
- package/dist/experiments/adapters/growthbook.js.map +1 -1
- package/dist/fetchers/cdnFetcher.js.map +1 -1
- package/dist/fetchers/experimentsFetcher.d.ts +1 -1
- package/dist/fetchers/experimentsFetcher.js.map +1 -1
- package/dist/hooks/useCanvasOverlays.d.ts +1 -1
- package/dist/hooks/useCanvasOverlays.js +2 -2
- package/dist/hooks/useCanvasOverlays.js.map +1 -1
- package/dist/hooks/useHostPatches.js.map +1 -1
- package/dist/hooks/useShadowCanvasConfig.d.ts +1 -1
- package/dist/hooks/useShadowCanvasConfig.js.map +1 -1
- package/dist/hostPatcher/core/patcher.js.map +1 -1
- package/dist/hostPatcher/policy/defaultPolicy.js.map +1 -1
- package/dist/overlays/fetcher.d.ts +1 -1
- package/dist/overlays/fetcher.js +12 -14
- package/dist/overlays/fetcher.js.map +1 -1
- package/dist/overlays/runtime/overlay/runner.js +18 -5
- package/dist/overlays/runtime/overlay/runner.js.map +1 -1
- package/dist/overlays/runtime/overlay/tooltip.js +3 -5
- package/dist/overlays/runtime/overlay/tooltip.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js.map +1 -1
- package/dist/render/RenderContext.js.map +1 -1
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +19 -4
- package/dist/runtime.js.map +1 -1
- package/dist/smart-canvas.esm.js +61 -49
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +22764 -25177
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +61 -49
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/state/StateStore.d.ts +0 -6
- package/dist/state/StateStore.js +7 -1
- package/dist/state/StateStore.js.map +1 -1
- package/dist/surfaces/Surfaces.js +1 -1
- package/dist/surfaces/Surfaces.js.map +1 -1
- package/dist/surfaces/positioning.js.map +1 -1
- package/dist/telemetry/adapters/posthog.js +1 -1
- package/dist/telemetry/adapters/posthog.js.map +1 -1
- package/dist/telemetry/registry.d.ts +0 -7
- package/dist/telemetry/registry.js +1 -1
- package/dist/telemetry/registry.js.map +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/defaultTheme.d.ts +2 -3
- package/dist/theme/defaultTheme.js +60 -51
- package/dist/theme/defaultTheme.js.map +1 -1
- package/dist/theme/extractHostTheme.js +1 -1
- package/dist/theme/extractHostTheme.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -1
- package/dist/types.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +20 -15
- package/dist/apps/adaptive-chatbot/index.js.map +0 -7
- package/dist/apps/faq/index.js +0 -11
- package/dist/apps/faq/index.js.map +0 -7
- package/dist/apps/nav/index.js.map +0 -7
- /package/dist/{apps → adaptives}/adaptive-chatbot/index.js +0 -0
- /package/dist/{apps → adaptives}/gamification/index.js +0 -0
- /package/dist/{apps → adaptives}/gamification/index.js.map +0 -0
- /package/dist/{apps → adaptives}/nav/index.js +0 -0
package/dist/smart-canvas.esm.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
var Sk=Object.create;var Za=Object.defineProperty;var bk=Object.getOwnPropertyDescriptor;var kk=Object.getOwnPropertyNames;var Ck=Object.getPrototypeOf,Ek=Object.prototype.hasOwnProperty;var $m=t=>{throw TypeError(t)};var Ak=(t,e,n)=>e in t?Za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Tn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Tk=(t,e)=>{for(var n in e)Za(t,n,{get:e[n],enumerable:!0})},Rk=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kk(e))!Ek.call(t,i)&&i!==n&&Za(t,i,{get:()=>e[i],enumerable:!(r=bk(e,i))||r.enumerable});return t};var ee=(t,e,n)=>(n=t!=null?Sk(Ck(t)):{},Rk(e||!t||!t.__esModule?Za(n,"default",{value:t,enumerable:!0}):n,t));var j=(t,e,n)=>Ak(t,typeof e!="symbol"?e+"":e,n),Dm=(t,e,n)=>e.has(t)||$m("Cannot "+n);var xe=(t,e,n)=>(Dm(t,e,"read from private field"),n?n.call(t):e.get(t)),ar=(t,e,n)=>e.has(t)?$m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),dn=(t,e,n,r)=>(Dm(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var F_=Tn(ne=>{"use strict";var Vs=Symbol.for("react.element"),cE=Symbol.for("react.portal"),dE=Symbol.for("react.fragment"),fE=Symbol.for("react.strict_mode"),pE=Symbol.for("react.profiler"),hE=Symbol.for("react.provider"),gE=Symbol.for("react.context"),mE=Symbol.for("react.forward_ref"),vE=Symbol.for("react.suspense"),yE=Symbol.for("react.memo"),_E=Symbol.for("react.lazy"),C_=Symbol.iterator;function wE(t){return t===null||typeof t!="object"?null:(t=C_&&t[C_]||t["@@iterator"],typeof t=="function"?t:null)}var T_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R_=Object.assign,I_={};function fo(t,e,n){this.props=t,this.context=e,this.refs=I_,this.updater=n||T_}fo.prototype.isReactComponent={};fo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): 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")};fo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function P_(){}P_.prototype=fo.prototype;function sp(t,e,n){this.props=t,this.context=e,this.refs=I_,this.updater=n||T_}var ap=sp.prototype=new P_;ap.constructor=sp;R_(ap,fo.prototype);ap.isPureReactComponent=!0;var E_=Array.isArray,N_=Object.prototype.hasOwnProperty,lp={current:null},O_={key:!0,ref:!0,__self:!0,__source:!0};function L_(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)N_.call(e,r)&&!O_.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Vs,type:t,key:o,ref:s,props:i,_owner:lp.current}}function xE(t,e){return{$$typeof:Vs,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function up(t){return typeof t=="object"&&t!==null&&t.$$typeof===Vs}function SE(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var A_=/\/+/g;function op(t,e){return typeof t=="object"&&t!==null&&t.key!=null?SE(""+t.key):e.toString(36)}function Gl(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Vs:case cE:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+op(s,0):r,E_(i)?(n="",t!=null&&(n=t.replace(A_,"$&/")+"/"),Gl(i,e,n,"",function(u){return u})):i!=null&&(up(i)&&(i=xE(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(A_,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",E_(t))for(var a=0;a<t.length;a++){o=t[a];var l=r+op(o,a);s+=Gl(o,e,n,l,i)}else if(l=wE(t),typeof l=="function")for(t=l.call(t),a=0;!(o=t.next()).done;)o=o.value,l=r+op(o,a++),s+=Gl(o,e,n,l,i);else if(o==="object")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 s}function Kl(t,e,n){if(t==null)return t;var r=[],i=0;return Gl(t,r,"","",function(o){return e.call(n,o,i++)}),r}function bE(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ot={current:null},Zl={transition:null},kE={ReactCurrentDispatcher:ot,ReactCurrentBatchConfig:Zl,ReactCurrentOwner:lp};function M_(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Kl,forEach:function(t,e,n){Kl(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Kl(t,function(){e++}),e},toArray:function(t){return Kl(t,function(e){return e})||[]},only:function(t){if(!up(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ne.Component=fo;ne.Fragment=dE;ne.Profiler=pE;ne.PureComponent=sp;ne.StrictMode=fE;ne.Suspense=vE;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kE;ne.act=M_;ne.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=R_({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=lp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)N_.call(e,l)&&!O_.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vs,type:t.type,key:i,ref:o,props:r,_owner:s}};ne.createContext=function(t){return t={$$typeof:gE,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:hE,_context:t},t.Consumer=t};ne.createElement=L_;ne.createFactory=function(t){var e=L_.bind(null,t);return e.type=t,e};ne.createRef=function(){return{current:null}};ne.forwardRef=function(t){return{$$typeof:mE,render:t}};ne.isValidElement=up;ne.lazy=function(t){return{$$typeof:_E,_payload:{_status:-1,_result:t},_init:bE}};ne.memo=function(t,e){return{$$typeof:yE,type:t,compare:e===void 0?null:e}};ne.startTransition=function(t){var e=Zl.transition;Zl.transition={};try{t()}finally{Zl.transition=e}};ne.unstable_act=M_;ne.useCallback=function(t,e){return ot.current.useCallback(t,e)};ne.useContext=function(t){return ot.current.useContext(t)};ne.useDebugValue=function(){};ne.useDeferredValue=function(t){return ot.current.useDeferredValue(t)};ne.useEffect=function(t,e){return ot.current.useEffect(t,e)};ne.useId=function(){return ot.current.useId()};ne.useImperativeHandle=function(t,e,n){return ot.current.useImperativeHandle(t,e,n)};ne.useInsertionEffect=function(t,e){return ot.current.useInsertionEffect(t,e)};ne.useLayoutEffect=function(t,e){return ot.current.useLayoutEffect(t,e)};ne.useMemo=function(t,e){return ot.current.useMemo(t,e)};ne.useReducer=function(t,e,n){return ot.current.useReducer(t,e,n)};ne.useRef=function(t){return ot.current.useRef(t)};ne.useState=function(t){return ot.current.useState(t)};ne.useSyncExternalStore=function(t,e,n){return ot.current.useSyncExternalStore(t,e,n)};ne.useTransition=function(){return ot.current.useTransition()};ne.version="18.3.1"});var Et=Tn((IN,$_)=>{"use strict";$_.exports=F_()});var z_=Tn(Xl=>{"use strict";var AE=Et(),TE=Symbol.for("react.element"),RE=Symbol.for("react.fragment"),IE=Object.prototype.hasOwnProperty,PE=AE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,NE={key:!0,ref:!0,__self:!0,__source:!0};function B_(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)IE.call(e,r)&&!NE.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:TE,type:t,key:o,ref:s,props:i,_owner:PE.current}}Xl.Fragment=RE;Xl.jsx=B_;Xl.jsxs=B_});var ve=Tn((MN,H_)=>{"use strict";H_.exports=z_()});var n0=Tn(ge=>{"use strict";function bp(t,e){var n=t.length;t.push(e);e:for(;0<n;){var r=n-1>>>1,i=t[r];if(0<eu(i,e))t[r]=e,t[n]=i,n=r;else break e}}function Xt(t){return t.length===0?null:t[0]}function nu(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var r=0,i=t.length,o=i>>>1;r<o;){var s=2*(r+1)-1,a=t[s],l=s+1,u=t[l];if(0>eu(a,n))l<i&&0>eu(u,a)?(t[r]=u,t[l]=n,r=l):(t[r]=a,t[s]=n,r=s);else if(l<i&&0>eu(u,n))t[r]=u,t[l]=n,r=l;else break e}}return e}function eu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?(K_=performance,ge.unstable_now=function(){return K_.now()}):(wp=Date,G_=wp.now(),ge.unstable_now=function(){return wp.now()-G_});var K_,wp,G_,yn=[],xr=[],fA=1,$t=null,Xe=3,ru=!1,li=!1,js=!1,X_=typeof setTimeout=="function"?setTimeout:null,Q_=typeof clearTimeout=="function"?clearTimeout:null,Z_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function kp(t){for(var e=Xt(xr);e!==null;){if(e.callback===null)nu(xr);else if(e.startTime<=t)nu(xr),e.sortIndex=e.expirationTime,bp(yn,e);else break;e=Xt(xr)}}function Cp(t){if(js=!1,kp(t),!li)if(Xt(yn)!==null)li=!0,Ap(Ep);else{var e=Xt(xr);e!==null&&Tp(Cp,e.startTime-t)}}function Ep(t,e){li=!1,js&&(js=!1,Q_(Us),Us=-1),ru=!0;var n=Xe;try{for(kp(e),$t=Xt(yn);$t!==null&&(!($t.expirationTime>e)||t&&!t0());){var r=$t.callback;if(typeof r=="function"){$t.callback=null,Xe=$t.priorityLevel;var i=r($t.expirationTime<=e);e=ge.unstable_now(),typeof i=="function"?$t.callback=i:$t===Xt(yn)&&nu(yn),kp(e)}else nu(yn);$t=Xt(yn)}if($t!==null)var o=!0;else{var s=Xt(xr);s!==null&&Tp(Cp,s.startTime-e),o=!1}return o}finally{$t=null,Xe=n,ru=!1}}var iu=!1,tu=null,Us=-1,J_=5,e0=-1;function t0(){return!(ge.unstable_now()-e0<J_)}function xp(){if(tu!==null){var t=ge.unstable_now();e0=t;var e=!0;try{e=tu(!0,t)}finally{e?Hs():(iu=!1,tu=null)}}else iu=!1}var Hs;typeof Z_=="function"?Hs=function(){Z_(xp)}:typeof MessageChannel<"u"?(Sp=new MessageChannel,Y_=Sp.port2,Sp.port1.onmessage=xp,Hs=function(){Y_.postMessage(null)}):Hs=function(){X_(xp,0)};var Sp,Y_;function Ap(t){tu=t,iu||(iu=!0,Hs())}function Tp(t,e){Us=X_(function(){t(ge.unstable_now())},e)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(t){t.callback=null};ge.unstable_continueExecution=function(){li||ru||(li=!0,Ap(Ep))};ge.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"):J_=0<t?Math.floor(1e3/t):5};ge.unstable_getCurrentPriorityLevel=function(){return Xe};ge.unstable_getFirstCallbackNode=function(){return Xt(yn)};ge.unstable_next=function(t){switch(Xe){case 1:case 2:case 3:var e=3;break;default:e=Xe}var n=Xe;Xe=e;try{return t()}finally{Xe=n}};ge.unstable_pauseExecution=function(){};ge.unstable_requestPaint=function(){};ge.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Xe;Xe=t;try{return e()}finally{Xe=n}};ge.unstable_scheduleCallback=function(t,e,n){var r=ge.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,t){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=n+i,t={id:fA++,callback:e,priorityLevel:t,startTime:n,expirationTime:i,sortIndex:-1},n>r?(t.sortIndex=n,bp(xr,t),Xt(yn)===null&&t===Xt(xr)&&(js?(Q_(Us),Us=-1):js=!0,Tp(Cp,n-r))):(t.sortIndex=i,bp(yn,t),li||ru||(li=!0,Ap(Ep))),t};ge.unstable_shouldYield=t0;ge.unstable_wrapCallback=function(t){var e=Xe;return function(){var n=Xe;Xe=e;try{return t.apply(this,arguments)}finally{Xe=n}}}});var i0=Tn((SO,r0)=>{"use strict";r0.exports=n0()});var lS=Tn(Nt=>{"use strict";var pA=Et(),It=i0();function R(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);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."}var dw=new Set,fa={};function xi(t,e){Mo(t,e),Mo(t+"Capture",e)}function Mo(t,e){for(fa[t]=e,t=0;t<e.length;t++)dw.add(e[t])}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xp=Object.prototype.hasOwnProperty,hA=/^[: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]*$/,o0={},s0={};function gA(t){return Xp.call(s0,t)?!0:Xp.call(o0,t)?!1:hA.test(t)?s0[t]=!0:(o0[t]=!0,!1)}function mA(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function vA(t,e,n,r){if(e===null||typeof e>"u"||mA(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function lt(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ge[t]=new lt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ge[e]=new lt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ge[t]=new lt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ge[t]=new lt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ge[t]=new lt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ge[t]=new lt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ge[t]=new lt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ge[t]=new lt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ge[t]=new lt(t,5,!1,t.toLowerCase(),null,!1,!1)});var jh=/[\-:]([a-z])/g;function Uh(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(jh,Uh);Ge[e]=new lt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(jh,Uh);Ge[e]=new lt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(jh,Uh);Ge[e]=new lt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ge[t]=new lt(t,1,!1,t.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ge[t]=new lt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Wh(t,e,n,r){var i=Ge.hasOwnProperty(e)?Ge[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(vA(e,n,i,r)&&(n=null),r||i===null?gA(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Kn=pA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ou=Symbol.for("react.element"),vo=Symbol.for("react.portal"),yo=Symbol.for("react.fragment"),qh=Symbol.for("react.strict_mode"),Qp=Symbol.for("react.profiler"),fw=Symbol.for("react.provider"),pw=Symbol.for("react.context"),Kh=Symbol.for("react.forward_ref"),Jp=Symbol.for("react.suspense"),eh=Symbol.for("react.suspense_list"),Gh=Symbol.for("react.memo"),br=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var hw=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var a0=Symbol.iterator;function Ws(t){return t===null||typeof t!="object"?null:(t=a0&&t[a0]||t["@@iterator"],typeof t=="function"?t:null)}var Re=Object.assign,Rp;function Js(t){if(Rp===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Rp=e&&e[1]||""}return`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`),
|
|
5
|
-
`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Ip=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Js(t):""}function yA(t){switch(t.tag){case 5:return Js(t.type);case 16:return Js("Lazy");case 13:return Js("Suspense");case 19:return Js("SuspenseList");case 0:case 2:case 15:return t=Pp(t.type,!1),t;case 11:return t=Pp(t.type.render,!1),t;case 1:return t=Pp(t.type,!0),t;default:return""}}function th(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case yo:return"Fragment";case vo:return"Portal";case Qp:return"Profiler";case qh:return"StrictMode";case Jp:return"Suspense";case eh:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case pw:return(t.displayName||"Context")+".Consumer";case fw:return(t._context.displayName||"Context")+".Provider";case Kh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Gh:return e=t.displayName||null,e!==null?e:th(t.type)||"Memo";case br:e=t._payload,t=t._init;try{return th(t(e))}catch{}}return null}function _A(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return th(e);case 8:return e===qh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function $r(t){switch(typeof t){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 wA(t){var e=gw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function su(t){t._valueTracker||(t._valueTracker=wA(t))}function mw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=gw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Lu(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}}function nh(t,e){var n=e.checked;return Re({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function l0(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=$r(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function vw(t,e){e=e.checked,e!=null&&Wh(t,"checked",e,!1)}function rh(t,e){vw(t,e);var n=$r(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?ih(t,e.type,n):e.hasOwnProperty("defaultValue")&&ih(t,e.type,$r(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function u0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function ih(t,e,n){(e!=="number"||Lu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ea=Array.isArray;function Ro(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+$r(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function oh(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(R(91));return Re({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function c0(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(R(92));if(ea(n)){if(1<n.length)throw Error(R(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:$r(n)}}function yw(t,e){var n=$r(e.value),r=$r(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function d0(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function _w(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function sh(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?_w(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var au,ww=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t})(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(au=au||document.createElement("div"),au.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=au.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function pa(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ra={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xA=["Webkit","ms","Moz","O"];Object.keys(ra).forEach(function(t){xA.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ra[e]=ra[t]})});function xw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ra.hasOwnProperty(t)&&ra[t]?(""+e).trim():e+"px"}function Sw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=xw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var SA=Re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ah(t,e){if(e){if(SA[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(R(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(R(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(R(61))}if(e.style!=null&&typeof e.style!="object")throw Error(R(62))}}function lh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";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 uh=null;function Zh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ch=null,Io=null,Po=null;function f0(t){if(t=Pa(t)){if(typeof ch!="function")throw Error(R(280));var e=t.stateNode;e&&(e=lc(e),ch(t.stateNode,t.type,e))}}function bw(t){Io?Po?Po.push(t):Po=[t]:Io=t}function kw(){if(Io){var t=Io,e=Po;if(Po=Io=null,f0(t),e)for(t=0;t<e.length;t++)f0(e[t])}}function Cw(t,e){return t(e)}function Ew(){}var Np=!1;function Aw(t,e,n){if(Np)return t(e,n);Np=!0;try{return Cw(t,e,n)}finally{Np=!1,(Io!==null||Po!==null)&&(Ew(),kw())}}function ha(t,e){var n=t.stateNode;if(n===null)return null;var r=lc(n);if(r===null)return null;n=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(n&&typeof n!="function")throw Error(R(231,e,typeof n));return n}var dh=!1;if(jn)try{go={},Object.defineProperty(go,"passive",{get:function(){dh=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{dh=!1}var go;function bA(t,e,n,r,i,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var ia=!1,Mu=null,Fu=!1,fh=null,kA={onError:function(t){ia=!0,Mu=t}};function CA(t,e,n,r,i,o,s,a,l){ia=!1,Mu=null,bA.apply(kA,arguments)}function EA(t,e,n,r,i,o,s,a,l){if(CA.apply(this,arguments),ia){if(ia){var u=Mu;ia=!1,Mu=null}else throw Error(R(198));Fu||(Fu=!0,fh=u)}}function Si(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n: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 p0(t){if(Si(t)!==t)throw Error(R(188))}function AA(t){var e=t.alternate;if(!e){if(e=Si(t),e===null)throw Error(R(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return p0(i),t;if(o===r)return p0(i),e;o=o.sibling}throw Error(R(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(R(189))}}if(n.alternate!==r)throw Error(R(190))}if(n.tag!==3)throw Error(R(188));return n.stateNode.current===n?t:e}function Rw(t){return t=AA(t),t!==null?Iw(t):null}function Iw(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Iw(t);if(e!==null)return e;t=t.sibling}return null}var Pw=It.unstable_scheduleCallback,h0=It.unstable_cancelCallback,TA=It.unstable_shouldYield,RA=It.unstable_requestPaint,Ne=It.unstable_now,IA=It.unstable_getCurrentPriorityLevel,Yh=It.unstable_ImmediatePriority,Nw=It.unstable_UserBlockingPriority,$u=It.unstable_NormalPriority,PA=It.unstable_LowPriority,Ow=It.unstable_IdlePriority,ic=null,Sn=null;function NA(t){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(ic,t,void 0,(t.current.flags&128)===128)}catch{}}var nn=Math.clz32?Math.clz32:MA,OA=Math.log,LA=Math.LN2;function MA(t){return t>>>=0,t===0?32:31-(OA(t)/LA|0)|0}var lu=64,uu=4194304;function ta(t){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: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Du(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=ta(a):(o&=s,o!==0&&(r=ta(o)))}else s=n&~i,s!==0?r=ta(s):o!==0&&(r=ta(o));if(r===0)return 0;if(e!==0&&e!==r&&(e&i)===0&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if((r&4)!==0&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-nn(e),i=1<<n,r|=t[n],e&=~i;return r}function FA(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $A(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-nn(o),a=1<<s,l=i[s];l===-1?((a&n)===0||(a&r)!==0)&&(i[s]=FA(a,e)):l<=e&&(t.expiredLanes|=a),o&=~a}}function ph(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Lw(){var t=lu;return lu<<=1,(lu&4194240)===0&&(lu=64),t}function Op(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ra(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-nn(e),t[e]=n}function DA(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-nn(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function Xh(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-nn(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var ce=0;function Mw(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Fw,Qh,$w,Dw,Vw,hh=!1,cu=[],Rr=null,Ir=null,Pr=null,ga=new Map,ma=new Map,Cr=[],VA="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 submit".split(" ");function g0(t,e){switch(t){case"focusin":case"focusout":Rr=null;break;case"dragenter":case"dragleave":Ir=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":ga.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ma.delete(e.pointerId)}}function qs(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=Pa(e),e!==null&&Qh(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function BA(t,e,n,r,i){switch(e){case"focusin":return Rr=qs(Rr,t,e,n,r,i),!0;case"dragenter":return Ir=qs(Ir,t,e,n,r,i),!0;case"mouseover":return Pr=qs(Pr,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return ga.set(o,qs(ga.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,ma.set(o,qs(ma.get(o)||null,t,e,n,r,i)),!0}return!1}function Bw(t){var e=di(t.target);if(e!==null){var n=Si(e);if(n!==null){if(e=n.tag,e===13){if(e=Tw(n),e!==null){t.blockedOn=e,Vw(t.priority,function(){$w(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ku(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=gh(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);uh=r,n.target.dispatchEvent(r),uh=null}else return e=Pa(n),e!==null&&Qh(e),t.blockedOn=n,!1;e.shift()}return!0}function m0(t,e,n){ku(t)&&n.delete(e)}function zA(){hh=!1,Rr!==null&&ku(Rr)&&(Rr=null),Ir!==null&&ku(Ir)&&(Ir=null),Pr!==null&&ku(Pr)&&(Pr=null),ga.forEach(m0),ma.forEach(m0)}function Ks(t,e){t.blockedOn===e&&(t.blockedOn=null,hh||(hh=!0,It.unstable_scheduleCallback(It.unstable_NormalPriority,zA)))}function va(t){function e(i){return Ks(i,t)}if(0<cu.length){Ks(cu[0],t);for(var n=1;n<cu.length;n++){var r=cu[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Rr!==null&&Ks(Rr,t),Ir!==null&&Ks(Ir,t),Pr!==null&&Ks(Pr,t),ga.forEach(e),ma.forEach(e),n=0;n<Cr.length;n++)r=Cr[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Cr.length&&(n=Cr[0],n.blockedOn===null);)Bw(n),n.blockedOn===null&&Cr.shift()}var No=Kn.ReactCurrentBatchConfig,Vu=!0;function HA(t,e,n,r){var i=ce,o=No.transition;No.transition=null;try{ce=1,Jh(t,e,n,r)}finally{ce=i,No.transition=o}}function jA(t,e,n,r){var i=ce,o=No.transition;No.transition=null;try{ce=4,Jh(t,e,n,r)}finally{ce=i,No.transition=o}}function Jh(t,e,n,r){if(Vu){var i=gh(t,e,n,r);if(i===null)Bp(t,e,r,Bu,n),g0(t,r);else if(BA(i,t,e,n,r))r.stopPropagation();else if(g0(t,r),e&4&&-1<VA.indexOf(t)){for(;i!==null;){var o=Pa(i);if(o!==null&&Fw(o),o=gh(t,e,n,r),o===null&&Bp(t,e,r,Bu,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Bp(t,e,r,null,n)}}var Bu=null;function gh(t,e,n,r){if(Bu=null,t=Zh(r),t=di(t),t!==null)if(e=Si(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Tw(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Bu=t,null}function zw(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(IA()){case Yh:return 1;case Nw:return 4;case $u:case PA:return 16;case Ow:return 536870912;default:return 16}default:return 16}}var Ar=null,eg=null,Cu=null;function Hw(){if(Cu)return Cu;var t,e=eg,n=e.length,r,i="value"in Ar?Ar.value:Ar.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[o-r];r++);return Cu=i.slice(t,1<r?1-r:void 0)}function Eu(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 du(){return!0}function v0(){return!1}function Pt(t){function e(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?du:v0,this.isPropagationStopped=v0,this}return Re(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=du)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=du)},persist:function(){},isPersistent:du}),e}var Ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tg=Pt(Ho),Ia=Re({},Ho,{view:0,detail:0}),UA=Pt(Ia),Lp,Mp,Gs,oc=Re({},Ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ng,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!==Gs&&(Gs&&t.type==="mousemove"?(Lp=t.screenX-Gs.screenX,Mp=t.screenY-Gs.screenY):Mp=Lp=0,Gs=t),Lp)},movementY:function(t){return"movementY"in t?t.movementY:Mp}}),y0=Pt(oc),WA=Re({},oc,{dataTransfer:0}),qA=Pt(WA),KA=Re({},Ia,{relatedTarget:0}),Fp=Pt(KA),GA=Re({},Ho,{animationName:0,elapsedTime:0,pseudoElement:0}),ZA=Pt(GA),YA=Re({},Ho,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),XA=Pt(YA),QA=Re({},Ho,{data:0}),_0=Pt(QA),JA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eT={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"},tT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=tT[t])?!!e[t]:!1}function ng(){return nT}var rT=Re({},Ia,{key:function(t){if(t.key){var e=JA[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Eu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?eT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ng,charCode:function(t){return t.type==="keypress"?Eu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Eu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),iT=Pt(rT),oT=Re({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),w0=Pt(oT),sT=Re({},Ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ng}),aT=Pt(sT),lT=Re({},Ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),uT=Pt(lT),cT=Re({},oc,{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}),dT=Pt(cT),fT=[9,13,27,32],rg=jn&&"CompositionEvent"in window,oa=null;jn&&"documentMode"in document&&(oa=document.documentMode);var pT=jn&&"TextEvent"in window&&!oa,jw=jn&&(!rg||oa&&8<oa&&11>=oa),x0=" ",S0=!1;function Uw(t,e){switch(t){case"keyup":return fT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ww(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _o=!1;function hT(t,e){switch(t){case"compositionend":return Ww(e);case"keypress":return e.which!==32?null:(S0=!0,x0);case"textInput":return t=e.data,t===x0&&S0?null:t;default:return null}}function gT(t,e){if(_o)return t==="compositionend"||!rg&&Uw(t,e)?(t=Hw(),Cu=eg=Ar=null,_o=!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 jw&&e.locale!=="ko"?null:e.data;default:return null}}var mT={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 b0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!mT[t.type]:e==="textarea"}function qw(t,e,n,r){bw(r),e=zu(e,"onChange"),0<e.length&&(n=new tg("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var sa=null,ya=null;function vT(t){rx(t,0)}function sc(t){var e=So(t);if(mw(e))return t}function yT(t,e){if(t==="change")return e}var Kw=!1;jn&&(jn?(pu="oninput"in document,pu||($p=document.createElement("div"),$p.setAttribute("oninput","return;"),pu=typeof $p.oninput=="function"),fu=pu):fu=!1,Kw=fu&&(!document.documentMode||9<document.documentMode));var fu,pu,$p;function k0(){sa&&(sa.detachEvent("onpropertychange",Gw),ya=sa=null)}function Gw(t){if(t.propertyName==="value"&&sc(ya)){var e=[];qw(e,ya,t,Zh(t)),Aw(vT,e)}}function _T(t,e,n){t==="focusin"?(k0(),sa=e,ya=n,sa.attachEvent("onpropertychange",Gw)):t==="focusout"&&k0()}function wT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return sc(ya)}function xT(t,e){if(t==="click")return sc(e)}function ST(t,e){if(t==="input"||t==="change")return sc(e)}function bT(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var on=typeof Object.is=="function"?Object.is:bT;function _a(t,e){if(on(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Xp.call(e,i)||!on(t[i],e[i]))return!1}return!0}function C0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function E0(t,e){var n=C0(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=C0(n)}}function Zw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Zw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Yw(){for(var t=window,e=Lu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Lu(t.document)}return e}function ig(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")}function kT(t){var e=Yw(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Zw(n.ownerDocument.documentElement,n)){if(r!==null&&ig(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=E0(n,o);var s=E0(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var CT=jn&&"documentMode"in document&&11>=document.documentMode,wo=null,mh=null,aa=null,vh=!1;function A0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vh||wo==null||wo!==Lu(r)||(r=wo,"selectionStart"in r&&ig(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}),aa&&_a(aa,r)||(aa=r,r=zu(mh,"onSelect"),0<r.length&&(e=new tg("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=wo)))}function hu(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xo={animationend:hu("Animation","AnimationEnd"),animationiteration:hu("Animation","AnimationIteration"),animationstart:hu("Animation","AnimationStart"),transitionend:hu("Transition","TransitionEnd")},Dp={},Xw={};jn&&(Xw=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function ac(t){if(Dp[t])return Dp[t];if(!xo[t])return t;var e=xo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Xw)return Dp[t]=e[n];return t}var Qw=ac("animationend"),Jw=ac("animationiteration"),ex=ac("animationstart"),tx=ac("transitionend"),nx=new Map,T0="abort auxClick 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(" ");function Vr(t,e){nx.set(t,e),xi(e,[t])}for(gu=0;gu<T0.length;gu++)mu=T0[gu],R0=mu.toLowerCase(),I0=mu[0].toUpperCase()+mu.slice(1),Vr(R0,"on"+I0);var mu,R0,I0,gu;Vr(Qw,"onAnimationEnd");Vr(Jw,"onAnimationIteration");Vr(ex,"onAnimationStart");Vr("dblclick","onDoubleClick");Vr("focusin","onFocus");Vr("focusout","onBlur");Vr(tx,"onTransitionEnd");Mo("onMouseEnter",["mouseout","mouseover"]);Mo("onMouseLeave",["mouseout","mouseover"]);Mo("onPointerEnter",["pointerout","pointerover"]);Mo("onPointerLeave",["pointerout","pointerover"]);xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xi("onBeforeInput",["compositionend","keypress","textInput","paste"]);xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var na="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(" "),ET=new Set("cancel close invalid load scroll toggle".split(" ").concat(na));function P0(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,EA(r,e,void 0,t),t.currentTarget=null}function rx(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;P0(i,a,u),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;P0(i,a,u),o=l}}}if(Fu)throw t=fh,Fu=!1,fh=null,t}function ye(t,e){var n=e[Sh];n===void 0&&(n=e[Sh]=new Set);var r=t+"__bubble";n.has(r)||(ix(e,t,2,!1),n.add(r))}function Vp(t,e,n){var r=0;e&&(r|=4),ix(n,t,r,e)}var vu="_reactListening"+Math.random().toString(36).slice(2);function wa(t){if(!t[vu]){t[vu]=!0,dw.forEach(function(n){n!=="selectionchange"&&(ET.has(n)||Vp(n,!1,t),Vp(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[vu]||(e[vu]=!0,Vp("selectionchange",!1,e))}}function ix(t,e,n,r){switch(zw(e)){case 1:var i=HA;break;case 4:i=jA;break;default:i=Jh}n=i.bind(null,e,n,t),i=void 0,!dh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Bp(t,e,n,r,i){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=di(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}Aw(function(){var u=o,c=Zh(n),f=[];e:{var h=nx.get(t);if(h!==void 0){var g=tg,v=t;switch(t){case"keypress":if(Eu(n)===0)break e;case"keydown":case"keyup":g=iT;break;case"focusin":v="focus",g=Fp;break;case"focusout":v="blur",g=Fp;break;case"beforeblur":case"afterblur":g=Fp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=qA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=aT;break;case Qw:case Jw:case ex:g=ZA;break;case tx:g=uT;break;case"scroll":g=UA;break;case"wheel":g=dT;break;case"copy":case"cut":case"paste":g=XA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=w0}var _=(e&4)!==0,x=!_&&t==="scroll",d=_?h!==null?h+"Capture":null:h;_=[];for(var p=u,m;p!==null;){m=p;var y=m.stateNode;if(m.tag===5&&y!==null&&(m=y,d!==null&&(y=ha(p,d),y!=null&&_.push(xa(p,y,m)))),x)break;p=p.return}0<_.length&&(h=new g(h,v,null,n,c),f.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&n!==uh&&(v=n.relatedTarget||n.fromElement)&&(di(v)||v[Un]))break e;if((g||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=u,v=v?di(v):null,v!==null&&(x=Si(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=u),g!==v)){if(_=y0,y="onMouseLeave",d="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=w0,y="onPointerLeave",d="onPointerEnter",p="pointer"),x=g==null?h:So(g),m=v==null?h:So(v),h=new _(y,p+"leave",g,n,c),h.target=x,h.relatedTarget=m,y=null,di(c)===u&&(_=new _(d,p+"enter",v,n,c),_.target=m,_.relatedTarget=x,y=_),x=y,g&&v)t:{for(_=g,d=v,p=0,m=_;m;m=mo(m))p++;for(m=0,y=d;y;y=mo(y))m++;for(;0<p-m;)_=mo(_),p--;for(;0<m-p;)d=mo(d),m--;for(;p--;){if(_===d||d!==null&&_===d.alternate)break t;_=mo(_),d=mo(d)}_=null}else _=null;g!==null&&N0(f,h,g,_,!1),v!==null&&x!==null&&N0(f,x,v,_,!0)}}e:{if(h=u?So(u):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var w=yT;else if(b0(h))if(Kw)w=ST;else{w=wT;var b=_T}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=xT);if(w&&(w=w(t,u))){qw(f,w,n,c);break e}b&&b(t,h,u),t==="focusout"&&(b=h._wrapperState)&&b.controlled&&h.type==="number"&&ih(h,"number",h.value)}switch(b=u?So(u):window,t){case"focusin":(b0(b)||b.contentEditable==="true")&&(wo=b,mh=u,aa=null);break;case"focusout":aa=mh=wo=null;break;case"mousedown":vh=!0;break;case"contextmenu":case"mouseup":case"dragend":vh=!1,A0(f,n,c);break;case"selectionchange":if(CT)break;case"keydown":case"keyup":A0(f,n,c)}var k;if(rg)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else _o?Uw(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(jw&&n.locale!=="ko"&&(_o||C!=="onCompositionStart"?C==="onCompositionEnd"&&_o&&(k=Hw()):(Ar=c,eg="value"in Ar?Ar.value:Ar.textContent,_o=!0)),b=zu(u,C),0<b.length&&(C=new _0(C,t,null,n,c),f.push({event:C,listeners:b}),k?C.data=k:(k=Ww(n),k!==null&&(C.data=k)))),(k=pT?hT(t,n):gT(t,n))&&(u=zu(u,"onBeforeInput"),0<u.length&&(c=new _0("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=k))}rx(f,e)})}function xa(t,e,n){return{instance:t,listener:e,currentTarget:n}}function zu(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=ha(t,n),o!=null&&r.unshift(xa(t,o,i)),o=ha(t,e),o!=null&&r.push(xa(t,o,i))),t=t.return}return r}function mo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function N0(t,e,n,r,i){for(var o=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=ha(n,o),l!=null&&s.unshift(xa(n,l,a))):i||(l=ha(n,o),l!=null&&s.push(xa(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var AT=/\r\n?/g,TT=/\u0000|\uFFFD/g;function O0(t){return(typeof t=="string"?t:""+t).replace(AT,`
|
|
6
|
-
`).replace(TT,"")}function yu(t,e,n){if(e=O0(e),O0(t)!==e&&n)throw Error(R(425))}function Hu(){}var yh=null,_h=null;function wh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var xh=typeof setTimeout=="function"?setTimeout:void 0,RT=typeof clearTimeout=="function"?clearTimeout:void 0,L0=typeof Promise=="function"?Promise:void 0,IT=typeof queueMicrotask=="function"?queueMicrotask:typeof L0<"u"?function(t){return L0.resolve(null).then(t).catch(PT)}:xh;function PT(t){setTimeout(function(){throw t})}function zp(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),va(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);va(e)}function Nr(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==="$?")break;if(e==="/$")return null}}return t}function M0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var jo=Math.random().toString(36).slice(2),xn="__reactFiber$"+jo,Sa="__reactProps$"+jo,Un="__reactContainer$"+jo,Sh="__reactEvents$"+jo,NT="__reactListeners$"+jo,OT="__reactHandles$"+jo;function di(t){var e=t[xn];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Un]||n[xn]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=M0(t);t!==null;){if(n=t[xn])return n;t=M0(t)}return e}t=n,n=t.parentNode}return null}function Pa(t){return t=t[xn]||t[Un],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function So(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(R(33))}function lc(t){return t[Sa]||null}var bh=[],bo=-1;function Br(t){return{current:t}}function _e(t){0>bo||(t.current=bh[bo],bh[bo]=null,bo--)}function me(t,e){bo++,bh[bo]=t.current,t.current=e}var Dr={},tt=Br(Dr),vt=Br(!1),mi=Dr;function Fo(t,e){var n=t.type.contextTypes;if(!n)return Dr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function yt(t){return t=t.childContextTypes,t!=null}function ju(){_e(vt),_e(tt)}function F0(t,e,n){if(tt.current!==Dr)throw Error(R(168));me(tt,e),me(vt,n)}function ox(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(R(108,_A(t)||"Unknown",i));return Re({},n,r)}function Uu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Dr,mi=tt.current,me(tt,t),me(vt,vt.current),!0}function $0(t,e,n){var r=t.stateNode;if(!r)throw Error(R(169));n?(t=ox(t,e,mi),r.__reactInternalMemoizedMergedChildContext=t,_e(vt),_e(tt),me(tt,t)):_e(vt),me(vt,n)}var Vn=null,uc=!1,Hp=!1;function sx(t){Vn===null?Vn=[t]:Vn.push(t)}function LT(t){uc=!0,sx(t)}function zr(){if(!Hp&&Vn!==null){Hp=!0;var t=0,e=ce;try{var n=Vn;for(ce=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Vn=null,uc=!1}catch(i){throw Vn!==null&&(Vn=Vn.slice(t+1)),Pw(Yh,zr),i}finally{ce=e,Hp=!1}}return null}var ko=[],Co=0,Wu=null,qu=0,Dt=[],Vt=0,vi=null,Bn=1,zn="";function ui(t,e){ko[Co++]=qu,ko[Co++]=Wu,Wu=t,qu=e}function ax(t,e,n){Dt[Vt++]=Bn,Dt[Vt++]=zn,Dt[Vt++]=vi,vi=t;var r=Bn;t=zn;var i=32-nn(r)-1;r&=~(1<<i),n+=1;var o=32-nn(e)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Bn=1<<32-nn(e)+i|n<<i|r,zn=o+t}else Bn=1<<o|n<<i|r,zn=t}function og(t){t.return!==null&&(ui(t,1),ax(t,1,0))}function sg(t){for(;t===Wu;)Wu=ko[--Co],ko[Co]=null,qu=ko[--Co],ko[Co]=null;for(;t===vi;)vi=Dt[--Vt],Dt[Vt]=null,zn=Dt[--Vt],Dt[Vt]=null,Bn=Dt[--Vt],Dt[Vt]=null}var Rt=null,Tt=null,be=!1,tn=null;function lx(t,e){var n=Bt(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function D0(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Rt=t,Tt=Nr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Rt=t,Tt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=vi!==null?{id:Bn,overflow:zn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Bt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Rt=t,Tt=null,!0):!1;default:return!1}}function kh(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ch(t){if(be){var e=Tt;if(e){var n=e;if(!D0(t,e)){if(kh(t))throw Error(R(418));e=Nr(n.nextSibling);var r=Rt;e&&D0(t,e)?lx(r,n):(t.flags=t.flags&-4097|2,be=!1,Rt=t)}}else{if(kh(t))throw Error(R(418));t.flags=t.flags&-4097|2,be=!1,Rt=t}}}function V0(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Rt=t}function _u(t){if(t!==Rt)return!1;if(!be)return V0(t),be=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!wh(t.type,t.memoizedProps)),e&&(e=Tt)){if(kh(t))throw ux(),Error(R(418));for(;e;)lx(t,e),e=Nr(e.nextSibling)}if(V0(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Tt=Nr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Tt=null}}else Tt=Rt?Nr(t.stateNode.nextSibling):null;return!0}function ux(){for(var t=Tt;t;)t=Nr(t.nextSibling)}function $o(){Tt=Rt=null,be=!1}function ag(t){tn===null?tn=[t]:tn.push(t)}var MT=Kn.ReactCurrentBatchConfig;function Zs(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(R(309));var r=n.stateNode}if(!r)throw Error(R(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof t!="string")throw Error(R(284));if(!n._owner)throw Error(R(290,t))}return t}function wu(t,e){throw t=Object.prototype.toString.call(e),Error(R(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function B0(t){var e=t._init;return e(t._payload)}function cx(t){function e(d,p){if(t){var m=d.deletions;m===null?(d.deletions=[p],d.flags|=16):m.push(p)}}function n(d,p){if(!t)return null;for(;p!==null;)e(d,p),p=p.sibling;return null}function r(d,p){for(d=new Map;p!==null;)p.key!==null?d.set(p.key,p):d.set(p.index,p),p=p.sibling;return d}function i(d,p){return d=Fr(d,p),d.index=0,d.sibling=null,d}function o(d,p,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<p?(d.flags|=2,p):m):(d.flags|=2,p)):(d.flags|=1048576,p)}function s(d){return t&&d.alternate===null&&(d.flags|=2),d}function a(d,p,m,y){return p===null||p.tag!==6?(p=Zp(m,d.mode,y),p.return=d,p):(p=i(p,m),p.return=d,p)}function l(d,p,m,y){var w=m.type;return w===yo?c(d,p,m.props.children,y,m.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===br&&B0(w)===p.type)?(y=i(p,m.props),y.ref=Zs(d,p,m),y.return=d,y):(y=Ou(m.type,m.key,m.props,null,d.mode,y),y.ref=Zs(d,p,m),y.return=d,y)}function u(d,p,m,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Yp(m,d.mode,y),p.return=d,p):(p=i(p,m.children||[]),p.return=d,p)}function c(d,p,m,y,w){return p===null||p.tag!==7?(p=gi(m,d.mode,y,w),p.return=d,p):(p=i(p,m),p.return=d,p)}function f(d,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Zp(""+p,d.mode,m),p.return=d,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case ou:return m=Ou(p.type,p.key,p.props,null,d.mode,m),m.ref=Zs(d,null,p),m.return=d,m;case vo:return p=Yp(p,d.mode,m),p.return=d,p;case br:var y=p._init;return f(d,y(p._payload),m)}if(ea(p)||Ws(p))return p=gi(p,d.mode,m,null),p.return=d,p;wu(d,p)}return null}function h(d,p,m,y){var w=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:a(d,p,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ou:return m.key===w?l(d,p,m,y):null;case vo:return m.key===w?u(d,p,m,y):null;case br:return w=m._init,h(d,p,w(m._payload),y)}if(ea(m)||Ws(m))return w!==null?null:c(d,p,m,y,null);wu(d,m)}return null}function g(d,p,m,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return d=d.get(m)||null,a(p,d,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ou:return d=d.get(y.key===null?m:y.key)||null,l(p,d,y,w);case vo:return d=d.get(y.key===null?m:y.key)||null,u(p,d,y,w);case br:var b=y._init;return g(d,p,m,b(y._payload),w)}if(ea(y)||Ws(y))return d=d.get(m)||null,c(p,d,y,w,null);wu(p,y)}return null}function v(d,p,m,y){for(var w=null,b=null,k=p,C=p=0,I=null;k!==null&&C<m.length;C++){k.index>C?(I=k,k=null):I=k.sibling;var A=h(d,k,m[C],y);if(A===null){k===null&&(k=I);break}t&&k&&A.alternate===null&&e(d,k),p=o(A,p,C),b===null?w=A:b.sibling=A,b=A,k=I}if(C===m.length)return n(d,k),be&&ui(d,C),w;if(k===null){for(;C<m.length;C++)k=f(d,m[C],y),k!==null&&(p=o(k,p,C),b===null?w=k:b.sibling=k,b=k);return be&&ui(d,C),w}for(k=r(d,k);C<m.length;C++)I=g(k,d,C,m[C],y),I!==null&&(t&&I.alternate!==null&&k.delete(I.key===null?C:I.key),p=o(I,p,C),b===null?w=I:b.sibling=I,b=I);return t&&k.forEach(function(H){return e(d,H)}),be&&ui(d,C),w}function _(d,p,m,y){var w=Ws(m);if(typeof w!="function")throw Error(R(150));if(m=w.call(m),m==null)throw Error(R(151));for(var b=w=null,k=p,C=p=0,I=null,A=m.next();k!==null&&!A.done;C++,A=m.next()){k.index>C?(I=k,k=null):I=k.sibling;var H=h(d,k,A.value,y);if(H===null){k===null&&(k=I);break}t&&k&&H.alternate===null&&e(d,k),p=o(H,p,C),b===null?w=H:b.sibling=H,b=H,k=I}if(A.done)return n(d,k),be&&ui(d,C),w;if(k===null){for(;!A.done;C++,A=m.next())A=f(d,A.value,y),A!==null&&(p=o(A,p,C),b===null?w=A:b.sibling=A,b=A);return be&&ui(d,C),w}for(k=r(d,k);!A.done;C++,A=m.next())A=g(k,d,C,A.value,y),A!==null&&(t&&A.alternate!==null&&k.delete(A.key===null?C:A.key),p=o(A,p,C),b===null?w=A:b.sibling=A,b=A);return t&&k.forEach(function(K){return e(d,K)}),be&&ui(d,C),w}function x(d,p,m,y){if(typeof m=="object"&&m!==null&&m.type===yo&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ou:e:{for(var w=m.key,b=p;b!==null;){if(b.key===w){if(w=m.type,w===yo){if(b.tag===7){n(d,b.sibling),p=i(b,m.props.children),p.return=d,d=p;break e}}else if(b.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===br&&B0(w)===b.type){n(d,b.sibling),p=i(b,m.props),p.ref=Zs(d,b,m),p.return=d,d=p;break e}n(d,b);break}else e(d,b);b=b.sibling}m.type===yo?(p=gi(m.props.children,d.mode,y,m.key),p.return=d,d=p):(y=Ou(m.type,m.key,m.props,null,d.mode,y),y.ref=Zs(d,p,m),y.return=d,d=y)}return s(d);case vo:e:{for(b=m.key;p!==null;){if(p.key===b)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(d,p.sibling),p=i(p,m.children||[]),p.return=d,d=p;break e}else{n(d,p);break}else e(d,p);p=p.sibling}p=Yp(m,d.mode,y),p.return=d,d=p}return s(d);case br:return b=m._init,x(d,p,b(m._payload),y)}if(ea(m))return v(d,p,m,y);if(Ws(m))return _(d,p,m,y);wu(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(d,p.sibling),p=i(p,m),p.return=d,d=p):(n(d,p),p=Zp(m,d.mode,y),p.return=d,d=p),s(d)):n(d,p)}return x}var Do=cx(!0),dx=cx(!1),Ku=Br(null),Gu=null,Eo=null,lg=null;function ug(){lg=Eo=Gu=null}function cg(t){var e=Ku.current;_e(Ku),t._currentValue=e}function Eh(t,e,n){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===n)break;t=t.return}}function Oo(t,e){Gu=t,lg=Eo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&e)!==0&&(mt=!0),t.firstContext=null)}function Ht(t){var e=t._currentValue;if(lg!==t)if(t={context:t,memoizedValue:e,next:null},Eo===null){if(Gu===null)throw Error(R(308));Eo=t,Gu.dependencies={lanes:0,firstContext:t}}else Eo=Eo.next=t;return e}var fi=null;function dg(t){fi===null?fi=[t]:fi.push(t)}function fx(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,dg(e)):(n.next=i.next,i.next=n),e.interleaved=n,Wn(t,r)}function Wn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var kr=!1;function fg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function px(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Hn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Or(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(se&2)!==0){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Wn(t,n)}return i=r.interleaved,i===null?(e.next=e,dg(r)):(e.next=i.next,i.next=e),r.interleaved=e,Wn(t,n)}function Au(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Xh(t,n)}}function z0(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Zu(t,e,n,r){var i=t.updateQueue;kr=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,_=a;switch(h=e,g=n,_.tag){case 1:if(v=_.payload,typeof v=="function"){f=v.call(g,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,h=typeof v=="function"?v.call(g,f,h):v,h==null)break e;f=Re({},f,h);break e;case 2:kr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=g,l=f):c=c.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);_i|=s,t.lanes=s,t.memoizedState=f}}function H0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(R(191,i));i.call(r)}}}var Na={},bn=Br(Na),ba=Br(Na),ka=Br(Na);function pi(t){if(t===Na)throw Error(R(174));return t}function pg(t,e){switch(me(ka,e),me(ba,t),me(bn,Na),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:sh(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=sh(e,t)}_e(bn),me(bn,e)}function Vo(){_e(bn),_e(ba),_e(ka)}function hx(t){pi(ka.current);var e=pi(bn.current),n=sh(e,t.type);e!==n&&(me(ba,t),me(bn,n))}function hg(t){ba.current===t&&(_e(bn),_e(ba))}var Ae=Br(0);function Yu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){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 jp=[];function gg(){for(var t=0;t<jp.length;t++)jp[t]._workInProgressVersionPrimary=null;jp.length=0}var Tu=Kn.ReactCurrentDispatcher,Up=Kn.ReactCurrentBatchConfig,yi=0,Te=null,$e=null,Be=null,Xu=!1,la=!1,Ca=0,FT=0;function Qe(){throw Error(R(321))}function mg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!on(t[n],e[n]))return!1;return!0}function vg(t,e,n,r,i,o){if(yi=o,Te=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Tu.current=t===null||t.memoizedState===null?BT:zT,t=n(r,i),la){o=0;do{if(la=!1,Ca=0,25<=o)throw Error(R(301));o+=1,Be=$e=null,e.updateQueue=null,Tu.current=HT,t=n(r,i)}while(la)}if(Tu.current=Qu,e=$e!==null&&$e.next!==null,yi=0,Be=$e=Te=null,Xu=!1,e)throw Error(R(300));return t}function yg(){var t=Ca!==0;return Ca=0,t}function wn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Be===null?Te.memoizedState=Be=t:Be=Be.next=t,Be}function jt(){if($e===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=$e.next;var e=Be===null?Te.memoizedState:Be.next;if(e!==null)Be=e,$e=t;else{if(t===null)throw Error(R(310));$e=t,t={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},Be===null?Te.memoizedState=Be=t:Be=Be.next=t}return Be}function Ea(t,e){return typeof e=="function"?e(t):e}function Wp(t){var e=jt(),n=e.queue;if(n===null)throw Error(R(311));n.lastRenderedReducer=t;var r=$e,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,u=o;do{var c=u.lane;if((yi&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Te.lanes|=c,_i|=c}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,on(r,e.memoizedState)||(mt=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,Te.lanes|=o,_i|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function qp(t){var e=jt(),n=e.queue;if(n===null)throw Error(R(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=t(o,s.action),s=s.next;while(s!==i);on(o,e.memoizedState)||(mt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function gx(){}function mx(t,e){var n=Te,r=jt(),i=e(),o=!on(r.memoizedState,i);if(o&&(r.memoizedState=i,mt=!0),r=r.queue,_g(_x.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||Be!==null&&Be.memoizedState.tag&1){if(n.flags|=2048,Aa(9,yx.bind(null,n,r,i,e),void 0,null),ze===null)throw Error(R(349));(yi&30)!==0||vx(n,e,i)}return i}function vx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Te.updateQueue,e===null?(e={lastEffect:null,stores:null},Te.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function yx(t,e,n,r){e.value=n,e.getSnapshot=r,wx(e)&&xx(t)}function _x(t,e,n){return n(function(){wx(e)&&xx(t)})}function wx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!on(t,n)}catch{return!0}}function xx(t){var e=Wn(t,1);e!==null&&rn(e,t,1,-1)}function j0(t){var e=wn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:t},e.queue=t,t=t.dispatch=VT.bind(null,Te,t),[e.memoizedState,t]}function Aa(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Te.updateQueue,e===null?(e={lastEffect:null,stores:null},Te.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function Sx(){return jt().memoizedState}function Ru(t,e,n,r){var i=wn();Te.flags|=t,i.memoizedState=Aa(1|e,n,void 0,r===void 0?null:r)}function cc(t,e,n,r){var i=jt();r=r===void 0?null:r;var o=void 0;if($e!==null){var s=$e.memoizedState;if(o=s.destroy,r!==null&&mg(r,s.deps)){i.memoizedState=Aa(e,n,o,r);return}}Te.flags|=t,i.memoizedState=Aa(1|e,n,o,r)}function U0(t,e){return Ru(8390656,8,t,e)}function _g(t,e){return cc(2048,8,t,e)}function bx(t,e){return cc(4,2,t,e)}function kx(t,e){return cc(4,4,t,e)}function Cx(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Ex(t,e,n){return n=n!=null?n.concat([t]):null,cc(4,4,Cx.bind(null,e,t),n)}function wg(){}function Ax(t,e){var n=jt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&mg(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Tx(t,e){var n=jt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&mg(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Rx(t,e,n){return(yi&21)===0?(t.baseState&&(t.baseState=!1,mt=!0),t.memoizedState=n):(on(n,e)||(n=Lw(),Te.lanes|=n,_i|=n,t.baseState=!0),e)}function $T(t,e){var n=ce;ce=n!==0&&4>n?n:4,t(!0);var r=Up.transition;Up.transition={};try{t(!1),e()}finally{ce=n,Up.transition=r}}function Ix(){return jt().memoizedState}function DT(t,e,n){var r=Mr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Px(t))Nx(e,n);else if(n=fx(t,e,n,r),n!==null){var i=at();rn(n,t,r,i),Ox(n,e,r)}}function VT(t,e,n){var r=Mr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Px(t))Nx(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,on(a,s)){var l=e.interleaved;l===null?(i.next=i,dg(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=fx(t,e,i,r),n!==null&&(i=at(),rn(n,t,r,i),Ox(n,e,r))}}function Px(t){var e=t.alternate;return t===Te||e!==null&&e===Te}function Nx(t,e){la=Xu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Ox(t,e,n){if((n&4194240)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Xh(t,n)}}var Qu={readContext:Ht,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},BT={readContext:Ht,useCallback:function(t,e){return wn().memoizedState=[t,e===void 0?null:e],t},useContext:Ht,useEffect:U0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ru(4194308,4,Cx.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ru(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ru(4,2,t,e)},useMemo:function(t,e){var n=wn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=wn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=DT.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var e=wn();return t={current:t},e.memoizedState=t},useState:j0,useDebugValue:wg,useDeferredValue:function(t){return wn().memoizedState=t},useTransition:function(){var t=j0(!1),e=t[0];return t=$T.bind(null,t[1]),wn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Te,i=wn();if(be){if(n===void 0)throw Error(R(407));n=n()}else{if(n=e(),ze===null)throw Error(R(349));(yi&30)!==0||vx(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,U0(_x.bind(null,r,o,t),[t]),r.flags|=2048,Aa(9,yx.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=wn(),e=ze.identifierPrefix;if(be){var n=zn,r=Bn;n=(r&~(1<<32-nn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ca++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=FT++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},zT={readContext:Ht,useCallback:Ax,useContext:Ht,useEffect:_g,useImperativeHandle:Ex,useInsertionEffect:bx,useLayoutEffect:kx,useMemo:Tx,useReducer:Wp,useRef:Sx,useState:function(){return Wp(Ea)},useDebugValue:wg,useDeferredValue:function(t){var e=jt();return Rx(e,$e.memoizedState,t)},useTransition:function(){var t=Wp(Ea)[0],e=jt().memoizedState;return[t,e]},useMutableSource:gx,useSyncExternalStore:mx,useId:Ix,unstable_isNewReconciler:!1},HT={readContext:Ht,useCallback:Ax,useContext:Ht,useEffect:_g,useImperativeHandle:Ex,useInsertionEffect:bx,useLayoutEffect:kx,useMemo:Tx,useReducer:qp,useRef:Sx,useState:function(){return qp(Ea)},useDebugValue:wg,useDeferredValue:function(t){var e=jt();return $e===null?e.memoizedState=t:Rx(e,$e.memoizedState,t)},useTransition:function(){var t=qp(Ea)[0],e=jt().memoizedState;return[t,e]},useMutableSource:gx,useSyncExternalStore:mx,useId:Ix,unstable_isNewReconciler:!1};function Jt(t,e){if(t&&t.defaultProps){e=Re({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Ah(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Re({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var dc={isMounted:function(t){return(t=t._reactInternals)?Si(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=at(),i=Mr(t),o=Hn(r,i);o.payload=e,n!=null&&(o.callback=n),e=Or(t,o,i),e!==null&&(rn(e,t,i,r),Au(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=at(),i=Mr(t),o=Hn(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=Or(t,o,i),e!==null&&(rn(e,t,i,r),Au(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=at(),r=Mr(t),i=Hn(n,r);i.tag=2,e!=null&&(i.callback=e),e=Or(t,i,r),e!==null&&(rn(e,t,r,n),Au(e,t,r))}};function W0(t,e,n,r,i,o,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,s):e.prototype&&e.prototype.isPureReactComponent?!_a(n,r)||!_a(i,o):!0}function Lx(t,e,n){var r=!1,i=Dr,o=e.contextType;return typeof o=="object"&&o!==null?o=Ht(o):(i=yt(e)?mi:tt.current,r=e.contextTypes,o=(r=r!=null)?Fo(t,i):Dr),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=dc,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function q0(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&dc.enqueueReplaceState(e,e.state,null)}function Th(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},fg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=Ht(o):(o=yt(e)?mi:tt.current,i.context=Fo(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Ah(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&dc.enqueueReplaceState(i,i.state,null),Zu(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Bo(t,e){try{var n="",r=e;do n+=yA(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function Kp(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Rh(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var jT=typeof WeakMap=="function"?WeakMap:Map;function Mx(t,e,n){n=Hn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){ec||(ec=!0,Vh=r),Rh(t,e)},n}function Fx(t,e,n){n=Hn(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Rh(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Rh(t,e),typeof r!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function K0(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new jT;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=rR.bind(null,t,e,n),e.then(t,t))}function G0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Z0(t,e,n,r,i){return(t.mode&1)===0?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Hn(-1,1),e.tag=2,Or(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var UT=Kn.ReactCurrentOwner,mt=!1;function st(t,e,n,r){e.child=t===null?dx(e,null,n,r):Do(e,t.child,n,r)}function Y0(t,e,n,r,i){n=n.render;var o=e.ref;return Oo(e,i),r=vg(t,e,n,r,o,i),n=yg(),t!==null&&!mt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,qn(t,e,i)):(be&&n&&og(e),e.flags|=1,st(t,e,r,i),e.child)}function X0(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!Tg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,$x(t,e,o,r,i)):(t=Ou(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,(t.lanes&i)===0){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:_a,n(s,r)&&t.ref===e.ref)return qn(t,e,i)}return e.flags|=1,t=Fr(o,r),t.ref=e.ref,t.return=e,e.child=t}function $x(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(_a(o,r)&&t.ref===e.ref)if(mt=!1,e.pendingProps=r=o,(t.lanes&i)!==0)(t.flags&131072)!==0&&(mt=!0);else return e.lanes=t.lanes,qn(t,e,i)}return Ih(t,e,n,r,i)}function Dx(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(To,At),At|=n;else{if((n&1073741824)===0)return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,me(To,At),At|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,me(To,At),At|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,me(To,At),At|=r;return st(t,e,i,n),e.child}function Vx(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ih(t,e,n,r,i){var o=yt(n)?mi:tt.current;return o=Fo(e,o),Oo(e,i),n=vg(t,e,n,r,o,i),r=yg(),t!==null&&!mt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,qn(t,e,i)):(be&&r&&og(e),e.flags|=1,st(t,e,n,i),e.child)}function Q0(t,e,n,r,i){if(yt(n)){var o=!0;Uu(e)}else o=!1;if(Oo(e,i),e.stateNode===null)Iu(t,e),Lx(e,n,r),Th(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ht(u):(u=yt(n)?mi:tt.current,u=Fo(e,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&q0(e,s,r,u),kr=!1;var h=e.memoizedState;s.state=h,Zu(e,r,s,i),l=e.memoizedState,a!==r||h!==l||vt.current||kr?(typeof c=="function"&&(Ah(e,n,c,r),l=e.memoizedState),(a=kr||W0(e,n,a,r,h,l,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,px(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Jt(e.type,a),s.props=u,f=e.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ht(l):(l=yt(n)?mi:tt.current,l=Fo(e,l));var g=n.getDerivedStateFromProps;(c=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&q0(e,s,r,l),kr=!1,h=e.memoizedState,s.state=h,Zu(e,r,s,i);var v=e.memoizedState;a!==f||h!==v||vt.current||kr?(typeof g=="function"&&(Ah(e,n,g,r),v=e.memoizedState),(u=kr||W0(e,n,u,r,h,v,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),s.props=r,s.state=v,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return Ph(t,e,n,r,o,i)}function Ph(t,e,n,r,i,o){Vx(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&$0(e,n,!1),qn(t,e,o);r=e.stateNode,UT.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Do(e,t.child,null,o),e.child=Do(e,null,a,o)):st(t,e,a,o),e.memoizedState=r.state,i&&$0(e,n,!0),e.child}function Bx(t){var e=t.stateNode;e.pendingContext?F0(t,e.pendingContext,e.pendingContext!==e.context):e.context&&F0(t,e.context,!1),pg(t,e.containerInfo)}function J0(t,e,n,r,i){return $o(),ag(i),e.flags|=256,st(t,e,n,r),e.child}var Nh={dehydrated:null,treeContext:null,retryLane:0};function Oh(t){return{baseLanes:t,cachePool:null,transitions:null}}function zx(t,e,n){var r=e.pendingProps,i=Ae.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),me(Ae,i&1),t===null)return Ch(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((e.mode&1)===0?e.lanes=1:t.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=s):o=hc(s,r,0,null),t=gi(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Oh(n),e.memoizedState=Nh,t):xg(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return WT(t,e,s,r,a,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Fr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Fr(a,o):(o=gi(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?Oh(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=Nh,r}return o=t.child,t=o.sibling,r=Fr(o,{mode:"visible",children:r.children}),(e.mode&1)===0&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function xg(t,e){return e=hc({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function xu(t,e,n,r){return r!==null&&ag(r),Do(e,t.child,null,n),t=xg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function WT(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=Kp(Error(R(422))),xu(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=hc({mode:"visible",children:r.children},i,0,null),o=gi(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,(e.mode&1)!==0&&Do(e,t.child,null,s),e.child.memoizedState=Oh(s),e.memoizedState=Nh,o);if((e.mode&1)===0)return xu(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(R(419)),r=Kp(o,r,void 0),xu(t,e,s,r)}if(a=(s&t.childLanes)!==0,mt||a){if(r=ze,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|s))!==0?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Wn(t,i),rn(r,t,i,-1))}return Ag(),r=Kp(Error(R(421))),xu(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=iR.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Tt=Nr(i.nextSibling),Rt=e,be=!0,tn=null,t!==null&&(Dt[Vt++]=Bn,Dt[Vt++]=zn,Dt[Vt++]=vi,Bn=t.id,zn=t.overflow,vi=e),e=xg(e,r.children),e.flags|=4096,e)}function ew(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Eh(t.return,e,n)}function Gp(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Hx(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(st(t,e,r.children,n),r=Ae.current,(r&2)!==0)r=r&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ew(t,n,e);else if(t.tag===19)ew(t,n,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}r&=1}if(me(Ae,r),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Yu(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Gp(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Yu(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Gp(e,!0,n,null,o);break;case"together":Gp(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Iu(t,e){(e.mode&1)===0&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function qn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),_i|=e.lanes,(n&e.childLanes)===0)return null;if(t!==null&&e.child!==t.child)throw Error(R(153));if(e.child!==null){for(t=e.child,n=Fr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Fr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function qT(t,e,n){switch(e.tag){case 3:Bx(e),$o();break;case 5:hx(e);break;case 1:yt(e.type)&&Uu(e);break;case 4:pg(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;me(Ku,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(me(Ae,Ae.current&1),e.flags|=128,null):(n&e.child.childLanes)!==0?zx(t,e,n):(me(Ae,Ae.current&1),t=qn(t,e,n),t!==null?t.sibling:null);me(Ae,Ae.current&1);break;case 19:if(r=(n&e.childLanes)!==0,(t.flags&128)!==0){if(r)return Hx(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(Ae,Ae.current),r)break;return null;case 22:case 23:return e.lanes=0,Dx(t,e,n)}return qn(t,e,n)}var jx,Lh,Ux,Wx;jx=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Lh=function(){};Ux=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,pi(bn.current);var o=null;switch(n){case"input":i=nh(t,i),r=nh(t,r),o=[];break;case"select":i=Re({},i,{value:void 0}),r=Re({},r,{value:void 0}),o=[];break;case"textarea":i=oh(t,i),r=oh(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Hu)}ah(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fa.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i?.[u],r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fa.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ye("scroll",t),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(e.updateQueue=u)&&(e.flags|=4)}};Wx=function(t,e,n,r){n!==r&&(e.flags|=4)};function Ys(t,e){if(!be)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Je(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function KT(t,e,n){var r=e.pendingProps;switch(sg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(e),null;case 1:return yt(e.type)&&ju(),Je(e),null;case 3:return r=e.stateNode,Vo(),_e(vt),_e(tt),gg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(_u(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,tn!==null&&(Hh(tn),tn=null))),Lh(t,e),Je(e),null;case 5:hg(e);var i=pi(ka.current);if(n=e.type,t!==null&&e.stateNode!=null)Ux(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(R(166));return Je(e),null}if(t=pi(bn.current),_u(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[xn]=e,r[Sa]=o,t=(e.mode&1)!==0,n){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(i=0;i<na.length;i++)ye(na[i],r);break;case"source":ye("error",r);break;case"img":case"image":case"link":ye("error",r),ye("load",r);break;case"details":ye("toggle",r);break;case"input":l0(r,o),ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ye("invalid",r);break;case"textarea":c0(r,o),ye("invalid",r)}ah(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&yu(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&yu(r.textContent,a,t),i=["children",""+a]):fa.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ye("scroll",r)}switch(n){case"input":su(r),u0(r,o,!0);break;case"textarea":su(r),d0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Hu)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=_w(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[xn]=e,t[Sa]=r,jx(t,e,!1,!1),e.stateNode=t;e:{switch(s=lh(n,r),n){case"dialog":ye("cancel",t),ye("close",t),i=r;break;case"iframe":case"object":case"embed":ye("load",t),i=r;break;case"video":case"audio":for(i=0;i<na.length;i++)ye(na[i],t);i=r;break;case"source":ye("error",t),i=r;break;case"img":case"image":case"link":ye("error",t),ye("load",t),i=r;break;case"details":ye("toggle",t),i=r;break;case"input":l0(t,r),i=nh(t,r),ye("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Re({},r,{value:void 0}),ye("invalid",t);break;case"textarea":c0(t,r),i=oh(t,r),ye("invalid",t);break;default:i=r}ah(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?Sw(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&ww(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&pa(t,l):typeof l=="number"&&pa(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(fa.hasOwnProperty(o)?l!=null&&o==="onScroll"&&ye("scroll",t):l!=null&&Wh(t,o,l,s))}switch(n){case"input":su(t),u0(t,r,!1);break;case"textarea":su(t),d0(t);break;case"option":r.value!=null&&t.setAttribute("value",""+$r(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Ro(t,!!r.multiple,o,!1):r.defaultValue!=null&&Ro(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Hu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Je(e),null;case 6:if(t&&e.stateNode!=null)Wx(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(R(166));if(n=pi(ka.current),pi(bn.current),_u(e)){if(r=e.stateNode,n=e.memoizedProps,r[xn]=e,(o=r.nodeValue!==n)&&(t=Rt,t!==null))switch(t.tag){case 3:yu(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&yu(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xn]=e,e.stateNode=r}return Je(e),null;case 13:if(_e(Ae),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(be&&Tt!==null&&(e.mode&1)!==0&&(e.flags&128)===0)ux(),$o(),e.flags|=98560,o=!1;else if(o=_u(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(R(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(R(317));o[xn]=e}else $o(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Je(e),o=!1}else tn!==null&&(Hh(tn),tn=null),o=!0;if(!o)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,(e.mode&1)!==0&&(t===null||(Ae.current&1)!==0?De===0&&(De=3):Ag())),e.updateQueue!==null&&(e.flags|=4),Je(e),null);case 4:return Vo(),Lh(t,e),t===null&&wa(e.stateNode.containerInfo),Je(e),null;case 10:return cg(e.type._context),Je(e),null;case 17:return yt(e.type)&&ju(),Je(e),null;case 19:if(_e(Ae),o=e.memoizedState,o===null)return Je(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)Ys(o,!1);else{if(De!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=Yu(t),s!==null){for(e.flags|=128,Ys(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return me(Ae,Ae.current&1|2),e.child}t=t.sibling}o.tail!==null&&Ne()>zo&&(e.flags|=128,r=!0,Ys(o,!1),e.lanes=4194304)}else{if(!r)if(t=Yu(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Ys(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!be)return Je(e),null}else 2*Ne()-o.renderingStartTime>zo&&n!==1073741824&&(e.flags|=128,r=!0,Ys(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ne(),e.sibling=null,n=Ae.current,me(Ae,r?n&1|2:n&1),e):(Je(e),null);case 22:case 23:return Eg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&(e.mode&1)!==0?(At&1073741824)!==0&&(Je(e),e.subtreeFlags&6&&(e.flags|=8192)):Je(e),null;case 24:return null;case 25:return null}throw Error(R(156,e.tag))}function GT(t,e){switch(sg(e),e.tag){case 1:return yt(e.type)&&ju(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Vo(),_e(vt),_e(tt),gg(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return hg(e),null;case 13:if(_e(Ae),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(R(340));$o()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return _e(Ae),null;case 4:return Vo(),null;case 10:return cg(e.type._context),null;case 22:case 23:return Eg(),null;case 24:return null;default:return null}}var Su=!1,et=!1,ZT=typeof WeakSet=="function"?WeakSet:Set,D=null;function Ao(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(t,e,r)}else n.current=null}function Mh(t,e,n){try{n()}catch(r){Ie(t,e,r)}}var tw=!1;function YT(t,e){if(yh=Vu,t=Yw(),ig(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=t,h=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===n&&++u===i&&(a=s),h===o&&++c===r&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(_h={focusedElem:t,selectionRange:n},Vu=!1,D=e;D!==null;)if(e=D,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,D=t;else for(;D!==null;){e=D;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,x=v.memoizedState,d=e.stateNode,p=d.getSnapshotBeforeUpdate(e.elementType===e.type?_:Jt(e.type,_),x);d.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(y){Ie(e,e.return,y)}if(t=e.sibling,t!==null){t.return=e.return,D=t;break}D=e.return}return v=tw,tw=!1,v}function ua(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&Mh(e,n,o)}i=i.next}while(i!==r)}}function fc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Fh(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function qx(t){var e=t.alternate;e!==null&&(t.alternate=null,qx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[xn],delete e[Sa],delete e[Sh],delete e[NT],delete e[OT])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Kx(t){return t.tag===5||t.tag===3||t.tag===4}function nw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Kx(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.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 $h(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Hu));else if(r!==4&&(t=t.child,t!==null))for($h(t,e,n),t=t.sibling;t!==null;)$h(t,e,n),t=t.sibling}function Dh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Dh(t,e,n),t=t.sibling;t!==null;)Dh(t,e,n),t=t.sibling}var qe=null,en=!1;function Sr(t,e,n){for(n=n.child;n!==null;)Gx(t,e,n),n=n.sibling}function Gx(t,e,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(ic,n)}catch{}switch(n.tag){case 5:et||Ao(n,e);case 6:var r=qe,i=en;qe=null,Sr(t,e,n),qe=r,en=i,qe!==null&&(en?(t=qe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(en?(t=qe,n=n.stateNode,t.nodeType===8?zp(t.parentNode,n):t.nodeType===1&&zp(t,n),va(t)):zp(qe,n.stateNode));break;case 4:r=qe,i=en,qe=n.stateNode.containerInfo,en=!0,Sr(t,e,n),qe=r,en=i;break;case 0:case 11:case 14:case 15:if(!et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&Mh(n,e,s),i=i.next}while(i!==r)}Sr(t,e,n);break;case 1:if(!et&&(Ao(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ie(n,e,a)}Sr(t,e,n);break;case 21:Sr(t,e,n);break;case 22:n.mode&1?(et=(r=et)||n.memoizedState!==null,Sr(t,e,n),et=r):Sr(t,e,n);break;default:Sr(t,e,n)}}function rw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new ZT),e.forEach(function(r){var i=oR.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Qt(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:qe=a.stateNode,en=!1;break e;case 3:qe=a.stateNode.containerInfo,en=!0;break e;case 4:qe=a.stateNode.containerInfo,en=!0;break e}a=a.return}if(qe===null)throw Error(R(160));Gx(o,s,i),qe=null,en=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Ie(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Zx(e,t),e=e.sibling}function Zx(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Qt(e,t),_n(t),r&4){try{ua(3,t,t.return),fc(3,t)}catch(_){Ie(t,t.return,_)}try{ua(5,t,t.return)}catch(_){Ie(t,t.return,_)}}break;case 1:Qt(e,t),_n(t),r&512&&n!==null&&Ao(n,n.return);break;case 5:if(Qt(e,t),_n(t),r&512&&n!==null&&Ao(n,n.return),t.flags&32){var i=t.stateNode;try{pa(i,"")}catch(_){Ie(t,t.return,_)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,s=n!==null?n.memoizedProps:o,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&vw(i,o),lh(a,s);var u=lh(a,o);for(s=0;s<l.length;s+=2){var c=l[s],f=l[s+1];c==="style"?Sw(i,f):c==="dangerouslySetInnerHTML"?ww(i,f):c==="children"?pa(i,f):Wh(i,c,f,u)}switch(a){case"input":rh(i,o);break;case"textarea":yw(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Ro(i,!!o.multiple,g,!1):h!==!!o.multiple&&(o.defaultValue!=null?Ro(i,!!o.multiple,o.defaultValue,!0):Ro(i,!!o.multiple,o.multiple?[]:"",!1))}i[Sa]=o}catch(_){Ie(t,t.return,_)}}break;case 6:if(Qt(e,t),_n(t),r&4){if(t.stateNode===null)throw Error(R(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(_){Ie(t,t.return,_)}}break;case 3:if(Qt(e,t),_n(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{va(e.containerInfo)}catch(_){Ie(t,t.return,_)}break;case 4:Qt(e,t),_n(t);break;case 13:Qt(e,t),_n(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(kg=Ne())),r&4&&rw(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(et=(u=et)||c,Qt(e,t),et=u):Qt(e,t),_n(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&(t.mode&1)!==0)for(D=t,c=t.child;c!==null;){for(f=D=c;D!==null;){switch(h=D,g=h.child,h.tag){case 0:case 11:case 14:case 15:ua(4,h,h.return);break;case 1:Ao(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(_){Ie(r,n,_)}}break;case 5:Ao(h,h.return);break;case 22:if(h.memoizedState!==null){ow(f);continue}}g!==null?(g.return=h,D=g):ow(f)}c=c.sibling}e:for(c=null,f=t;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=xw("display",s))}catch(_){Ie(t,t.return,_)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(_){Ie(t,t.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Qt(e,t),_n(t),r&4&&rw(t);break;case 21:break;default:Qt(e,t),_n(t)}}function _n(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Kx(n)){var r=n;break e}n=n.return}throw Error(R(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(pa(i,""),r.flags&=-33);var o=nw(t);Dh(t,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=nw(t);$h(t,a,s);break;default:throw Error(R(161))}}catch(l){Ie(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function XT(t,e,n){D=t,Yx(t,e,n)}function Yx(t,e,n){for(var r=(t.mode&1)!==0;D!==null;){var i=D,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Su;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||et;a=Su;var u=et;if(Su=s,(et=l)&&!u)for(D=i;D!==null;)s=D,l=s.child,s.tag===22&&s.memoizedState!==null?sw(i):l!==null?(l.return=s,D=l):sw(i);for(;o!==null;)D=o,Yx(o,e,n),o=o.sibling;D=i,Su=a,et=u}iw(t,e,n)}else(i.subtreeFlags&8772)!==0&&o!==null?(o.return=i,D=o):iw(t,e,n)}}function iw(t){for(;D!==null;){var e=D;if((e.flags&8772)!==0){var n=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:et||fc(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!et)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Jt(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&H0(e,o,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}H0(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&va(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}et||e.flags&512&&Fh(e)}catch(h){Ie(e,e.return,h)}}if(e===t){D=null;break}if(n=e.sibling,n!==null){n.return=e.return,D=n;break}D=e.return}}function ow(t){for(;D!==null;){var e=D;if(e===t){D=null;break}var n=e.sibling;if(n!==null){n.return=e.return,D=n;break}D=e.return}}function sw(t){for(;D!==null;){var e=D;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{fc(4,e)}catch(l){Ie(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Ie(e,i,l)}}var o=e.return;try{Fh(e)}catch(l){Ie(e,o,l)}break;case 5:var s=e.return;try{Fh(e)}catch(l){Ie(e,s,l)}}}catch(l){Ie(e,e.return,l)}if(e===t){D=null;break}var a=e.sibling;if(a!==null){a.return=e.return,D=a;break}D=e.return}}var QT=Math.ceil,Ju=Kn.ReactCurrentDispatcher,Sg=Kn.ReactCurrentOwner,zt=Kn.ReactCurrentBatchConfig,se=0,ze=null,Le=null,Ke=0,At=0,To=Br(0),De=0,Ta=null,_i=0,pc=0,bg=0,ca=null,gt=null,kg=0,zo=1/0,Dn=null,ec=!1,Vh=null,Lr=null,bu=!1,Tr=null,tc=0,da=0,Bh=null,Pu=-1,Nu=0;function at(){return(se&6)!==0?Ne():Pu!==-1?Pu:Pu=Ne()}function Mr(t){return(t.mode&1)===0?1:(se&2)!==0&&Ke!==0?Ke&-Ke:MT.transition!==null?(Nu===0&&(Nu=Lw()),Nu):(t=ce,t!==0||(t=window.event,t=t===void 0?16:zw(t.type)),t)}function rn(t,e,n,r){if(50<da)throw da=0,Bh=null,Error(R(185));Ra(t,n,r),((se&2)===0||t!==ze)&&(t===ze&&((se&2)===0&&(pc|=n),De===4&&Er(t,Ke)),_t(t,r),n===1&&se===0&&(e.mode&1)===0&&(zo=Ne()+500,uc&&zr()))}function _t(t,e){var n=t.callbackNode;$A(t,e);var r=Du(t,t===ze?Ke:0);if(r===0)n!==null&&h0(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&h0(n),e===1)t.tag===0?LT(aw.bind(null,t)):sx(aw.bind(null,t)),IT(function(){(se&6)===0&&zr()}),n=null;else{switch(Mw(r)){case 1:n=Yh;break;case 4:n=Nw;break;case 16:n=$u;break;case 536870912:n=Ow;break;default:n=$u}n=iS(n,Xx.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Xx(t,e){if(Pu=-1,Nu=0,(se&6)!==0)throw Error(R(327));var n=t.callbackNode;if(Lo()&&t.callbackNode!==n)return null;var r=Du(t,t===ze?Ke:0);if(r===0)return null;if((r&30)!==0||(r&t.expiredLanes)!==0||e)e=nc(t,r);else{e=r;var i=se;se|=2;var o=Jx();(ze!==t||Ke!==e)&&(Dn=null,zo=Ne()+500,hi(t,e));do try{tR();break}catch(a){Qx(t,a)}while(!0);ug(),Ju.current=o,se=i,Le!==null?e=0:(ze=null,Ke=0,e=De)}if(e!==0){if(e===2&&(i=ph(t),i!==0&&(r=i,e=zh(t,i))),e===1)throw n=Ta,hi(t,0),Er(t,r),_t(t,Ne()),n;if(e===6)Er(t,r);else{if(i=t.current.alternate,(r&30)===0&&!JT(i)&&(e=nc(t,r),e===2&&(o=ph(t),o!==0&&(r=o,e=zh(t,o))),e===1))throw n=Ta,hi(t,0),Er(t,r),_t(t,Ne()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(R(345));case 2:ci(t,gt,Dn);break;case 3:if(Er(t,r),(r&130023424)===r&&(e=kg+500-Ne(),10<e)){if(Du(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){at(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=xh(ci.bind(null,t,gt,Dn),e);break}ci(t,gt,Dn);break;case 4:if(Er(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-nn(r);o=1<<s,s=e[s],s>i&&(i=s),r&=~o}if(r=i,r=Ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*QT(r/1960))-r,10<r){t.timeoutHandle=xh(ci.bind(null,t,gt,Dn),r);break}ci(t,gt,Dn);break;case 5:ci(t,gt,Dn);break;default:throw Error(R(329))}}}return _t(t,Ne()),t.callbackNode===n?Xx.bind(null,t):null}function zh(t,e){var n=ca;return t.current.memoizedState.isDehydrated&&(hi(t,e).flags|=256),t=nc(t,e),t!==2&&(e=gt,gt=n,e!==null&&Hh(e)),t}function Hh(t){gt===null?gt=t:gt.push.apply(gt,t)}function JT(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!on(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;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 Er(t,e){for(e&=~bg,e&=~pc,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-nn(e),r=1<<n;t[n]=-1,e&=~r}}function aw(t){if((se&6)!==0)throw Error(R(327));Lo();var e=Du(t,0);if((e&1)===0)return _t(t,Ne()),null;var n=nc(t,e);if(t.tag!==0&&n===2){var r=ph(t);r!==0&&(e=r,n=zh(t,r))}if(n===1)throw n=Ta,hi(t,0),Er(t,e),_t(t,Ne()),n;if(n===6)throw Error(R(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ci(t,gt,Dn),_t(t,Ne()),null}function Cg(t,e){var n=se;se|=1;try{return t(e)}finally{se=n,se===0&&(zo=Ne()+500,uc&&zr())}}function wi(t){Tr!==null&&Tr.tag===0&&(se&6)===0&&Lo();var e=se;se|=1;var n=zt.transition,r=ce;try{if(zt.transition=null,ce=1,t)return t()}finally{ce=r,zt.transition=n,se=e,(se&6)===0&&zr()}}function Eg(){At=To.current,_e(To)}function hi(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,RT(n)),Le!==null)for(n=Le.return;n!==null;){var r=n;switch(sg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ju();break;case 3:Vo(),_e(vt),_e(tt),gg();break;case 5:hg(r);break;case 4:Vo();break;case 13:_e(Ae);break;case 19:_e(Ae);break;case 10:cg(r.type._context);break;case 22:case 23:Eg()}n=n.return}if(ze=t,Le=t=Fr(t.current,null),Ke=At=e,De=0,Ta=null,bg=pc=_i=0,gt=ca=null,fi!==null){for(e=0;e<fi.length;e++)if(n=fi[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}fi=null}return t}function Qx(t,e){do{var n=Le;try{if(ug(),Tu.current=Qu,Xu){for(var r=Te.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Xu=!1}if(yi=0,Be=$e=Te=null,la=!1,Ca=0,Sg.current=null,n===null||n.return===null){De=1,Ta=e,Le=null;break}e:{var o=t,s=n.return,a=n,l=e;if(e=Ke,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,f=c.tag;if((c.mode&1)===0&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var g=G0(s);if(g!==null){g.flags&=-257,Z0(g,s,a,o,e),g.mode&1&&K0(o,u,e),e=g,l=u;var v=e.updateQueue;if(v===null){var _=new Set;_.add(l),e.updateQueue=_}else v.add(l);break e}else{if((e&1)===0){K0(o,u,e),Ag();break e}l=Error(R(426))}}else if(be&&a.mode&1){var x=G0(s);if(x!==null){(x.flags&65536)===0&&(x.flags|=256),Z0(x,s,a,o,e),ag(Bo(l,a));break e}}o=l=Bo(l,a),De!==4&&(De=2),ca===null?ca=[o]:ca.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var d=Mx(o,l,e);z0(o,d);break e;case 1:a=l;var p=o.type,m=o.stateNode;if((o.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Lr===null||!Lr.has(m)))){o.flags|=65536,e&=-e,o.lanes|=e;var y=Fx(o,a,e);z0(o,y);break e}}o=o.return}while(o!==null)}tS(n)}catch(w){e=w,Le===n&&n!==null&&(Le=n=n.return);continue}break}while(!0)}function Jx(){var t=Ju.current;return Ju.current=Qu,t===null?Qu:t}function Ag(){(De===0||De===3||De===2)&&(De=4),ze===null||(_i&268435455)===0&&(pc&268435455)===0||Er(ze,Ke)}function nc(t,e){var n=se;se|=2;var r=Jx();(ze!==t||Ke!==e)&&(Dn=null,hi(t,e));do try{eR();break}catch(i){Qx(t,i)}while(!0);if(ug(),se=n,Ju.current=r,Le!==null)throw Error(R(261));return ze=null,Ke=0,De}function eR(){for(;Le!==null;)eS(Le)}function tR(){for(;Le!==null&&!TA();)eS(Le)}function eS(t){var e=rS(t.alternate,t,At);t.memoizedProps=t.pendingProps,e===null?tS(t):Le=e,Sg.current=null}function tS(t){var e=t;do{var n=e.alternate;if(t=e.return,(e.flags&32768)===0){if(n=KT(n,e,At),n!==null){Le=n;return}}else{if(n=GT(n,e),n!==null){n.flags&=32767,Le=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{De=6,Le=null;return}}if(e=e.sibling,e!==null){Le=e;return}Le=e=t}while(e!==null);De===0&&(De=5)}function ci(t,e,n){var r=ce,i=zt.transition;try{zt.transition=null,ce=1,nR(t,e,n,r)}finally{zt.transition=i,ce=r}return null}function nR(t,e,n,r){do Lo();while(Tr!==null);if((se&6)!==0)throw Error(R(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(R(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(DA(t,o),t===ze&&(Le=ze=null,Ke=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||bu||(bu=!0,iS($u,function(){return Lo(),null})),o=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||o){o=zt.transition,zt.transition=null;var s=ce;ce=1;var a=se;se|=4,Sg.current=null,YT(t,n),Zx(n,t),kT(_h),Vu=!!yh,_h=yh=null,t.current=n,XT(n,t,i),RA(),se=a,ce=s,zt.transition=o}else t.current=n;if(bu&&(bu=!1,Tr=t,tc=i),o=t.pendingLanes,o===0&&(Lr=null),NA(n.stateNode,r),_t(t,Ne()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ec)throw ec=!1,t=Vh,Vh=null,t;return(tc&1)!==0&&t.tag!==0&&Lo(),o=t.pendingLanes,(o&1)!==0?t===Bh?da++:(da=0,Bh=t):da=0,zr(),null}function Lo(){if(Tr!==null){var t=Mw(tc),e=zt.transition,n=ce;try{if(zt.transition=null,ce=16>t?16:t,Tr===null)var r=!1;else{if(t=Tr,Tr=null,tc=0,(se&6)!==0)throw Error(R(331));var i=se;for(se|=4,D=t.current;D!==null;){var o=D,s=o.child;if((D.flags&16)!==0){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(D=u;D!==null;){var c=D;switch(c.tag){case 0:case 11:case 15:ua(8,c,o)}var f=c.child;if(f!==null)f.return=c,D=f;else for(;D!==null;){c=D;var h=c.sibling,g=c.return;if(qx(c),c===u){D=null;break}if(h!==null){h.return=g,D=h;break}D=g}}}var v=o.alternate;if(v!==null){var _=v.child;if(_!==null){v.child=null;do{var x=_.sibling;_.sibling=null,_=x}while(_!==null)}}D=o}}if((o.subtreeFlags&2064)!==0&&s!==null)s.return=o,D=s;else e:for(;D!==null;){if(o=D,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:ua(9,o,o.return)}var d=o.sibling;if(d!==null){d.return=o.return,D=d;break e}D=o.return}}var p=t.current;for(D=p;D!==null;){s=D;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,D=m;else e:for(s=p;D!==null;){if(a=D,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:fc(9,a)}}catch(w){Ie(a,a.return,w)}if(a===s){D=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,D=y;break e}D=a.return}}if(se=i,zr(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(ic,t)}catch{}r=!0}return r}finally{ce=n,zt.transition=e}}return!1}function lw(t,e,n){e=Bo(n,e),e=Mx(t,e,1),t=Or(t,e,1),e=at(),t!==null&&(Ra(t,1,e),_t(t,e))}function Ie(t,e,n){if(t.tag===3)lw(t,t,n);else for(;e!==null;){if(e.tag===3){lw(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Lr===null||!Lr.has(r))){t=Bo(n,t),t=Fx(e,t,1),e=Or(e,t,1),t=at(),e!==null&&(Ra(e,1,t),_t(e,t));break}}e=e.return}}function rR(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=at(),t.pingedLanes|=t.suspendedLanes&n,ze===t&&(Ke&n)===n&&(De===4||De===3&&(Ke&130023424)===Ke&&500>Ne()-kg?hi(t,0):bg|=n),_t(t,e)}function nS(t,e){e===0&&((t.mode&1)===0?e=1:(e=uu,uu<<=1,(uu&130023424)===0&&(uu=4194304)));var n=at();t=Wn(t,e),t!==null&&(Ra(t,e,n),_t(t,n))}function iR(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),nS(t,n)}function oR(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(e),nS(t,n)}var rS;rS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||vt.current)mt=!0;else{if((t.lanes&n)===0&&(e.flags&128)===0)return mt=!1,qT(t,e,n);mt=(t.flags&131072)!==0}else mt=!1,be&&(e.flags&1048576)!==0&&ax(e,qu,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Iu(t,e),t=e.pendingProps;var i=Fo(e,tt.current);Oo(e,n),i=vg(null,e,r,t,i,n);var o=yg();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,yt(r)?(o=!0,Uu(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,fg(e),i.updater=dc,e.stateNode=i,i._reactInternals=e,Th(e,r,t,n),e=Ph(null,e,r,!0,o,n)):(e.tag=0,be&&o&&og(e),st(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Iu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=aR(r),t=Jt(r,t),i){case 0:e=Ih(null,e,r,t,n);break e;case 1:e=Q0(null,e,r,t,n);break e;case 11:e=Y0(null,e,r,t,n);break e;case 14:e=X0(null,e,r,Jt(r.type,t),n);break e}throw Error(R(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jt(r,i),Ih(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jt(r,i),Q0(t,e,r,i,n);case 3:e:{if(Bx(e),t===null)throw Error(R(387));r=e.pendingProps,o=e.memoizedState,i=o.element,px(t,e),Zu(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Bo(Error(R(423)),e),e=J0(t,e,r,n,i);break e}else if(r!==i){i=Bo(Error(R(424)),e),e=J0(t,e,r,n,i);break e}else for(Tt=Nr(e.stateNode.containerInfo.firstChild),Rt=e,be=!0,tn=null,n=dx(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($o(),r===i){e=qn(t,e,n);break e}st(t,e,r,n)}e=e.child}return e;case 5:return hx(e),t===null&&Ch(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,wh(r,i)?s=null:o!==null&&wh(r,o)&&(e.flags|=32),Vx(t,e),st(t,e,s,n),e.child;case 6:return t===null&&Ch(e),null;case 13:return zx(t,e,n);case 4:return pg(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Do(e,null,r,n):st(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jt(r,i),Y0(t,e,r,i,n);case 7:return st(t,e,e.pendingProps,n),e.child;case 8:return st(t,e,e.pendingProps.children,n),e.child;case 12:return st(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,me(Ku,r._currentValue),r._currentValue=s,o!==null)if(on(o.value,s)){if(o.children===i.children&&!vt.current){e=qn(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Hn(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Eh(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(R(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Eh(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}st(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Oo(e,n),i=Ht(i),r=r(i),e.flags|=1,st(t,e,r,n),e.child;case 14:return r=e.type,i=Jt(r,e.pendingProps),i=Jt(r.type,i),X0(t,e,r,i,n);case 15:return $x(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jt(r,i),Iu(t,e),e.tag=1,yt(r)?(t=!0,Uu(e)):t=!1,Oo(e,n),Lx(e,r,i),Th(e,r,i,n),Ph(null,e,r,!0,t,n);case 19:return Hx(t,e,n);case 22:return Dx(t,e,n)}throw Error(R(156,e.tag))};function iS(t,e){return Pw(t,e)}function sR(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,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 Bt(t,e,n,r){return new sR(t,e,n,r)}function Tg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function aR(t){if(typeof t=="function")return Tg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Kh)return 11;if(t===Gh)return 14}return 2}function Fr(t,e){var n=t.alternate;return n===null?(n=Bt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ou(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Tg(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case yo:return gi(n.children,i,o,e);case qh:s=8,i|=8;break;case Qp:return t=Bt(12,n,e,i|2),t.elementType=Qp,t.lanes=o,t;case Jp:return t=Bt(13,n,e,i),t.elementType=Jp,t.lanes=o,t;case eh:return t=Bt(19,n,e,i),t.elementType=eh,t.lanes=o,t;case hw:return hc(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case fw:s=10;break e;case pw:s=9;break e;case Kh:s=11;break e;case Gh:s=14;break e;case br:s=16,r=null;break e}throw Error(R(130,t==null?t:typeof t,""))}return e=Bt(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function gi(t,e,n,r){return t=Bt(7,t,r,e),t.lanes=n,t}function hc(t,e,n,r){return t=Bt(22,t,r,e),t.elementType=hw,t.lanes=n,t.stateNode={isHidden:!1},t}function Zp(t,e,n){return t=Bt(6,t,null,e),t.lanes=n,t}function Yp(t,e,n){return e=Bt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function lR(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Op(0),this.expirationTimes=Op(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Op(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rg(t,e,n,r,i,o,s,a,l){return t=new lR(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Bt(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fg(o),t}function uR(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vo,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function oS(t){if(!t)return Dr;t=t._reactInternals;e:{if(Si(t)!==t||t.tag!==1)throw Error(R(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(yt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(R(171))}if(t.tag===1){var n=t.type;if(yt(n))return ox(t,n,e)}return e}function sS(t,e,n,r,i,o,s,a,l){return t=Rg(n,r,!0,t,i,o,s,a,l),t.context=oS(null),n=t.current,r=at(),i=Mr(n),o=Hn(r,i),o.callback=e??null,Or(n,o,i),t.current.lanes=i,Ra(t,i,r),_t(t,r),t}function gc(t,e,n,r){var i=e.current,o=at(),s=Mr(i);return n=oS(n),e.context===null?e.context=n:e.pendingContext=n,e=Hn(o,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Or(i,e,s),t!==null&&(rn(t,i,s,o),Au(t,i,s)),s}function rc(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function uw(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Ig(t,e){uw(t,e),(t=t.alternate)&&uw(t,e)}function cR(){return null}var aS=typeof reportError=="function"?reportError:function(t){console.error(t)};function Pg(t){this._internalRoot=t}mc.prototype.render=Pg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(R(409));gc(t,e,null,null)};mc.prototype.unmount=Pg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;wi(function(){gc(null,t,null,null)}),e[Un]=null}};function mc(t){this._internalRoot=t}mc.prototype.unstable_scheduleHydration=function(t){if(t){var e=Dw();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Cr.length&&e!==0&&e<Cr[n].priority;n++);Cr.splice(n,0,t),n===0&&Bw(t)}};function Ng(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function vc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function cw(){}function dR(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=rc(s);o.call(u)}}var s=sS(e,r,t,0,null,!1,!1,"",cw);return t._reactRootContainer=s,t[Un]=s.current,wa(t.nodeType===8?t.parentNode:t),wi(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=rc(l);a.call(u)}}var l=Rg(t,0,!1,null,null,!1,!1,"",cw);return t._reactRootContainer=l,t[Un]=l.current,wa(t.nodeType===8?t.parentNode:t),wi(function(){gc(e,l,n,r)}),l}function yc(t,e,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=rc(s);a.call(l)}}gc(e,s,t,i)}else s=dR(n,e,t,i,r);return rc(s)}Fw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ta(e.pendingLanes);n!==0&&(Xh(e,n|1),_t(e,Ne()),(se&6)===0&&(zo=Ne()+500,zr()))}break;case 13:wi(function(){var r=Wn(t,1);if(r!==null){var i=at();rn(r,t,1,i)}}),Ig(t,1)}};Qh=function(t){if(t.tag===13){var e=Wn(t,134217728);if(e!==null){var n=at();rn(e,t,134217728,n)}Ig(t,134217728)}};$w=function(t){if(t.tag===13){var e=Mr(t),n=Wn(t,e);if(n!==null){var r=at();rn(n,t,e,r)}Ig(t,e)}};Dw=function(){return ce};Vw=function(t,e){var n=ce;try{return ce=t,e()}finally{ce=n}};ch=function(t,e,n){switch(e){case"input":if(rh(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=lc(r);if(!i)throw Error(R(90));mw(r),rh(r,i)}}}break;case"textarea":yw(t,n);break;case"select":e=n.value,e!=null&&Ro(t,!!n.multiple,e,!1)}};Cw=Cg;Ew=wi;var fR={usingClientEntryPoint:!1,Events:[Pa,So,lc,bw,kw,Cg]},Xs={findFiberByHostInstance:di,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pR={bundleType:Xs.bundleType,version:Xs.version,rendererPackageName:Xs.rendererPackageName,rendererConfig:Xs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Rw(t),t===null?null:t.stateNode},findFiberByHostInstance:Xs.findFiberByHostInstance||cR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Qs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Qs.isDisabled&&Qs.supportsFiber))try{ic=Qs.inject(pR),Sn=Qs}catch{}var Qs;Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fR;Nt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ng(e))throw Error(R(200));return uR(t,e,null,n)};Nt.createRoot=function(t,e){if(!Ng(t))throw Error(R(299));var n=!1,r="",i=aS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Rg(t,1,!1,null,null,n,!1,r,i),t[Un]=e.current,wa(t.nodeType===8?t.parentNode:t),new Pg(e)};Nt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(R(188)):(t=Object.keys(t).join(","),Error(R(268,t)));return t=Rw(e),t=t===null?null:t.stateNode,t};Nt.flushSync=function(t){return wi(t)};Nt.hydrate=function(t,e,n){if(!vc(e))throw Error(R(200));return yc(null,t,e,!0,n)};Nt.hydrateRoot=function(t,e,n){if(!Ng(t))throw Error(R(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=aS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=sS(e,null,t,1,n??null,i,!1,o,s),t[Un]=e.current,wa(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new mc(e)};Nt.render=function(t,e,n){if(!vc(e))throw Error(R(200));return yc(null,t,e,!1,n)};Nt.unmountComponentAtNode=function(t){if(!vc(t))throw Error(R(40));return t._reactRootContainer?(wi(function(){yc(null,null,t,!1,function(){t._reactRootContainer=null,t[Un]=null})}),!0):!1};Nt.unstable_batchedUpdates=Cg;Nt.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!vc(n))throw Error(R(200));if(t==null||t._reactInternals===void 0)throw Error(R(38));return yc(t,e,n,!1,r)};Nt.version="18.3.1-next-f1338f8080-20240426"});var _c=Tn((kO,cS)=>{"use strict";function uS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uS)}catch(t){console.error(t)}}uS(),cS.exports=lS()});var yS=Tn(Fg=>{"use strict";var vS=_c();Fg.createRoot=vS.createRoot,Fg.hydrateRoot=vS.hydrateRoot;var WO});var Jc="2.1.0-canary.1";var lr="2.0";function is(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function j2(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let r=t;if(r.tiles||n.push("Config missing required field: tiles"),r.actions||n.push("Config missing required field: actions"),r.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let i=r.schemaVersion||"1.0",o=is(i),s=is(lr);return o.major>s.major&&e.push(`Config schema v${i} is newer than SDK v${lr}. Some features may not work. Update SDK to latest version.`),o.major<s.major||!r.schemaVersion?(e.push(`Config schema v${i} is older than SDK v${lr}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:Ik(r,i)}):{valid:!0,warnings:e,errors:n}}function Ik(t,e){let n={...t};return is(e).major===1&&(n=Pk(n)),n.schemaVersion=lr,n}function Pk(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(n=>{let r={...n};if(n.experiment&&!n.activation){let i=n.experiment;i.featureKey&&(r.activation={strategy:{type:"external",provider:"growthbook",featureKey:i.featureKey,fallback:!1}}),delete r.experiment}return 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),t.routes&&(e.routes=t.routes),e}function U2(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",r=is(n),i=is(lr);return r.major<i.major||!e.schemaVersion}var E=typeof window<"u"?window:void 0,Ue=typeof globalThis<"u"?globalThis:E;typeof self>"u"&&(Ue.self=Ue),typeof File>"u"&&(Ue.File=function(){});var Lv=Array.prototype,Vm=Lv.forEach,Bm=Lv.indexOf,kt=Ue?.navigator,O=Ue?.document,dt=Ue?.location,gd=Ue?.fetch,md=Ue!=null&&Ue.XMLHttpRequest&&"withCredentials"in new Ue.XMLHttpRequest?Ue.XMLHttpRequest:void 0,zm=Ue?.AbortController,ct=kt?.userAgent,G=E??{},In={DEBUG:!1,LIB_VERSION:"1.302.2"};function Hm(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(u){return void n(u)}a.done?e(l):Promise.resolve(l).then(r,i)}function jm(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(l){Hm(o,r,i,s,a,"next",l)}function a(l){Hm(o,r,i,s,a,"throw",l)}s(void 0)}))}}function $(){return $=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$.apply(null,arguments)}function Mv(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var Nk=["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"],Um=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return Nk.concat(e).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))},Ok=["$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 te(t,e){return t.indexOf(e)!==-1}var Al=function(t){return t.trim()},vd=function(t){return t.replace(/^\$/,"")},Lk=Array.isArray,Fv=Object.prototype,$v=Fv.hasOwnProperty,Tl=Fv.toString,fe=Lk||function(t){return Tl.call(t)==="[object Array]"},hr=t=>typeof t=="function",Ve=t=>t===Object(t)&&!fe(t),Zi=t=>{if(Ve(t)){for(var e in t)if($v.call(t,e))return!1;return!0}return!1},N=t=>t===void 0,Me=t=>Tl.call(t)=="[object String]",yd=t=>Me(t)&&t.trim().length===0,Ln=t=>t===null,de=t=>N(t)||Ln(t),gn=t=>Tl.call(t)=="[object Number]",gr=t=>Tl.call(t)==="[object Boolean]",Mk=t=>t instanceof FormData,Fk=t=>te(Ok,t);function _d(t){return t===null||typeof t!="object"}function sl(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Dv(t){return!N(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var $k=[!0,"true",1,"1","yes"],ed=t=>te($k,t),Dk=[!1,"false",0,"0","no"];function fn(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),gn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):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: "+n+", fallback: "+i),fn(i||n,e,n,r))}var wd=class{constructor(e){this.t={},this.i=e.i,this.o=fn(e.bucketSize,0,100,e.h),this.m=fn(e.refillRate,0,this.o,e.h),this.S=fn(e.refillInterval,0,864e5,e.h)}$(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var o=i*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),o=this.t[i];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[i]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},Ya,Wm,td,Vk=t=>t instanceof Error;function Bk(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return td&&n.length===Wm||(Wm=n.length,td=n.reduce(((r,i)=>{Ya||(Ya={});var o=Ya[i];if(o)r[o[0]]=o[1];else for(var s=t(i),a=s.length-1;a>=0;a--){var l=s[a],u=l?.filename,c=e[i];if(u&&c){r[u]=c,Ya[i]=[u,c];break}}return r}),{})),td}}var xd=class{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),o=this.buildParsingContext(),s=this.parseStacktrace(i,o);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var n=this;return jm((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&fe(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),$({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return jm((function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,n){var r,i,o,s={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,$({},n,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:Bk(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(o,s)=>{if(s<=4){var a=this.buildCoercingContext(e,n,s);return this.applyCoercers(o,a)}};return $({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:o=>i(o,r),next:o=>i(o,r+1)})}},Ji="?";function Sd(t,e,n,r,i){var o={platform:t,filename:e,function:n==="<anonymous>"?Ji:n,in_app:!0};return N(r)||(o.lineno=r),N(i)||(o.colno=i),o}var Vv=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Ji,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},zk=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Hk=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,jk=/\((\S*)(?::(\d+))(?::(\d+))\)/,Uk=(t,e)=>{var n=zk.exec(t);if(n){var[,r,i,o]=n;return Sd(e,r,Ji,+i,+o)}var s=Hk.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var a=jk.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,u]=Vv(s[1]||Ji,s[2]);return Sd(e,u,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Wk=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qk=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Kk=(t,e)=>{var n=Wk.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=qk.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],o=n[1]||Ji;return[o,i]=Vv(o,i),Sd(e,i,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},qm=/\(error: (.*)\)/,Km=50;function Gk(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,o){o===void 0&&(o=0);for(var s=[],a=i.split(`
|
|
9
|
-
`),l=o;l<a.length;l++){var u=a[l];if(!(u.length>1024)){var c=qm.test(u)?u.replace(qm,"$1"):u;if(!c.match(/\S*Error: /)){for(var f of n){var h=f(c,t);if(h){s.push(h);break}}if(s.length>=Km)break}}}return(function(g){if(!g.length)return[];var v=Array.from(g);return v.reverse(),v.slice(0,Km).map((_=>{return $({},_,{filename:_.filename||(x=v,x[x.length-1]||{}).filename,function:_.function||Ji});var x}))})(s)}}var bd=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=Me(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return sl(e,"DOMException")}isDOMError(e){return sl(e,"DOMError")}},kd=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){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}},Cd=class{constructor(){}match(e){return sl(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Zk=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Ed=class{match(e){return typeof e=="string"}coerce(e,n){var r,[i,o]=this.getInfos(e);return{type:i??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(Zk);return i&&(n=i[1],r=i[2]),[n,r]}},Yk=["fatal","error","warning","log","info","debug"];function Bv(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}var Ad=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Dv(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}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: "+Bv(e)}isSeverityLevel(e){return Me(e)&&!yd(e)&&Yk.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(Vk(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},Td=class{match(e){return Dv(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Bv(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Rd=class{match(e){return _d(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Id=class{match(e){return sl(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return _d(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(_d(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}},zv=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(E&&(In.DEBUG||G.POSTHOG_DEBUG||n)&&!N(E.console)&&E.console){for(var o=("__rrweb_original__"in E.console[i])?E.console[i].__rrweb_original__:E.console[i],s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];o(t,...a)}},info:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("log",...o)},warn:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("warn",...o)},error:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("error",...o)},critical:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];console.error(t,...o)},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,o)=>zv(t+" "+i,o)};return r},L=zv("[PostHog.js]"),Fe=L.createLogger,Xk=Fe("[ExternalScriptsLoader]"),Gm=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return Xk.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=O?.querySelectorAll("script");if(r){for(var i,o=function(){if(r[s].src===e){var l=r[s];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,n(void 0,u)})),l.onerror=u=>n(u),{v:void 0})}},s=0;s<r.length;s++)if(i=o())return i.v}var a=()=>{if(!O)return n("document not found");var l=O.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var u,c=O.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):O.body.appendChild(l)};O!=null&&O.body?a():O?.addEventListener("DOMContentLoaded",a)};G.__PosthogExtensions__=G.__PosthogExtensions__||{},G.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var o=t.requestRouter.endpointFor("assets",r);Gm(t,o,n)},G.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Gm(t,r,n)};var al={};function mr(t,e,n){if(fe(t)){if(Vm&&t.forEach===Vm)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===al)return}}}function pe(t,e,n){if(!de(t)){if(fe(t))return mr(t,e,n);if(Mk(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===al)return}else for(var i in t)if($v.call(t,i)&&e.call(n,t[i],i)===al)return}}var Pe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return mr(n,(function(i){for(var o in i)i[o]!==void 0&&(t[o]=i[o])})),t},no=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return mr(n,(function(i){mr(i,(function(o){t.push(o)}))})),t};function rl(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Zm=function(t){try{return t()}catch{return}},Qk=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){L.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),L.critical(i)}}},Ef=function(t){var e={};return pe(t,(function(n,r){(Me(n)&&n.length>0||gn(n))&&(e[r]=n)})),e};function Jk(t,e){return n=t,r=o=>Me(o)&&!Ln(e)?o.slice(0,e):o,i=new Set,(function o(s,a){return s!==Object(s)?r?r(s,a):s:i.has(s)?void 0:(i.add(s),fe(s)?(l=[],mr(s,(u=>{l.push(o(u))}))):(l={},pe(s,((u,c)=>{i.has(u)||(l[c]=o(u,c))}))),l);var l})(n);var n,r,i}var e1=["herokuapp.com","vercel.app","netlify.app"];function t1(t){var e=t?.hostname;if(!Me(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of e1)if(n===r)return!1;return!0}function Hv(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Oe(t,e,n,r){var{capture:i=!1,passive:o=!0}=r??{};t?.addEventListener(e,n,{capture:i,passive:o})}var jv="$people_distinct_id",hs="__alias",gs="__timers",Ym="$autocapture_disabled_server_side",Pd="$heatmaps_enabled_server_side",Xm="$exception_capture_enabled_server_side",Nd="$error_tracking_suppression_rules",Qm="$error_tracking_capture_extension_exceptions",Jm="$web_vitals_enabled_server_side",Uv="$dead_clicks_enabled_server_side",ev="$web_vitals_allowed_metrics",nd="$session_recording_remote_config",ll="$sesid",Wv="$session_is_sampled",Yi="$enabled_feature_flags",ms="$early_access_features",Od="$feature_flag_details",vs="$stored_person_properties",ri="$stored_group_properties",Ld="$surveys",Xa="$surveys_activated",ul="$flag_call_reported",Pn="$user_state",Md="$client_session_props",Fd="$capture_rate_limit",$d="$initial_campaign_params",Dd="$initial_referrer_info",cl="$initial_person_info",dl="$epp",qv="__POSTHOG_TOOLBAR__",os="$posthog_cookieless",n1=[jv,hs,"__cmpns",gs,"$session_recording_enabled_server_side",Pd,ll,Yi,Nd,Pn,ms,Od,ri,vs,Ld,ul,Md,Fd,$d,Dd,dl,cl];function tv(t){return t instanceof Element&&(t.id===qv||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Rl(t){return!!t&&t.nodeType===1}function vr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Kv(t){return!!t&&t.nodeType===3}function Gv(t){return!!t&&t.nodeType===11}function Af(t){return t?Al(t).split(/\s+/):[]}function nv(t){var e=E?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function fl(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 Af(e)}function Zv(t){return de(t)?null:Al(t).split(/(\s+)/).filter((e=>ks(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Is(t){var e="";return Vd(t)&&!ey(t)&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;Kv(n)&&n.textContent&&(e+=(r=Zv(n.textContent))!==null&&r!==void 0?r:"")})),Al(e)}function Yv(t){return N(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Tf=["a","button","form","input","select","textarea","label"];function Xv(t,e){if(N(e))return!0;var n,r=function(o){if(e.some((s=>o.matches(s))))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function Qv(t){var e=t.parentNode;return!(!e||!Rl(e))&&e}var r1=["next","previous","prev",">","<"],rv=10,iv=[".ph-no-rageclick",".ph-no-capture"];function i1(t,e){if(!E||Rf(t))return!1;var n,r,i;if(gr(e)?(n=!!e&&iv,r=void 0):(n=(i=e?.css_selector_ignorelist)!==null&&i!==void 0?i:iv,r=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=Jv(t,!1);return!(function(s,a){if(s===!1||N(s))return!1;var l;if(s===!0)l=r1;else{if(!fe(s))return!1;if(s.length>rv)return L.error("[PostHog] content_ignorelist array cannot exceed "+rv+" items. Use css_selector_ignorelist for more complex matching."),!1;l=s.map((u=>u.toLowerCase()))}return a.some((u=>{var{safeText:c,ariaLabel:f}=u;return l.some((h=>c.includes(h)||f.includes(h)))}))})(r,o.map((s=>{var a;return{safeText:Is(s).toLowerCase(),ariaLabel:((a=s.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}})))&&!Xv(o,n)}var Rf=t=>!t||vr(t,"html")||!Rl(t),Jv=(t,e)=>{if(!E||Rf(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!vr(i,"body");)if(Gv(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var o=Qv(i);if(!o)break;if(e||Tf.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var s=E.getComputedStyle(o);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(o),i=o}return{parentIsUsefulElement:n,targetElementList:r}};function o1(t,e,n,r,i){var o,s,a,l;if(n===void 0&&(n=void 0),!E||Rf(t)||(o=n)!=null&&o.url_allowlist&&!nv(n.url_allowlist)||(s=n)!=null&&s.url_ignorelist&&nv(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((v=>e.type===v)))return!1}var{parentIsUsefulElement:c,targetElementList:f}=Jv(t,r);if(!(function(v,_){var x=_?.element_allowlist;if(N(x))return!0;var d,p=function(y){if(x.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var m of v)if(d=p(m))return d.v;return!1})(f,n)||!Xv(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=E.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return c?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(Tf.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function Vd(t){for(var e=t;e.parentNode&&!vr(e,"body");e=e.parentNode){var n=fl(e);if(te(n,"ph-sensitive")||te(n,"ph-no-capture"))return!1}if(te(fl(t),"ph-include"))return!0;var r=t.type||"";if(Me(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(Me(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function ey(t){return!!(vr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vr(t,"select")||vr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var ty="(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})",s1=new RegExp("^(?:"+ty+")$"),a1=new RegExp(ty),ny="\\d{3}-?\\d{2}-?\\d{4}",l1=new RegExp("^("+ny+")$"),u1=new RegExp("("+ny+")");function ks(t,e){return e===void 0&&(e=!0),!(de(t)||Me(t)&&(t=Al(t),(e?s1:a1).test((t||"").replace(/[- ]/g,""))||(e?l1:u1).test(t)))}function ry(t){var e=Is(t);return ks(e=(e+" "+iy(t)).trim())?e:""}function iy(t){var e="";return t&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Is(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+iy(n)).trim())}catch(o){L.error("[AutoCapture]",o)}})),e}function c1(t){return(function(e){var n=e.map((r=>{var i,o,s="";if(r.tag_name&&(s+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))s+="."+a.replace(/"/g,"");var l=$({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i: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 rl(l).sort(((c,f)=>{var[h]=c,[g]=f;return h.localeCompare(g)})).forEach((c=>{var[f,h]=c;return u[ov(f.toString())]=ov(h.toString())})),s+=":",s+=rl(u).map((c=>{var[f,h]=c;return f+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var r,i,o={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:d1(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return rl(n).filter((s=>{var[a]=s;return a.indexOf("attr__")===0})).forEach((s=>{var[a,l]=s;return o.attributes[a]=l})),o}))})(t))}function ov(t){return t.replace(/"|\\"/g,'\\"')}function d1(t){var e=t.attr__class;return e?fe(e)?e:Af(e):void 0}var pl=class{constructor(e){this.disabled=e===!1;var n=Ve(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}},rd="$copy_autocapture",On=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var hl=t=>{var e=O?.createElement("a");return N(e)?null:(e.href=t,e)},f1=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return pe(t,(function(o,s){N(o)||N(s)||s==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+n)})),i.join(e)},gl=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===e){n=o;break}}if(!fe(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch{L.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Ps=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],l=s[0],u=(a||"").split("&"),c=[],f=0;f<u.length;f++){var h=u[f].split("=");fe(h)&&(e.includes(h[0])?c.push(h[0]+"="+n):c.push(u[f]))}var g=l;return a!=null&&(g+="?"+c.join("&")),o!=null&&(g+="#"+o),g},ml=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},sv=Fe("[AutoCapture]");function id(t,e){return e.length>t?e.slice(0,t)+"...":e}function p1(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Rl(e));return e}function h1(t,e,n,r){var i=t.tagName.toLowerCase(),o={tag_name:i};Tf.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=id(1024,ry(t)):o.$el_text=id(1024,Is(t)));var s=fl(t);s.length>0&&(o.classes=s.filter((function(c){return c!==""}))),pe(t.attributes,(function(c){var f;if((!ey(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&ks(c.value)&&(f=c.name,!Me(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var h=c.value;c.name==="class"&&(h=Af(h).join(" ")),o["attr__"+c.name]=id(1024,h)}}));for(var a=1,l=1,u=t;u=p1(u);)a++,u.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function g1(t,e){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!vr(c,"body");)Gv(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var f,h=[],g={},v=!1,_=!1;if(pe(u,(y=>{var w=Vd(y);y.tagName.toLowerCase()==="a"&&(v=y.getAttribute("href"),v=w&&v&&ks(v)&&v),te(fl(y),"ph-no-capture")&&(_=!0),h.push(h1(y,o,s,a));var b=(function(k){if(!Vd(k))return{};var C={};return pe(k.attributes,(function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var A=I.name.replace("data-ph-capture-attribute-",""),H=I.value;A&&H&&ks(H)&&(C[A]=H)}})),C})(y);Pe(g,b)})),_)return{props:{},explicitNoCapture:_};if(s||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=ry(t):h[0].$el_text=Is(t)),v){var x,d;h[0].attr__href=v;var p=(x=hl(v))==null?void 0:x.host,m=E==null||(d=E.location)==null?void 0:d.host;p&&m&&p!==m&&(f=v)}return{props:Pe({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:c1(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},f&&i.type==="click"?{$external_click_url:f}:{},g)}}var Bd=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new pl(e.config.rageclick),this.I=null}get F(){var e,n,r=Ve(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map((i=>new RegExp(i))),r}C(){if(this.isBrowserSupported()){if(E&&O){var e=r=>{r=r||E?.event;try{this.M(r)}catch(i){sv.error("Failed to capture event",i)}};if(Oe(O,"submit",e,{capture:!0}),Oe(O,"change",e,{capture:!0}),Oe(O,"click",e,{capture:!0}),this.F.capture_copied_text){var n=r=>{r=r||E?.event,this.M(r,rd)};Oe(O,"copy",n,{capture:!0}),Oe(O,"cut",n,{capture:!0})}}}else sv.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({[Ym]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,r=[];return(n=this.I)==null||n.forEach((i=>{var o=O?.querySelectorAll(i);o?.forEach((s=>{e===s&&r.push(i)}))})),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[Ym],i=this.T;if(Ln(i)&&!gr(r)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=Yv(e);Kv(i)&&(i=i.parentNode||null),n==="$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())&&i1(i,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===rd;if(i&&o1(i,e,this.F,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:a}=g1(i,{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(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(s.$element_selectors=l),n===rd){var u,c=Zv(E==null||(u=E.getSelection())==null?void 0:u.toString()),f=e.type||"clipboard";if(!c)return!1;s.$selected_content=c,s.$copy_type=f}return this.instance.capture(n,s),!0}}}isBrowserSupported(){return hr(O?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return gn(t)&&isFinite(t)&&Math.floor(t)===t});var av="0123456789abcdef",zd=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>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|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+av.charAt(this.bytes[n]>>>4)+av.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==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 n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},Hd=class{constructor(){this.A=0,this.D=0,this.j=new jd}generate(){var e=this.generateOrAbort();if(N(e)){this.A=0;var n=this.generateOrAbort();if(N(n))throw new Error("Could not generate UUID after timestamp reset");return n}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 zd.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())}},lv,oy=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};E&&!N(E.crypto)&&crypto.getRandomValues&&(oy=t=>crypto.getRandomValues(t));var jd=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(oy(this.N),this.U=0),this.N[this.U++]}},pr=()=>m1().toString(),m1=()=>(lv||(lv=new Hd)).generate(),ss="",v1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function y1(t,e){if(e){var n=(function(i,o){if(o===void 0&&(o=O),ss)return ss;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var s=i.split("."),a=Math.min(s.length,8),l="dmn_chk_"+pr();!ss&&a--;){var u=s.slice(a).join("."),c=l+"=1;domain=."+u+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(l)&&(o.cookie=c+";max-age=0",ss=u)}return ss})(t);if(!n){var r=(i=>{var o=i.match(v1);return o?o[0]:""})(t);r!==n&&L.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var hn={H:()=>!!O,B:function(t){L.error("cookieStore error: "+t)},q:function(t){if(O){try{for(var e=t+"=",n=O.cookie.split(";").filter((o=>o.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(hn.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(O)try{var o="",s="",a=y1(O.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&L.warn("cookieStore warning: large cookie, len="+u.length),O.cookie=u,u}catch{return}},V:function(t,e){if(O!=null&&O.cookie)try{hn.G(t,"",-1,e)}catch{return}}},od=null,ke={H:function(){if(!Ln(od))return od;var t=!0;if(N(E))t=!1;else try{var e="__mplssupport__";ke.G(e,"xyz"),ke.q(e)!=='"xyz"'&&(t=!1),ke.V(e)}catch{t=!1}return t||L.error("localStorage unsupported; falling back to cookie store"),od=t,t},B:function(t){L.error("localStorage error: "+t)},q:function(t){try{return E?.localStorage.getItem(t)}catch(e){ke.B(e)}return null},W:function(t){try{return JSON.parse(ke.q(t))||{}}catch{}return null},G:function(t,e){try{E?.localStorage.setItem(t,JSON.stringify(e))}catch(n){ke.B(n)}},V:function(t){try{E?.localStorage.removeItem(t)}catch(e){ke.B(e)}}},_1=["distinct_id",ll,Wv,dl,cl],Qa=$({},ke,{W:function(t){try{var e={};try{e=hn.W(t)||{}}catch{}var n=Pe(e,JSON.parse(ke.q(t)||"{}"));return ke.G(t,n),n}catch{}return null},G:function(t,e,n,r,i,o){try{ke.G(t,e,void 0,void 0,o);var s={};_1.forEach((a=>{e[a]&&(s[a]=e[a])})),Object.keys(s).length&&hn.G(t,s,n,r,i,o)}catch(a){ke.B(a)}},V:function(t,e){try{E?.localStorage.removeItem(t),hn.V(t,e)}catch(n){ke.B(n)}}}),Ja={},w1={H:function(){return!0},B:function(t){L.error("memoryStorage error: "+t)},q:function(t){return Ja[t]||null},W:function(t){return Ja[t]||null},G:function(t,e){Ja[t]=e},V:function(t){delete Ja[t]}},ti=null,je={H:function(){if(!Ln(ti))return ti;if(ti=!0,N(E))ti=!1;else try{var t="__support__";je.G(t,"xyz"),je.q(t)!=='"xyz"'&&(ti=!1),je.V(t)}catch{ti=!1}return ti},B:function(t){L.error("sessionStorage error: ",t)},q:function(t){try{return E?.sessionStorage.getItem(t)}catch(e){je.B(e)}return null},W:function(t){try{return JSON.parse(je.q(t))||null}catch{}return null},G:function(t,e){try{E?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){je.B(n)}},V:function(t){try{E?.sessionStorage.removeItem(t)}catch(e){je.B(e)}}},Nn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Ud=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Nn.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Nn.DENIED||this.consent===Nn.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Nn.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return ed(e)?Nn.GRANTED:te(Dk,e)?Nn.DENIED:Nn.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?ke:hn;var n=e==="localStorage"?hn:ke;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(ed(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!Hv([kt?.doNotTrack,kt?.msDoNotTrack,G.doNotTrack],(e=>ed(e)))}},el=Fe("[Dead Clicks]"),x1=()=>!0,S1=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Uv)),r=t.instance.config.capture_dead_clicks;return gr(r)?r:!!Ve(r)||n},vl=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Uv]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?el.error("failed to load script",i):e()}))}et(){var e;if(O){if(!this.tt&&(e=G.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ve(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=G.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(O),el.info("starting...")}}else el.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,el.info("stopping..."))}},as=Fe("[ExceptionAutocapture]"),Wd=class{constructor(e){var n,r,i;this.rt=()=>{var o;if(E&&this.isEnabled&&(o=G.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=G.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=G.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=G.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=s(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=a(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){as.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[Xm]),this.F=this.ht(),this.vt=new wd({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:as}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ve(e)?n=$({},n,e):(N(e)?this.ut:e)&&(n=$({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(as.info("enabled"),this.it(this.rt))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return as.error("failed to load script",i);e()}))}lt(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Xm]:this.ut}),this.startIfEnabled()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(i)?as.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}};function uv(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return hr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}var qd=class{constructor(e){var n;this._instance=e,this.dt=(E==null||(n=E.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(L.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,L.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(E&&E.history){var r=this;(e=E.history.pushState)!=null&&e.__posthog_wrapped__||uv(E.history,"pushState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("pushState")})),(n=E.history.replaceState)!=null&&n.__posthog_wrapped__||uv(E.history,"replaceState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("replaceState")})),this.gt()}}ft(e){try{var n,r=E==null||(n=E.location)==null?void 0:n.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(i){L.error("Error capturing "+e+" pageview",i)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};Oe(E,"popstate",e),this.ct=()=>{E&&E.removeEventListener("popstate",e)}}}},sd=Fe("[SegmentIntegration]");function b1(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var o=r.config.segment;if(!o)return i();var s=l=>{var u=()=>l.anonymousId()||pr();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(Pn,"identified")),i()},a=o.user();"then"in a&&hr(a.then)?a.then((l=>s(l))):s(a)})(t,(()=>{n.register((r=>{Promise&&Promise.resolve||sd.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,s)=>{if(!s)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(sd.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(sd.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var a=r.calculateEventProperties(s,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(t)).then((()=>{e()}))}))}var sy="posthog-js";function ay(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:o=["error"],sendExceptionsToPostHog:s=!0}=e===void 0?{}:e;return a=>{var l,u,c,f,h;if(!(o==="*"||o.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v=((l=a.exception)==null?void 0:l.values)||[],_=v.map((d=>$({},d,{stacktrace:d.stacktrace?$({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((p=>$({},p,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=v[0])==null?void 0:u.value)||a.message,$exception_type:(c=v[0])==null?void 0:c.type,$exception_level:a.level,$exception_list:_,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((f=v[0])==null?void 0:f.value)||a.message,$sentry_exception_type:(h=v[0])==null?void 0:h.type,$sentry_tags:a.tags};return n&&r&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),s&&t.exceptions.sendExceptionEvent(x),a}}var Kd=class{constructor(e,n,r,i,o,s){this.name=sy,this.setupOnce=function(a){a(ay(e,{organization:n,projectId:r,prefix:i,severityAllowList:o,sendExceptionsToPostHog:s==null||s}))}}},k1=E!=null&&E.location?ml(E.location.hash,"__posthog")||ml(location.hash,"state"):null,cv="_postHogToolbarParams",dv=Fe("[Toolbar]"),fr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(fr||{}),Gd=class{constructor(e){this.instance=e}_t(e){G.ph_toolbar_state=e}yt(){var e;return(e=G.ph_toolbar_state)!==null&&e!==void 0?e:fr.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!E||!O)return!1;e=e??E.location,r=r??E.history;try{if(!n){try{E.localStorage.setItem("test","test"),E.localStorage.removeItem("test")}catch{return!1}n=E?.localStorage}var i,o=k1||ml(e.hash,"__posthog")||ml(e.hash,"state"),s=o?Zm((()=>JSON.parse(atob(decodeURIComponent(o)))))||Zm((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(cv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}bt(e){var n=G.ph_load_toolbar||G.ph_load_editor;!de(n)&&hr(n)?n(e,this.instance):dv.warn("No toolbar load function found")}loadToolbar(e){var n=!(O==null||!O.getElementById(qv));if(!E||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=$({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(E.localStorage.setItem(cv,JSON.stringify($({},i,{source:void 0}))),this.yt()===fr.LOADED)this.bt(i);else if(this.yt()===fr.UNINITIALIZED){var o;this._t(fr.LOADING),(o=G.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return dv.error("[Toolbar] Failed to load",s),void this._t(fr.UNINITIALIZED);this._t(fr.LOADED),this.bt(i)})),Oe(E,"turbolinks:load",(()=>{this._t(fr.UNINITIALIZED),this.loadToolbar(i)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}},C1=Fe("[TracingHeaders]"),Zd=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,r;N(this.xt)&&((n=G.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),N(this.St)&&((r=G.__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 n,r;(n=G.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return C1.error("failed to load script",i);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Mt="Mobile",yl="iOS",pn="Android",Cs="Tablet",ly=pn+" "+Cs,uy="iPad",cy="Apple",dy=cy+" Watch",Es="Safari",eo="BlackBerry",fy="Samsung",py=fy+"Browser",hy=fy+" Internet",ii="Chrome",E1=ii+" OS",gy=ii+" "+yl,If="Internet Explorer",my=If+" "+Mt,Pf="Opera",A1=Pf+" Mini",Nf="Edge",vy="Microsoft "+Nf,Xi="Firefox",yy=Xi+" "+yl,As="Nintendo",Ts="PlayStation",Qi="Xbox",_y=pn+" "+Mt,wy=Mt+" "+Es,ys="Windows",Yd=ys+" Phone",fv="Nokia",Xd="Ouya",xy="Generic",T1=xy+" "+Mt.toLowerCase(),Sy=xy+" "+Cs.toLowerCase(),Qd="Konqueror",rt="(\\d+(\\.\\d+)?)",ad=new RegExp("Version/"+rt),R1=new RegExp(Qi,"i"),I1=new RegExp(Ts+" \\w+","i"),P1=new RegExp(As+" \\w+","i"),Of=new RegExp(eo+"|PlayBook|BB10","i"),N1={"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"},O1=(t,e)=>e&&te(e,cy)||(function(n){return te(n,Es)&&!te(n,ii)&&!te(n,pn)})(t),by=function(t,e){return e=e||"",te(t," OPR/")&&te(t,"Mini")?A1:te(t," OPR/")?Pf:Of.test(t)?eo:te(t,"IE"+Mt)||te(t,"WPDesktop")?my:te(t,py)?hy:te(t,Nf)||te(t,"Edg/")?vy:te(t,"FBIOS")?"Facebook "+Mt:te(t,"UCWEB")||te(t,"UCBrowser")?"UC Browser":te(t,"CriOS")?gy:te(t,"CrMo")||te(t,ii)?ii:te(t,pn)&&te(t,Es)?_y:te(t,"FxiOS")?yy:te(t.toLowerCase(),Qd.toLowerCase())?Qd:O1(t,e)?te(t,Mt)?wy:Es:te(t,Xi)?Xi:te(t,"MSIE")||te(t,"Trident/")?If:te(t,"Gecko")?Xi:""},L1={[my]:[new RegExp("rv:"+rt)],[vy]:[new RegExp(Nf+"?\\/"+rt)],[ii]:[new RegExp("("+ii+"|CrMo)\\/"+rt)],[gy]:[new RegExp("CriOS\\/"+rt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+rt)],[Es]:[ad],[wy]:[ad],[Pf]:[new RegExp("(Opera|OPR)\\/"+rt)],[Xi]:[new RegExp(Xi+"\\/"+rt)],[yy]:[new RegExp("FxiOS\\/"+rt)],[Qd]:[new RegExp("Konqueror[:/]?"+rt,"i")],[eo]:[new RegExp(eo+" "+rt),ad],[_y]:[new RegExp("android\\s"+rt,"i")],[hy]:[new RegExp(py+"\\/"+rt)],[If]:[new RegExp("(rv:|MSIE )"+rt)],Mozilla:[new RegExp("rv:"+rt)]},M1=function(t,e){var n=by(t,e),r=L1[n];if(N(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},pv=[[new RegExp(Qi+"; "+Qi+" (.*?)[);]","i"),t=>[Qi,t&&t[1]||""]],[new RegExp(As,"i"),[As,""]],[new RegExp(Ts,"i"),[Ts,""]],[Of,[eo,""]],[new RegExp(ys,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Yd,""];if(new RegExp(Mt).test(e)&&!/IEMobile\b/.test(e))return[ys+" "+Mt,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=N1[r]||"";return/arm/i.test(e)&&(i="RT"),[ys,i]}return[ys,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[yl,e.join(".")]}return[yl,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=N(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+pn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+pn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[pn,e.join(".")]}return[pn,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[E1,""]],[/Linux|debian/i,["Linux",""]]],hv=function(t){return P1.test(t)?As:I1.test(t)?Ts:R1.test(t)?Qi:new RegExp(Xd,"i").test(t)?Xd:new RegExp("("+Yd+"|WPDesktop)","i").test(t)?Yd:/iPad/.test(t)?uy:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?dy:Of.test(t)?eo:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(fv,"i").test(t)?fv:/(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(Mt).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)?pn:ly:pn:new RegExp("(pda|"+Mt+")","i").test(t)?T1:new RegExp(Cs,"i").test(t)&&!new RegExp(Cs+" pc","i").test(t)?Sy:""},tl="https?://(.*)",ro=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],F1=no(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ro),Ns="<masked>",$1=["li_fat_id"];function ky(t,e,n){if(!O)return{};var r,i=e?no([],ro,n||[]):[],o=Cy(Ps(O.URL,i,Ns),t),s=(r={},pe($1,(function(a){var l=hn.q(a);r[a]=l||null})),r);return Pe(s,o)}function Cy(t,e){var n=F1.concat(e||[]),r={};return pe(n,(function(i){var o=gl(t,i);r[i]=o||null})),r}function Ey(t){var e=(function(o){return o?o.search(tl+"google.([^/?]*)")===0?"google":o.search(tl+"bing.com")===0?"bing":o.search(tl+"yahoo.com")===0?"yahoo":o.search(tl+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Ln(e)){r.$search_engine=e;var i=O?gl(O.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function gv(){return navigator.language||navigator.userLanguage}function Ay(){return O?.referrer||"$direct"}function Ty(t,e){var n=t?no([],ro,e||[]):[],r=dt?.href.substring(0,1e3);return{r:Ay().substring(0,1e3),u:r?Ps(r,n,Ns):void 0}}function Ry(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=hl(n))==null?void 0:e.host};if(r){i.$current_url=r;var o=hl(r);i.$host=o?.host,i.$pathname=o?.pathname;var s=Cy(r);Pe(i,s)}if(n){var a=Ey(n);Pe(i,a)}return i}function Iy(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function D1(){try{return new Date().getTimezoneOffset()}catch{return}}function V1(t,e){if(!ct)return{};var n,r,i,o=t?no([],ro,e||[]):[],[s,a]=(function(l){for(var u=0;u<pv.length;u++){var[c,f]=pv[u],h=c.exec(l),g=h&&(hr(f)?f(h,l):f);if(g)return g}return["",""]})(ct);return Pe(Ef({$os:s,$os_version:a,$browser:by(ct,navigator.vendor),$device:hv(ct),$device_type:(r=ct,i=hv(r),i===uy||i===ly||i==="Kobo"||i==="Kindle Fire"||i===Sy?Cs:i===As||i===Qi||i===Ts||i===Xd?"Console":i===dy?"Wearable":i?Mt:"Desktop"),$timezone:Iy(),$timezone_offset:D1()}),{$current_url:Ps(dt?.href,o,Ns),$host:dt?.host,$pathname:dt?.pathname,$raw_user_agent:ct.length>1e3?ct.substring(0,997)+"...":ct,$browser_version:M1(ct,navigator.vendor),$browser_language:gv(),$browser_language_prefix:(n=gv(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:E?.screen.height,$screen_width:E?.screen.width,$viewport_height:E?.innerHeight,$viewport_width:E?.innerWidth,$lib:"web",$lib_version:In.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ur=Fe("[Web Vitals]"),mv=9e5,Jd=class{constructor(e){var n;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,i)=>$({},r,{["$web_vitals_"+i.name+"_event"]:$({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var i,o=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(N(o))ur.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Tt();N(s)||(de(r?.name)||de(r?.value)?ur.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?ur.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==s&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),N(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=N(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push($({},r,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,i,o,s,a=G.__PosthogExtensions__;N(a)||N(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:o,onINP:s}=a.postHogWebVitalsCallbacks),r&&i&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Pt.bind(this)),this.P=!0):ur.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[Jm]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=Ve(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return N(r)?((n=this._instance.persistence)==null?void 0:n.props[ev])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ve(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=Ve(this._instance.config.capture_performance)&&gn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:mv;return 0<e&&e<=6e4?mv:e}get isEnabled(){var e=dt?.protocol;if(e!=="http:"&&e!=="https:")return ur.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=Ve(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:gr(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return gr(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(ur.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=Ve(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ve(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Jm]:n}),this._instance.persistence.register({[ev]:r})),this.Et=n,this.startIfEnabled()}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(i=>{i?ur.error("failed to load script",i):e()}))}Tt(){var e=E?E.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?no([],ro,r||[]):[];return Ps(e,i,Ns)}ur.error("Could not determine current URL")}},B1=Fe("[Heatmaps]");function vv(t){return Ve(t)&&"clientX"in t&&"clientY"in t&&gn(t.clientX)&&gn(t.clientY)}var ef=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[Pd]),this.rageclicks=new pl(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Ve(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 N(this.instance.config.capture_heatmaps)?N(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;B1.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 n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Pd]:n}),this.Et=n,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"})(O)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){E&&O&&(this.jt=this.Dt.bind(this),Oe(E,"beforeunload",this.jt),this.Lt=e=>this.At(e||E?.event),Oe(O,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||E?.event),Oe(O,"mousemove",this.Nt,{capture:!0}),this.zt=new vl(this.instance,x1,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),Oe(O,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;E&&O&&(this.jt&&E.removeEventListener("beforeunload",this.jt),this.Lt&&O.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&O.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&O.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(a,l,u){for(var c=a;c&&Rl(c)&&!vr(c,"body");){if(c===u)return!1;if(te(l,E?.getComputedStyle(c).position))return!0;c=Qv(c)}return!1})(Yv(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:n}}At(e,n){var r;if(n===void 0&&(n="click"),!tv(e.target)&&vv(e)){var i=this.qt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt($({},i,{type:"rageclick"})),this.Wt(i)}}Ut(e){!tv(e.target)&&vv(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(E){var n=E.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,o=r?no([],ro,i||[]):[],s=Ps(n,o,Ns);this.N=this.N||{},this.N[s]||(this.N[s]=[]),this.N[s].push(e)}}Dt(){this.N&&!Zi(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},tf=class{constructor(e){this._instance=e}doPageView(e,n){var r,i=this.Gt(e,n);return this.Vt={pathname:(r=E?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var r=this.Vt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:f}=o;if(!(N(s)||N(a)||N(l)||N(u)||N(c)||N(f))){s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),f=Math.ceil(f);var h=s<=1?1:fn(a/s,0,1,L),g=s<=1?1:fn(l/s,0,1,L),v=u<=1?1:fn(c/u,0,1,L),_=u<=1?1:fn(f/u,0,1,L);i=Pe(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}},Ft=Uint8Array,it=Uint16Array,to=Uint32Array,Lf=new Ft([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]),Mf=new Ft([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]),yv=new Ft([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Py=function(t,e){for(var n=new it(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new to(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Ny=Py(Lf,2),z1=Ny[0],nf=Ny[1];z1[28]=258,nf[258]=28;for(rf=Py(Mf,0)[1],_l=new it(32768),he=0;he<32768;++he)cr=(43690&he)>>>1|(21845&he)<<1,cr=(61680&(cr=(52428&cr)>>>2|(13107&cr)<<2))>>>4|(3855&cr)<<4,_l[he]=((65280&cr)>>>8|(255&cr)<<8)>>>1;var cr,rf,_l,he,xs=function(t,e,n){for(var r=t.length,i=0,o=new it(e);i<r;++i)++o[t[i]-1];var s,a=new it(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new it(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],f=a[t[i]-1]++<<c,h=f|(1<<c)-1;f<=h;++f)s[_l[f]>>>l]=u}else for(s=new it(r),i=0;i<r;++i)s[i]=_l[a[t[i]-1]++]>>>15-t[i];return s},oi=new Ft(288);for(he=0;he<144;++he)oi[he]=8;for(he=144;he<256;++he)oi[he]=9;for(he=256;he<280;++he)oi[he]=7;for(he=280;he<288;++he)oi[he]=8;var wl=new Ft(32);for(he=0;he<32;++he)wl[he]=5;var H1=xs(oi,9,0),j1=xs(wl,5,0),Oy=function(t){return(t/8>>0)+(7&t&&1)},Ly=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof it?it:t instanceof to?to:Ft)(n-e);return r.set(t.subarray(e,n)),r},Rn=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},ls=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},ld=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[new Ft(0),0];if(i==1){var s=new Ft(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(w,b){return w.f-b.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[f].f?u++:f++],l=n[u!=c&&n[u].f<n[f].f?u++:f++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var g=new it(h+1),v=of(n[c-1],g,0);if(v>e){r=0;var _=0,x=v-e,d=1<<x;for(o.sort((function(w,b){return g[b.s]-g[w.s]||w.f-b.f}));r<i;++r){var p=o[r].s;if(!(g[p]>e))break;_+=d-(1<<v-g[p]),g[p]=e}for(_>>>=x;_>0;){var m=o[r].s;g[m]<e?_-=1<<e-g[m]++-1:++r}for(;r>=0&&_;--r){var y=o[r].s;g[y]==e&&(--g[y],++_)}v=e}return[new Ft(g),v]},of=function(t,e,n){return t.s==-1?Math.max(of(t.l,e,n+1),of(t.r,e,n+1)):e[t.s]=n},_v=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new it(++e),r=0,i=t[0],o=1,s=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]},us=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},sf=function(t,e,n){var r=n.length,i=Oy(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)},wv=function(t,e,n,r,i,o,s,a,l,u,c){Rn(e,c++,n),++i[256];for(var f=ld(i,15),h=f[0],g=f[1],v=ld(o,15),_=v[0],x=v[1],d=_v(h),p=d[0],m=d[1],y=_v(_),w=y[0],b=y[1],k=new it(19),C=0;C<p.length;++C)k[31&p[C]]++;for(C=0;C<w.length;++C)k[31&w[C]]++;for(var I=ld(k,7),A=I[0],H=I[1],K=19;K>4&&!A[yv[K-1]];--K);var Y,W,le,V,X=u+5<<3,B=us(i,oi)+us(o,wl)+s,Z=us(i,h)+us(o,_)+s+14+3*K+us(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(X<=B&&X<=Z)return sf(e,c,t.subarray(l,l+u));if(Rn(e,c,1+(Z<B)),c+=2,Z<B){Y=xs(h,g,0),W=h,le=xs(_,x,0),V=_;var ut=xs(A,H,0);for(Rn(e,c,m-257),Rn(e,c+5,b-1),Rn(e,c+10,K-4),c+=14,C=0;C<K;++C)Rn(e,c+3*C,A[yv[C]]);c+=3*K;for(var An=[p,w],He=0;He<2;++He){var Lt=An[He];for(C=0;C<Lt.length;++C){var bt=31&Lt[C];Rn(e,c,ut[bt]),c+=A[bt],bt>15&&(Rn(e,c,Lt[C]>>>5&127),c+=Lt[C]>>>12)}}}else Y=H1,W=oi,le=j1,V=wl;for(C=0;C<a;++C)if(r[C]>255){bt=r[C]>>>18&31,ls(e,c,Y[bt+257]),c+=W[bt+257],bt>7&&(Rn(e,c,r[C]>>>23&31),c+=Lf[bt]);var Wi=31&r[C];ls(e,c,le[Wi]),c+=V[Wi],Wi>3&&(ls(e,c,r[C]>>>5&8191),c+=Mf[Wi])}else ls(e,c,Y[r[C]]),c+=W[r[C]];return ls(e,c,Y[256]),c+W[256]},U1=new to([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),W1=(function(){for(var t=new to(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),q1=function(t,e,n,r,i){return(function(o,s,a,l,u,c){var f=o.length,h=new Ft(l+f+5*(1+Math.floor(f/7e3))+u),g=h.subarray(l,h.length-u),v=0;if(!s||f<8)for(var _=0;_<=f;_+=65535){var x=_+65535;x<f?v=sf(g,v,o.subarray(_,x)):(g[_]=c,v=sf(g,v,o.subarray(_,f)))}else{for(var d=U1[s-1],p=d>>>13,m=8191&d,y=(1<<a)-1,w=new it(32768),b=new it(y+1),k=Math.ceil(a/3),C=2*k,I=function(Qc){return(o[Qc]^o[Qc+1]<<k^o[Qc+2]<<C)&y},A=new to(25e3),H=new it(288),K=new it(32),Y=0,W=0,le=(_=0,0),V=0,X=0;_<f;++_){var B=I(_),Z=32767&_,ut=b[B];if(w[Z]=ut,b[B]=Z,V<=_){var An=f-_;if((Y>7e3||le>24576)&&An>423){v=wv(o,g,0,A,H,K,W,le,X,_-X,v),le=Y=W=0,X=_;for(var He=0;He<286;++He)H[He]=0;for(He=0;He<30;++He)K[He]=0}var Lt=2,bt=0,Wi=m,or=Z-ut&32767;if(An>2&&B==I(_-or))for(var yk=Math.min(p,An)-1,_k=Math.min(32767,_),wk=Math.min(258,An);or<=_k&&--Wi&&Z!=ut;){if(o[_+Lt]==o[_+Lt-or]){for(var sr=0;sr<wk&&o[_+sr]==o[_+sr-or];++sr);if(sr>Lt){if(Lt=sr,bt=or,sr>yk)break;var xk=Math.min(or,sr-2),Om=0;for(He=0;He<xk;++He){var Xc=_-or+He+32768&32767,Lm=Xc-w[Xc]+32768&32767;Lm>Om&&(Om=Lm,ut=Xc)}}}or+=(Z=ut)-(ut=w[Z])+32768&32767}if(bt){A[le++]=268435456|nf[Lt]<<18|rf[bt];var Mm=31&nf[Lt],Fm=31&rf[bt];W+=Lf[Mm]+Mf[Fm],++H[257+Mm],++K[Fm],V=_+Lt,++Y}else A[le++]=o[_],++H[o[_]]}}v=wv(o,g,c,A,H,K,W,le,X,_-X,v)}return Ly(h,0,l+Oy(v)+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,n,r,!0)},ud=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function K1(t,e){e===void 0&&(e={});var n=(function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=W1[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}})(),r=t.length;n.p(t);var i,o=q1(t,e,10+((i=e).filename&&i.filename.length+1||0),8),s=o.length;return(function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&ud(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}})(o,e),ud(o,s-8,n.d()),ud(o,s-4,r),o}var G1=function(t){var e,n,r,i,o="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
1
|
+
var DA=Object.create;var _c=Object.defineProperty;var LA=Object.getOwnPropertyDescriptor;var zA=Object.getOwnPropertyNames;var BA=Object.getPrototypeOf,HA=Object.prototype.hasOwnProperty;var Uy=t=>{throw TypeError(t)};var UA=(t,e,n)=>e in t?_c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ln=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$A=(t,e)=>{for(var n in e)_c(t,n,{get:e[n],enumerable:!0})},VA=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of zA(e))!HA.call(t,r)&&r!==n&&_c(t,r,{get:()=>e[r],enumerable:!(i=LA(e,r))||i.enumerable});return t};var ie=(t,e,n)=>(n=t!=null?DA(BA(t)):{},VA(e||!t||!t.__esModule?_c(n,"default",{value:t,enumerable:!0}):n,t));var F=(t,e,n)=>UA(t,typeof e!="symbol"?e+"":e,n),$y=(t,e,n)=>e.has(t)||Uy("Cannot "+n);var Le=(t,e,n)=>($y(t,e,"read from private field"),n?n.call(t):e.get(t)),Fi=(t,e,n)=>e.has(t)?Uy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),zn=(t,e,n,i)=>($y(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var Bb=Ln(W=>{"use strict";var Ih=Symbol.for("react.transitional.element"),SR=Symbol.for("react.portal"),xR=Symbol.for("react.fragment"),ER=Symbol.for("react.strict_mode"),wR=Symbol.for("react.profiler"),CR=Symbol.for("react.consumer"),AR=Symbol.for("react.context"),kR=Symbol.for("react.forward_ref"),TR=Symbol.for("react.suspense"),RR=Symbol.for("react.memo"),Ob=Symbol.for("react.lazy"),OR=Symbol.for("react.activity"),Ab=Symbol.iterator;function MR(t){return t===null||typeof t!="object"?null:(t=Ab&&t[Ab]||t["@@iterator"],typeof t=="function"?t:null)}var Mb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nb=Object.assign,Db={};function ss(t,e,n){this.props=t,this.context=e,this.refs=Db,this.updater=n||Mb}ss.prototype.isReactComponent={};ss.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")};ss.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Lb(){}Lb.prototype=ss.prototype;function Fh(t,e,n){this.props=t,this.context=e,this.refs=Db,this.updater=n||Mb}var jh=Fh.prototype=new Lb;jh.constructor=Fh;Nb(jh,ss.prototype);jh.isPureReactComponent=!0;var kb=Array.isArray;function Vh(){}var Te={H:null,A:null,T:null,S:null},zb=Object.prototype.hasOwnProperty;function qh(t,e,n){var i=n.ref;return{$$typeof:Ih,type:t,key:e,ref:i!==void 0?i:null,props:n}}function NR(t,e){return qh(t.type,e,t.props)}function Ph(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ih}function DR(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Tb=/\/+/g;function $h(t,e){return typeof t=="object"&&t!==null&&t.key!=null?DR(""+t.key):e.toString(36)}function LR(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Vh,Vh):(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 as(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(a){case"bigint":case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Ih:case SR:s=!0;break;case Ob:return s=t._init,as(s(t._payload),e,n,i,r)}}if(s)return r=r(t),s=i===""?"."+$h(t,0):i,kb(r)?(n="",s!=null&&(n=s.replace(Tb,"$&/")+"/"),as(r,e,n,"",function(c){return c})):r!=null&&(Ph(r)&&(r=NR(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Tb,"$&/")+"/")+s)),e.push(r)),1;s=0;var o=i===""?".":i+":";if(kb(t))for(var l=0;l<t.length;l++)i=t[l],a=o+$h(i,l),s+=as(i,e,n,a,r);else if(l=MR(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,a=o+$h(i,l++),s+=as(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return as(LR(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return s}function vu(t,e,n){if(t==null)return t;var i=[],r=0;return as(t,i,"","",function(a){return e.call(n,a,r++)}),i}function zR(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Rb=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)},BR={map:vu,forEach:function(t,e,n){vu(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return vu(t,function(){e++}),e},toArray:function(t){return vu(t,function(e){return e})||[]},only:function(t){if(!Ph(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};W.Activity=OR;W.Children=BR;W.Component=ss;W.Fragment=xR;W.Profiler=wR;W.PureComponent=Fh;W.StrictMode=ER;W.Suspense=TR;W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Te;W.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Te.H.useMemoCache(t)}};W.cache=function(t){return function(){return t.apply(null,arguments)}};W.cacheSignal=function(){return null};W.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Nb({},t.props),r=t.key;if(e!=null)for(a in e.key!==void 0&&(r=""+e.key),e)!zb.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(i[a]=e[a]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var s=Array(a),o=0;o<a;o++)s[o]=arguments[o+2];i.children=s}return qh(t.type,r,i)};W.createContext=function(t){return t={$$typeof:AR,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:CR,_context:t},t};W.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)zb.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];r.children=o}if(t&&t.defaultProps)for(i in s=t.defaultProps,s)r[i]===void 0&&(r[i]=s[i]);return qh(t,a,r)};W.createRef=function(){return{current:null}};W.forwardRef=function(t){return{$$typeof:kR,render:t}};W.isValidElement=Ph;W.lazy=function(t){return{$$typeof:Ob,_payload:{_status:-1,_result:t},_init:zR}};W.memo=function(t,e){return{$$typeof:RR,type:t,compare:e===void 0?null:e}};W.startTransition=function(t){var e=Te.T,n={};Te.T=n;try{var i=t(),r=Te.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(Vh,Rb)}catch(a){Rb(a)}finally{e!==null&&n.types!==null&&(e.types=n.types),Te.T=e}};W.unstable_useCacheRefresh=function(){return Te.H.useCacheRefresh()};W.use=function(t){return Te.H.use(t)};W.useActionState=function(t,e,n){return Te.H.useActionState(t,e,n)};W.useCallback=function(t,e){return Te.H.useCallback(t,e)};W.useContext=function(t){return Te.H.useContext(t)};W.useDebugValue=function(){};W.useDeferredValue=function(t,e){return Te.H.useDeferredValue(t,e)};W.useEffect=function(t,e){return Te.H.useEffect(t,e)};W.useEffectEvent=function(t){return Te.H.useEffectEvent(t)};W.useId=function(){return Te.H.useId()};W.useImperativeHandle=function(t,e,n){return Te.H.useImperativeHandle(t,e,n)};W.useInsertionEffect=function(t,e){return Te.H.useInsertionEffect(t,e)};W.useLayoutEffect=function(t,e){return Te.H.useLayoutEffect(t,e)};W.useMemo=function(t,e){return Te.H.useMemo(t,e)};W.useOptimistic=function(t,e){return Te.H.useOptimistic(t,e)};W.useReducer=function(t,e,n){return Te.H.useReducer(t,e,n)};W.useRef=function(t){return Te.H.useRef(t)};W.useState=function(t){return Te.H.useState(t)};W.useSyncExternalStore=function(t,e,n){return Te.H.useSyncExternalStore(t,e,n)};W.useTransition=function(){return Te.H.useTransition()};W.version="19.2.4"});var Pt=Ln((f5,Hb)=>{"use strict";Hb.exports=Bb()});var Ib=Ln(_u=>{"use strict";var $R=Symbol.for("react.transitional.element"),VR=Symbol.for("react.fragment");function Vb(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:$R,type:t,key:i,ref:e!==void 0?e:null,props:n}}_u.Fragment=VR;_u.jsx=Vb;_u.jsxs=Vb});var Re=Ln((q5,Fb)=>{"use strict";Fb.exports=Ib()});var Zb=Ln(wt=>{"use strict";var b2=Pt();function Yb(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}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 ir(){}var Et={d:{f:ir,r:function(){throw Error(Yb(522))},D:ir,C:ir,L:ir,m:ir,X:ir,S:ir,M:ir},p:0,findDOMNode:null},S2=Symbol.for("react.portal");function x2(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S2,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var nl=b2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function xu(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Et;wt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Yb(299));return x2(t,e,null,n)};wt.flushSync=function(t){var e=nl.T,n=Et.p;try{if(nl.T=null,Et.p=2,t)return t()}finally{nl.T=e,Et.p=n,Et.d.f()}};wt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Et.d.C(t,e))};wt.prefetchDNS=function(t){typeof t=="string"&&Et.d.D(t)};wt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=xu(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Et.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Et.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};wt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=xu(e.as,e.crossOrigin);Et.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Et.d.M(t)};wt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=xu(n,e.crossOrigin);Et.d.L(t,n,{crossOrigin:i,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})}};wt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=xu(e.as,e.crossOrigin);Et.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Et.d.m(t)};wt.requestFormReset=function(t){Et.d.r(t)};wt.unstable_batchedUpdates=function(t,e){return t(e)};wt.useFormState=function(t,e,n){return nl.H.useFormState(t,e,n)};wt.useFormStatus=function(){return nl.H.useHostTransitionStatus()};wt.version="19.2.4"});var Eu=Ln((NL,Xb)=>{"use strict";function Kb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Kb)}catch(t){console.error(t)}}Kb(),Xb.exports=Zb()});var fS=Ln(Be=>{"use strict";function lg(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<wu(r,e))t[i]=e,t[n]=r,n=i;else break e}}function jn(t){return t.length===0?null:t[0]}function Au(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,a=r>>>1;i<a;){var s=2*(i+1)-1,o=t[s],l=s+1,c=t[l];if(0>wu(o,n))l<r&&0>wu(c,o)?(t[i]=c,t[l]=n,i=l):(t[i]=o,t[s]=n,i=s);else if(l<r&&0>wu(c,n))t[i]=c,t[l]=n,i=l;else break e}}return e}function wu(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Be.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(iS=performance,Be.unstable_now=function(){return iS.now()}):(ag=Date,rS=ag.now(),Be.unstable_now=function(){return ag.now()-rS});var iS,ag,rS,ui=[],sr=[],R2=1,on=null,_t=3,cg=!1,rl=!1,al=!1,ug=!1,oS=typeof setTimeout=="function"?setTimeout:null,lS=typeof clearTimeout=="function"?clearTimeout:null,aS=typeof setImmediate<"u"?setImmediate:null;function Cu(t){for(var e=jn(sr);e!==null;){if(e.callback===null)Au(sr);else if(e.startTime<=t)Au(sr),e.sortIndex=e.expirationTime,lg(ui,e);else break;e=jn(sr)}}function dg(t){if(al=!1,Cu(t),!rl)if(jn(ui)!==null)rl=!0,ds||(ds=!0,us());else{var e=jn(sr);e!==null&&fg(dg,e.startTime-t)}}var ds=!1,sl=-1,cS=5,uS=-1;function dS(){return ug?!0:!(Be.unstable_now()-uS<cS)}function sg(){if(ug=!1,ds){var t=Be.unstable_now();uS=t;var e=!0;try{e:{rl=!1,al&&(al=!1,lS(sl),sl=-1),cg=!0;var n=_t;try{t:{for(Cu(t),on=jn(ui);on!==null&&!(on.expirationTime>t&&dS());){var i=on.callback;if(typeof i=="function"){on.callback=null,_t=on.priorityLevel;var r=i(on.expirationTime<=t);if(t=Be.unstable_now(),typeof r=="function"){on.callback=r,Cu(t),e=!0;break t}on===jn(ui)&&Au(ui),Cu(t)}else Au(ui);on=jn(ui)}if(on!==null)e=!0;else{var a=jn(sr);a!==null&&fg(dg,a.startTime-t),e=!1}}break e}finally{on=null,_t=n,cg=!1}e=void 0}}finally{e?us():ds=!1}}}var us;typeof aS=="function"?us=function(){aS(sg)}:typeof MessageChannel<"u"?(og=new MessageChannel,sS=og.port2,og.port1.onmessage=sg,us=function(){sS.postMessage(null)}):us=function(){oS(sg,0)};var og,sS;function fg(t,e){sl=oS(function(){t(Be.unstable_now())},e)}Be.unstable_IdlePriority=5;Be.unstable_ImmediatePriority=1;Be.unstable_LowPriority=4;Be.unstable_NormalPriority=3;Be.unstable_Profiling=null;Be.unstable_UserBlockingPriority=2;Be.unstable_cancelCallback=function(t){t.callback=null};Be.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"):cS=0<t?Math.floor(1e3/t):5};Be.unstable_getCurrentPriorityLevel=function(){return _t};Be.unstable_next=function(t){switch(_t){case 1:case 2:case 3:var e=3;break;default:e=_t}var n=_t;_t=e;try{return t()}finally{_t=n}};Be.unstable_requestPaint=function(){ug=!0};Be.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=_t;_t=t;try{return e()}finally{_t=n}};Be.unstable_scheduleCallback=function(t,e,n){var i=Be.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:R2++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,lg(sr,t),jn(ui)===null&&t===jn(sr)&&(al?(lS(sl),sl=-1):al=!0,fg(dg,n-i))):(t.sortIndex=r,lg(ui,t),rl||cg||(rl=!0,ds||(ds=!0,us()))),t};Be.unstable_shouldYield=dS;Be.unstable_wrapCallback=function(t){var e=_t;return function(){var n=_t;_t=e;try{return t.apply(this,arguments)}finally{_t=n}}}});var hS=Ln((iz,pS)=>{"use strict";pS.exports=fS()});var Aw=Ln(Wd=>{"use strict";var it=hS(),Vx=Pt(),O2=Eu();function k(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}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 Ix(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Gl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Fx(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 jx(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 gS(t){if(Gl(t)!==t)throw Error(k(188))}function M2(t){var e=t.alternate;if(!e){if(e=Gl(t),e===null)throw Error(k(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return gS(r),t;if(a===i)return gS(r),e;a=a.sibling}throw Error(k(188))}if(n.return!==i.return)n=r,i=a;else{for(var s=!1,o=r.child;o;){if(o===n){s=!0,n=r,i=a;break}if(o===i){s=!0,i=r,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,i=r;break}if(o===i){s=!0,i=a,n=r;break}o=o.sibling}if(!s)throw Error(k(189))}}if(n.alternate!==i)throw Error(k(190))}if(n.tag!==3)throw Error(k(188));return n.stateNode.current===n?t:e}function qx(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=qx(t),e!==null)return e;t=t.sibling}return null}var De=Object.assign,N2=Symbol.for("react.element"),ku=Symbol.for("react.transitional.element"),hl=Symbol.for("react.portal"),vs=Symbol.for("react.fragment"),Px=Symbol.for("react.strict_mode"),Gg=Symbol.for("react.profiler"),Gx=Symbol.for("react.consumer"),yi=Symbol.for("react.context"),Im=Symbol.for("react.forward_ref"),Yg=Symbol.for("react.suspense"),Zg=Symbol.for("react.suspense_list"),Fm=Symbol.for("react.memo"),or=Symbol.for("react.lazy"),Kg=Symbol.for("react.activity"),D2=Symbol.for("react.memo_cache_sentinel"),mS=Symbol.iterator;function ol(t){return t===null||typeof t!="object"?null:(t=mS&&t[mS]||t["@@iterator"],typeof t=="function"?t:null)}var L2=Symbol.for("react.client.reference");function Xg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===L2?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case vs:return"Fragment";case Gg:return"Profiler";case Px:return"StrictMode";case Yg:return"Suspense";case Zg:return"SuspenseList";case Kg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case hl:return"Portal";case yi:return t.displayName||"Context";case Gx:return(t._context.displayName||"Context")+".Consumer";case Im:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fm:return e=t.displayName||null,e!==null?e:Xg(t.type)||"Memo";case or:e=t._payload,t=t._init;try{return Xg(t(e))}catch{}}return null}var gl=Array.isArray,Z=Vx.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=O2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,na={pending:!1,data:null,method:null,action:null},Wg=[],ys=-1;function Zn(t){return{current:t}}function ot(t){0>ys||(t.current=Wg[ys],Wg[ys]=null,ys--)}function ke(t,e){ys++,Wg[ys]=t.current,t.current=e}var Yn=Zn(null),Nl=Zn(null),yr=Zn(null),sd=Zn(null);function od(t,e){switch(ke(yr,e),ke(Nl,t),ke(Yn,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Ex(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Ex(e),t=fw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ot(Yn),ke(Yn,t)}function Bs(){ot(Yn),ot(Nl),ot(yr)}function Qg(t){t.memoizedState!==null&&ke(sd,t);var e=Yn.current,n=fw(e,t.type);e!==n&&(ke(Nl,t),ke(Yn,n))}function ld(t){Nl.current===t&&(ot(Yn),ot(Nl)),sd.current===t&&(ot(sd),jl._currentValue=na)}var pg,vS;function Qr(t){if(pg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);pg=e&&e[1]||"",vS=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+pg+t+vS}var hg=!1;function gg(t,e){if(!t||hg)return"";hg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(p){var g=p}Reflect.construct(t,[],f)}else{try{f.call()}catch(p){g=p}t.call(f.prototype)}}else{try{throw Error()}catch(p){g=p}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(p){if(p&&g&&typeof p.stack=="string")return[p.stack,g.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split(`
|
|
4
|
+
`),c=o.split(`
|
|
5
|
+
`);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||l[i]!==c[r]){var u=`
|
|
6
|
+
`+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{hg=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Qr(n):""}function z2(t,e){switch(t.tag){case 26:case 27:case 5:return Qr(t.type);case 16:return Qr("Lazy");case 13:return t.child!==e&&e!==null?Qr("Suspense Fallback"):Qr("Suspense");case 19:return Qr("SuspenseList");case 0:case 15:return gg(t.type,!1);case 11:return gg(t.type.render,!1);case 1:return gg(t.type,!0);case 31:return Qr("Activity");default:return""}}function yS(t){try{var e="",n=null;do e+=z2(t,n),n=t,t=t.return;while(t);return e}catch(i){return`
|
|
7
|
+
Error generating stack: `+i.message+`
|
|
8
|
+
`+i.stack}}var Jg=Object.prototype.hasOwnProperty,jm=it.unstable_scheduleCallback,mg=it.unstable_cancelCallback,B2=it.unstable_shouldYield,H2=it.unstable_requestPaint,Xt=it.unstable_now,U2=it.unstable_getCurrentPriorityLevel,Yx=it.unstable_ImmediatePriority,Zx=it.unstable_UserBlockingPriority,cd=it.unstable_NormalPriority,$2=it.unstable_LowPriority,Kx=it.unstable_IdlePriority,V2=it.log,I2=it.unstable_setDisableYieldValue,Yl=null,Wt=null;function pr(t){if(typeof V2=="function"&&I2(t),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(Yl,t)}catch{}}var Qt=Math.clz32?Math.clz32:q2,F2=Math.log,j2=Math.LN2;function q2(t){return t>>>=0,t===0?32:31-(F2(t)/j2|0)|0}var Tu=256,Ru=262144,Ou=4194304;function Jr(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 zd(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var o=i&134217727;return o!==0?(i=o&~a,i!==0?r=Jr(i):(s&=o,s!==0?r=Jr(s):n||(n=o&~t,n!==0&&(r=Jr(n))))):(o=i&~a,o!==0?r=Jr(o):s!==0?r=Jr(s):n||(n=i&~t,n!==0&&(r=Jr(n)))),r===0?0:e!==0&&e!==r&&(e&a)===0&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function Zl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function P2(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 Xx(){var t=Ou;return Ou<<=1,(Ou&62914560)===0&&(Ou=4194304),t}function vg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Kl(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function G2(t,e,n,i,r,a){var s=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var o=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=s&~n;0<n;){var u=31-Qt(n),f=1<<u;o[u]=0,l[u]=-1;var g=c[u];if(g!==null)for(c[u]=null,u=0;u<g.length;u++){var p=g[u];p!==null&&(p.lane&=-536870913)}n&=~f}i!==0&&Wx(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(s&~e))}function Wx(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-Qt(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&261930}function Qx(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-Qt(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function Jx(t,e){var n=e&-e;return n=(n&42)!==0?1:qm(n),(n&(t.suspendedLanes|e))!==0?0:n}function qm(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 Pm(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function e1(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:Ew(t.type))}function _S(t,e){var n=he.p;try{return he.p=t,e()}finally{he.p=n}}var Mr=Math.random().toString(36).slice(2),pt="__reactFiber$"+Mr,Ht="__reactProps$"+Mr,Ys="__reactContainer$"+Mr,em="__reactEvents$"+Mr,Y2="__reactListeners$"+Mr,Z2="__reactHandles$"+Mr,bS="__reactResources$"+Mr,Xl="__reactMarker$"+Mr;function Gm(t){delete t[pt],delete t[Ht],delete t[em],delete t[Y2],delete t[Z2]}function _s(t){var e=t[pt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ys]||n[pt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Tx(t);t!==null;){if(n=t[pt])return n;t=Tx(t)}return e}t=n,n=t.parentNode}return null}function Zs(t){if(t=t[pt]||t[Ys]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function ml(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(k(33))}function Rs(t){var e=t[bS];return e||(e=t[bS]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function st(t){t[Xl]=!0}var t1=new Set,n1={};function fa(t,e){Hs(t,e),Hs(t+"Capture",e)}function Hs(t,e){for(n1[t]=e,t=0;t<e.length;t++)t1.add(e[t])}var K2=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]*$"),SS={},xS={};function X2(t){return Jg.call(xS,t)?!0:Jg.call(SS,t)?!1:K2.test(t)?xS[t]=!0:(SS[t]=!0,!1)}function Pu(t,e,n){if(X2(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Mu(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function di(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}function cn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function i1(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function W2(t,e,n){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,a=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tm(t){if(!t._valueTracker){var e=i1(t)?"checked":"value";t._valueTracker=W2(t,e,""+t[e])}}function r1(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=i1(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function ud(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 fn(t){return t.replace(Q2,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function nm(t,e,n,i,r,a,s,o){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+cn(e)):t.value!==""+cn(e)&&(t.value=""+cn(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?im(t,s,cn(e)):n!=null?im(t,s,cn(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+cn(o):t.removeAttribute("name")}function a1(t,e,n,i,r,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){tm(t);return}n=n!=null?""+cn(n):"",e=e!=null?""+cn(e):n,o||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=o?t.checked:!!i,t.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s),tm(t)}function im(t,e,n){e==="number"&&ud(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Os(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+cn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function s1(t,e,n){if(e!=null&&(e=""+cn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+cn(n):""}function o1(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(k(92));if(gl(i)){if(1<i.length)throw Error(k(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=cn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i),tm(t)}function Us(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.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 ES(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||J2.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function l1(t,e,n){if(e!=null&&typeof e!="object")throw Error(k(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&ES(t,r,i)}else for(var a in e)e.hasOwnProperty(a)&&ES(t,a,e[a])}function Ym(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 eO=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"]]),tO=/^[\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 Gu(t){return tO.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function _i(){}var rm=null;function Zm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var bs=null,Ms=null;function wS(t){var e=Zs(t);if(e&&(t=e.stateNode)){var n=t[Ht]||null;e:switch(t=e.stateNode,e.type){case"input":if(nm(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+fn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Ht]||null;if(!r)throw Error(k(90));nm(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&r1(i)}break e;case"textarea":s1(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Os(t,!!n.multiple,e,!1)}}}var yg=!1;function c1(t,e,n){if(yg)return t(e,n);yg=!0;try{var i=t(e);return i}finally{if(yg=!1,(bs!==null||Ms!==null)&&(Yd(),bs&&(e=bs,t=Ms,Ms=bs=null,wS(e),t)))for(e=0;e<t.length;e++)wS(t[e])}}function Dl(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Ht]||null;if(i===null)return null;n=i[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":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(k(231,e,typeof n));return n}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=!1;if(wi)try{fs={},Object.defineProperty(fs,"passive",{get:function(){am=!0}}),window.addEventListener("test",fs,fs),window.removeEventListener("test",fs,fs)}catch{am=!1}var fs,hr=null,Km=null,Yu=null;function u1(){if(Yu)return Yu;var t,e=Km,n=e.length,i,r="value"in hr?hr.value:hr.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var s=n-t;for(i=1;i<=s&&e[n-i]===r[a-i];i++);return Yu=r.slice(t,1<i?1-i:void 0)}function Zu(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 Nu(){return!0}function CS(){return!1}function Ut(t){function e(n,i,r,a,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Nu:CS,this.isPropagationStopped=CS,this}return De(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Nu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Nu)},persist:function(){},isPersistent:Nu}),e}var pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bd=Ut(pa),Wl=De({},pa,{view:0,detail:0}),nO=Ut(Wl),_g,bg,ll,Hd=De({},Wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xm,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!==ll&&(ll&&t.type==="mousemove"?(_g=t.screenX-ll.screenX,bg=t.screenY-ll.screenY):bg=_g=0,ll=t),_g)},movementY:function(t){return"movementY"in t?t.movementY:bg}}),AS=Ut(Hd),iO=De({},Hd,{dataTransfer:0}),rO=Ut(iO),aO=De({},Wl,{relatedTarget:0}),Sg=Ut(aO),sO=De({},pa,{animationName:0,elapsedTime:0,pseudoElement:0}),oO=Ut(sO),lO=De({},pa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cO=Ut(lO),uO=De({},pa,{data:0}),kS=Ut(uO),dO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fO={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"},pO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hO(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=pO[t])?!!e[t]:!1}function Xm(){return hO}var gO=De({},Wl,{key:function(t){if(t.key){var e=dO[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Zu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?fO[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xm,charCode:function(t){return t.type==="keypress"?Zu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),mO=Ut(gO),vO=De({},Hd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),TS=Ut(vO),yO=De({},Wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xm}),_O=Ut(yO),bO=De({},pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),SO=Ut(bO),xO=De({},Hd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),EO=Ut(xO),wO=De({},pa,{newState:0,oldState:0}),CO=Ut(wO),AO=[9,13,27,32],Wm=wi&&"CompositionEvent"in window,_l=null;wi&&"documentMode"in document&&(_l=document.documentMode);var kO=wi&&"TextEvent"in window&&!_l,d1=wi&&(!Wm||_l&&8<_l&&11>=_l),RS=" ",OS=!1;function f1(t,e){switch(t){case"keyup":return AO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ss=!1;function TO(t,e){switch(t){case"compositionend":return p1(e);case"keypress":return e.which!==32?null:(OS=!0,RS);case"textInput":return t=e.data,t===RS&&OS?null:t;default:return null}}function RO(t,e){if(Ss)return t==="compositionend"||!Wm&&f1(t,e)?(t=u1(),Yu=Km=hr=null,Ss=!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 d1&&e.locale!=="ko"?null:e.data;default:return null}}var OO={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 MS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!OO[t.type]:e==="textarea"}function h1(t,e,n,i){bs?Ms?Ms.push(i):Ms=[i]:bs=i,e=Td(e,"onChange"),0<e.length&&(n=new Bd("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var bl=null,Ll=null;function MO(t){cw(t,0)}function Ud(t){var e=ml(t);if(r1(e))return t}function NS(t,e){if(t==="change")return e}var g1=!1;wi&&(wi?(Lu="oninput"in document,Lu||(xg=document.createElement("div"),xg.setAttribute("oninput","return;"),Lu=typeof xg.oninput=="function"),Du=Lu):Du=!1,g1=Du&&(!document.documentMode||9<document.documentMode));var Du,Lu,xg;function DS(){bl&&(bl.detachEvent("onpropertychange",m1),Ll=bl=null)}function m1(t){if(t.propertyName==="value"&&Ud(Ll)){var e=[];h1(e,Ll,t,Zm(t)),c1(MO,e)}}function NO(t,e,n){t==="focusin"?(DS(),bl=e,Ll=n,bl.attachEvent("onpropertychange",m1)):t==="focusout"&&DS()}function DO(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ud(Ll)}function LO(t,e){if(t==="click")return Ud(e)}function zO(t,e){if(t==="input"||t==="change")return Ud(e)}function BO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var en=typeof Object.is=="function"?Object.is:BO;function zl(t,e){if(en(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Jg.call(e,r)||!en(t[r],e[r]))return!1}return!0}function LS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zS(t,e){var n=LS(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=LS(n)}}function v1(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?v1(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function y1(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ud(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ud(t.document)}return e}function Qm(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 HO=wi&&"documentMode"in document&&11>=document.documentMode,xs=null,sm=null,Sl=null,om=!1;function BS(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;om||xs==null||xs!==ud(i)||(i=xs,"selectionStart"in i&&Qm(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Sl&&zl(Sl,i)||(Sl=i,i=Td(sm,"onSelect"),0<i.length&&(e=new Bd("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=xs)))}function Wr(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Es={animationend:Wr("Animation","AnimationEnd"),animationiteration:Wr("Animation","AnimationIteration"),animationstart:Wr("Animation","AnimationStart"),transitionrun:Wr("Transition","TransitionRun"),transitionstart:Wr("Transition","TransitionStart"),transitioncancel:Wr("Transition","TransitionCancel"),transitionend:Wr("Transition","TransitionEnd")},Eg={},_1={};wi&&(_1=document.createElement("div").style,"AnimationEvent"in window||(delete Es.animationend.animation,delete Es.animationiteration.animation,delete Es.animationstart.animation),"TransitionEvent"in window||delete Es.transitionend.transition);function ha(t){if(Eg[t])return Eg[t];if(!Es[t])return t;var e=Es[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in _1)return Eg[t]=e[n];return t}var b1=ha("animationend"),S1=ha("animationiteration"),x1=ha("animationstart"),UO=ha("transitionrun"),$O=ha("transitionstart"),VO=ha("transitioncancel"),E1=ha("transitionend"),w1=new Map,lm="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(" ");lm.push("scrollEnd");function Rn(t,e){w1.set(t,e),fa(e,[t])}var dd=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)},ln=[],ws=0,Jm=0;function $d(){for(var t=ws,e=Jm=ws=0;e<t;){var n=ln[e];ln[e++]=null;var i=ln[e];ln[e++]=null;var r=ln[e];ln[e++]=null;var a=ln[e];if(ln[e++]=null,i!==null&&r!==null){var s=i.pending;s===null?r.next=r:(r.next=s.next,s.next=r),i.pending=r}a!==0&&C1(n,r,a)}}function Vd(t,e,n,i){ln[ws++]=t,ln[ws++]=e,ln[ws++]=n,ln[ws++]=i,Jm|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function ev(t,e,n,i){return Vd(t,e,n,i),fd(t)}function ga(t,e){return Vd(t,null,null,e),fd(t)}function C1(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=!0)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-Qt(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function fd(t){if(50<Ol)throw Ol=0,Rm=null,Error(k(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Cs={};function IO(t,e,n,i){this.tag=t,this.key=n,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(t,e,n,i){return new IO(t,e,n,i)}function tv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Si(t,e){var n=t.alternate;return n===null?(n=Zt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function A1(t,e){t.flags&=65011714;var n=t.alternate;return n===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=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Ku(t,e,n,i,r,a){var s=0;if(i=t,typeof t=="function")tv(t)&&(s=1);else if(typeof t=="string")s=qM(t,n,Yn.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Kg:return t=Zt(31,n,e,r),t.elementType=Kg,t.lanes=a,t;case vs:return ia(n.children,r,a,e);case Px:s=8,r|=24;break;case Gg:return t=Zt(12,n,e,r|2),t.elementType=Gg,t.lanes=a,t;case Yg:return t=Zt(13,n,e,r),t.elementType=Yg,t.lanes=a,t;case Zg:return t=Zt(19,n,e,r),t.elementType=Zg,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case yi:s=10;break e;case Gx:s=9;break e;case Im:s=11;break e;case Fm:s=14;break e;case or:s=16,i=null;break e}s=29,n=Error(k(130,t===null?"null":typeof t,"")),i=null}return e=Zt(s,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function ia(t,e,n,i){return t=Zt(7,t,i,e),t.lanes=n,t}function wg(t,e,n){return t=Zt(6,t,null,e),t.lanes=n,t}function k1(t){var e=Zt(18,null,null,0);return e.stateNode=t,e}function Cg(t,e,n){return e=Zt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var HS=new WeakMap;function pn(t,e){if(typeof t=="object"&&t!==null){var n=HS.get(t);return n!==void 0?n:(e={value:t,source:e,stack:yS(e)},HS.set(t,e),e)}return{value:t,source:e,stack:yS(e)}}var As=[],ks=0,pd=null,Bl=0,un=[],dn=0,kr=null,qn=1,Pn="";function mi(t,e){As[ks++]=Bl,As[ks++]=pd,pd=t,Bl=e}function T1(t,e,n){un[dn++]=qn,un[dn++]=Pn,un[dn++]=kr,kr=t;var i=qn;t=Pn;var r=32-Qt(i)-1;i&=~(1<<r),n+=1;var a=32-Qt(e)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,qn=1<<32-Qt(e)+r|n<<r|i,Pn=a+t}else qn=1<<a|n<<r|i,Pn=t}function nv(t){t.return!==null&&(mi(t,1),T1(t,1,0))}function iv(t){for(;t===pd;)pd=As[--ks],As[ks]=null,Bl=As[--ks],As[ks]=null;for(;t===kr;)kr=un[--dn],un[dn]=null,Pn=un[--dn],un[dn]=null,qn=un[--dn],un[dn]=null}function R1(t,e){un[dn++]=qn,un[dn++]=Pn,un[dn++]=kr,qn=e.id,Pn=e.overflow,kr=t}var ht=null,Ne=null,de=!1,_r=null,hn=!1,cm=Error(k(519));function Tr(t){var e=Error(k(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(pn(e,t)),cm}function US(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[pt]=t,e[Ht]=i,n){case"dialog":ae("cancel",e),ae("close",e);break;case"iframe":case"object":case"embed":ae("load",e);break;case"video":case"audio":for(n=0;n<Il.length;n++)ae(Il[n],e);break;case"source":ae("error",e);break;case"img":case"image":case"link":ae("error",e),ae("load",e);break;case"details":ae("toggle",e);break;case"input":ae("invalid",e),a1(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ae("invalid",e);break;case"textarea":ae("invalid",e),o1(e,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||dw(e.textContent,n)?(i.popover!=null&&(ae("beforetoggle",e),ae("toggle",e)),i.onScroll!=null&&ae("scroll",e),i.onScrollEnd!=null&&ae("scrollend",e),i.onClick!=null&&(e.onclick=_i),e=!0):e=!1,e||Tr(t,!0)}function $S(t){for(ht=t.return;ht;)switch(ht.tag){case 5:case 31:case 13:hn=!1;return;case 27:case 3:hn=!0;return;default:ht=ht.return}}function ps(t){if(t!==ht)return!1;if(!de)return $S(t),de=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Lm(t.type,t.memoizedProps)),n=!n),n&&Ne&&Tr(t),$S(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(k(317));Ne=kx(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(k(317));Ne=kx(t)}else e===27?(e=Ne,Nr(t.type)?(t=Um,Um=null,Ne=t):Ne=e):Ne=ht?mn(t.stateNode.nextSibling):null;return!0}function oa(){Ne=ht=null,de=!1}function Ag(){var t=_r;return t!==null&&(zt===null?zt=t:zt.push.apply(zt,t),_r=null),t}function Hl(t){_r===null?_r=[t]:_r.push(t)}var um=Zn(null),ma=null,bi=null;function cr(t,e,n){ke(um,e._currentValue),e._currentValue=n}function xi(t){t._currentValue=um.current,ot(um)}function dm(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function fm(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var s=r.child;a=a.firstContext;e:for(;a!==null;){var o=a;a=r;for(var l=0;l<e.length;l++)if(o.context===e[l]){a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),dm(a.return,n,t),i||(s=null);break e}a=o.next}}else if(r.tag===18){if(s=r.return,s===null)throw Error(k(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dm(s,n,t),s=null}else s=r.child;if(s!==null)s.return=r;else for(s=r;s!==null;){if(s===t){s=null;break}if(r=s.sibling,r!==null){r.return=s.return,s=r;break}s=s.return}r=s}}function Ks(t,e,n,i){t=null;for(var r=e,a=!1;r!==null;){if(!a){if((r.flags&524288)!==0)a=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var s=r.alternate;if(s===null)throw Error(k(387));if(s=s.memoizedProps,s!==null){var o=r.type;en(r.pendingProps.value,s.value)||(t!==null?t.push(o):t=[o])}}else if(r===sd.current){if(s=r.alternate,s===null)throw Error(k(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(jl):t=[jl])}r=r.return}t!==null&&fm(e,t,n,i),e.flags|=262144}function hd(t){for(t=t.firstContext;t!==null;){if(!en(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function la(t){ma=t,bi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function gt(t){return O1(ma,t)}function zu(t,e){return ma===null&&la(t),O1(t,e)}function O1(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},bi===null){if(t===null)throw Error(k(308));bi=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else bi=bi.next=e;return n}var FO=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},jO=it.unstable_scheduleCallback,qO=it.unstable_NormalPriority,We={$$typeof:yi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rv(){return{controller:new FO,data:new Map,refCount:0}}function Ql(t){t.refCount--,t.refCount===0&&jO(qO,function(){t.controller.abort()})}var xl=null,pm=0,$s=0,Ns=null;function PO(t,e){if(xl===null){var n=xl=[];pm=0,$s=Rv(),Ns={status:"pending",value:void 0,then:function(i){n.push(i)}}}return pm++,e.then(VS,VS),e}function VS(){if(--pm===0&&xl!==null){Ns!==null&&(Ns.status="fulfilled");var t=xl;xl=null,$s=0,Ns=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function GO(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var IS=Z.S;Z.S=function(t,e){qE=Xt(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&PO(t,e),IS!==null&&IS(t,e)};var ra=Zn(null);function av(){var t=ra.current;return t!==null?t:Ee.pooledCache}function Xu(t,e){e===null?ke(ra,ra.current):ke(ra,e.pool)}function M1(){var t=av();return t===null?null:{parent:We._currentValue,pool:t}}var Xs=Error(k(460)),sv=Error(k(474)),Id=Error(k(542)),gd={then:function(){}};function FS(t){return t=t.status,t==="fulfilled"||t==="rejected"}function N1(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(_i,_i),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,qS(t),t;default:if(typeof e.status=="string")e.then(_i,_i);else{if(t=Ee,t!==null&&100<t.shellSuspendCounter)throw Error(k(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,qS(t),t}throw aa=e,Xs}}function ea(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(aa=n,Xs):n}}var aa=null;function jS(){if(aa===null)throw Error(k(459));var t=aa;return aa=null,t}function qS(t){if(t===Xs||t===Id)throw Error(k(483))}var Ds=null,Ul=0;function Bu(t){var e=Ul;return Ul+=1,Ds===null&&(Ds=[]),N1(Ds,t,e)}function cl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Hu(t,e){throw e.$$typeof===N2?Error(k(525)):(t=Object.prototype.toString.call(e),Error(k(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function D1(t){function e(d,h){if(t){var m=d.deletions;m===null?(d.deletions=[h],d.flags|=16):m.push(h)}}function n(d,h){if(!t)return null;for(;h!==null;)e(d,h),h=h.sibling;return null}function i(d){for(var h=new Map;d!==null;)d.key!==null?h.set(d.key,d):h.set(d.index,d),d=d.sibling;return h}function r(d,h){return d=Si(d,h),d.index=0,d.sibling=null,d}function a(d,h,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<h?(d.flags|=67108866,h):m):(d.flags|=67108866,h)):(d.flags|=1048576,h)}function s(d){return t&&d.alternate===null&&(d.flags|=67108866),d}function o(d,h,m,v){return h===null||h.tag!==6?(h=wg(m,d.mode,v),h.return=d,h):(h=r(h,m),h.return=d,h)}function l(d,h,m,v){var S=m.type;return S===vs?u(d,h,m.props.children,v,m.key):h!==null&&(h.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===or&&ea(S)===h.type)?(h=r(h,m.props),cl(h,m),h.return=d,h):(h=Ku(m.type,m.key,m.props,null,d.mode,v),cl(h,m),h.return=d,h)}function c(d,h,m,v){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=Cg(m,d.mode,v),h.return=d,h):(h=r(h,m.children||[]),h.return=d,h)}function u(d,h,m,v,S){return h===null||h.tag!==7?(h=ia(m,d.mode,v,S),h.return=d,h):(h=r(h,m),h.return=d,h)}function f(d,h,m){if(typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint")return h=wg(""+h,d.mode,m),h.return=d,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ku:return m=Ku(h.type,h.key,h.props,null,d.mode,m),cl(m,h),m.return=d,m;case hl:return h=Cg(h,d.mode,m),h.return=d,h;case or:return h=ea(h),f(d,h,m)}if(gl(h)||ol(h))return h=ia(h,d.mode,m,null),h.return=d,h;if(typeof h.then=="function")return f(d,Bu(h),m);if(h.$$typeof===yi)return f(d,zu(d,h),m);Hu(d,h)}return null}function g(d,h,m,v){var S=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return S!==null?null:o(d,h,""+m,v);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ku:return m.key===S?l(d,h,m,v):null;case hl:return m.key===S?c(d,h,m,v):null;case or:return m=ea(m),g(d,h,m,v)}if(gl(m)||ol(m))return S!==null?null:u(d,h,m,v,null);if(typeof m.then=="function")return g(d,h,Bu(m),v);if(m.$$typeof===yi)return g(d,h,zu(d,m),v);Hu(d,m)}return null}function p(d,h,m,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return d=d.get(m)||null,o(h,d,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ku:return d=d.get(v.key===null?m:v.key)||null,l(h,d,v,S);case hl:return d=d.get(v.key===null?m:v.key)||null,c(h,d,v,S);case or:return v=ea(v),p(d,h,m,v,S)}if(gl(v)||ol(v))return d=d.get(m)||null,u(h,d,v,S,null);if(typeof v.then=="function")return p(d,h,m,Bu(v),S);if(v.$$typeof===yi)return p(d,h,m,zu(h,v),S);Hu(h,v)}return null}function y(d,h,m,v){for(var S=null,w=null,E=h,C=h=0,O=null;E!==null&&C<m.length;C++){E.index>C?(O=E,E=null):O=E.sibling;var T=g(d,E,m[C],v);if(T===null){E===null&&(E=O);break}t&&E&&T.alternate===null&&e(d,E),h=a(T,h,C),w===null?S=T:w.sibling=T,w=T,E=O}if(C===m.length)return n(d,E),de&&mi(d,C),S;if(E===null){for(;C<m.length;C++)E=f(d,m[C],v),E!==null&&(h=a(E,h,C),w===null?S=E:w.sibling=E,w=E);return de&&mi(d,C),S}for(E=i(E);C<m.length;C++)O=p(E,d,C,m[C],v),O!==null&&(t&&O.alternate!==null&&E.delete(O.key===null?C:O.key),h=a(O,h,C),w===null?S=O:w.sibling=O,w=O);return t&&E.forEach(function(I){return e(d,I)}),de&&mi(d,C),S}function _(d,h,m,v){if(m==null)throw Error(k(151));for(var S=null,w=null,E=h,C=h=0,O=null,T=m.next();E!==null&&!T.done;C++,T=m.next()){E.index>C?(O=E,E=null):O=E.sibling;var I=g(d,E,T.value,v);if(I===null){E===null&&(E=O);break}t&&E&&I.alternate===null&&e(d,E),h=a(I,h,C),w===null?S=I:w.sibling=I,w=I,E=O}if(T.done)return n(d,E),de&&mi(d,C),S;if(E===null){for(;!T.done;C++,T=m.next())T=f(d,T.value,v),T!==null&&(h=a(T,h,C),w===null?S=T:w.sibling=T,w=T);return de&&mi(d,C),S}for(E=i(E);!T.done;C++,T=m.next())T=p(E,d,C,T.value,v),T!==null&&(t&&T.alternate!==null&&E.delete(T.key===null?C:T.key),h=a(T,h,C),w===null?S=T:w.sibling=T,w=T);return t&&E.forEach(function(Y){return e(d,Y)}),de&&mi(d,C),S}function b(d,h,m,v){if(typeof m=="object"&&m!==null&&m.type===vs&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ku:e:{for(var S=m.key;h!==null;){if(h.key===S){if(S=m.type,S===vs){if(h.tag===7){n(d,h.sibling),v=r(h,m.props.children),v.return=d,d=v;break e}}else if(h.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===or&&ea(S)===h.type){n(d,h.sibling),v=r(h,m.props),cl(v,m),v.return=d,d=v;break e}n(d,h);break}else e(d,h);h=h.sibling}m.type===vs?(v=ia(m.props.children,d.mode,v,m.key),v.return=d,d=v):(v=Ku(m.type,m.key,m.props,null,d.mode,v),cl(v,m),v.return=d,d=v)}return s(d);case hl:e:{for(S=m.key;h!==null;){if(h.key===S)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(d,h.sibling),v=r(h,m.children||[]),v.return=d,d=v;break e}else{n(d,h);break}else e(d,h);h=h.sibling}v=Cg(m,d.mode,v),v.return=d,d=v}return s(d);case or:return m=ea(m),b(d,h,m,v)}if(gl(m))return y(d,h,m,v);if(ol(m)){if(S=ol(m),typeof S!="function")throw Error(k(150));return m=S.call(m),_(d,h,m,v)}if(typeof m.then=="function")return b(d,h,Bu(m),v);if(m.$$typeof===yi)return b(d,h,zu(d,m),v);Hu(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint"?(m=""+m,h!==null&&h.tag===6?(n(d,h.sibling),v=r(h,m),v.return=d,d=v):(n(d,h),v=wg(m,d.mode,v),v.return=d,d=v),s(d)):n(d,h)}return function(d,h,m,v){try{Ul=0;var S=b(d,h,m,v);return Ds=null,S}catch(E){if(E===Xs||E===Id)throw E;var w=Zt(29,E,null,d.mode);return w.lanes=v,w.return=d,w}}}var ca=D1(!0),L1=D1(!1),lr=!1;function ov(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hm(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function br(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Sr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(pe&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=fd(t),C1(t,null,n),e}return Vd(t,i,e,n),fd(t)}function El(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Qx(t,n)}}function kg(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?r=a=e:a=a.next=e}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var gm=!1;function wl(){if(gm){var t=Ns;if(t!==null)throw t}}function Cl(t,e,n,i){gm=!1;var r=t.updateQueue;lr=!1;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==s&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=r.baseState;s=0,u=c=l=null,o=a;do{var g=o.lane&-536870913,p=g!==o.lane;if(p?(le&g)===g:(i&g)===g){g!==0&&g===$s&&(gm=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=t,_=o;g=e;var b=n;switch(_.tag){case 1:if(y=_.payload,typeof y=="function"){f=y.call(b,f,g);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,g=typeof y=="function"?y.call(b,f,g):y,g==null)break e;f=De({},f,g);break e;case 2:lr=!0}}g=o.callback,g!==null&&(t.flags|=64,p&&(t.flags|=8192),p=r.callbacks,p===null?r.callbacks=[g]:p.push(g))}else p={lane:g,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,s|=g;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;p=o,o=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);u===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,a===null&&(r.shared.lanes=0),Or|=s,t.lanes=s,t.memoizedState=f}}function z1(t,e){if(typeof t!="function")throw Error(k(191,t));t.call(e)}function B1(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)z1(n[t],e)}var Vs=Zn(null),md=Zn(0);function PS(t,e){t=Ti,ke(md,t),ke(Vs,e),Ti=t|e.baseLanes}function mm(){ke(md,Ti),ke(Vs,Vs.current)}function lv(){Ti=md.current,ot(Vs),ot(md)}var tn=Zn(null),gn=null;function ur(t){var e=t.alternate;ke(qe,qe.current&1),ke(tn,t),gn===null&&(e===null||Vs.current!==null||e.memoizedState!==null)&&(gn=t)}function vm(t){ke(qe,qe.current),ke(tn,t),gn===null&&(gn=t)}function H1(t){t.tag===22?(ke(qe,qe.current),ke(tn,t),gn===null&&(gn=t)):dr(t)}function dr(){ke(qe,qe.current),ke(tn,tn.current)}function Yt(t){ot(tn),gn===t&&(gn=null),ot(qe)}var qe=Zn(0);function vd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Bm(n)||Hm(n)))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 Ci=0,ee=null,Se=null,Ke=null,yd=!1,Ls=!1,ua=!1,_d=0,$l=0,zs=null,YO=0;function Ie(){throw Error(k(321))}function cv(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!en(t[n],e[n]))return!1;return!0}function uv(t,e,n,i,r,a){return Ci=a,ee=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Z.H=t===null||t.memoizedState===null?hE:Sv,ua=!1,a=n(i,r),ua=!1,Ls&&(a=$1(e,n,i,r)),U1(t),a}function U1(t){Z.H=Vl;var e=Se!==null&&Se.next!==null;if(Ci=0,Ke=Se=ee=null,yd=!1,$l=0,zs=null,e)throw Error(k(300));t===null||Qe||(t=t.dependencies,t!==null&&hd(t)&&(Qe=!0))}function $1(t,e,n,i){ee=t;var r=0;do{if(Ls&&(zs=null),$l=0,Ls=!1,25<=r)throw Error(k(301));if(r+=1,Ke=Se=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Z.H=gE,a=e(n,i)}while(Ls);return a}function ZO(){var t=Z.H,e=t.useState()[0];return e=typeof e.then=="function"?Jl(e):e,t=t.useState()[0],(Se!==null?Se.memoizedState:null)!==t&&(ee.flags|=1024),e}function dv(){var t=_d!==0;return _d=0,t}function fv(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function pv(t){if(yd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}yd=!1}Ci=0,Ke=Se=ee=null,Ls=!1,$l=_d=0,zs=null}function Ct(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?ee.memoizedState=Ke=t:Ke=Ke.next=t,Ke}function Pe(){if(Se===null){var t=ee.alternate;t=t!==null?t.memoizedState:null}else t=Se.next;var e=Ke===null?ee.memoizedState:Ke.next;if(e!==null)Ke=e,Se=t;else{if(t===null)throw ee.alternate===null?Error(k(467)):Error(k(310));Se=t,t={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},Ke===null?ee.memoizedState=Ke=t:Ke=Ke.next=t}return Ke}function Fd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jl(t){var e=$l;return $l+=1,zs===null&&(zs=[]),t=N1(zs,t,e),e=ee,(Ke===null?e.memoizedState:Ke.next)===null&&(e=e.alternate,Z.H=e===null||e.memoizedState===null?hE:Sv),t}function jd(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Jl(t);if(t.$$typeof===yi)return gt(t)}throw Error(k(438,String(t)))}function hv(t){var e=null,n=ee.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=ee.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Fd(),ee.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=D2;return e.index++,n}function Ai(t,e){return typeof e=="function"?e(t):e}function Wu(t){var e=Pe();return gv(e,Se,t)}function gv(t,e,n){var i=t.queue;if(i===null)throw Error(k(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var s=r.next;r.next=a.next,a.next=s}e.baseQueue=r=a,i.pending=null}if(a=t.baseState,r===null)t.memoizedState=a;else{e=r.next;var o=s=null,l=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(le&f)===f:(Ci&f)===f){var g=c.revertLane;if(g===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===$s&&(u=!0);else if((Ci&g)===g){c=c.next,g===$s&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=f,s=a):l=l.next=f,ee.lanes|=g,Or|=g;f=c.action,ua&&n(a,f),a=c.hasEagerState?c.eagerState:n(a,f)}else g={lane:f,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=g,s=a):l=l.next=g,ee.lanes|=f,Or|=f;c=c.next}while(c!==null&&c!==e);if(l===null?s=a:l.next=o,!en(a,t.memoizedState)&&(Qe=!0,u&&(n=Ns,n!==null)))throw n;t.memoizedState=a,t.baseState=s,t.baseQueue=l,i.lastRenderedState=a}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Tg(t){var e=Pe(),n=e.queue;if(n===null)throw Error(k(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do a=t(a,s.action),s=s.next;while(s!==r);en(a,e.memoizedState)||(Qe=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,i]}function V1(t,e,n){var i=ee,r=Pe(),a=de;if(a){if(n===void 0)throw Error(k(407));n=n()}else n=e();var s=!en((Se||r).memoizedState,n);if(s&&(r.memoizedState=n,Qe=!0),r=r.queue,mv(j1.bind(null,i,r,t),[t]),r.getSnapshot!==e||s||Ke!==null&&Ke.memoizedState.tag&1){if(i.flags|=2048,Is(9,{destroy:void 0},F1.bind(null,i,r,n,e),null),Ee===null)throw Error(k(349));a||(Ci&127)!==0||I1(i,e,n)}return n}function I1(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ee.updateQueue,e===null?(e=Fd(),ee.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function F1(t,e,n,i){e.value=n,e.getSnapshot=i,q1(e)&&P1(t)}function j1(t,e,n){return n(function(){q1(e)&&P1(t)})}function q1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!en(t,n)}catch{return!0}}function P1(t){var e=ga(t,2);e!==null&&Bt(e,t,2)}function ym(t){var e=Ct();if(typeof t=="function"){var n=t;if(t=n(),ua){pr(!0);try{n()}finally{pr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:t},e}function G1(t,e,n,i){return t.baseState=n,gv(t,Se,typeof i=="function"?i:Ai)}function KO(t,e,n,i,r){if(Pd(t))throw Error(k(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){a.listeners.push(s)}};Z.T!==null?n(!0):a.isTransition=!1,i(a),n=e.pending,n===null?(a.next=e.pending=a,Y1(e,a)):(a.next=n.next,e.pending=n.next=a)}}function Y1(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Z.T,s={};Z.T=s;try{var o=n(r,i),l=Z.S;l!==null&&l(s,o),GS(t,e,o)}catch(c){_m(t,e,c)}finally{a!==null&&s.types!==null&&(a.types=s.types),Z.T=a}}else try{a=n(r,i),GS(t,e,a)}catch(c){_m(t,e,c)}}function GS(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){YS(t,e,i)},function(i){return _m(t,e,i)}):YS(t,e,n)}function YS(t,e,n){e.status="fulfilled",e.value=n,Z1(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,Y1(t,n)))}function _m(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,Z1(e),e=e.next;while(e!==i)}t.action=null}function Z1(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function K1(t,e){return e}function ZS(t,e){if(de){var n=Ee.formState;if(n!==null){e:{var i=ee;if(de){if(Ne){t:{for(var r=Ne,a=hn;r.nodeType!==8;){if(!a){r=null;break t}if(r=mn(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){Ne=mn(r.nextSibling),i=r.data==="F!";break e}}Tr(i)}i=!1}i&&(e=n[0])}}return n=Ct(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:K1,lastRenderedState:e},n.queue=i,n=dE.bind(null,ee,i),i.dispatch=n,i=ym(!1),a=bv.bind(null,ee,!1,i.queue),i=Ct(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=KO.bind(null,ee,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function KS(t){var e=Pe();return X1(e,Se,t)}function X1(t,e,n){if(e=gv(t,e,K1)[0],t=Wu(Ai)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Jl(e)}catch(s){throw s===Xs?Id:s}else i=e;e=Pe();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(ee.flags|=2048,Is(9,{destroy:void 0},XO.bind(null,r,n),null)),[i,a,t]}function XO(t,e){t.action=e}function XS(t){var e=Pe(),n=Se;if(n!==null)return X1(e,n,t);Pe(),e=e.memoizedState,n=Pe();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function Is(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=ee.updateQueue,e===null&&(e=Fd(),ee.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function W1(){return Pe().memoizedState}function Qu(t,e,n,i){var r=Ct();ee.flags|=t,r.memoizedState=Is(1|e,{destroy:void 0},n,i===void 0?null:i)}function qd(t,e,n,i){var r=Pe();i=i===void 0?null:i;var a=r.memoizedState.inst;Se!==null&&i!==null&&cv(i,Se.memoizedState.deps)?r.memoizedState=Is(e,a,n,i):(ee.flags|=t,r.memoizedState=Is(1|e,a,n,i))}function WS(t,e){Qu(8390656,8,t,e)}function mv(t,e){qd(2048,8,t,e)}function WO(t){ee.flags|=4;var e=ee.updateQueue;if(e===null)e=Fd(),ee.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function Q1(t){var e=Pe().memoizedState;return WO({ref:e,nextImpl:t}),function(){if((pe&2)!==0)throw Error(k(440));return e.impl.apply(void 0,arguments)}}function J1(t,e){return qd(4,2,t,e)}function eE(t,e){return qd(4,4,t,e)}function tE(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function nE(t,e,n){n=n!=null?n.concat([t]):null,qd(4,4,tE.bind(null,e,t),n)}function vv(){}function iE(t,e){var n=Pe();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&cv(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function rE(t,e){var n=Pe();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&cv(e,i[1]))return i[0];if(i=t(),ua){pr(!0);try{t()}finally{pr(!1)}}return n.memoizedState=[i,e],i}function yv(t,e,n){return n===void 0||(Ci&1073741824)!==0&&(le&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=GE(),ee.lanes|=t,Or|=t,n)}function aE(t,e,n,i){return en(n,e)?n:Vs.current!==null?(t=yv(t,n,i),en(t,e)||(Qe=!0),t):(Ci&42)===0||(Ci&1073741824)!==0&&(le&261930)===0?(Qe=!0,t.memoizedState=n):(t=GE(),ee.lanes|=t,Or|=t,e)}function sE(t,e,n,i,r){var a=he.p;he.p=a!==0&&8>a?a:8;var s=Z.T,o={};Z.T=o,bv(t,!1,e,n);try{var l=r(),c=Z.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=GO(l,i);Al(t,e,u,Jt(t))}else Al(t,e,i,Jt(t))}catch(f){Al(t,e,{then:function(){},status:"rejected",reason:f},Jt())}finally{he.p=a,s!==null&&o.types!==null&&(s.types=o.types),Z.T=s}}function QO(){}function bm(t,e,n,i){if(t.tag!==5)throw Error(k(476));var r=oE(t).queue;sE(t,r,e,na,n===null?QO:function(){return lE(t),n(i)})}function oE(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:na,baseState:na,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:na},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function lE(t){var e=oE(t);e.next===null&&(e=t.alternate.memoizedState),Al(t,e.next.queue,{},Jt())}function _v(){return gt(jl)}function cE(){return Pe().memoizedState}function uE(){return Pe().memoizedState}function JO(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Jt();t=br(n);var i=Sr(e,t,n);i!==null&&(Bt(i,e,n),El(i,e,n)),e={cache:rv()},t.payload=e;return}e=e.return}}function eM(t,e,n){var i=Jt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Pd(t)?fE(e,n):(n=ev(t,e,n,i),n!==null&&(Bt(n,t,i),pE(n,e,i)))}function dE(t,e,n){var i=Jt();Al(t,e,n,i)}function Al(t,e,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Pd(t))fE(e,r);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,n);if(r.hasEagerState=!0,r.eagerState=o,en(o,s))return Vd(t,e,r,0),Ee===null&&$d(),!1}catch{}if(n=ev(t,e,r,i),n!==null)return Bt(n,t,i),pE(n,e,i),!0}return!1}function bv(t,e,n,i){if(i={lane:2,revertLane:Rv(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Pd(t)){if(e)throw Error(k(479))}else e=ev(t,n,i,2),e!==null&&Bt(e,t,2)}function Pd(t){var e=t.alternate;return t===ee||e!==null&&e===ee}function fE(t,e){Ls=yd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function pE(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Qx(t,n)}}var Vl={readContext:gt,use:jd,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};Vl.useEffectEvent=Ie;var hE={readContext:gt,use:jd,useCallback:function(t,e){return Ct().memoizedState=[t,e===void 0?null:e],t},useContext:gt,useEffect:WS,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Qu(4194308,4,tE.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Qu(4194308,4,t,e)},useInsertionEffect:function(t,e){Qu(4,2,t,e)},useMemo:function(t,e){var n=Ct();e=e===void 0?null:e;var i=t();if(ua){pr(!0);try{t()}finally{pr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Ct();if(n!==void 0){var r=n(e);if(ua){pr(!0);try{n(e)}finally{pr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=eM.bind(null,ee,t),[i.memoizedState,t]},useRef:function(t){var e=Ct();return t={current:t},e.memoizedState=t},useState:function(t){t=ym(t);var e=t.queue,n=dE.bind(null,ee,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:vv,useDeferredValue:function(t,e){var n=Ct();return yv(n,t,e)},useTransition:function(){var t=ym(!1);return t=sE.bind(null,ee,t.queue,!0,!1),Ct().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=ee,r=Ct();if(de){if(n===void 0)throw Error(k(407));n=n()}else{if(n=e(),Ee===null)throw Error(k(349));(le&127)!==0||I1(i,e,n)}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,WS(j1.bind(null,i,a,t),[t]),i.flags|=2048,Is(9,{destroy:void 0},F1.bind(null,i,a,n,e),null),n},useId:function(){var t=Ct(),e=Ee.identifierPrefix;if(de){var n=Pn,i=qn;n=(i&~(1<<32-Qt(i)-1)).toString(32)+n,e="_"+e+"R_"+n,n=_d++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=YO++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:_v,useFormState:ZS,useActionState:ZS,useOptimistic:function(t){var e=Ct();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=bv.bind(null,ee,!0,n),n.dispatch=e,[t,e]},useMemoCache:hv,useCacheRefresh:function(){return Ct().memoizedState=JO.bind(null,ee)},useEffectEvent:function(t){var e=Ct(),n={impl:t};return e.memoizedState=n,function(){if((pe&2)!==0)throw Error(k(440));return n.impl.apply(void 0,arguments)}}},Sv={readContext:gt,use:jd,useCallback:iE,useContext:gt,useEffect:mv,useImperativeHandle:nE,useInsertionEffect:J1,useLayoutEffect:eE,useMemo:rE,useReducer:Wu,useRef:W1,useState:function(){return Wu(Ai)},useDebugValue:vv,useDeferredValue:function(t,e){var n=Pe();return aE(n,Se.memoizedState,t,e)},useTransition:function(){var t=Wu(Ai)[0],e=Pe().memoizedState;return[typeof t=="boolean"?t:Jl(t),e]},useSyncExternalStore:V1,useId:cE,useHostTransitionStatus:_v,useFormState:KS,useActionState:KS,useOptimistic:function(t,e){var n=Pe();return G1(n,Se,t,e)},useMemoCache:hv,useCacheRefresh:uE};Sv.useEffectEvent=Q1;var gE={readContext:gt,use:jd,useCallback:iE,useContext:gt,useEffect:mv,useImperativeHandle:nE,useInsertionEffect:J1,useLayoutEffect:eE,useMemo:rE,useReducer:Tg,useRef:W1,useState:function(){return Tg(Ai)},useDebugValue:vv,useDeferredValue:function(t,e){var n=Pe();return Se===null?yv(n,t,e):aE(n,Se.memoizedState,t,e)},useTransition:function(){var t=Tg(Ai)[0],e=Pe().memoizedState;return[typeof t=="boolean"?t:Jl(t),e]},useSyncExternalStore:V1,useId:cE,useHostTransitionStatus:_v,useFormState:XS,useActionState:XS,useOptimistic:function(t,e){var n=Pe();return Se!==null?G1(n,Se,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:hv,useCacheRefresh:uE};gE.useEffectEvent=Q1;function Rg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:De({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Sm={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=Jt(),r=br(i);r.payload=e,n!=null&&(r.callback=n),e=Sr(t,r,i),e!==null&&(Bt(e,t,i),El(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=Jt(),r=br(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Sr(t,r,i),e!==null&&(Bt(e,t,i),El(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Jt(),i=br(n);i.tag=2,e!=null&&(i.callback=e),e=Sr(t,i,n),e!==null&&(Bt(e,t,n),El(e,t,n))}};function QS(t,e,n,i,r,a,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,s):e.prototype&&e.prototype.isPureReactComponent?!zl(n,i)||!zl(r,a):!0}function JS(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Sm.enqueueReplaceState(e,e.state,null)}function da(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=De({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function mE(t){dd(t)}function vE(t){console.error(t)}function yE(t){dd(t)}function bd(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function ex(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function xm(t,e,n){return n=br(n),n.tag=3,n.payload={element:null},n.callback=function(){bd(t,e)},n}function _E(t){return t=br(t),t.tag=3,t}function bE(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){ex(e,n,i)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){ex(e,n,i),typeof r!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var o=i.stack;this.componentDidCatch(i.value,{componentStack:o!==null?o:""})})}function tM(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ks(e,n,r,!0),n=tn.current,n!==null){switch(n.tag){case 31:case 13:return gn===null?Cd():n.alternate===null&&Fe===0&&(Fe=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===gd?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Vg(t,i,r)),!1;case 22:return n.flags|=65536,i===gd?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Vg(t,i,r)),!1}throw Error(k(435,n.tag))}return Vg(t,i,r),Cd(),!1}if(de)return e=tn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==cm&&(t=Error(k(422),{cause:i}),Hl(pn(t,n)))):(i!==cm&&(e=Error(k(423),{cause:i}),Hl(pn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=pn(i,n),r=xm(t.stateNode,i,r),kg(t,r),Fe!==4&&(Fe=2)),!1;var a=Error(k(520),{cause:i});if(a=pn(a,n),Rl===null?Rl=[a]:Rl.push(a),Fe!==4&&(Fe=2),e===null)return!0;i=pn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=xm(n.stateNode,i,t),kg(n,t),!1;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(xr===null||!xr.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=_E(r),bE(r,t,n,i),kg(n,r),!1}n=n.return}while(n!==null);return!1}var xv=Error(k(461)),Qe=!1;function ft(t,e,n,i){e.child=t===null?L1(e,null,n,i):ca(e,t.child,n,i)}function tx(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}else s=i;return la(e),i=uv(t,e,n,s,a,r),o=dv(),t!==null&&!Qe?(fv(t,e,r),ki(t,e,r)):(de&&o&&nv(e),e.flags|=1,ft(t,e,i,r),e.child)}function nx(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!tv(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,SE(t,e,a,i,r)):(t=Ku(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!Ev(t,r)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:zl,n(s,i)&&t.ref===e.ref)return ki(t,e,r)}return e.flags|=1,t=Si(a,i),t.ref=e.ref,t.return=e,e.child=t}function SE(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(zl(a,i)&&t.ref===e.ref)if(Qe=!1,e.pendingProps=i=a,Ev(t,r))(t.flags&131072)!==0&&(Qe=!0);else return e.lanes=t.lanes,ki(t,e,r)}return Em(t,e,n,i,r)}function xE(t,e,n,i){var r=i.children,a=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(a=a!==null?a.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a}else i=0,e.child=null;return ix(t,e,a,n,i)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Xu(e,a!==null?a.cachePool:null),a!==null?PS(e,a):mm(),H1(e);else return i=e.lanes=536870912,ix(t,e,a!==null?a.baseLanes|n:n,n,i)}else a!==null?(Xu(e,a.cachePool),PS(e,a),dr(e),e.memoizedState=null):(t!==null&&Xu(e,null),mm(),dr(e));return ft(t,e,r,n),e.child}function vl(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function ix(t,e,n,i,r){var a=av();return a=a===null?null:{parent:We._currentValue,pool:a},e.memoizedState={baseLanes:n,cachePool:a},t!==null&&Xu(e,null),mm(),H1(e),t!==null&&Ks(t,e,i,!0),e.childLanes=r,null}function Ju(t,e){return e=Sd({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function rx(t,e,n){return ca(e,t.child,null,n),t=Ju(e,e.pendingProps),t.flags|=2,Yt(e),e.memoizedState=null,t}function nM(t,e,n){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(de){if(i.mode==="hidden")return t=Ju(e,i),e.lanes=536870912,vl(null,t);if(vm(e),(t=Ne)?(t=hw(t,hn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:kr!==null?{id:qn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},n=k1(t),n.return=e,e.child=n,ht=e,Ne=null)):t=null,t===null)throw Tr(e);return e.lanes=536870912,null}return Ju(e,i)}var a=t.memoizedState;if(a!==null){var s=a.dehydrated;if(vm(e),r)if(e.flags&256)e.flags&=-257,e=rx(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(k(558));else if(Qe||Ks(t,e,n,!1),r=(n&t.childLanes)!==0,Qe||r){if(i=Ee,i!==null&&(s=Jx(i,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,ga(t,s),Bt(i,t,s),xv;Cd(),e=rx(t,e,n)}else t=a.treeContext,Ne=mn(s.nextSibling),ht=e,de=!0,_r=null,hn=!1,t!==null&&R1(e,t),e=Ju(e,i),e.flags|=4096;return e}return t=Si(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ed(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(k(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Em(t,e,n,i,r){return la(e),n=uv(t,e,n,i,void 0,r),i=dv(),t!==null&&!Qe?(fv(t,e,r),ki(t,e,r)):(de&&i&&nv(e),e.flags|=1,ft(t,e,n,r),e.child)}function ax(t,e,n,i,r,a){return la(e),e.updateQueue=null,n=$1(e,i,n,r),U1(t),i=dv(),t!==null&&!Qe?(fv(t,e,a),ki(t,e,a)):(de&&i&&nv(e),e.flags|=1,ft(t,e,n,a),e.child)}function sx(t,e,n,i,r){if(la(e),e.stateNode===null){var a=Cs,s=n.contextType;typeof s=="object"&&s!==null&&(a=gt(s)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Sm,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},ov(e),s=n.contextType,a.context=typeof s=="object"&&s!==null?gt(s):Cs,a.state=e.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Rg(e,n,s,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&Sm.enqueueReplaceState(a,a.state,null),Cl(e,i,a,r),wl(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){a=e.stateNode;var o=e.memoizedProps,l=da(n,o);a.props=l;var c=a.context,u=n.contextType;s=Cs,typeof u=="object"&&u!==null&&(s=gt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",o=e.pendingProps!==o,u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o||c!==s)&&JS(e,a,i,s),lr=!1;var g=e.memoizedState;a.state=g,Cl(e,i,a,r),wl(),c=e.memoizedState,o||g!==c||lr?(typeof f=="function"&&(Rg(e,n,f,i),c=e.memoizedState),(l=lr||QS(e,n,l,i,g,c,s))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),a.props=i,a.state=c,a.context=s,i=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,hm(t,e),s=e.memoizedProps,u=da(n,s),a.props=u,f=e.pendingProps,g=a.context,c=n.contextType,l=Cs,typeof c=="object"&&c!==null&&(l=gt(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||g!==l)&&JS(e,a,i,l),lr=!1,g=e.memoizedState,a.state=g,Cl(e,i,a,r),wl();var p=e.memoizedState;s!==f||g!==p||lr||t!==null&&t.dependencies!==null&&hd(t.dependencies)?(typeof o=="function"&&(Rg(e,n,o,i),p=e.memoizedState),(u=lr||QS(e,n,u,i,g,p,l)||t!==null&&t.dependencies!==null&&hd(t.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,p,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),a.props=i,a.state=p,a.context=l,i=u):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),i=!1)}return a=i,ed(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=ca(e,t.child,null,r),e.child=ca(e,null,n,r)):ft(t,e,n,r),e.memoizedState=a.state,t=e.child):t=ki(t,e,r),t}function ox(t,e,n,i){return oa(),e.flags|=256,ft(t,e,n,i),e.child}var Og={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mg(t){return{baseLanes:t,cachePool:M1()}}function Ng(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Kt),t}function EE(t,e,n){var i=e.pendingProps,r=!1,a=(e.flags&128)!==0,s;if((s=a)||(s=t!==null&&t.memoizedState===null?!1:(qe.current&2)!==0),s&&(r=!0,e.flags&=-129),s=(e.flags&32)!==0,e.flags&=-33,t===null){if(de){if(r?ur(e):dr(e),(t=Ne)?(t=hw(t,hn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:kr!==null?{id:qn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},n=k1(t),n.return=e,e.child=n,ht=e,Ne=null)):t=null,t===null)throw Tr(e);return Hm(t)?e.lanes=32:e.lanes=536870912,null}var o=i.children;return i=i.fallback,r?(dr(e),r=e.mode,o=Sd({mode:"hidden",children:o},r),i=ia(i,r,n,null),o.return=e,i.return=e,o.sibling=i,e.child=o,i=e.child,i.memoizedState=Mg(n),i.childLanes=Ng(t,s,n),e.memoizedState=Og,vl(null,i)):(ur(e),wm(e,o))}var l=t.memoizedState;if(l!==null&&(o=l.dehydrated,o!==null)){if(a)e.flags&256?(ur(e),e.flags&=-257,e=Dg(t,e,n)):e.memoizedState!==null?(dr(e),e.child=t.child,e.flags|=128,e=null):(dr(e),o=i.fallback,r=e.mode,i=Sd({mode:"visible",children:i.children},r),o=ia(o,r,n,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,ca(e,t.child,null,n),i=e.child,i.memoizedState=Mg(n),i.childLanes=Ng(t,s,n),e.memoizedState=Og,e=vl(null,i));else if(ur(e),Hm(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var c=s.dgst;s=c,i=Error(k(419)),i.stack="",i.digest=s,Hl({value:i,source:null,stack:null}),e=Dg(t,e,n)}else if(Qe||Ks(t,e,n,!1),s=(n&t.childLanes)!==0,Qe||s){if(s=Ee,s!==null&&(i=Jx(s,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,ga(t,i),Bt(s,t,i),xv;Bm(o)||Cd(),e=Dg(t,e,n)}else Bm(o)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Ne=mn(o.nextSibling),ht=e,de=!0,_r=null,hn=!1,t!==null&&R1(e,t),e=wm(e,i.children),e.flags|=4096);return e}return r?(dr(e),o=i.fallback,r=e.mode,l=t.child,c=l.sibling,i=Si(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?o=Si(c,o):(o=ia(o,r,n,null),o.flags|=2),o.return=e,i.return=e,i.sibling=o,e.child=i,vl(null,i),i=e.child,o=t.child.memoizedState,o===null?o=Mg(n):(r=o.cachePool,r!==null?(l=We._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=M1(),o={baseLanes:o.baseLanes|n,cachePool:r}),i.memoizedState=o,i.childLanes=Ng(t,s,n),e.memoizedState=Og,vl(t.child,i)):(ur(e),n=t.child,t=n.sibling,n=Si(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(s=e.deletions,s===null?(e.deletions=[t],e.flags|=16):s.push(t)),e.child=n,e.memoizedState=null,n)}function wm(t,e){return e=Sd({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Sd(t,e){return t=Zt(22,t,null,e),t.lanes=0,t}function Dg(t,e,n){return ca(e,t.child,null,n),t=wm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function lx(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),dm(t.return,e,n)}function Lg(t,e,n,i,r,a){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:a}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r,s.treeForkCount=a)}function wE(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var s=qe.current,o=(s&2)!==0;if(o?(s=s&1|2,e.flags|=128):s&=1,ke(qe,s),ft(t,e,i,n),i=de?Bl:0,!o&&t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&lx(t,n,e);else if(t.tag===19)lx(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&vd(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Lg(e,!1,r,n,a,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&vd(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Lg(e,!0,n,null,a,i);break;case"together":Lg(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function ki(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Or|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ks(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(k(153));if(e.child!==null){for(t=e.child,n=Si(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Si(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Ev(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&hd(t)))}function iM(t,e,n){switch(e.tag){case 3:od(e,e.stateNode.containerInfo),cr(e,We,t.memoizedState.cache),oa();break;case 27:case 5:Qg(e);break;case 4:od(e,e.stateNode.containerInfo);break;case 10:cr(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,vm(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(ur(e),e.flags|=128,null):(n&e.child.childLanes)!==0?EE(t,e,n):(ur(e),t=ki(t,e,n),t!==null?t.sibling:null);ur(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ks(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return wE(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ke(qe,qe.current),i)break;return null;case 22:return e.lanes=0,xE(t,e,n,e.pendingProps);case 24:cr(e,We,t.memoizedState.cache)}return ki(t,e,n)}function CE(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)Qe=!0;else{if(!Ev(t,n)&&(e.flags&128)===0)return Qe=!1,iM(t,e,n);Qe=(t.flags&131072)!==0}else Qe=!1,de&&(e.flags&1048576)!==0&&T1(e,Bl,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(t=ea(e.elementType),e.type=t,typeof t=="function")tv(t)?(i=da(t,i),e.tag=1,e=sx(null,e,t,i,n)):(e.tag=0,e=Em(null,e,t,i,n));else{if(t!=null){var r=t.$$typeof;if(r===Im){e.tag=11,e=tx(null,e,t,i,n);break e}else if(r===Fm){e.tag=14,e=nx(null,e,t,i,n);break e}}throw e=Xg(t)||t,Error(k(306,e,""))}}return e;case 0:return Em(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=da(i,e.pendingProps),sx(t,e,i,r,n);case 3:e:{if(od(e,e.stateNode.containerInfo),t===null)throw Error(k(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,hm(t,e),Cl(e,i,null,n);var s=e.memoizedState;if(i=s.cache,cr(e,We,i),i!==a.cache&&fm(e,[We],n,!0),wl(),i=s.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:s.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=ox(t,e,i,n);break e}else if(i!==r){r=pn(Error(k(424)),e),Hl(r),e=ox(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ne=mn(t.firstChild),ht=e,de=!0,_r=null,hn=!0,n=L1(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oa(),i===r){e=ki(t,e,n);break e}ft(t,e,i,n)}e=e.child}return e;case 26:return ed(t,e),t===null?(n=Ox(e.type,null,e.pendingProps,null))?e.memoizedState=n:de||(n=e.type,t=e.pendingProps,i=Rd(yr.current).createElement(n),i[pt]=e,i[Ht]=t,mt(i,n,t),st(i),e.stateNode=i):e.memoizedState=Ox(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Qg(e),t===null&&de&&(i=e.stateNode=gw(e.type,e.pendingProps,yr.current),ht=e,hn=!0,r=Ne,Nr(e.type)?(Um=r,Ne=mn(i.firstChild)):Ne=r),ft(t,e,e.pendingProps.children,n),ed(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&de&&((r=i=Ne)&&(i=MM(i,e.type,e.pendingProps,hn),i!==null?(e.stateNode=i,ht=e,Ne=mn(i.firstChild),hn=!1,r=!0):r=!1),r||Tr(e)),Qg(e),r=e.type,a=e.pendingProps,s=t!==null?t.memoizedProps:null,i=a.children,Lm(r,a)?i=null:s!==null&&Lm(r,s)&&(e.flags|=32),e.memoizedState!==null&&(r=uv(t,e,ZO,null,null,n),jl._currentValue=r),ed(t,e),ft(t,e,i,n),e.child;case 6:return t===null&&de&&((t=n=Ne)&&(n=NM(n,e.pendingProps,hn),n!==null?(e.stateNode=n,ht=e,Ne=null,t=!0):t=!1),t||Tr(e)),null;case 13:return EE(t,e,n);case 4:return od(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=ca(e,null,i,n):ft(t,e,i,n),e.child;case 11:return tx(t,e,e.type,e.pendingProps,n);case 7:return ft(t,e,e.pendingProps,n),e.child;case 8:return ft(t,e,e.pendingProps.children,n),e.child;case 12:return ft(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,cr(e,e.type,i.value),ft(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,la(e),r=gt(r),i=i(r),e.flags|=1,ft(t,e,i,n),e.child;case 14:return nx(t,e,e.type,e.pendingProps,n);case 15:return SE(t,e,e.type,e.pendingProps,n);case 19:return wE(t,e,n);case 31:return nM(t,e,n);case 22:return xE(t,e,n,e.pendingProps);case 24:return la(e),i=gt(We),t===null?(r=av(),r===null&&(r=Ee,a=rv(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},ov(e),cr(e,We,r)):((t.lanes&n)!==0&&(hm(t,e),Cl(e,null,null,n),wl()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),cr(e,We,i)):(i=a.cache,cr(e,We,i),i!==r.cache&&fm(e,[We],n,!0))),ft(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(k(156,e.tag))}function fi(t){t.flags|=4}function zg(t,e,n,i,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(KE())t.flags|=8192;else throw aa=gd,sv}else t.flags&=-16777217}function cx(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!yw(e))if(KE())t.flags|=8192;else throw aa=gd,sv}function Uu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Xx():536870912,t.lanes|=e,Fs|=e)}function ul(t,e){if(!de)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Me(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function rM(t,e,n){var i=e.pendingProps;switch(iv(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(e),null;case 1:return Me(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),xi(We),Bs(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ps(e)?fi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Ag())),Me(e),null;case 26:var r=e.type,a=e.memoizedState;return t===null?(fi(e),a!==null?(Me(e),cx(e,a)):(Me(e),zg(e,r,null,i,n))):a?a!==t.memoizedState?(fi(e),Me(e),cx(e,a)):(Me(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&fi(e),Me(e),zg(e,r,t,i,n)),null;case 27:if(ld(e),n=yr.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&fi(e);else{if(!i){if(e.stateNode===null)throw Error(k(166));return Me(e),null}t=Yn.current,ps(e)?US(e,t):(t=gw(r,i,n),e.stateNode=t,fi(e))}return Me(e),null;case 5:if(ld(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&fi(e);else{if(!i){if(e.stateNode===null)throw Error(k(166));return Me(e),null}if(a=Yn.current,ps(e))US(e,a);else{var s=Rd(yr.current);switch(a){case 1:a=s.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":a=s.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":a=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":a=s.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof i.is=="string"?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?a.multiple=!0:i.size&&(a.size=i.size);break;default:a=typeof i.is=="string"?s.createElement(r,{is:i.is}):s.createElement(r)}}a[pt]=e,a[Ht]=i;e:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break e;for(;s.sibling===null;){if(s.return===null||s.return===e)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=a;e:switch(mt(a,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&fi(e)}}return Me(e),zg(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&fi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(k(166));if(t=yr.current,ps(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=ht,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[pt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||dw(t.nodeValue,n)),t||Tr(e,!0)}else t=Rd(t).createTextNode(i),t[pt]=e,e.stateNode=t}return Me(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(i=ps(e),n!==null){if(t===null){if(!i)throw Error(k(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(k(557));t[pt]=e}else oa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Me(e),t=!1}else n=Ag(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Yt(e),e):(Yt(e),null);if((e.flags&128)!==0)throw Error(k(558))}return Me(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=ps(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(k(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(k(317));r[pt]=e}else oa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Me(e),r=!1}else r=Ag(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Yt(e),e):(Yt(e),null)}return Yt(e),(e.flags&128)!==0?(e.lanes=n,e):(n=i!==null,t=t!==null&&t.memoizedState!==null,n&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Uu(e,e.updateQueue),Me(e),null);case 4:return Bs(),t===null&&Ov(e.stateNode.containerInfo),Me(e),null;case 10:return xi(e.type),Me(e),null;case 19:if(ot(qe),i=e.memoizedState,i===null)return Me(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)ul(i,!1);else{if(Fe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(a=vd(t),a!==null){for(e.flags|=128,ul(i,!1),t=a.updateQueue,e.updateQueue=t,Uu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)A1(n,t),n=n.sibling;return ke(qe,qe.current&1|2),de&&mi(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&Xt()>Ed&&(e.flags|=128,r=!0,ul(i,!1),e.lanes=4194304)}else{if(!r)if(t=vd(a),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,Uu(e,t),ul(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!de)return Me(e),null}else 2*Xt()-i.renderingStartTime>Ed&&n!==536870912&&(e.flags|=128,r=!0,ul(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(t=i.last,t!==null?t.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Xt(),t.sibling=null,n=qe.current,ke(qe,r?n&1|2:n&1),de&&mi(e,i.treeForkCount),t):(Me(e),null);case 22:case 23:return Yt(e),lv(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Me(e),e.subtreeFlags&6&&(e.flags|=8192)):Me(e),n=e.updateQueue,n!==null&&Uu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ot(ra),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),xi(We),Me(e),null;case 25:return null;case 30:return null}throw Error(k(156,e.tag))}function aM(t,e){switch(iv(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return xi(We),Bs(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ld(e),null;case 31:if(e.memoizedState!==null){if(Yt(e),e.alternate===null)throw Error(k(340));oa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Yt(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(k(340));oa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ot(qe),null;case 4:return Bs(),null;case 10:return xi(e.type),null;case 22:case 23:return Yt(e),lv(),t!==null&&ot(ra),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return xi(We),null;case 25:return null;default:return null}}function AE(t,e){switch(iv(e),e.tag){case 3:xi(We),Bs();break;case 26:case 27:case 5:ld(e);break;case 4:Bs();break;case 31:e.memoizedState!==null&&Yt(e);break;case 13:Yt(e);break;case 19:ot(qe);break;case 10:xi(e.type);break;case 22:case 23:Yt(e),lv(),t!==null&&ot(ra);break;case 24:xi(We)}}function ec(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,s=n.inst;i=a(),s.destroy=i}n=n.next}while(n!==r)}}catch(o){ye(e,e.return,o)}}function Rr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var s=i.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,r=e;var l=n,c=o;try{c()}catch(u){ye(r,l,u)}}}i=i.next}while(i!==a)}}catch(u){ye(e,e.return,u)}}function kE(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{B1(e,n)}catch(i){ye(t,t.return,i)}}}function TE(t,e,n){n.props=da(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){ye(t,e,i)}}function kl(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){ye(t,e,r)}}function Gn(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){ye(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){ye(t,e,r)}else n.current=null}function RE(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){ye(t,t.return,r)}}function Bg(t,e,n){try{var i=t.stateNode;CM(i,t.type,n,e),i[Ht]=e}catch(r){ye(t,t.return,r)}}function OE(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Nr(t.type)||t.tag===4}function Hg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||OE(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&&Nr(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 Cm(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=_i));else if(i!==4&&(i===27&&Nr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Cm(t,e,n),t=t.sibling;t!==null;)Cm(t,e,n),t=t.sibling}function xd(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Nr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(xd(t,e,n),t=t.sibling;t!==null;)xd(t,e,n),t=t.sibling}function ME(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);mt(e,i,n),e[pt]=t,e[Ht]=n}catch(a){ye(t,t.return,a)}}var vi=!1,Xe=!1,Ug=!1,ux=typeof WeakSet=="function"?WeakSet:Set,at=null;function sM(t,e){if(t=t.containerInfo,Nm=Dd,t=y1(t),Qm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,c=0,u=0,f=t,g=null;t:for(;;){for(var p;f!==n||r!==0&&f.nodeType!==3||(o=s+r),f!==a||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)g=f,f=p;for(;;){if(f===t)break t;if(g===n&&++c===r&&(o=s),g===a&&++u===i&&(l=s),(p=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dm={focusedElem:t,selectionRange:n},Dd=!1,at=e;at!==null;)if(e=at,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,at=t;else for(;at!==null;){switch(e=at,a=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(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var y=da(n.type,r);t=i.getSnapshotBeforeUpdate(y,a),i.__reactInternalSnapshotBeforeUpdate=t}catch(_){ye(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)zm(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":zm(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(k(163))}if(t=e.sibling,t!==null){t.return=e.return,at=t;break}at=e.return}}function NE(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:hi(t,n),i&4&&ec(5,n);break;case 1:if(hi(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(s){ye(n,n.return,s)}else{var r=da(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(s){ye(n,n.return,s)}}i&64&&kE(n),i&512&&kl(n,n.return);break;case 3:if(hi(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{B1(t,e)}catch(s){ye(n,n.return,s)}}break;case 27:e===null&&i&4&&ME(n);case 26:case 5:hi(t,n),e===null&&i&4&&RE(n),i&512&&kl(n,n.return);break;case 12:hi(t,n);break;case 31:hi(t,n),i&4&&zE(t,n);break;case 13:hi(t,n),i&4&&BE(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=gM.bind(null,n),DM(t,n))));break;case 22:if(i=n.memoizedState!==null||vi,!i){e=e!==null&&e.memoizedState!==null||Xe,r=vi;var a=Xe;vi=i,(Xe=e)&&!a?gi(t,n,(n.subtreeFlags&8772)!==0):hi(t,n),vi=r,Xe=a}break;case 30:break;default:hi(t,n)}}function DE(t){var e=t.alternate;e!==null&&(t.alternate=null,DE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Gm(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 He=null,Lt=!1;function pi(t,e,n){for(n=n.child;n!==null;)LE(t,e,n),n=n.sibling}function LE(t,e,n){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Yl,n)}catch{}switch(n.tag){case 26:Xe||Gn(n,e),pi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xe||Gn(n,e);var i=He,r=Lt;Nr(n.type)&&(He=n.stateNode,Lt=!1),pi(t,e,n),Ml(n.stateNode),He=i,Lt=r;break;case 5:Xe||Gn(n,e);case 6:if(i=He,r=Lt,He=null,pi(t,e,n),He=i,Lt=r,He!==null)if(Lt)try{(He.nodeType===9?He.body:He.nodeName==="HTML"?He.ownerDocument.body:He).removeChild(n.stateNode)}catch(a){ye(n,e,a)}else try{He.removeChild(n.stateNode)}catch(a){ye(n,e,a)}break;case 18:He!==null&&(Lt?(t=He,Cx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Gs(t)):Cx(He,n.stateNode));break;case 4:i=He,r=Lt,He=n.stateNode.containerInfo,Lt=!0,pi(t,e,n),He=i,Lt=r;break;case 0:case 11:case 14:case 15:Rr(2,n,e),Xe||Rr(4,n,e),pi(t,e,n);break;case 1:Xe||(Gn(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&TE(n,e,i)),pi(t,e,n);break;case 21:pi(t,e,n);break;case 22:Xe=(i=Xe)||n.memoizedState!==null,pi(t,e,n),Xe=i;break;default:pi(t,e,n)}}function zE(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Gs(t)}catch(n){ye(e,e.return,n)}}}function BE(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Gs(t)}catch(n){ye(e,e.return,n)}}function oM(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new ux),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new ux),e;default:throw Error(k(435,t.tag))}}function $u(t,e){var n=oM(t);e.forEach(function(i){if(!n.has(i)){n.add(i);var r=mM.bind(null,t,i);i.then(r,r)}})}function Nt(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,s=e,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Nr(o.type)){He=o.stateNode,Lt=!1;break e}break;case 5:He=o.stateNode,Lt=!1;break e;case 3:case 4:He=o.stateNode.containerInfo,Lt=!0;break e}o=o.return}if(He===null)throw Error(k(160));LE(a,s,r),He=null,Lt=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)HE(e,t),e=e.sibling}var Tn=null;function HE(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Nt(e,t),Dt(t),i&4&&(Rr(3,t,t.return),ec(3,t),Rr(5,t,t.return));break;case 1:Nt(e,t),Dt(t),i&512&&(Xe||n===null||Gn(n,n.return)),i&64&&vi&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Tn;if(Nt(e,t),Dt(t),i&512&&(Xe||n===null||Gn(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":a=r.getElementsByTagName("title")[0],(!a||a[Xl]||a[pt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),mt(a,i,n),a[pt]=t,st(a),i=a;break e;case"link":var s=Nx("link","href",r).get(i+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(a=s[o],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}a=r.createElement(i),mt(a,i,n),r.head.appendChild(a);break;case"meta":if(s=Nx("meta","content",r).get(i+(n.content||""))){for(o=0;o<s.length;o++)if(a=s[o],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}a=r.createElement(i),mt(a,i,n),r.head.appendChild(a);break;default:throw Error(k(468,i))}a[pt]=t,st(a),i=a}t.stateNode=i}else Dx(r,t.type,t.stateNode);else t.stateNode=Mx(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?Dx(r,t.type,t.stateNode):Mx(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Bg(t,t.memoizedProps,n.memoizedProps)}break;case 27:Nt(e,t),Dt(t),i&512&&(Xe||n===null||Gn(n,n.return)),n!==null&&i&4&&Bg(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Nt(e,t),Dt(t),i&512&&(Xe||n===null||Gn(n,n.return)),t.flags&32){r=t.stateNode;try{Us(r,"")}catch(y){ye(t,t.return,y)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Bg(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Ug=!0);break;case 6:if(Nt(e,t),Dt(t),i&4){if(t.stateNode===null)throw Error(k(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(y){ye(t,t.return,y)}}break;case 3:if(id=null,r=Tn,Tn=Od(e.containerInfo),Nt(e,t),Tn=r,Dt(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Gs(e.containerInfo)}catch(y){ye(t,t.return,y)}Ug&&(Ug=!1,UE(t));break;case 4:i=Tn,Tn=Od(t.stateNode.containerInfo),Nt(e,t),Dt(t),Tn=i;break;case 12:Nt(e,t),Dt(t);break;case 31:Nt(e,t),Dt(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,$u(t,i)));break;case 13:Nt(e,t),Dt(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Gd=Xt()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,$u(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=vi,u=Xe;if(vi=c||r,Xe=u||l,Nt(e,t),Xe=u,vi=c,Dt(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||vi||Xe||ta(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(a=l.stateNode,r)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var f=l.memoizedProps.style,g=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=g==null||typeof g=="boolean"?"":(""+g).trim()}}catch(y){ye(l,l.return,y)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(y){ye(l,l.return,y)}}}else if(e.tag===18){if(n===null){l=e;try{var p=l.stateNode;r?Ax(p,!0):Ax(l.stateNode,!1)}catch(y){ye(l,l.return,y)}}}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;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,$u(t,n))));break;case 19:Nt(e,t),Dt(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,$u(t,i)));break;case 30:break;case 21:break;default:Nt(e,t),Dt(t)}}function Dt(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(OE(i)){n=i;break}i=i.return}if(n==null)throw Error(k(160));switch(n.tag){case 27:var r=n.stateNode,a=Hg(t);xd(t,a,r);break;case 5:var s=n.stateNode;n.flags&32&&(Us(s,""),n.flags&=-33);var o=Hg(t);xd(t,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Hg(t);Cm(t,c,l);break;default:throw Error(k(161))}}catch(u){ye(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function UE(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;UE(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function hi(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)NE(t,e.alternate,e),e=e.sibling}function ta(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Rr(4,e,e.return),ta(e);break;case 1:Gn(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&TE(e,e.return,n),ta(e);break;case 27:Ml(e.stateNode);case 26:case 5:Gn(e,e.return),ta(e);break;case 22:e.memoizedState===null&&ta(e);break;case 30:ta(e);break;default:ta(e)}t=t.sibling}}function gi(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,s=a.flags;switch(a.tag){case 0:case 11:case 15:gi(r,a,n),ec(4,a);break;case 1:if(gi(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){ye(i,i.return,c)}if(i=a,r=i.updateQueue,r!==null){var o=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)z1(l[r],o)}catch(c){ye(i,i.return,c)}}n&&s&64&&kE(a),kl(a,a.return);break;case 27:ME(a);case 26:case 5:gi(r,a,n),n&&i===null&&s&4&&RE(a),kl(a,a.return);break;case 12:gi(r,a,n);break;case 31:gi(r,a,n),n&&s&4&&zE(r,a);break;case 13:gi(r,a,n),n&&s&4&&BE(r,a);break;case 22:a.memoizedState===null&&gi(r,a,n),kl(a,a.return);break;case 30:break;default:gi(r,a,n)}e=e.sibling}}function wv(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Ql(n))}function Cv(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ql(t))}function kn(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$E(t,e,n,i),e=e.sibling}function $E(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:kn(t,e,n,i),r&2048&&ec(9,e);break;case 1:kn(t,e,n,i);break;case 3:kn(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ql(t)));break;case 12:if(r&2048){kn(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,s=a.id,o=a.onPostCommit;typeof o=="function"&&o(s,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){ye(e,e.return,l)}}else kn(t,e,n,i);break;case 31:kn(t,e,n,i);break;case 13:kn(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,s=e.alternate,e.memoizedState!==null?a._visibility&2?kn(t,e,n,i):Tl(t,e):a._visibility&2?kn(t,e,n,i):(a._visibility|=2,gs(t,e,n,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&wv(s,e);break;case 24:kn(t,e,n,i),r&2048&&Cv(e.alternate,e);break;default:kn(t,e,n,i)}}function gs(t,e,n,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var a=t,s=e,o=n,l=i,c=s.flags;switch(s.tag){case 0:case 11:case 15:gs(a,s,o,l,r),ec(8,s);break;case 23:break;case 22:var u=s.stateNode;s.memoizedState!==null?u._visibility&2?gs(a,s,o,l,r):Tl(a,s):(u._visibility|=2,gs(a,s,o,l,r)),r&&c&2048&&wv(s.alternate,s);break;case 24:gs(a,s,o,l,r),r&&c&2048&&Cv(s.alternate,s);break;default:gs(a,s,o,l,r)}e=e.sibling}}function Tl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Tl(n,i),r&2048&&wv(i.alternate,i);break;case 24:Tl(n,i),r&2048&&Cv(i.alternate,i);break;default:Tl(n,i)}e=e.sibling}}var yl=8192;function hs(t,e,n){if(t.subtreeFlags&yl)for(t=t.child;t!==null;)VE(t,e,n),t=t.sibling}function VE(t,e,n){switch(t.tag){case 26:hs(t,e,n),t.flags&yl&&t.memoizedState!==null&&PM(n,Tn,t.memoizedState,t.memoizedProps);break;case 5:hs(t,e,n);break;case 3:case 4:var i=Tn;Tn=Od(t.stateNode.containerInfo),hs(t,e,n),Tn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=yl,yl=16777216,hs(t,e,n),yl=i):hs(t,e,n));break;default:hs(t,e,n)}}function IE(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 n=0;n<e.length;n++){var i=e[n];at=i,jE(i,t)}IE(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)FE(t),t=t.sibling}function FE(t){switch(t.tag){case 0:case 11:case 15:dl(t),t.flags&2048&&Rr(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,td(t)):dl(t);break;default:dl(t)}}function td(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];at=i,jE(i,t)}IE(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Rr(8,e,e.return),td(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,td(e));break;default:td(e)}t=t.sibling}}function jE(t,e){for(;at!==null;){var n=at;switch(n.tag){case 0:case 11:case 15:Rr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ql(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,at=i;else e:for(n=t;at!==null;){i=at;var r=i.sibling,a=i.return;if(DE(i),i===n){at=null;break e}if(r!==null){r.return=a,at=r;break e}at=a}}}var lM={getCacheForType:function(t){var e=gt(We),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return gt(We).controller.signal}},cM=typeof WeakMap=="function"?WeakMap:Map,pe=0,Ee=null,se=null,le=0,ve=0,Gt=null,gr=!1,Ws=!1,Av=!1,Ti=0,Fe=0,Or=0,sa=0,kv=0,Kt=0,Fs=0,Rl=null,zt=null,Am=!1,Gd=0,qE=0,Ed=1/0,wd=null,xr=null,nt=0,Er=null,js=null,Ei=0,km=0,Tm=null,PE=null,Ol=0,Rm=null;function Jt(){return(pe&2)!==0&&le!==0?le&-le:Z.T!==null?Rv():e1()}function GE(){if(Kt===0)if((le&536870912)===0||de){var t=Ru;Ru<<=1,(Ru&3932160)===0&&(Ru=262144),Kt=t}else Kt=536870912;return t=tn.current,t!==null&&(t.flags|=32),Kt}function Bt(t,e,n){(t===Ee&&(ve===2||ve===9)||t.cancelPendingCommit!==null)&&(qs(t,0),mr(t,le,Kt,!1)),Kl(t,n),((pe&2)===0||t!==Ee)&&(t===Ee&&((pe&2)===0&&(sa|=n),Fe===4&&mr(t,le,Kt,!1)),Kn(t))}function YE(t,e,n){if((pe&6)!==0)throw Error(k(327));var i=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Zl(t,e),r=i?fM(t,e):$g(t,e,!0),a=i;do{if(r===0){Ws&&!i&&mr(t,e,0,!1);break}else{if(n=t.current.alternate,a&&!uM(n)){r=$g(t,e,!1),a=!1;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var s=0;else s=t.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){e=s;e:{var o=t;r=Rl;var l=o.current.memoizedState.isDehydrated;if(l&&(qs(o,s).flags|=256),s=$g(o,s,!1),s!==2){if(Av&&!l){o.errorRecoveryDisabledLanes|=a,sa|=a,r=4;break e}a=zt,zt=r,a!==null&&(zt===null?zt=a:zt.push.apply(zt,a))}r=s}if(a=!1,r!==2)continue}}if(r===1){qs(t,0),mr(t,e,0,!0);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(k(345));case 4:if((e&4194048)!==e)break;case 6:mr(i,e,Kt,!gr);break e;case 2:zt=null;break;case 3:case 5:break;default:throw Error(k(329))}if((e&62914560)===e&&(r=Gd+300-Xt(),10<r)){if(mr(i,e,Kt,!gr),zd(i,0,!0)!==0)break e;Ei=e,i.timeoutHandle=pw(dx.bind(null,i,n,zt,wd,Am,e,Kt,sa,Fs,gr,a,"Throttled",-0,0),r);break e}dx(i,n,zt,wd,Am,e,Kt,sa,Fs,gr,a,null,-0,0)}}break}while(!0);Kn(t)}function dx(t,e,n,i,r,a,s,o,l,c,u,f,g,p){if(t.timeoutHandle=-1,f=e.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_i},VE(e,a,f);var y=(a&62914560)===a?Gd-Xt():(a&4194048)===a?qE-Xt():0;if(y=GM(f,y),y!==null){Ei=a,t.cancelPendingCommit=y(px.bind(null,t,e,a,n,i,r,s,o,l,u,f,null,g,p)),mr(t,a,s,!c);return}}px(t,e,a,n,i,r,s,o,l)}function uM(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!en(a(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;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 mr(t,e,n,i){e&=~kv,e&=~sa,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-Qt(r),s=1<<a;i[a]=-1,r&=~s}n!==0&&Wx(t,n,e)}function Yd(){return(pe&6)===0?(tc(0,!1),!1):!0}function Tv(){if(se!==null){if(ve===0)var t=se.return;else t=se,bi=ma=null,pv(t),Ds=null,Ul=0,t=se;for(;t!==null;)AE(t.alternate,t),t=t.return;se=null}}function qs(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,TM(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),Ei=0,Tv(),Ee=t,se=n=Si(t.current,null),le=e,ve=0,Gt=null,gr=!1,Ws=Zl(t,e),Av=!1,Fs=Kt=kv=sa=Or=Fe=0,zt=Rl=null,Am=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-Qt(i),a=1<<r;e|=t[r],i&=~a}return Ti=e,$d(),n}function ZE(t,e){ee=null,Z.H=Vl,e===Xs||e===Id?(e=jS(),ve=3):e===sv?(e=jS(),ve=4):ve=e===xv?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Gt=e,se===null&&(Fe=1,bd(t,pn(e,t.current)))}function KE(){var t=tn.current;return t===null?!0:(le&4194048)===le?gn===null:(le&62914560)===le||(le&536870912)!==0?t===gn:!1}function XE(){var t=Z.H;return Z.H=Vl,t===null?Vl:t}function WE(){var t=Z.A;return Z.A=lM,t}function Cd(){Fe=4,gr||(le&4194048)!==le&&tn.current!==null||(Ws=!0),(Or&134217727)===0&&(sa&134217727)===0||Ee===null||mr(Ee,le,Kt,!1)}function $g(t,e,n){var i=pe;pe|=2;var r=XE(),a=WE();(Ee!==t||le!==e)&&(wd=null,qs(t,e)),e=!1;var s=Fe;e:do try{if(ve!==0&&se!==null){var o=se,l=Gt;switch(ve){case 8:Tv(),s=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(e=!0);var c=ve;if(ve=0,Gt=null,Ts(t,o,l,c),n&&Ws){s=0;break e}break;default:c=ve,ve=0,Gt=null,Ts(t,o,l,c)}}dM(),s=Fe;break}catch(u){ZE(t,u)}while(!0);return e&&t.shellSuspendCounter++,bi=ma=null,pe=i,Z.H=r,Z.A=a,se===null&&(Ee=null,le=0,$d()),s}function dM(){for(;se!==null;)QE(se)}function fM(t,e){var n=pe;pe|=2;var i=XE(),r=WE();Ee!==t||le!==e?(wd=null,Ed=Xt()+500,qs(t,e)):Ws=Zl(t,e);e:do try{if(ve!==0&&se!==null){e=se;var a=Gt;t:switch(ve){case 1:ve=0,Gt=null,Ts(t,e,a,1);break;case 2:case 9:if(FS(a)){ve=0,Gt=null,fx(e);break}e=function(){ve!==2&&ve!==9||Ee!==t||(ve=7),Kn(t)},a.then(e,e);break e;case 3:ve=7;break e;case 4:ve=5;break e;case 7:FS(a)?(ve=0,Gt=null,fx(e)):(ve=0,Gt=null,Ts(t,e,a,7));break;case 5:var s=null;switch(se.tag){case 26:s=se.memoizedState;case 5:case 27:var o=se;if(s?yw(s):o.stateNode.complete){ve=0,Gt=null;var l=o.sibling;if(l!==null)se=l;else{var c=o.return;c!==null?(se=c,Zd(c)):se=null}break t}}ve=0,Gt=null,Ts(t,e,a,5);break;case 6:ve=0,Gt=null,Ts(t,e,a,6);break;case 8:Tv(),Fe=6;break e;default:throw Error(k(462))}}pM();break}catch(u){ZE(t,u)}while(!0);return bi=ma=null,Z.H=i,Z.A=r,pe=n,se!==null?0:(Ee=null,le=0,$d(),Fe)}function pM(){for(;se!==null&&!B2();)QE(se)}function QE(t){var e=CE(t.alternate,t,Ti);t.memoizedProps=t.pendingProps,e===null?Zd(t):se=e}function fx(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=ax(n,e,e.pendingProps,e.type,void 0,le);break;case 11:e=ax(n,e,e.pendingProps,e.type.render,e.ref,le);break;case 5:pv(e);default:AE(n,e),e=se=A1(e,Ti),e=CE(n,e,Ti)}t.memoizedProps=t.pendingProps,e===null?Zd(t):se=e}function Ts(t,e,n,i){bi=ma=null,pv(e),Ds=null,Ul=0;var r=e.return;try{if(tM(t,r,e,n,le)){Fe=1,bd(t,pn(n,t.current)),se=null;return}}catch(a){if(r!==null)throw se=r,a;Fe=1,bd(t,pn(n,t.current)),se=null;return}e.flags&32768?(de||i===1?t=!0:Ws||(le&536870912)!==0?t=!1:(gr=t=!0,(i===2||i===9||i===3||i===6)&&(i=tn.current,i!==null&&i.tag===13&&(i.flags|=16384))),JE(e,t)):Zd(e)}function Zd(t){var e=t;do{if((e.flags&32768)!==0){JE(e,gr);return}t=e.return;var n=rM(e.alternate,e,Ti);if(n!==null){se=n;return}if(e=e.sibling,e!==null){se=e;return}se=e=t}while(e!==null);Fe===0&&(Fe=5)}function JE(t,e){do{var n=aM(t.alternate,t);if(n!==null){n.flags&=32767,se=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){se=t;return}se=t=n}while(t!==null);Fe=6,se=null}function px(t,e,n,i,r,a,s,o,l){t.cancelPendingCommit=null;do Kd();while(nt!==0);if((pe&6)!==0)throw Error(k(327));if(e!==null){if(e===t.current)throw Error(k(177));if(a=e.lanes|e.childLanes,a|=Jm,G2(t,n,a,s,o,l),t===Ee&&(se=Ee=null,le=0),js=e,Er=t,Ei=n,km=a,Tm=r,PE=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,vM(cd,function(){return rw(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Z.T,Z.T=null,r=he.p,he.p=2,s=pe,pe|=4;try{sM(t,e,n)}finally{pe=s,he.p=r,Z.T=i}}nt=1,ew(),tw(),nw()}}function ew(){if(nt===1){nt=0;var t=Er,e=js,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Z.T,Z.T=null;var i=he.p;he.p=2;var r=pe;pe|=4;try{HE(e,t);var a=Dm,s=y1(t.containerInfo),o=a.focusedElem,l=a.selectionRange;if(s!==o&&o&&o.ownerDocument&&v1(o.ownerDocument.documentElement,o)){if(l!==null&&Qm(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var f=o.ownerDocument||document,g=f&&f.defaultView||window;if(g.getSelection){var p=g.getSelection(),y=o.textContent.length,_=Math.min(l.start,y),b=l.end===void 0?_:Math.min(l.end,y);!p.extend&&_>b&&(s=b,b=_,_=s);var d=zS(o,_),h=zS(o,b);if(d&&h&&(p.rangeCount!==1||p.anchorNode!==d.node||p.anchorOffset!==d.offset||p.focusNode!==h.node||p.focusOffset!==h.offset)){var m=f.createRange();m.setStart(d.node,d.offset),p.removeAllRanges(),_>b?(p.addRange(m),p.extend(h.node,h.offset)):(m.setEnd(h.node,h.offset),p.addRange(m))}}}}for(f=[],p=o;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<f.length;o++){var v=f[o];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Dd=!!Nm,Dm=Nm=null}finally{pe=r,he.p=i,Z.T=n}}t.current=e,nt=2}}function tw(){if(nt===2){nt=0;var t=Er,e=js,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Z.T,Z.T=null;var i=he.p;he.p=2;var r=pe;pe|=4;try{NE(t,e.alternate,e)}finally{pe=r,he.p=i,Z.T=n}}nt=3}}function nw(){if(nt===4||nt===3){nt=0,H2();var t=Er,e=js,n=Ei,i=PE;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?nt=5:(nt=0,js=Er=null,iw(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(xr=null),Pm(n),e=e.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Yl,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Z.T,r=he.p,he.p=2,Z.T=null;try{for(var a=t.onRecoverableError,s=0;s<i.length;s++){var o=i[s];a(o.value,{componentStack:o.stack})}}finally{Z.T=e,he.p=r}}(Ei&3)!==0&&Kd(),Kn(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===Rm?Ol++:(Ol=0,Rm=t):Ol=0,tc(0,!1)}}function iw(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Ql(e)))}function Kd(){return ew(),tw(),nw(),rw()}function rw(){if(nt!==5)return!1;var t=Er,e=km;km=0;var n=Pm(Ei),i=Z.T,r=he.p;try{he.p=32>n?32:n,Z.T=null,n=Tm,Tm=null;var a=Er,s=Ei;if(nt=0,js=Er=null,Ei=0,(pe&6)!==0)throw Error(k(331));var o=pe;if(pe|=4,FE(a.current),$E(a,a.current,s,n),pe=o,tc(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Yl,a)}catch{}return!0}finally{he.p=r,Z.T=i,iw(t,e)}}function hx(t,e,n){e=pn(n,e),e=xm(t.stateNode,e,2),t=Sr(t,e,2),t!==null&&(Kl(t,2),Kn(t))}function ye(t,e,n){if(t.tag===3)hx(t,t,n);else for(;e!==null;){if(e.tag===3){hx(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(xr===null||!xr.has(i))){t=pn(n,t),n=_E(2),i=Sr(e,n,2),i!==null&&(bE(n,i,e,t),Kl(i,2),Kn(i));break}}e=e.return}}function Vg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new cM;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(Av=!0,r.add(n),t=hM.bind(null,t,e,n),e.then(t,t))}function hM(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ee===t&&(le&n)===n&&(Fe===4||Fe===3&&(le&62914560)===le&&300>Xt()-Gd?(pe&2)===0&&qs(t,0):kv|=n,Fs===le&&(Fs=0)),Kn(t)}function aw(t,e){e===0&&(e=Xx()),t=ga(t,e),t!==null&&(Kl(t,e),Kn(t))}function gM(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),aw(t,n)}function mM(t,e){var n=0;switch(t.tag){case 31:case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(k(314))}i!==null&&i.delete(e),aw(t,n)}function vM(t,e){return jm(t,e)}var Ad=null,ms=null,Om=!1,kd=!1,Ig=!1,vr=0;function Kn(t){t!==ms&&t.next===null&&(ms===null?Ad=ms=t:ms=ms.next=t),kd=!0,Om||(Om=!0,_M())}function tc(t,e){if(!Ig&&kd){Ig=!0;do for(var n=!1,i=Ad;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else{var s=i.suspendedLanes,o=i.pingedLanes;a=(1<<31-Qt(42|t)+1)-1,a&=r&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gx(i,a))}else a=le,a=zd(i,i===Ee?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(a&3)===0||Zl(i,a)||(n=!0,gx(i,a));i=i.next}while(n);Ig=!1}}function yM(){sw()}function sw(){kd=Om=!1;var t=0;vr!==0&&kM()&&(t=vr);for(var e=Xt(),n=null,i=Ad;i!==null;){var r=i.next,a=ow(i,e);a===0?(i.next=null,n===null?Ad=r:n.next=r,r===null&&(ms=n)):(n=i,(t!==0||(a&3)!==0)&&(kd=!0)),i=r}nt!==0&&nt!==5||tc(t,!1),vr!==0&&(vr=0)}function ow(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var s=31-Qt(a),o=1<<s,l=r[s];l===-1?((o&n)===0||(o&i)!==0)&&(r[s]=P2(o,e)):l<=e&&(t.expiredLanes|=o),a&=~o}if(e=Ee,n=le,n=zd(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(ve===2||ve===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&mg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Zl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&mg(i),Pm(n)){case 2:case 8:n=Zx;break;case 32:n=cd;break;case 268435456:n=Kx;break;default:n=cd}return i=lw.bind(null,t),n=jm(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&mg(i),t.callbackPriority=2,t.callbackNode=null,2}function lw(t,e){if(nt!==0&&nt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Kd()&&t.callbackNode!==n)return null;var i=le;return i=zd(t,t===Ee?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(YE(t,i,e),ow(t,Xt()),t.callbackNode!=null&&t.callbackNode===n?lw.bind(null,t):null)}function gx(t,e){if(Kd())return null;YE(t,e,!0)}function _M(){RM(function(){(pe&6)!==0?jm(Yx,yM):sw()})}function Rv(){if(vr===0){var t=$s;t===0&&(t=Tu,Tu<<=1,(Tu&261888)===0&&(Tu=256)),vr=t}return vr}function mx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Gu(""+t)}function vx(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function bM(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=mx((r[Ht]||null).action),s=i.submitter;s&&(e=(e=s[Ht]||null)?mx(e.formAction):s.getAttribute("formAction"),e!==null&&(a=e,s=null));var o=new Bd("action","action",null,i,r);t.push({event:o,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(vr!==0){var l=s?vx(r,s):new FormData(r);bm(n,{pending:!0,data:l,method:r.method,action:a},null,l)}}else typeof a=="function"&&(o.preventDefault(),l=s?vx(r,s):new FormData(r),bm(n,{pending:!0,data:l,method:r.method,action:a},a,l))},currentTarget:r}]})}}for(Vu=0;Vu<lm.length;Vu++)Iu=lm[Vu],yx=Iu.toLowerCase(),_x=Iu[0].toUpperCase()+Iu.slice(1),Rn(yx,"on"+_x);var Iu,yx,_x,Vu;Rn(b1,"onAnimationEnd");Rn(S1,"onAnimationIteration");Rn(x1,"onAnimationStart");Rn("dblclick","onDoubleClick");Rn("focusin","onFocus");Rn("focusout","onBlur");Rn(UO,"onTransitionRun");Rn($O,"onTransitionStart");Rn(VO,"onTransitionCancel");Rn(E1,"onTransitionEnd");Hs("onMouseEnter",["mouseout","mouseover"]);Hs("onMouseLeave",["mouseout","mouseover"]);Hs("onPointerEnter",["pointerout","pointerover"]);Hs("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Il="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(" "),SM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Il));function cw(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var s=i.length-1;0<=s;s--){var o=i[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){dd(u)}r.currentTarget=null,a=l}else for(s=0;s<i.length;s++){if(o=i[s],l=o.instance,c=o.currentTarget,o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){dd(u)}r.currentTarget=null,a=l}}}}function ae(t,e){var n=e[em];n===void 0&&(n=e[em]=new Set);var i=t+"__bubble";n.has(i)||(uw(e,t,2,!1),n.add(i))}function Fg(t,e,n){var i=0;e&&(i|=4),uw(n,t,i,e)}var Fu="_reactListening"+Math.random().toString(36).slice(2);function Ov(t){if(!t[Fu]){t[Fu]=!0,t1.forEach(function(n){n!=="selectionchange"&&(SM.has(n)||Fg(n,!1,t),Fg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Fu]||(e[Fu]=!0,Fg("selectionchange",!1,e))}}function uw(t,e,n,i){switch(Ew(e)){case 2:var r=KM;break;case 8:r=XM;break;default:r=Lv}n=r.bind(null,e,n,t),r=void 0,!am||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function jg(t,e,n,i,r){var a=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var o=i.stateNode.containerInfo;if(o===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===r)return;s=s.return}for(;o!==null;){if(s=_s(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){i=a=s;continue e}o=o.parentNode}}i=i.return}c1(function(){var c=a,u=Zm(n),f=[];e:{var g=w1.get(t);if(g!==void 0){var p=Bd,y=t;switch(t){case"keypress":if(Zu(n)===0)break e;case"keydown":case"keyup":p=mO;break;case"focusin":y="focus",p=Sg;break;case"focusout":y="blur",p=Sg;break;case"beforeblur":case"afterblur":p=Sg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=AS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=rO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=_O;break;case b1:case S1:case x1:p=oO;break;case E1:p=SO;break;case"scroll":case"scrollend":p=nO;break;case"wheel":p=EO;break;case"copy":case"cut":case"paste":p=cO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=TS;break;case"toggle":case"beforetoggle":p=CO}var _=(e&4)!==0,b=!_&&(t==="scroll"||t==="scrollend"),d=_?g!==null?g+"Capture":null:g;_=[];for(var h=c,m;h!==null;){var v=h;if(m=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||m===null||d===null||(v=Dl(h,d),v!=null&&_.push(Fl(h,v,m))),b)break;h=h.return}0<_.length&&(g=new p(g,y,null,n,u),f.push({event:g,listeners:_}))}}if((e&7)===0){e:{if(g=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",g&&n!==rm&&(y=n.relatedTarget||n.fromElement)&&(_s(y)||y[Ys]))break e;if((p||g)&&(g=u.window===u?u:(g=u.ownerDocument)?g.defaultView||g.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=c,y=y?_s(y):null,y!==null&&(b=Gl(y),_=y.tag,y!==b||_!==5&&_!==27&&_!==6)&&(y=null)):(p=null,y=c),p!==y)){if(_=AS,v="onMouseLeave",d="onMouseEnter",h="mouse",(t==="pointerout"||t==="pointerover")&&(_=TS,v="onPointerLeave",d="onPointerEnter",h="pointer"),b=p==null?g:ml(p),m=y==null?g:ml(y),g=new _(v,h+"leave",p,n,u),g.target=b,g.relatedTarget=m,v=null,_s(u)===c&&(_=new _(d,h+"enter",y,n,u),_.target=m,_.relatedTarget=b,v=_),b=v,p&&y)t:{for(_=xM,d=p,h=y,m=0,v=d;v;v=_(v))m++;v=0;for(var S=h;S;S=_(S))v++;for(;0<m-v;)d=_(d),m--;for(;0<v-m;)h=_(h),v--;for(;m--;){if(d===h||h!==null&&d===h.alternate){_=d;break t}d=_(d),h=_(h)}_=null}else _=null;p!==null&&bx(f,g,p,_,!1),y!==null&&b!==null&&bx(f,b,y,_,!0)}}e:{if(g=c?ml(c):window,p=g.nodeName&&g.nodeName.toLowerCase(),p==="select"||p==="input"&&g.type==="file")var w=NS;else if(MS(g))if(g1)w=zO;else{w=DO;var E=NO}else p=g.nodeName,!p||p.toLowerCase()!=="input"||g.type!=="checkbox"&&g.type!=="radio"?c&&Ym(c.elementType)&&(w=NS):w=LO;if(w&&(w=w(t,c))){h1(f,w,n,u);break e}E&&E(t,g,c),t==="focusout"&&c&&g.type==="number"&&c.memoizedProps.value!=null&&im(g,"number",g.value)}switch(E=c?ml(c):window,t){case"focusin":(MS(E)||E.contentEditable==="true")&&(xs=E,sm=c,Sl=null);break;case"focusout":Sl=sm=xs=null;break;case"mousedown":om=!0;break;case"contextmenu":case"mouseup":case"dragend":om=!1,BS(f,n,u);break;case"selectionchange":if(HO)break;case"keydown":case"keyup":BS(f,n,u)}var C;if(Wm)e:{switch(t){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Ss?f1(t,n)&&(O="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(d1&&n.locale!=="ko"&&(Ss||O!=="onCompositionStart"?O==="onCompositionEnd"&&Ss&&(C=u1()):(hr=u,Km="value"in hr?hr.value:hr.textContent,Ss=!0)),E=Td(c,O),0<E.length&&(O=new kS(O,t,null,n,u),f.push({event:O,listeners:E}),C?O.data=C:(C=p1(n),C!==null&&(O.data=C)))),(C=kO?TO(t,n):RO(t,n))&&(O=Td(c,"onBeforeInput"),0<O.length&&(E=new kS("onBeforeInput","beforeinput",null,n,u),f.push({event:E,listeners:O}),E.data=C)),bM(f,t,c,n,u)}cw(f,e)})}function Fl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Td(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=Dl(t,n),r!=null&&i.unshift(Fl(t,r,a)),r=Dl(t,e),r!=null&&i.push(Fl(t,r,a))),t.tag===3)return i;t=t.return}return[]}function xM(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function bx(t,e,n,i,r){for(var a=e._reactName,s=[];n!==null&&n!==i;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===i)break;o!==5&&o!==26&&o!==27||c===null||(l=c,r?(c=Dl(n,a),c!=null&&s.unshift(Fl(n,c,l))):r||(c=Dl(n,a),c!=null&&s.push(Fl(n,c,l)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var EM=/\r\n?/g,wM=/\u0000|\uFFFD/g;function Sx(t){return(typeof t=="string"?t:""+t).replace(EM,`
|
|
9
|
+
`).replace(wM,"")}function dw(t,e){return e=Sx(e),Sx(t)===e}function be(t,e,n,i,r,a){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Us(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Us(t,""+i);break;case"className":Mu(t,"class",i);break;case"tabIndex":Mu(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Mu(t,n,i);break;case"style":l1(t,i,a);break;case"data":if(e!=="object"){Mu(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Gu(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"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 a=="function"&&(n==="formAction"?(e!=="input"&&be(t,e,"name",r.name,r,null),be(t,e,"formEncType",r.formEncType,r,null),be(t,e,"formMethod",r.formMethod,r,null),be(t,e,"formTarget",r.formTarget,r,null)):(be(t,e,"encType",r.encType,r,null),be(t,e,"method",r.method,r,null),be(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Gu(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=_i);break;case"onScroll":i!=null&&ae("scroll",t);break;case"onScrollEnd":i!=null&&ae("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(k(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(k(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Gu(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);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":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":ae("beforetoggle",t),ae("toggle",t),Pu(t,"popover",i);break;case"xlinkActuate":di(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":di(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":di(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":di(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":di(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":di(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":di(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":di(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":di(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Pu(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=eO.get(n)||n,Pu(t,n,i))}}function Mm(t,e,n,i,r,a){switch(n){case"style":l1(t,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(k(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(k(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Us(t,i):(typeof i=="number"||typeof i=="bigint")&&Us(t,""+i);break;case"onScroll":i!=null&&ae("scroll",t);break;case"onScrollEnd":i!=null&&ae("scrollend",t);break;case"onClick":i!=null&&(t.onclick=_i);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!n1.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Ht]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Pu(t,n,i)}}}function mt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ae("error",t),ae("load",t);var i=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(k(137,e));default:be(t,e,a,s,n,null)}}r&&be(t,e,"srcSet",n.srcSet,n,null),i&&be(t,e,"src",n.src,n,null);return;case"input":ae("invalid",t);var o=a=s=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":s=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":a=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(k(137,e));break;default:be(t,e,i,u,n,null)}}a1(t,a,o,l,c,s,r,!1);return;case"select":ae("invalid",t),i=s=a=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":a=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:be(t,e,r,o,n,null)}e=a,n=s,t.multiple=!!i,e!=null?Os(t,!!i,e,!1):n!=null&&Os(t,!!i,n,!0);return;case"textarea":ae("invalid",t),a=r=i=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":i=o;break;case"defaultValue":r=o;break;case"children":a=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(k(91));break;default:be(t,e,s,o,n,null)}o1(t,i,r,a);return;case"option":for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null)&&(l==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":be(t,e,l,i,n,null));return;case"dialog":ae("beforetoggle",t),ae("toggle",t),ae("cancel",t),ae("close",t);break;case"iframe":case"object":ae("load",t);break;case"video":case"audio":for(i=0;i<Il.length;i++)ae(Il[i],t);break;case"image":ae("error",t),ae("load",t);break;case"details":ae("toggle",t);break;case"embed":case"source":case"link":ae("error",t),ae("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(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(k(137,e));default:be(t,e,c,i,n,null)}return;default:if(Ym(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Mm(t,e,u,i,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(i=n[o],i!=null&&be(t,e,o,i,n,null))}function CM(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,s=null,o=null,l=null,c=null,u=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":l=f;default:i.hasOwnProperty(p)||be(t,e,p,null,i,f)}}for(var g in i){var p=i[g];if(f=n[g],i.hasOwnProperty(g)&&(p!=null||f!=null))switch(g){case"type":a=p;break;case"name":r=p;break;case"checked":c=p;break;case"defaultChecked":u=p;break;case"value":s=p;break;case"defaultValue":o=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(k(137,e));break;default:p!==f&&be(t,e,g,p,i,f)}}nm(t,s,o,l,c,u,a,r);return;case"select":p=s=o=g=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":p=l;default:i.hasOwnProperty(a)||be(t,e,a,null,i,l)}for(r in i)if(a=i[r],l=n[r],i.hasOwnProperty(r)&&(a!=null||l!=null))switch(r){case"value":g=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:a!==l&&be(t,e,r,a,i,l)}e=o,n=s,i=p,g!=null?Os(t,!!n,g,!1):!!i!=!!n&&(e!=null?Os(t,!!n,e,!0):Os(t,!!n,n?[]:"",!1));return;case"textarea":p=g=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!i.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:be(t,e,o,null,i,r)}for(s in i)if(r=i[s],a=n[s],i.hasOwnProperty(s)&&(r!=null||a!=null))switch(s){case"value":g=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(k(91));break;default:r!==a&&be(t,e,s,r,i,a)}s1(t,g,p);return;case"option":for(var y in n)g=n[y],n.hasOwnProperty(y)&&g!=null&&!i.hasOwnProperty(y)&&(y==="selected"?t.selected=!1:be(t,e,y,null,i,g));for(l in i)g=i[l],p=n[l],i.hasOwnProperty(l)&&g!==p&&(g!=null||p!=null)&&(l==="selected"?t.selected=g&&typeof g!="function"&&typeof g!="symbol":be(t,e,l,g,i,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 _ in n)g=n[_],n.hasOwnProperty(_)&&g!=null&&!i.hasOwnProperty(_)&&be(t,e,_,null,i,g);for(c in i)if(g=i[c],p=n[c],i.hasOwnProperty(c)&&g!==p&&(g!=null||p!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(k(137,e));break;default:be(t,e,c,g,i,p)}return;default:if(Ym(e)){for(var b in n)g=n[b],n.hasOwnProperty(b)&&g!==void 0&&!i.hasOwnProperty(b)&&Mm(t,e,b,void 0,i,g);for(u in i)g=i[u],p=n[u],!i.hasOwnProperty(u)||g===p||g===void 0&&p===void 0||Mm(t,e,u,g,i,p);return}}for(var d in n)g=n[d],n.hasOwnProperty(d)&&g!=null&&!i.hasOwnProperty(d)&&be(t,e,d,null,i,g);for(f in i)g=i[f],p=n[f],!i.hasOwnProperty(f)||g===p||g==null&&p==null||be(t,e,f,g,i,p)}function xx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AM(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],a=r.transferSize,s=r.initiatorType,o=r.duration;if(a&&o&&xx(s)){for(s=0,o=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>o)break;var u=l.transferSize,f=l.initiatorType;u&&xx(f)&&(l=l.responseEnd,s+=u*(l<o?1:(o-c)/(l-c)))}if(--i,e+=8*(a+s)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Nm=null,Dm=null;function Rd(t){return t.nodeType===9?t:t.ownerDocument}function Ex(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 fw(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 Lm(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 qg=null;function kM(){var t=window.event;return t&&t.type==="popstate"?t===qg?!1:(qg=t,!0):(qg=null,!1)}var pw=typeof setTimeout=="function"?setTimeout:void 0,TM=typeof clearTimeout=="function"?clearTimeout:void 0,wx=typeof Promise=="function"?Promise:void 0,RM=typeof queueMicrotask=="function"?queueMicrotask:typeof wx<"u"?function(t){return wx.resolve(null).then(t).catch(OM)}:pw;function OM(t){setTimeout(function(){throw t})}function Nr(t){return t==="head"}function Cx(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){t.removeChild(r),Gs(e);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Ml(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Ml(n);for(var a=n.firstChild;a;){var s=a.nextSibling,o=a.nodeName;a[Xl]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=s}}else n==="body"&&Ml(t.ownerDocument.body);n=r}while(n);Gs(e)}function Ax(t,e){var n=t;t=0;do{var i=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=i}while(n)}function zm(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":zm(n),Gm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function MM(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Xl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=mn(t.nextSibling),t===null)break}return null}function NM(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=mn(t.nextSibling),t===null))return null;return t}function hw(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=mn(t.nextSibling),t===null))return null;return t}function Bm(t){return t.data==="$?"||t.data==="$~"}function Hm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function DM(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function mn(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 Um=null;function kx(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return mn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function Tx(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function gw(t,e,n){switch(e=Rd(n),t){case"html":if(t=e.documentElement,!t)throw Error(k(452));return t;case"head":if(t=e.head,!t)throw Error(k(453));return t;case"body":if(t=e.body,!t)throw Error(k(454));return t;default:throw Error(k(451))}}function Ml(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Gm(t)}var vn=new Map,Rx=new Set;function Od(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ri=he.d;he.d={f:LM,r:zM,D:BM,C:HM,L:UM,m:$M,X:IM,S:VM,M:FM};function LM(){var t=Ri.f(),e=Yd();return t||e}function zM(t){var e=Zs(t);e!==null&&e.tag===5&&e.type==="form"?lE(e):Ri.r(t)}var Qs=typeof document>"u"?null:document;function mw(t,e,n){var i=Qs;if(i&&typeof e=="string"&&e){var r=fn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Rx.has(r)||(Rx.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),mt(e,"link",t),st(e),i.head.appendChild(e)))}}function BM(t){Ri.D(t),mw("dns-prefetch",t,null)}function HM(t,e){Ri.C(t,e),mw("preconnect",t,e)}function UM(t,e,n){Ri.L(t,e,n);var i=Qs;if(i&&t&&e){var r='link[rel="preload"][as="'+fn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+fn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+fn(n.imageSizes)+'"]')):r+='[href="'+fn(t)+'"]';var a=r;switch(e){case"style":a=Ps(t);break;case"script":a=Js(t)}vn.has(a)||(t=De({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),vn.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(nc(a))||e==="script"&&i.querySelector(ic(a))||(e=i.createElement("link"),mt(e,"link",t),st(e),i.head.appendChild(e)))}}function $M(t,e){Ri.m(t,e);var n=Qs;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+fn(i)+'"][href="'+fn(t)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Js(t)}if(!vn.has(a)&&(t=De({rel:"modulepreload",href:t},e),vn.set(a,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ic(a)))return}i=n.createElement("link"),mt(i,"link",t),st(i),n.head.appendChild(i)}}}function VM(t,e,n){Ri.S(t,e,n);var i=Qs;if(i&&t){var r=Rs(i).hoistableStyles,a=Ps(t);e=e||"default";var s=r.get(a);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(nc(a)))o.loading=5;else{t=De({rel:"stylesheet",href:t,"data-precedence":e},n),(n=vn.get(a))&&Mv(t,n);var l=s=i.createElement("link");st(l),mt(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,nd(s,e,i)}s={type:"stylesheet",instance:s,count:1,state:o},r.set(a,s)}}}function IM(t,e){Ri.X(t,e);var n=Qs;if(n&&t){var i=Rs(n).hoistableScripts,r=Js(t),a=i.get(r);a||(a=n.querySelector(ic(r)),a||(t=De({src:t,async:!0},e),(e=vn.get(r))&&Nv(t,e),a=n.createElement("script"),st(a),mt(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function FM(t,e){Ri.M(t,e);var n=Qs;if(n&&t){var i=Rs(n).hoistableScripts,r=Js(t),a=i.get(r);a||(a=n.querySelector(ic(r)),a||(t=De({src:t,async:!0,type:"module"},e),(e=vn.get(r))&&Nv(t,e),a=n.createElement("script"),st(a),mt(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function Ox(t,e,n,i){var r=(r=yr.current)?Od(r):null;if(!r)throw Error(k(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Ps(n.href),n=Rs(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Ps(n.href);var a=Rs(r).hoistableStyles,s=a.get(t);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,s),(a=r.querySelector(nc(t)))&&!a._p&&(s.instance=a,s.state.loading=5),vn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vn.set(t,n),a||jM(r,t,n,s.state))),e&&i===null)throw Error(k(528,""));return s}if(e&&i!==null)throw Error(k(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Js(n),n=Rs(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(k(444,t))}}function Ps(t){return'href="'+fn(t)+'"'}function nc(t){return'link[rel="stylesheet"]['+t+"]"}function vw(t){return De({},t,{"data-precedence":t.precedence,precedence:null})}function jM(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),mt(e,"link",n),st(e),t.head.appendChild(e))}function Js(t){return'[src="'+fn(t)+'"]'}function ic(t){return"script[async]"+t}function Mx(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+fn(n.href)+'"]');if(i)return e.instance=i,st(i),i;var r=De({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),st(i),mt(i,"style",r),nd(i,n.precedence,t),e.instance=i;case"stylesheet":r=Ps(n.href);var a=t.querySelector(nc(r));if(a)return e.state.loading|=4,e.instance=a,st(a),a;i=vw(n),(r=vn.get(r))&&Mv(i,r),a=(t.ownerDocument||t).createElement("link"),st(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),mt(a,"link",i),e.state.loading|=4,nd(a,n.precedence,t),e.instance=a;case"script":return a=Js(n.src),(r=t.querySelector(ic(a)))?(e.instance=r,st(r),r):(i=n,(r=vn.get(a))&&(i=De({},n),Nv(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),st(r),mt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(k(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,nd(i,n.precedence,t));return e.instance}function nd(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,s=0;s<i.length;s++){var o=i[s];if(o.dataset.precedence===e)a=o;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Mv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Nv(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var id=null;function Nx(t,e,n){if(id===null){var i=new Map,r=id=new Map;r.set(n,i)}else r=id,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[Xl]||a[pt]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(e)||"";s=t+s;var o=i.get(s);o?o.push(a):i.set(s,[a])}}return i}function Dx(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function qM(t,e,n){if(n===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 yw(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function PM(t,e,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Ps(i.href),a=e.querySelector(nc(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Md.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=a,st(a);return}a=e.ownerDocument||e,i=vw(i),(r=vn.get(r))&&Mv(i,r),a=a.createElement("link"),st(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),mt(a,"link",i),n.instance=a}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Md.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Pg=0;function GM(t,e){return t.stylesheets&&t.count===0&&rd(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var i=setTimeout(function(){if(t.stylesheets&&rd(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}},6e4+e);0<t.imgBytes&&Pg===0&&(Pg=62500*AM());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&rd(t,t.stylesheets),t.unsuspend)){var a=t.unsuspend;t.unsuspend=null,a()}},(t.imgBytes>Pg?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function Md(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rd(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Nd=null;function rd(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Nd=new Map,e.forEach(YM,t),Nd=null,Md.call(t))}function YM(t,e){if(!(e.state.loading&4)){var n=Nd.get(t);if(n)var i=n.get(null);else{n=new Map,Nd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var s=r[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}r=e.instance,s=r.getAttribute("data-precedence"),a=n.get(s)||i,a===i&&n.set(null,r),n.set(s,r),this.count++,i=Md.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var jl={$$typeof:yi,Provider:null,Consumer:null,_currentValue:na,_currentValue2:na,_threadCount:0};function ZM(t,e,n,i,r,a,s,o,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=vg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vg(0),this.hiddenUpdates=vg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function _w(t,e,n,i,r,a,s,o,l,c,u,f){return t=new ZM(t,e,n,s,l,c,u,f,o),e=1,a===!0&&(e|=24),a=Zt(3,null,null,e),t.current=a,a.stateNode=t,e=rv(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},ov(a),t}function bw(t){return t?(t=Cs,t):Cs}function Sw(t,e,n,i,r,a){r=bw(r),i.context===null?i.context=r:i.pendingContext=r,i=br(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=Sr(t,i,e),n!==null&&(Bt(n,t,e),El(n,t,e))}function Lx(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Dv(t,e){Lx(t,e),(t=t.alternate)&&Lx(t,e)}function xw(t){if(t.tag===13||t.tag===31){var e=ga(t,67108864);e!==null&&Bt(e,t,67108864),Dv(t,67108864)}}function zx(t){if(t.tag===13||t.tag===31){var e=Jt();e=qm(e);var n=ga(t,e);n!==null&&Bt(n,t,e),Dv(t,e)}}var Dd=!0;function KM(t,e,n,i){var r=Z.T;Z.T=null;var a=he.p;try{he.p=2,Lv(t,e,n,i)}finally{he.p=a,Z.T=r}}function XM(t,e,n,i){var r=Z.T;Z.T=null;var a=he.p;try{he.p=8,Lv(t,e,n,i)}finally{he.p=a,Z.T=r}}function Lv(t,e,n,i){if(Dd){var r=$m(i);if(r===null)jg(t,e,i,Ld,n),Bx(t,i);else if(QM(r,t,e,n,i))i.stopPropagation();else if(Bx(t,i),e&4&&-1<WM.indexOf(t)){for(;r!==null;){var a=Zs(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=Jr(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-Qt(s);o.entanglements[1]|=l,s&=~l}Kn(a),(pe&6)===0&&(Ed=Xt()+500,tc(0,!1))}}break;case 31:case 13:o=ga(a,2),o!==null&&Bt(o,a,2),Yd(),Dv(a,2)}if(a=$m(i),a===null&&jg(t,e,i,Ld,n),a===r)break;r=a}r!==null&&i.stopPropagation()}else jg(t,e,i,null,n)}}function $m(t){return t=Zm(t),zv(t)}var Ld=null;function zv(t){if(Ld=null,t=_s(t),t!==null){var e=Gl(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=Fx(e),t!==null)return t;t=null}else if(n===31){if(t=jx(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Ld=t,null}function Ew(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(U2()){case Yx:return 2;case Zx:return 8;case cd:case $2:return 32;case Kx:return 268435456;default:return 32}default:return 32}}var Vm=!1,wr=null,Cr=null,Ar=null,ql=new Map,Pl=new Map,fr=[],WM="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 Bx(t,e){switch(t){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":Cr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":ql.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(e.pointerId)}}function fl(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=Zs(e),e!==null&&xw(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function QM(t,e,n,i,r){switch(e){case"focusin":return wr=fl(wr,t,e,n,i,r),!0;case"dragenter":return Cr=fl(Cr,t,e,n,i,r),!0;case"mouseover":return Ar=fl(Ar,t,e,n,i,r),!0;case"pointerover":var a=r.pointerId;return ql.set(a,fl(ql.get(a)||null,t,e,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,Pl.set(a,fl(Pl.get(a)||null,t,e,n,i,r)),!0}return!1}function ww(t){var e=_s(t.target);if(e!==null){var n=Gl(e);if(n!==null){if(e=n.tag,e===13){if(e=Fx(n),e!==null){t.blockedOn=e,_S(t.priority,function(){zx(n)});return}}else if(e===31){if(e=jx(n),e!==null){t.blockedOn=e,_S(t.priority,function(){zx(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ad(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=$m(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);rm=i,n.target.dispatchEvent(i),rm=null}else return e=Zs(n),e!==null&&xw(e),t.blockedOn=n,!1;e.shift()}return!0}function Hx(t,e,n){ad(t)&&n.delete(e)}function JM(){Vm=!1,wr!==null&&ad(wr)&&(wr=null),Cr!==null&&ad(Cr)&&(Cr=null),Ar!==null&&ad(Ar)&&(Ar=null),ql.forEach(Hx),Pl.forEach(Hx)}function ju(t,e){t.blockedOn===e&&(t.blockedOn=null,Vm||(Vm=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,JM)))}var qu=null;function Ux(t){qu!==t&&(qu=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){qu===t&&(qu=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(zv(i||n)===null)continue;break}var a=Zs(n);a!==null&&(t.splice(e,3),e-=3,bm(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Gs(t){function e(l){return ju(l,t)}wr!==null&&ju(wr,t),Cr!==null&&ju(Cr,t),Ar!==null&&ju(Ar,t),ql.forEach(e),Pl.forEach(e);for(var n=0;n<fr.length;n++){var i=fr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<fr.length&&(n=fr[0],n.blockedOn===null);)ww(n),n.blockedOn===null&&fr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],s=r[Ht]||null;if(typeof a=="function")s||Ux(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[Ht]||null)o=s.formAction;else if(zv(r)!==null)continue}else o=s.action;typeof o=="function"?n[i+1]=o:(n.splice(i,3),i-=3),Ux(n)}}}function Cw(){function t(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(s){return r=s})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function Bv(t){this._internalRoot=t}Xd.prototype.render=Bv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(k(409));var n=e.current,i=Jt();Sw(n,i,t,e,null,null)};Xd.prototype.unmount=Bv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Sw(t.current,2,null,t,null,null),Yd(),e[Ys]=null}};function Xd(t){this._internalRoot=t}Xd.prototype.unstable_scheduleHydration=function(t){if(t){var e=e1();t={blockedOn:null,target:t,priority:e};for(var n=0;n<fr.length&&e!==0&&e<fr[n].priority;n++);fr.splice(n,0,t),n===0&&ww(t)}};var $x=Vx.version;if($x!=="19.2.4")throw Error(k(527,$x,"19.2.4"));he.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(k(188)):(t=Object.keys(t).join(","),Error(k(268,t)));return t=M2(e),t=t!==null?qx(t):null,t=t===null?null:t.stateNode,t};var eN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(pl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!pl.isDisabled&&pl.supportsFiber))try{Yl=pl.inject(eN),Wt=pl}catch{}var pl;Wd.createRoot=function(t,e){if(!Ix(t))throw Error(k(299));var n=!1,i="",r=mE,a=vE,s=yE;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=_w(t,1,!1,null,null,n,i,null,r,a,s,Cw),t[Ys]=e.current,Ov(t),new Bv(e)};Wd.hydrateRoot=function(t,e,n){if(!Ix(t))throw Error(k(299));var i=!1,r="",a=mE,s=vE,o=yE,l=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=_w(t,1,!0,e,n??null,i,r,l,a,s,o,Cw),e.context=bw(null),n=e.current,i=Jt(),i=qm(i),r=br(i),r.callback=null,Sr(n,r,i),n=i,e.current.lanes=n,Kl(e,n),Kn(e),t[Ys]=e.current,Ov(t),new Xd(e)};Wd.version="19.2.4"});var Rw=Ln((az,Tw)=>{"use strict";function kw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kw)}catch(t){console.error(t)}}kw(),Tw.exports=Aw()});var Lf="2.1.0-canary.10";var ji="2.0";function go(t){let e=t.split(".");return{major:parseInt(e[0]||"0",10),minor:parseInt(e[1]||"0",10)}}function C4(t){let e=[],n=[];if(!t||typeof t!="object")return{valid:!1,errors:["Config must be an object"],warnings:e};let i=t;if(i.tiles||n.push("Config missing required field: tiles"),i.actions||n.push("Config missing required field: actions"),i.fetchedAt||n.push("Config missing required field: fetchedAt"),n.length>0)return{valid:!1,errors:n,warnings:e};let r=i.schemaVersion||"1.0",a=go(r),s=go(ji);return a.major>s.major&&e.push(`Config schema v${r} is newer than SDK v${ji}. Some features may not work. Update SDK to latest version.`),a.major<s.major||!i.schemaVersion?(e.push(`Config schema v${r} is older than SDK v${ji}. Migrating config to current version.`),{valid:!0,warnings:e,errors:n,migratedConfig:IA(i,r)}):{valid:!0,warnings:e,errors:n}}function IA(t,e){let n={...t};return go(e).major===1&&(n=FA(n)),n.schemaVersion=ji,n}function FA(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(n=>{let i={...n};if(n.experiment&&!n.activation){let r=n.experiment;r.featureKey&&(i.activation={strategy:{type:"external",provider:"growthbook",featureKey:r.featureKey,fallback:!1}}),delete i.experiment}return i})),t.configVersion&&(e.configVersion=t.configVersion),t.canvasTitle&&(e.canvasTitle=t.canvasTitle),t.theme&&(e.theme=t.theme),t.launcher&&(e.launcher=t.launcher),t.routes&&(e.routes=t.routes),e}function A4(t){if(!t||typeof t!="object")return!1;let e=t,n=e.schemaVersion||"1.0",i=go(n),r=go(ji);return i.major<r.major||!e.schemaVersion}var A=typeof window<"u"?window:void 0,ut=typeof globalThis<"u"?globalThis:A;typeof self>"u"&&(ut.self=ut),typeof File>"u"&&(ut.File=function(){});var z0=Array.prototype,Vy=z0.forEach,Iy=z0.indexOf,jt=ut?.navigator,L=ut?.document,Tt=ut?.location,Xf=ut?.fetch,Wf=ut!=null&&ut.XMLHttpRequest&&"withCredentials"in new ut.XMLHttpRequest?ut.XMLHttpRequest:void 0,Fy=ut?.AbortController,kt=jt?.userAgent,K=A??{},ti={DEBUG:!1,LIB_VERSION:"1.302.2"};function jy(t,e,n,i,r,a,s){try{var o=t[a](s),l=o.value}catch(c){return void n(c)}o.done?e(l):Promise.resolve(l).then(i,r)}function qy(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function s(l){jy(a,i,r,s,o,"next",l)}function o(l){jy(a,i,r,s,o,"throw",l)}s(void 0)}))}}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},H.apply(null,arguments)}function B0(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var jA=["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"],Py=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return jA.concat(e).some((i=>{var r=i.toLowerCase();return n.indexOf(r)!==-1}))},qA=["$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 re(t,e){return t.indexOf(e)!==-1}var Wc=function(t){return t.trim()},Qf=function(t){return t.replace(/^\$/,"")},PA=Array.isArray,H0=Object.prototype,U0=H0.hasOwnProperty,Qc=H0.toString,xe=PA||function(t){return Qc.call(t)==="[object Array]"},Ki=t=>typeof t=="function",rt=t=>t===Object(t)&&!xe(t),ja=t=>{if(rt(t)){for(var e in t)if(U0.call(t,e))return!1;return!0}return!1},D=t=>t===void 0,Je=t=>Qc.call(t)=="[object String]",Jf=t=>Je(t)&&t.trim().length===0,ai=t=>t===null,_e=t=>D(t)||ai(t),$n=t=>Qc.call(t)=="[object Number]",Xi=t=>Qc.call(t)==="[object Boolean]",GA=t=>t instanceof FormData,YA=t=>re(qA,t);function ep(t){return t===null||typeof t!="object"}function Oc(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function $0(t){return!D(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var ZA=[!0,"true",1,"1","yes"],zf=t=>re(ZA,t),KA=[!1,"false",0,"0","no"];function Bn(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),$n(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),Bn(r||n,e,n,i))}var tp=class{constructor(e){this.t={},this.i=e.i,this.o=Bn(e.bucketSize,0,100,e.h),this.m=Bn(e.refillRate,0,this.o,e.h),this.S=Bn(e.refillInterval,0,864e5,e.h)}$(e,n){var i=n-e.lastAccess,r=Math.floor(i/this.S);if(r>0){var a=r*this.m;e.tokens=Math.min(e.tokens+a,this.o),e.lastAccess=e.lastAccess+r*this.S}}consumeRateLimit(e){var n,i=Date.now(),r=String(e),a=this.t[r];return a?this.$(a,i):(a={tokens:this.o,lastAccess:i},this.t[r]=a),a.tokens===0||(a.tokens--,a.tokens===0&&((n=this.i)==null||n.call(this,e)),a.tokens===0)}stop(){this.t={}}},bc,Gy,Bf,XA=t=>t instanceof Error;function WA(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Bf&&n.length===Gy||(Gy=n.length,Bf=n.reduce(((i,r)=>{bc||(bc={});var a=bc[r];if(a)i[a[0]]=a[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var l=s[o],c=l?.filename,u=e[r];if(c&&u){i[c]=u,bc[r]=[c,u];break}}return i}),{})),Bf}}var np=class{constructor(e,n,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n){n===void 0&&(n={});var i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),a=this.buildParsingContext(),s=this.parseStacktrace(r,a);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(e){var n=this;return qy((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&xe(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),H({},e,{cause:i,stack:r})}applyChunkIds(e,n){return e.map((i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i)))}applyCoercers(e,n){for(var i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return qy((function*(){var i=e;for(var r of n.modifiers)i=yield r(i);return i}))()}convertToExceptionList(e,n){var i,r,a,s={type:e.type,value:e.value,mechanism:{type:(i=n.type)!==null&&i!==void 0?i:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(a=e.synthetic)!==null&&a!==void 0&&a}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,H({},n,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:WA(this.stackParser)}}buildCoercingContext(e,n,i){i===void 0&&(i=0);var r=(a,s)=>{if(s<=4){var o=this.buildCoercingContext(e,n,s);return this.applyCoercers(a,o)}};return H({},n,{syntheticException:i==0?n.syntheticException:void 0,mechanism:e,apply:a=>r(a,i),next:a=>r(a,i+1)})}},Ya="?";function ip(t,e,n,i,r){var a={platform:t,filename:e,function:n==="<anonymous>"?Ya:n,in_app:!0};return D(i)||(a.lineno=i),D(r)||(a.colno=r),a}var V0=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:Ya,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},QA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,JA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ek=/\((\S*)(?::(\d+))(?::(\d+))\)/,tk=(t,e)=>{var n=QA.exec(t);if(n){var[,i,r,a]=n;return ip(e,i,Ya,+r,+a)}var s=JA.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var o=ek.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}var[l,c]=V0(s[1]||Ya,s[2]);return ip(e,c,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},nk=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ik=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rk=(t,e)=>{var n=nk.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=ik.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],a=n[1]||Ya;return[a,r]=V0(a,r),ip(e,r,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Yy=/\(error: (.*)\)/,Zy=50;function ak(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(r,a){a===void 0&&(a=0);for(var s=[],o=r.split(`
|
|
10
|
+
`),l=a;l<o.length;l++){var c=o[l];if(!(c.length>1024)){var u=Yy.test(c)?c.replace(Yy,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of n){var g=f(u,t);if(g){s.push(g);break}}if(s.length>=Zy)break}}}return(function(p){if(!p.length)return[];var y=Array.from(p);return y.reverse(),y.slice(0,Zy).map((_=>{return H({},_,{filename:_.filename||(b=y,b[b.length-1]||{}).filename,function:_.function||Ya});var b}))})(s)}}var rp=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var i=Je(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Oc(e,"DOMException")}isDOMError(e){return Oc(e,"DOMError")}},ap=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}},sp=class{constructor(){}match(e){return Oc(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var i,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},sk=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,op=class{match(e){return typeof e=="string"}coerce(e,n){var i,[r,a]=this.getInfos(e);return{type:r??"Error",value:a??e,stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var n="Error",i=e,r=e.match(sk);return r&&(n=r[1],i=r[2]),[n,i]}},ok=["fatal","error","warning","log","info","debug"];function I0(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>e))return i===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}var lp=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return $0(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+I0(e)}isSeverityLevel(e){return Je(e)&&!Jf(e)&&ok.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=e[n];if(XA(i))return i}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},cp=class{match(e){return $0(e)}coerce(e,n){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+I0(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},up=class{match(e){return ep(e)}coerce(e,n){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}}},dp=class{match(e){return Oc(e,"PromiseRejectionEvent")}coerce(e,n){var i,r=this.getUnhandledRejectionReason(e);return ep(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=n.syntheticException)==null?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(ep(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}},F0=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,i={k:function(r){if(A&&(ti.DEBUG||K.POSTHOG_DEBUG||n)&&!D(A.console)&&A.console){for(var a=("__rrweb_original__"in A.console[r])?A.console[r].__rrweb_original__:A.console[r],s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];a(t,...o)}},info:function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];i.k("log",...a)},warn:function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];i.k("warn",...a)},error:function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];i.k("error",...a)},critical:function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];console.error(t,...a)},uninitializedWarning:r=>{i.error("You must initialize PostHog before calling "+r)},createLogger:(r,a)=>F0(t+" "+r,a)};return i},z=F0("[PostHog.js]"),et=z.createLogger,lk=et("[ExternalScriptsLoader]"),Ky=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return lk.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=L?.querySelectorAll("script");if(i){for(var r,a=function(){if(i[s].src===e){var l=i[s];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},s=0;s<i.length;s++)if(r=a())return r.v}var o=()=>{if(!L)return n("document not found");var l=L.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=L.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):L.body.appendChild(l)};L!=null&&L.body?o():L?.addEventListener("DOMContentLoaded",o)};K.__PosthogExtensions__=K.__PosthogExtensions__||{},K.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var i="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(i="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var a=t.requestRouter.endpointFor("assets",i);Ky(t,a,n)},K.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var i=t.requestRouter.endpointFor("api",e);Ky(t,i,n)};var Mc={};function Wi(t,e,n){if(xe(t)){if(Vy&&t.forEach===Vy)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var i=0,r=t.length;i<r;i++)if(i in t&&e.call(n,t[i],i)===Mc)return}}}function we(t,e,n){if(!_e(t)){if(xe(t))return Wi(t,e,n);if(GA(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===Mc)return}else for(var r in t)if(U0.call(t,r)&&e.call(n,t[r],r)===Mc)return}}var je=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Wi(n,(function(r){for(var a in r)r[a]!==void 0&&(t[a]=r[a])})),t},Xa=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Wi(n,(function(r){Wi(r,(function(a){t.push(a)}))})),t};function kc(t){for(var e=Object.keys(t),n=e.length,i=new Array(n);n--;)i[n]=[e[n],t[e[n]]];return i}var Xy=function(t){try{return t()}catch{return}},ck=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(this,n)}catch(r){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(r)}}},sh=function(t){var e={};return we(t,(function(n,i){(Je(n)&&n.length>0||$n(n))&&(e[i]=n)})),e};function uk(t,e){return n=t,i=a=>Je(a)&&!ai(e)?a.slice(0,e):a,r=new Set,(function a(s,o){return s!==Object(s)?i?i(s,o):s:r.has(s)?void 0:(r.add(s),xe(s)?(l=[],Wi(s,(c=>{l.push(a(c))}))):(l={},we(s,((c,u)=>{r.has(c)||(l[u]=a(c,u))}))),l);var l})(n);var n,i,r}var dk=["herokuapp.com","vercel.app","netlify.app"];function fk(t){var e=t?.hostname;if(!Je(e))return!1;var n=e.split(".").slice(-2).join(".");for(var i of dk)if(n===i)return!1;return!0}function j0(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Ge(t,e,n,i){var{capture:r=!1,passive:a=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:a})}var q0="$people_distinct_id",Co="__alias",Ao="__timers",Wy="$autocapture_disabled_server_side",fp="$heatmaps_enabled_server_side",Qy="$exception_capture_enabled_server_side",pp="$error_tracking_suppression_rules",Jy="$error_tracking_capture_extension_exceptions",e0="$web_vitals_enabled_server_side",P0="$dead_clicks_enabled_server_side",t0="$web_vitals_allowed_metrics",Hf="$session_recording_remote_config",Nc="$sesid",G0="$session_is_sampled",qa="$enabled_feature_flags",ko="$early_access_features",hp="$feature_flag_details",To="$stored_person_properties",Gr="$stored_group_properties",gp="$surveys",Sc="$surveys_activated",Dc="$flag_call_reported",ni="$user_state",mp="$client_session_props",vp="$capture_rate_limit",yp="$initial_campaign_params",_p="$initial_referrer_info",Lc="$initial_person_info",zc="$epp",Y0="__POSTHOG_TOOLBAR__",mo="$posthog_cookieless",pk=[q0,Co,"__cmpns",Ao,"$session_recording_enabled_server_side",fp,Nc,qa,pp,ni,ko,hp,Gr,To,gp,Dc,mp,vp,yp,_p,zc,Lc];function n0(t){return t instanceof Element&&(t.id===Y0||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Jc(t){return!!t&&t.nodeType===1}function Qi(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Z0(t){return!!t&&t.nodeType===3}function K0(t){return!!t&&t.nodeType===11}function oh(t){return t?Wc(t).split(/\s+/):[]}function i0(t){var e=A?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Bc(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 oh(e)}function X0(t){return _e(t)?null:Wc(t).split(/(\s+)/).filter((e=>zo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Io(t){var e="";return bp(t)&&!t_(t)&&t.childNodes&&t.childNodes.length&&we(t.childNodes,(function(n){var i;Z0(n)&&n.textContent&&(e+=(i=X0(n.textContent))!==null&&i!==void 0?i:"")})),Wc(e)}function W0(t){return D(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var lh=["a","button","form","input","select","textarea","label"];function Q0(t,e){if(D(e))return!0;var n,i=function(a){if(e.some((s=>a.matches(s))))return{v:!0}};for(var r of t)if(n=i(r))return n.v;return!1}function J0(t){var e=t.parentNode;return!(!e||!Jc(e))&&e}var hk=["next","previous","prev",">","<"],r0=10,a0=[".ph-no-rageclick",".ph-no-capture"];function gk(t,e){if(!A||ch(t))return!1;var n,i,r;if(Xi(e)?(n=!!e&&a0,i=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:a0,i=e?.content_ignorelist),n===!1)return!1;var{targetElementList:a}=e_(t,!1);return!(function(s,o){if(s===!1||D(s))return!1;var l;if(s===!0)l=hk;else{if(!xe(s))return!1;if(s.length>r0)return z.error("[PostHog] content_ignorelist array cannot exceed "+r0+" items. Use css_selector_ignorelist for more complex matching."),!1;l=s.map((c=>c.toLowerCase()))}return o.some((c=>{var{safeText:u,ariaLabel:f}=c;return l.some((g=>u.includes(g)||f.includes(g)))}))})(i,a.map((s=>{var o;return{safeText:Io(s).toLowerCase(),ariaLabel:((o=s.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!Q0(a,n)}var ch=t=>!t||Qi(t,"html")||!Jc(t),e_=(t,e)=>{if(!A||ch(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[t],r=t;r.parentNode&&!Qi(r,"body");)if(K0(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var a=J0(r);if(!a)break;if(e||lh.indexOf(a.tagName.toLowerCase())>-1)n=!0;else{var s=A.getComputedStyle(a);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}i.push(a),r=a}return{parentIsUsefulElement:n,targetElementList:i}};function mk(t,e,n,i,r){var a,s,o,l;if(n===void 0&&(n=void 0),!A||ch(t)||(a=n)!=null&&a.url_allowlist&&!i0(n.url_allowlist)||(s=n)!=null&&s.url_ignorelist&&i0(n.url_ignorelist))return!1;if((o=n)!=null&&o.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((y=>e.type===y)))return!1}var{parentIsUsefulElement:u,targetElementList:f}=e_(t,i);if(!(function(y,_){var b=_?.element_allowlist;if(D(b))return!0;var d,h=function(v){if(b.some((S=>v.tagName.toLowerCase()===S)))return{v:!0}};for(var m of y)if(d=h(m))return d.v;return!1})(f,n)||!Q0(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var g=A.getComputedStyle(t);if(g&&g.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=t.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(lh.indexOf(p)>-1||t.getAttribute("contenteditable")==="true")}}function bp(t){for(var e=t;e.parentNode&&!Qi(e,"body");e=e.parentNode){var n=Bc(e);if(re(n,"ph-sensitive")||re(n,"ph-no-capture"))return!1}if(re(Bc(t),"ph-include"))return!0;var i=t.type||"";if(Je(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(Je(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function t_(t){return!!(Qi(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Qi(t,"select")||Qi(t,"textarea")||t.getAttribute("contenteditable")==="true")}var n_="(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})",vk=new RegExp("^(?:"+n_+")$"),yk=new RegExp(n_),i_="\\d{3}-?\\d{2}-?\\d{4}",_k=new RegExp("^("+i_+")$"),bk=new RegExp("("+i_+")");function zo(t,e){return e===void 0&&(e=!0),!(_e(t)||Je(t)&&(t=Wc(t),(e?vk:yk).test((t||"").replace(/[- ]/g,""))||(e?_k:bk).test(t)))}function r_(t){var e=Io(t);return zo(e=(e+" "+a_(t)).trim())?e:""}function a_(t){var e="";return t&&t.childNodes&&t.childNodes.length&&we(t.childNodes,(function(n){var i;if(n&&((i=n.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Io(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+a_(n)).trim())}catch(a){z.error("[AutoCapture]",a)}})),e}function Sk(t){return(function(e){var n=e.map((i=>{var r,a,s="";if(i.tag_name&&(s+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))s+="."+o.replace(/"/g,"");var l=H({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(a=i.nth_of_type)!==null&&a!==void 0?a:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return kc(l).sort(((u,f)=>{var[g]=u,[p]=f;return g.localeCompare(p)})).forEach((u=>{var[f,g]=u;return c[s0(f.toString())]=s0(g.toString())})),s+=":",s+=kc(c).map((u=>{var[f,g]=u;return f+'="'+g+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var i,r,a={text:(i=n.$el_text)==null?void 0:i.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:xk(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return kc(n).filter((s=>{var[o]=s;return o.indexOf("attr__")===0})).forEach((s=>{var[o,l]=s;return a.attributes[o]=l})),a}))})(t))}function s0(t){return t.replace(/"|\\"/g,'\\"')}function xk(t){var e=t.attr__class;return e?xe(e)?e:oh(e):void 0}var Hc=class{constructor(e){this.disabled=e===!1;var n=rt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}},Uf="$copy_autocapture",ri=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Uc=t=>{var e=L?.createElement("a");return D(e)?null:(e.href=t,e)},Ek=function(t,e){var n,i;e===void 0&&(e="&");var r=[];return we(t,(function(a,s){D(a)||D(s)||s==="undefined"||(n=encodeURIComponent((o=>o instanceof File)(a)?a.name:a.toString()),i=encodeURIComponent(s),r[r.length]=i+"="+n)})),r.join(e)},$c=function(t,e){for(var n,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var a=i[r].split("=");if(a[0]===e){n=a;break}}if(!xe(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch{z.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Fo=function(t,e,n){if(!t||!e||!e.length)return t;for(var i=t.split("#"),r=i[0]||"",a=i[1],s=r.split("?"),o=s[1],l=s[0],c=(o||"").split("&"),u=[],f=0;f<c.length;f++){var g=c[f].split("=");xe(g)&&(e.includes(g[0])?u.push(g[0]+"="+n):u.push(c[f]))}var p=l;return o!=null&&(p+="?"+u.join("&")),a!=null&&(p+="#"+a),p},Vc=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},o0=et("[AutoCapture]");function $f(t,e){return e.length>t?e.slice(0,t)+"...":e}function wk(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Jc(e));return e}function Ck(t,e,n,i){var r=t.tagName.toLowerCase(),a={tag_name:r};lh.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?a.$el_text=$f(1024,r_(t)):a.$el_text=$f(1024,Io(t)));var s=Bc(t);s.length>0&&(a.classes=s.filter((function(u){return u!==""}))),we(t.attributes,(function(u){var f;if((!t_(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&zo(u.value)&&(f=u.name,!Je(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var g=u.value;u.name==="class"&&(g=oh(g).join(" ")),a["attr__"+u.name]=$f(1024,g)}}));for(var o=1,l=1,c=t;c=wk(c);)o++,c.tagName===t.tagName&&l++;return a.nth_child=o,a.nth_of_type=l,a}function Ak(t,e){for(var n,i,{e:r,maskAllElementAttributes:a,maskAllText:s,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!Qi(u,"body");)K0(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,g=[],p={},y=!1,_=!1;if(we(c,(v=>{var S=bp(v);v.tagName.toLowerCase()==="a"&&(y=v.getAttribute("href"),y=S&&y&&zo(y)&&y),re(Bc(v),"ph-no-capture")&&(_=!0),g.push(Ck(v,a,s,o));var w=(function(E){if(!bp(E))return{};var C={};return we(E.attributes,(function(O){if(O.name&&O.name.indexOf("data-ph-capture-attribute")===0){var T=O.name.replace("data-ph-capture-attribute-",""),I=O.value;T&&I&&zo(I)&&(C[T]=I)}})),C})(v);je(p,w)})),_)return{props:{},explicitNoCapture:_};if(s||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?g[0].$el_text=r_(t):g[0].$el_text=Io(t)),y){var b,d;g[0].attr__href=y;var h=(b=Uc(y))==null?void 0:b.host,m=A==null||(d=A.location)==null?void 0:d.host;h&&m&&h!==m&&(f=y)}return{props:je({$event_type:r.type,$ce_version:1},l?{}:{$elements:g},{$elements_chain:Sk(g)},(n=g[0])!=null&&n.$el_text?{$el_text:(i=g[0])==null?void 0:i.$el_text}:{},f&&r.type==="click"?{$external_click_url:f}:{},p)}}var Sp=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Hc(e.config.rageclick),this.I=null}get F(){var e,n,i=rt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),i.url_ignorelist=(n=i.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),i}C(){if(this.isBrowserSupported()){if(A&&L){var e=i=>{i=i||A?.event;try{this.M(i)}catch(r){o0.error("Failed to capture event",r)}};if(Ge(L,"submit",e,{capture:!0}),Ge(L,"change",e,{capture:!0}),Ge(L,"click",e,{capture:!0}),this.F.capture_copied_text){var n=i=>{i=i||A?.event,this.M(i,Uf)};Ge(L,"copy",n,{capture:!0}),Ge(L,"cut",n,{capture:!0})}}}else o0.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({[Wy]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,i=[];return(n=this.I)==null||n.forEach((r=>{var a=L?.querySelectorAll(r);a?.forEach((s=>{e===s&&i.push(r)}))})),i}get isEnabled(){var e,n,i=(e=this.instance.persistence)==null?void 0:e.props[Wy],r=this.T;if(ai(r)&&!Xi(i)&&!this.instance.O())return!1;var a=(n=this.T)!==null&&n!==void 0?n:!!i;return!!this.instance.config.autocapture&&!a}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var i,r=W0(e);Z0(r)&&(r=r.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&gk(r,this.instance.config.rageclick)&&this.M(e,"$rageclick");var a=n===Uf;if(r&&mk(r,e,this.F,a,a?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Ak(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(s.$element_selectors=l),n===Uf){var c,u=X0(A==null||(c=A.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=f}return this.instance.capture(n,s),!0}}}isBrowserSupported(){return Ki(L?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return $n(t)&&isFinite(t)&&Math.floor(t)===t});var l0="0123456789abcdef",xp=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||n<0||i<0||r<0||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=e/Math.pow(2,40),a[1]=e/Math.pow(2,32),a[2]=e/Math.pow(2,24),a[3]=e/Math.pow(2,16),a[4]=e/Math.pow(2,8),a[5]=e,a[6]=112|n>>>8,a[7]=n,a[8]=128|i>>>24,a[9]=i>>>16,a[10]=i>>>8,a[11]=i,a[12]=r>>>24,a[13]=r>>>16,a[14]=r>>>8,a[15]=r,new t(a)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+l0.charAt(this.bytes[n]>>>4)+l0.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==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 n=0;n<16;n++){var i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},Ep=class{constructor(){this.A=0,this.D=0,this.j=new wp}generate(){var e=this.generateOrAbort();if(D(e)){this.A=0;var n=this.generateOrAbort();if(D(n))throw new Error("Could not generate UUID after timestamp reset");return n}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 xp.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())}},c0,s_=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};A&&!D(A.crypto)&&crypto.getRandomValues&&(s_=t=>crypto.getRandomValues(t));var wp=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(s_(this.N),this.U=0),this.N[this.U++]}},Zi=()=>kk().toString(),kk=()=>(c0||(c0=new Ep)).generate(),vo="",Tk=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Rk(t,e){if(e){var n=(function(r,a){if(a===void 0&&(a=L),vo)return vo;if(!a||["localhost","127.0.0.1"].includes(r))return"";for(var s=r.split("."),o=Math.min(s.length,8),l="dmn_chk_"+Zi();!vo&&o--;){var c=s.slice(o).join("."),u=l+"=1;domain=."+c+";path=/";a.cookie=u+";max-age=3",a.cookie.includes(l)&&(a.cookie=u+";max-age=0",vo=c)}return vo})(t);if(!n){var i=(r=>{var a=r.match(Tk);return a?a[0]:""})(t);i!==n&&z.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var Un={H:()=>!!L,B:function(t){z.error("cookieStore error: "+t)},q:function(t){if(L){try{for(var e=t+"=",n=L.cookie.split(";").filter((a=>a.length)),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(Un.q(t))||{}}catch{}return e},G:function(t,e,n,i,r){if(L)try{var a="",s="",o=Rk(L.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}r&&(s="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+o+s;return c.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+c.length),L.cookie=c,c}catch{return}},V:function(t,e){if(L!=null&&L.cookie)try{Un.G(t,"",-1,e)}catch{return}}},Vf=null,Ue={H:function(){if(!ai(Vf))return Vf;var t=!0;if(D(A))t=!1;else try{var e="__mplssupport__";Ue.G(e,"xyz"),Ue.q(e)!=='"xyz"'&&(t=!1),Ue.V(e)}catch{t=!1}return t||z.error("localStorage unsupported; falling back to cookie store"),Vf=t,t},B:function(t){z.error("localStorage error: "+t)},q:function(t){try{return A?.localStorage.getItem(t)}catch(e){Ue.B(e)}return null},W:function(t){try{return JSON.parse(Ue.q(t))||{}}catch{}return null},G:function(t,e){try{A?.localStorage.setItem(t,JSON.stringify(e))}catch(n){Ue.B(n)}},V:function(t){try{A?.localStorage.removeItem(t)}catch(e){Ue.B(e)}}},Ok=["distinct_id",Nc,G0,zc,Lc],xc=H({},Ue,{W:function(t){try{var e={};try{e=Un.W(t)||{}}catch{}var n=je(e,JSON.parse(Ue.q(t)||"{}"));return Ue.G(t,n),n}catch{}return null},G:function(t,e,n,i,r,a){try{Ue.G(t,e,void 0,void 0,a);var s={};Ok.forEach((o=>{e[o]&&(s[o]=e[o])})),Object.keys(s).length&&Un.G(t,s,n,i,r,a)}catch(o){Ue.B(o)}},V:function(t,e){try{A?.localStorage.removeItem(t),Un.V(t,e)}catch(n){Ue.B(n)}}}),Ec={},Mk={H:function(){return!0},B:function(t){z.error("memoryStorage error: "+t)},q:function(t){return Ec[t]||null},W:function(t){return Ec[t]||null},G:function(t,e){Ec[t]=e},V:function(t){delete Ec[t]}},qr=null,ct={H:function(){if(!ai(qr))return qr;if(qr=!0,D(A))qr=!1;else try{var t="__support__";ct.G(t,"xyz"),ct.q(t)!=='"xyz"'&&(qr=!1),ct.V(t)}catch{qr=!1}return qr},B:function(t){z.error("sessionStorage error: ",t)},q:function(t){try{return A?.sessionStorage.getItem(t)}catch(e){ct.B(e)}return null},W:function(t){try{return JSON.parse(ct.q(t))||null}catch{}return null},G:function(t,e){try{A?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){ct.B(n)}},V:function(t){try{A?.sessionStorage.removeItem(t)}catch(e){ct.B(e)}}},ii=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Cp=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?ii.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===ii.DENIED||this.consent===ii.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ii.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:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return zf(e)?ii.GRANTED:re(KA,e)?ii.DENIED:ii.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ue:Un;var n=e==="localStorage"?Un:Ue;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(zf(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!j0([jt?.doNotTrack,jt?.msDoNotTrack,K.doNotTrack],(e=>zf(e)))}},wc=et("[Dead Clicks]"),Nk=()=>!0,Dk=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(P0)),i=t.instance.config.capture_dead_clicks;return Xi(i)?i:!!rt(i)||n},Ic=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[P0]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,i;(n=K.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(i=K.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?wc.error("failed to load script",r):e()}))}et(){var e;if(L){if(!this.tt&&(e=K.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=rt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=K.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(L),wc.info("starting...")}}else wc.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,wc.info("stopping..."))}},yo=et("[ExceptionAutocapture]"),Ap=class{constructor(e){var n,i,r;this.rt=()=>{var a;if(A&&this.isEnabled&&(a=K.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var s=K.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=K.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=K.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=s(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){yo.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[Qy]),this.F=this.ht(),this.vt=new tp({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:yo}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return rt(e)?n=H({},n,e):(D(e)?this.ut:e)&&(n=H({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(yo.info("enabled"),this.it(this.rt))}it(e){var n,i;(n=K.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(i=K.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return yo.error("failed to load script",r);e()}))}lt(){var e,n,i;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Qy]:this.ut}),this.startIfEnabled()}captureException(e){var n,i,r=(n=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(r)?yo.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}};function u0(t,e,n){try{if(!(e in t))return()=>{};var i=t[e],r=n(i);return Ki(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=i}}catch{return()=>{}}}var kp=class{constructor(e){var n;this._instance=e,this.dt=(A==null||(n=A.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(z.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,z.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(A&&A.history){var i=this;(e=A.history.pushState)!=null&&e.__posthog_wrapped__||u0(A.history,"pushState",(r=>function(a,s,o){r.call(this,a,s,o),i.ft("pushState")})),(n=A.history.replaceState)!=null&&n.__posthog_wrapped__||u0(A.history,"replaceState",(r=>function(a,s,o){r.call(this,a,s,o),i.ft("replaceState")})),this.gt()}}ft(e){try{var n,i=A==null||(n=A.location)==null?void 0:n.pathname;if(!i)return;i!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=i}catch(r){z.error("Error capturing "+e+" pageview",r)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};Ge(A,"popstate",e),this.ct=()=>{A&&A.removeEventListener("popstate",e)}}}},If=et("[SegmentIntegration]");function Lk(t,e){var n=t.config.segment;if(!n)return e();(function(i,r){var a=i.config.segment;if(!a)return r();var s=l=>{var c=()=>l.anonymousId()||Zi();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(ni,"identified")),r()},o=a.user();"then"in o&&Ki(o.then)?o.then((l=>s(l))):s(o)})(t,(()=>{n.register((i=>{Promise&&Promise.resolve||If.warn("This browser does not have Promise support, and can not use the segment integration");var r=(a,s)=>{if(!s)return a;a.event.userId||a.event.anonymousId===i.get_distinct_id()||(If.info("No userId set, resetting PostHog"),i.reset()),a.event.userId&&a.event.userId!==i.get_distinct_id()&&(If.info("UserId set, identifying with PostHog"),i.identify(a.event.userId));var o=i.calculateEventProperties(s,a.event.properties);return a.event.properties=Object.assign({},o,a.event.properties),a};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:a=>r(a,a.event.event),page:a=>r(a,"$pageview"),identify:a=>r(a,"$identify"),screen:a=>r(a,"$screen")}})(t)).then((()=>{e()}))}))}var o_="posthog-js";function l_(t,e){var{organization:n,projectId:i,prefix:r,severityAllowList:a=["error"],sendExceptionsToPostHog:s=!0}=e===void 0?{}:e;return o=>{var l,c,u,f,g;if(!(a==="*"||a.includes(o.level))||!t.__loaded)return o;o.tags||(o.tags={});var p=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());o.tags["PostHog Person URL"]=p,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var y=((l=o.exception)==null?void 0:l.values)||[],_=y.map((d=>H({},d,{stacktrace:d.stacktrace?H({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((h=>H({},h,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((c=y[0])==null?void 0:c.value)||o.message,$exception_type:(u=y[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=y[0])==null?void 0:f.value)||o.message,$sentry_exception_type:(g=y[0])==null?void 0:g.type,$sentry_tags:o.tags};return n&&i&&(b.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+o.event_id),s&&t.exceptions.sendExceptionEvent(b),o}}var Tp=class{constructor(e,n,i,r,a,s){this.name=o_,this.setupOnce=function(o){o(l_(e,{organization:n,projectId:i,prefix:r,severityAllowList:a,sendExceptionsToPostHog:s==null||s}))}}},zk=A!=null&&A.location?Vc(A.location.hash,"__posthog")||Vc(location.hash,"state"):null,d0="_postHogToolbarParams",f0=et("[Toolbar]"),Yi=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Yi||{}),Rp=class{constructor(e){this.instance=e}_t(e){K.ph_toolbar_state=e}yt(){var e;return(e=K.ph_toolbar_state)!==null&&e!==void 0?e:Yi.UNINITIALIZED}maybeLoadToolbar(e,n,i){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),!A||!L)return!1;e=e??A.location,i=i??A.history;try{if(!n){try{A.localStorage.setItem("test","test"),A.localStorage.removeItem("test")}catch{return!1}n=A?.localStorage}var r,a=zk||Vc(e.hash,"__posthog")||Vc(e.hash,"state"),s=a?Xy((()=>JSON.parse(atob(decodeURIComponent(a)))))||Xy((()=>JSON.parse(decodeURIComponent(a)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(d0)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}bt(e){var n=K.ph_load_toolbar||K.ph_load_editor;!_e(n)&&Ki(n)?n(e,this.instance):f0.warn("No toolbar load function found")}loadToolbar(e){var n=!(L==null||!L.getElementById(Y0));if(!A||n)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=H({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(A.localStorage.setItem(d0,JSON.stringify(H({},r,{source:void 0}))),this.yt()===Yi.LOADED)this.bt(r);else if(this.yt()===Yi.UNINITIALIZED){var a;this._t(Yi.LOADING),(a=K.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return f0.error("[Toolbar] Failed to load",s),void this._t(Yi.UNINITIALIZED);this._t(Yi.LOADED),this.bt(r)})),Ge(A,"turbolinks:load",(()=>{this._t(Yi.UNINITIALIZED),this.loadToolbar(r)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,i){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,n,i)}},Bk=et("[TracingHeaders]"),Op=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,i;D(this.xt)&&((n=K.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),D(this.St)&&((i=K.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,i;(n=K.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(i=K.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return Bk.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},an="Mobile",Fc="iOS",Hn="Android",Bo="Tablet",c_=Hn+" "+Bo,u_="iPad",d_="Apple",f_=d_+" Watch",Ho="Safari",Za="BlackBerry",p_="Samsung",h_=p_+"Browser",g_=p_+" Internet",Yr="Chrome",Hk=Yr+" OS",m_=Yr+" "+Fc,uh="Internet Explorer",v_=uh+" "+an,dh="Opera",Uk=dh+" Mini",fh="Edge",y_="Microsoft "+fh,Pa="Firefox",__=Pa+" "+Fc,Uo="Nintendo",$o="PlayStation",Ga="Xbox",b_=Hn+" "+an,S_=an+" "+Ho,Ro="Windows",Mp=Ro+" Phone",p0="Nokia",Np="Ouya",x_="Generic",$k=x_+" "+an.toLowerCase(),E_=x_+" "+Bo.toLowerCase(),Dp="Konqueror",St="(\\d+(\\.\\d+)?)",Ff=new RegExp("Version/"+St),Vk=new RegExp(Ga,"i"),Ik=new RegExp($o+" \\w+","i"),Fk=new RegExp(Uo+" \\w+","i"),ph=new RegExp(Za+"|PlayBook|BB10","i"),jk={"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"},qk=(t,e)=>e&&re(e,d_)||(function(n){return re(n,Ho)&&!re(n,Yr)&&!re(n,Hn)})(t),w_=function(t,e){return e=e||"",re(t," OPR/")&&re(t,"Mini")?Uk:re(t," OPR/")?dh:ph.test(t)?Za:re(t,"IE"+an)||re(t,"WPDesktop")?v_:re(t,h_)?g_:re(t,fh)||re(t,"Edg/")?y_:re(t,"FBIOS")?"Facebook "+an:re(t,"UCWEB")||re(t,"UCBrowser")?"UC Browser":re(t,"CriOS")?m_:re(t,"CrMo")||re(t,Yr)?Yr:re(t,Hn)&&re(t,Ho)?b_:re(t,"FxiOS")?__:re(t.toLowerCase(),Dp.toLowerCase())?Dp:qk(t,e)?re(t,an)?S_:Ho:re(t,Pa)?Pa:re(t,"MSIE")||re(t,"Trident/")?uh:re(t,"Gecko")?Pa:""},Pk={[v_]:[new RegExp("rv:"+St)],[y_]:[new RegExp(fh+"?\\/"+St)],[Yr]:[new RegExp("("+Yr+"|CrMo)\\/"+St)],[m_]:[new RegExp("CriOS\\/"+St)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+St)],[Ho]:[Ff],[S_]:[Ff],[dh]:[new RegExp("(Opera|OPR)\\/"+St)],[Pa]:[new RegExp(Pa+"\\/"+St)],[__]:[new RegExp("FxiOS\\/"+St)],[Dp]:[new RegExp("Konqueror[:/]?"+St,"i")],[Za]:[new RegExp(Za+" "+St),Ff],[b_]:[new RegExp("android\\s"+St,"i")],[g_]:[new RegExp(h_+"\\/"+St)],[uh]:[new RegExp("(rv:|MSIE )"+St)],Mozilla:[new RegExp("rv:"+St)]},Gk=function(t,e){var n=w_(t,e),i=Pk[n];if(D(i))return null;for(var r=0;r<i.length;r++){var a=i[r],s=t.match(a);if(s)return parseFloat(s[s.length-2])}return null},h0=[[new RegExp(Ga+"; "+Ga+" (.*?)[);]","i"),t=>[Ga,t&&t[1]||""]],[new RegExp(Uo,"i"),[Uo,""]],[new RegExp($o,"i"),[$o,""]],[ph,[Za,""]],[new RegExp(Ro,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Mp,""];if(new RegExp(an).test(e)&&!/IEMobile\b/.test(e))return[Ro+" "+an,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var i=n[1],r=jk[i]||"";return/arm/i.test(e)&&(r="RT"),[Ro,r]}return[Ro,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Fc,e.join(".")]}return[Fc,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=D(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Hn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Hn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Hn,e.join(".")]}return[Hn,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Hk,""]],[/Linux|debian/i,["Linux",""]]],g0=function(t){return Fk.test(t)?Uo:Ik.test(t)?$o:Vk.test(t)?Ga:new RegExp(Np,"i").test(t)?Np:new RegExp("("+Mp+"|WPDesktop)","i").test(t)?Mp:/iPad/.test(t)?u_:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?f_:ph.test(t)?Za:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(p0,"i").test(t)?p0:/(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(an).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)?Hn:c_:Hn:new RegExp("(pda|"+an+")","i").test(t)?$k:new RegExp(Bo,"i").test(t)&&!new RegExp(Bo+" pc","i").test(t)?E_:""},Cc="https?://(.*)",Wa=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Yk=Xa(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Wa),jo="<masked>",Zk=["li_fat_id"];function C_(t,e,n){if(!L)return{};var i,r=e?Xa([],Wa,n||[]):[],a=A_(Fo(L.URL,r,jo),t),s=(i={},we(Zk,(function(o){var l=Un.q(o);i[o]=l||null})),i);return je(s,a)}function A_(t,e){var n=Yk.concat(e||[]),i={};return we(n,(function(r){var a=$c(t,r);i[r]=a||null})),i}function k_(t){var e=(function(a){return a?a.search(Cc+"google.([^/?]*)")===0?"google":a.search(Cc+"bing.com")===0?"bing":a.search(Cc+"yahoo.com")===0?"yahoo":a.search(Cc+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!ai(e)){i.$search_engine=e;var r=L?$c(L.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function m0(){return navigator.language||navigator.userLanguage}function T_(){return L?.referrer||"$direct"}function R_(t,e){var n=t?Xa([],Wa,e||[]):[],i=Tt?.href.substring(0,1e3);return{r:T_().substring(0,1e3),u:i?Fo(i,n,jo):void 0}}function O_(t){var e,{r:n,u:i}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Uc(n))==null?void 0:e.host};if(i){r.$current_url=i;var a=Uc(i);r.$host=a?.host,r.$pathname=a?.pathname;var s=A_(i);je(r,s)}if(n){var o=k_(n);je(r,o)}return r}function M_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Kk(){try{return new Date().getTimezoneOffset()}catch{return}}function Xk(t,e){if(!kt)return{};var n,i,r,a=t?Xa([],Wa,e||[]):[],[s,o]=(function(l){for(var c=0;c<h0.length;c++){var[u,f]=h0[c],g=u.exec(l),p=g&&(Ki(f)?f(g,l):f);if(p)return p}return["",""]})(kt);return je(sh({$os:s,$os_version:o,$browser:w_(kt,navigator.vendor),$device:g0(kt),$device_type:(i=kt,r=g0(i),r===u_||r===c_||r==="Kobo"||r==="Kindle Fire"||r===E_?Bo:r===Uo||r===Ga||r===$o||r===Np?"Console":r===f_?"Wearable":r?an:"Desktop"),$timezone:M_(),$timezone_offset:Kk()}),{$current_url:Fo(Tt?.href,a,jo),$host:Tt?.host,$pathname:Tt?.pathname,$raw_user_agent:kt.length>1e3?kt.substring(0,997)+"...":kt,$browser_version:Gk(kt,navigator.vendor),$browser_language:m0(),$browser_language_prefix:(n=m0(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:A?.screen.height,$screen_width:A?.screen.width,$viewport_height:A?.innerHeight,$viewport_width:A?.innerWidth,$lib:"web",$lib_version:ti.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var qi=et("[Web Vitals]"),v0=9e5,Lp=class{constructor(e){var n;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(((i,r)=>H({},i,{["$web_vitals_"+r.name+"_event"]:H({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var r,a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(D(a))qi.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Tt();D(s)||(_e(i?.name)||_e(i?.value)?qi.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?qi.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==s&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),D(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=D(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(H({},i,{$current_url:s,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,r,a,s,o=K.__PosthogExtensions__;D(o)||D(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:a,onINP:s}=o.postHogWebVitalsCallbacks),i&&r&&a&&s?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Pt.bind(this)),this.P=!0):qi.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[e0]),this.startIfEnabled()}get allowedMetrics(){var e,n,i=rt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return D(i)?((n=this._instance.persistence)==null?void 0:n.props[t0])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(rt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=rt(this._instance.config.capture_performance)&&$n(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:v0;return 0<e&&e<=6e4?v0:e}get isEnabled(){var e=Tt?.protocol;if(e!=="http:"&&e!=="https:")return qi.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=rt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Xi(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Xi(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(qi.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=rt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=rt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[e0]:n}),this._instance.persistence.register({[t0]:i})),this.Et=n,this.startIfEnabled()}it(e){var n,i;(n=K.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(i=K.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(r=>{r?qi.error("failed to load script",r):e()}))}Tt(){var e=A?A.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=n?Xa([],Wa,i||[]):[];return Fo(e,r,jo)}qi.error("Could not determine current URL")}},Wk=et("[Heatmaps]");function y0(t){return rt(t)&&"clientX"in t&&"clientY"in t&&$n(t.clientX)&&$n(t.clientY)}var zp=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[fp]),this.rageclicks=new Hc(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return rt(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 D(this.instance.config.capture_heatmaps)?D(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;Wk.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 n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[fp]:n}),this.Et=n,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"})(L)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){A&&L&&(this.jt=this.Dt.bind(this),Ge(A,"beforeunload",this.jt),this.Lt=e=>this.At(e||A?.event),Ge(L,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||A?.event),Ge(L,"mousemove",this.Nt,{capture:!0}),this.zt=new Ic(this.instance,Nk,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),Ge(L,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;A&&L&&(this.jt&&A.removeEventListener("beforeunload",this.jt),this.Lt&&L.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&L.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&L.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),s=(function(o,l,c){for(var u=o;u&&Jc(u)&&!Qi(u,"body");){if(u===c)return!1;if(re(l,A?.getComputedStyle(u).position))return!0;u=J0(u)}return!1})(W0(e),["fixed","sticky"],a);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:i),target_fixed:s,type:n}}At(e,n){var i;if(n===void 0&&(n="click"),!n0(e.target)&&y0(e)){var r=this.qt(e,n);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(H({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!n0(e.target)&&y0(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(A){var n=A.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,a=i?Xa([],Wa,r||[]):[],s=Fo(n,a,jo);this.N=this.N||{},this.N[s]||(this.N[s]=[]),this.N[s].push(e)}}Dt(){this.N&&!ja(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Bp=class{constructor(e){this._instance=e}doPageView(e,n){var i,r=this.Gt(e,n);return this.Vt={pathname:(i=A?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var i=this.Vt;if(!i)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:i.pageViewId},a=this._instance.scrollManager.getContext();if(a&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=a;if(!(D(s)||D(o)||D(l)||D(c)||D(u)||D(f))){s=Math.ceil(s),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var g=s<=1?1:Bn(o/s,0,1,z),p=s<=1?1:Bn(l/s,0,1,z),y=c<=1?1:Bn(u/c,0,1,z),_=c<=1?1:Bn(f/c,0,1,z);r=je(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}},sn=Uint8Array,xt=Uint16Array,Ka=Uint32Array,hh=new sn([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]),gh=new sn([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]),_0=new sn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),N_=function(t,e){for(var n=new xt(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new Ka(n[30]);for(i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]},D_=N_(hh,2),Qk=D_[0],Hp=D_[1];Qk[28]=258,Hp[258]=28;for(Up=N_(gh,0)[1],jc=new xt(32768),Ce=0;Ce<32768;++Ce)Pi=(43690&Ce)>>>1|(21845&Ce)<<1,Pi=(61680&(Pi=(52428&Pi)>>>2|(13107&Pi)<<2))>>>4|(3855&Pi)<<4,jc[Ce]=((65280&Pi)>>>8|(255&Pi)<<8)>>>1;var Pi,Up,jc,Ce,No=function(t,e,n){for(var i=t.length,r=0,a=new xt(e);r<i;++r)++a[t[r]-1];var s,o=new xt(e);for(r=0;r<e;++r)o[r]=o[r-1]+a[r-1]<<1;if(n){s=new xt(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=o[t[r]-1]++<<u,g=f|(1<<u)-1;f<=g;++f)s[jc[f]>>>l]=c}else for(s=new xt(i),r=0;r<i;++r)s[r]=jc[o[t[r]-1]++]>>>15-t[r];return s},Zr=new sn(288);for(Ce=0;Ce<144;++Ce)Zr[Ce]=8;for(Ce=144;Ce<256;++Ce)Zr[Ce]=9;for(Ce=256;Ce<280;++Ce)Zr[Ce]=7;for(Ce=280;Ce<288;++Ce)Zr[Ce]=8;var qc=new sn(32);for(Ce=0;Ce<32;++Ce)qc[Ce]=5;var Jk=No(Zr,9,0),eT=No(qc,5,0),L_=function(t){return(t/8>>0)+(7&t&&1)},z_=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof xt?xt:t instanceof Ka?Ka:sn)(n-e);return i.set(t.subarray(e,n)),i},ei=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8},_o=function(t,e,n){n<<=7&e;var i=e/8>>0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},jf=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,a=n.slice();if(!r)return[new sn(0),0];if(r==1){var s=new sn(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(S,w){return S.f-w.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=r-1;)o=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:o.f+l.f,l:o,r:l};var g=a[0].s;for(i=1;i<r;++i)a[i].s>g&&(g=a[i].s);var p=new xt(g+1),y=$p(n[u-1],p,0);if(y>e){i=0;var _=0,b=y-e,d=1<<b;for(a.sort((function(S,w){return p[w.s]-p[S.s]||S.f-w.f}));i<r;++i){var h=a[i].s;if(!(p[h]>e))break;_+=d-(1<<y-p[h]),p[h]=e}for(_>>>=b;_>0;){var m=a[i].s;p[m]<e?_-=1<<e-p[m]++-1:++i}for(;i>=0&&_;--i){var v=a[i].s;p[v]==e&&(--p[v],++_)}y=e}return[new sn(p),y]},$p=function(t,e,n){return t.s==-1?Math.max($p(t.l,e,n+1),$p(t.r,e,n+1)):e[t.s]=n},b0=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new xt(++e),i=0,r=t[0],a=1,s=function(l){n[i++]=l},o=1;o<=e;++o)if(t[o]==r&&o!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(r),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(r);a=1,r=t[o]}return[n.subarray(0,i),e]},bo=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},Vp=function(t,e,n){var i=n.length,r=L_(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var a=0;a<i;++a)t[r+a+4]=n[a];return 8*(r+4+i)},S0=function(t,e,n,i,r,a,s,o,l,c,u){ei(e,u++,n),++r[256];for(var f=jf(r,15),g=f[0],p=f[1],y=jf(a,15),_=y[0],b=y[1],d=b0(g),h=d[0],m=d[1],v=b0(_),S=v[0],w=v[1],E=new xt(19),C=0;C<h.length;++C)E[31&h[C]]++;for(C=0;C<S.length;++C)E[31&S[C]]++;for(var O=jf(E,7),T=O[0],I=O[1],Y=19;Y>4&&!T[_0[Y-1]];--Y);var Q,P,ge,U,J=c+5<<3,$=bo(r,Zr)+bo(a,qc)+s,X=bo(r,g)+bo(a,_)+s+14+3*Y+bo(E,T)+(2*E[16]+3*E[17]+7*E[18]);if(J<=$&&J<=X)return Vp(e,u,t.subarray(l,l+c));if(ei(e,u,1+(X<$)),u+=2,X<$){Q=No(g,p,0),P=g,ge=No(_,b,0),U=_;var At=No(T,I,0);for(ei(e,u,m-257),ei(e,u+5,w-1),ei(e,u+10,Y-4),u+=14,C=0;C<Y;++C)ei(e,u+3*C,T[_0[C]]);u+=3*Y;for(var Jn=[h,S],lt=0;lt<2;++lt){var rn=Jn[lt];for(C=0;C<rn.length;++C){var Ft=31&rn[C];ei(e,u,At[Ft]),u+=T[Ft],Ft>15&&(ei(e,u,rn[C]>>>5&127),u+=rn[C]>>>12)}}}else Q=Jk,P=Zr,ge=eT,U=qc;for(C=0;C<o;++C)if(i[C]>255){Ft=i[C]>>>18&31,_o(e,u,Q[Ft+257]),u+=P[Ft+257],Ft>7&&(ei(e,u,i[C]>>>23&31),u+=hh[Ft]);var $a=31&i[C];_o(e,u,ge[$a]),u+=U[$a],$a>3&&(_o(e,u,i[C]>>>5&8191),u+=gh[$a])}else _o(e,u,Q[i[C]]),u+=P[i[C]];return _o(e,u,Q[256]),u+P[256]},tT=new Ka([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nT=(function(){for(var t=new Ka(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),iT=function(t,e,n,i,r){return(function(a,s,o,l,c,u){var f=a.length,g=new sn(l+f+5*(1+Math.floor(f/7e3))+c),p=g.subarray(l,g.length-c),y=0;if(!s||f<8)for(var _=0;_<=f;_+=65535){var b=_+65535;b<f?y=Vp(p,y,a.subarray(_,b)):(p[_]=u,y=Vp(p,y,a.subarray(_,f)))}else{for(var d=tT[s-1],h=d>>>13,m=8191&d,v=(1<<o)-1,S=new xt(32768),w=new xt(v+1),E=Math.ceil(o/3),C=2*E,O=function(Df){return(a[Df]^a[Df+1]<<E^a[Df+2]<<C)&v},T=new Ka(25e3),I=new xt(288),Y=new xt(32),Q=0,P=0,ge=(_=0,0),U=0,J=0;_<f;++_){var $=O(_),X=32767&_,At=w[$];if(S[X]=At,w[$]=X,U<=_){var Jn=f-_;if((Q>7e3||ge>24576)&&Jn>423){y=S0(a,p,0,T,I,Y,P,ge,J,_-J,y),ge=Q=P=0,J=_;for(var lt=0;lt<286;++lt)I[lt]=0;for(lt=0;lt<30;++lt)Y[lt]=0}var rn=2,Ft=0,$a=m,Vi=X-At&32767;if(Jn>2&&$==O(_-Vi))for(var RA=Math.min(h,Jn)-1,OA=Math.min(32767,_),MA=Math.min(258,Jn);Vi<=OA&&--$a&&X!=At;){if(a[_+rn]==a[_+rn-Vi]){for(var Ii=0;Ii<MA&&a[_+Ii]==a[_+Ii-Vi];++Ii);if(Ii>rn){if(rn=Ii,Ft=Vi,Ii>RA)break;var NA=Math.min(Vi,Ii-2),Ly=0;for(lt=0;lt<NA;++lt){var Nf=_-Vi+lt+32768&32767,zy=Nf-S[Nf]+32768&32767;zy>Ly&&(Ly=zy,At=Nf)}}}Vi+=(X=At)-(At=S[X])+32768&32767}if(Ft){T[ge++]=268435456|Hp[rn]<<18|Up[Ft];var By=31&Hp[rn],Hy=31&Up[Ft];P+=hh[By]+gh[Hy],++I[257+By],++Y[Hy],U=_+rn,++Q}else T[ge++]=a[_],++I[a[_]]}}y=S0(a,p,u,T,I,Y,P,ge,J,_-J,y)}return z_(g,0,l+L_(y)+c)})(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,n,i,!0)},qf=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function rT(t,e){e===void 0&&(e={});var n=(function(){var o=4294967295;return{p:function(l){for(var c=o,u=0;u<l.length;++u)c=nT[255&c^l[u]]^c>>>8;o=c},d:function(){return 4294967295^o}}})(),i=t.length;n.p(t);var r,a=iT(t,e,10+((r=e).filename&&r.filename.length+1||0),8),s=a.length;return(function(o,l){var c=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&qf(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var u=0;u<=c.length;++u)o[u+10]=c.charCodeAt(u)}})(a,e),qf(a,s-8,n.d()),qf(a,s-4,i),a}var aT=function(t){var e,n,i,r,a="";for(e=n=0,i=(t=(t+"").replace(/\r\n/g,`
|
|
10
11
|
`).replace(/\r/g,`
|
|
11
|
-
`)).length,i=0;i<r;i++){var s=t.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),Ln(a)||(n>e&&(o+=t.substring(e,n)),o+=a,e=n=i+1)}return n>e&&(o+=t.substring(e,t.length)),o},Z1=!!md||!!gd,xv="text/plain",xl=function(t,e,n){var r;n===void 0&&(n=!0);var[i,o]=t.split("?"),s=$({},e),a=(r=o?.split("&").map((u=>{var c,[f,h]=u.split("="),g=n&&(c=s[f])!==null&&c!==void 0?c:h;return delete s[f],f+"="+g})))!==null&&r!==void 0?r:[],l=f1(s);return l&&a.push(l),i+"?"+a.join("&")},_s=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),cd=t=>{var{data:e,compression:n}=t;if(e){if(n===On.GZipJS){var r=K1((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new Ft(l.length+(l.length>>>1)),h=0,g=function(d){f[h++]=d},v=0;v<c;++v){if(h+5>f.length){var _=new Ft(h+8+(c-v<<1));_.set(f),f=_}var x=l.charCodeAt(v);x<128||u?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++v))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return Ly(f,0,h)})(_s(e)),{mtime:0}),i=new Blob([r],{type:xv});return{contentType:xv,body:i,estimatedSize:i.size}}if(n===On.Base64){var o=(function(l){var u,c,f,h,g,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,x=0,d="",p=[];if(!l)return l;l=G1(l);do u=(g=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,c=g>>12&63,f=g>>6&63,h=63&g,p[x++]=v.charAt(u)+v.charAt(c)+v.charAt(f)+v.charAt(h);while(_<l.length);switch(d=p.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(_s(e)),s=(l=>"data="+encodeURIComponent(typeof l=="string"?l:_s(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=_s(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},il=[];gd&&il.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:o}=(e=cd(t))!==null&&e!==void 0?e:{},s=new Headers;pe(t.headers,(function(c,f){s.append(f,c)})),r&&s.append("Content-Type",r);var a=t.url,l=null;if(zm){var u=new zm;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}gd(a,$({method:t?.method||"GET",headers:s,keepalive:t.method==="POST"&&(o||0)<52428.8,body:i,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((c=>c.text().then((f=>{var h={statusCode:c.status,text:f};if(c.status===200)try{h.json=JSON.parse(f)}catch(g){L.error(g)}t.callback==null||t.callback(h)})))).catch((c=>{L.error(c),t.callback==null||t.callback({statusCode:0,text:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),md&&il.push({transport:"XHR",method:t=>{var e,n=new md;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=cd(t))!==null&&e!==void 0?e:{};pe(t.headers,(function(o,s){n.setRequestHeader(s,o)})),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(i)}}),kt!=null&&kt.sendBeacon&&il.push({transport:"sendBeacon",method:t=>{var e=xl(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=cd(t))!==null&&n!==void 0?n:{},o=typeof i=="string"?new Blob([i],{type:r}):i;kt.sendBeacon(e,o)}catch{}}});var Sl=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Sv(t,e,n){return _s({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var My={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>Sl(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!Sl(n,r))))),icontains:(t,e)=>e.map(nl).some((n=>t.map(nl).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(nl).every((n=>t.map(nl).every((r=>!n.includes(r)))))},nl=t=>t.toLowerCase();function Fy(t,e){return!t||Object.entries(t).every((n=>{var[r,i]=n,o=e?.[r];if(N(o)||Ln(o))return!1;var s=[String(o)],a=My[i.operator];return!!a&&a(i.values,s)}))}var dd=Fe("[Error tracking]"),af=class{constructor(e){var n,r;this.Jt=[],this.Kt=new xd([new bd,new Id,new Cd,new kd,new Td,new Ad,new Ed,new Rd],Gk("web:javascript",Uk,Kk)),this._instance=e,this.Jt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(Nd))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,o=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],s=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[Nd]:this.Jt,[Qm]:s})}get Yt(){var e,n=!!this._instance.get_property(Qm),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void dd.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void dd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void dd.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 n=e.reduce(((r,i)=>{var{type:o,value:s}=i;return Me(o)&&o.length>0&&r.$exception_types.push(o),Me(s)&&s.length>0&&r.$exception_values.push(s),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var i=r.values.map((o=>{var s,a=My[o.operator],l=fe(o.value)?o.value:[o.value],u=(s=n[o.key])!==null&&s!==void 0?s:[];return l.length>0&&a(l,u)}));return r.type==="OR"?i.some(Boolean):i.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,r,i,o,s=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=s[s.length-1];return(i=a==null||(o=a.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}Xt(e){return!de(e)&&fe(e)}},Zt=Fe("[FeatureFlags]"),cs=Fe("[FeatureFlags]",{debugEnabled:!0}),fd="$active_feature_flags",qi="$override_feature_flags",bv="$feature_flag_payloads",ds="$override_feature_flag_payloads",kv="$feature_flag_request_id",Cv="$feature_flag_evaluated_at",Ev=t=>{var e={};for(var[n,r]of rl(t||{}))r&&(e[n]=r);return e},Y1=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]})))):Zt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},X1=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),lf=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((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Zt.error("Invalid evaluation environment found:",n,"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(Od),n=this._instance.get_property(qi),r=this._instance.get_property(ds);if(!r&&!n)return e||{};var i=Pe({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var s of o){var a,l,u=i[s],c=n?.[s],f=N(c)?(a=u?.enabled)!==null&&a!==void 0&&a:!!c,h=N(c)?u.variant:typeof c=="string"?c:void 0,g=r?.[s],v=$({},u,{enabled:f,variant:f?h??u?.variant:void 0});f!==u?.enabled&&(v.original_enabled=u?.enabled),h!==u?.variant&&(v.original_variant=u?.variant),g&&(v.metadata=$({},u?.metadata,{payload:g,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),i[s]=v}return this.ii||(Zt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.ii=!0),i}getFlagVariants(){var e=this._instance.get_property(Yi),n=this._instance.get_property(qi);if(!n)return e||{};for(var r=Pe({},e),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(Zt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(bv),n=this._instance.get_property(ds);if(!n)return e||{};for(var r=Pe({},e||{}),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(Zt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,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 n;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:$({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(vs)||{}),group_properties:this._instance.get_property(ri)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var i=this._instance.config.__preview_remote_config,o=i?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",o+s);i&&(r.timezone=Iy()),this.ri=!0,this._instance.ci({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:On.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!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=!f,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(X1.FeatureFlags))Zt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,o=this._instance.get_property(kv)||void 0,s=this._instance.get_property(Cv)||void 0,a=this._instance.get_property(ul)||{};if((n.send_event||!("send_event"in n))&&(!(e in a)||!a[e].includes(i))){var l,u,c,f,h,g,v,_,x;fe(a[e])?a[e].push(i):a[e]=[i],(l=this._instance.persistence)==null||l.register({[ul]:a});var d=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:s,$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};N(d==null||(f=d.metadata)==null?void 0:f.version)||(p.$feature_flag_version=d.metadata.version);var m,y=(h=d==null||(g=d.reason)==null?void 0:g.description)!==null&&h!==void 0?h:d==null||(v=d.reason)==null?void 0:v.code;y&&(p.$feature_flag_reason=y),d!=null&&(_=d.metadata)!=null&&_.id&&(p.$feature_flag_id=d.metadata.id),N(d?.original_variant)&&N(d?.original_enabled)||(p.$feature_flag_original_response=N(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(x=d.metadata)!=null&&x.original_payload&&(p.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",p)}return r}Zt.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,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(i.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:On.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var s,a=(s=o.json)==null?void 0:s.featureFlagPayloads;n(a?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return N(r)?void 0:!!r}Zt.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((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(s,a,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var f=Y1(s),h=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(g){var _=s.requestId,x=s.evaluatedAt;if(fe(g)){Zt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(g)for(var p=0;p<g.length;p++)d[g[p]]=!0;a&&a.register({[fd]:g,[Yi]:d})}else{var m=g,y=v,w=h;s.errorsWhileComputingFlags&&(m=$({},l,m),y=$({},u,y),w=$({},c,w)),a&&a.register($({[fd]:Object.keys(Ev(m)),[Yi]:m||{},[bv]:y||{},[Od]:w||{}},_?{[kv]:_}:{},x?{[Cv]:x}:{}))}}})(e,this._instance.persistence,r,i,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),Zt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Zt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(qi),this._instance.persistence.unregister(ds),this.pi(),cs.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.ii=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(qi),cs.info("Flag overrides cleared");else if(r.flags){if(fe(r.flags)){for(var i={},o=0;o<r.flags.length;o++)i[r.flags[o]]=!0;this._instance.persistence.register({[qi]:i})}else this._instance.persistence.register({[qi]:r.flags});cs.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(ds),cs.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[ds]:r.payloads}),cs.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:r}=this.gi();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,o=(this._instance.get_property(ms)||[]).find((u=>u.flagKey===e)),s={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:s};o&&(a.$early_access_feature_name=o.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=$({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[fd]:Object.keys(Ev(l)),[Yi]:l}),this.pi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(ms),o=r?"&"+r.map((s=>"stage="+s)).join("&"):"";if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,l;if(s.json){var u=s.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(ms),(l=this._instance.persistence)==null||l.register({[ms]:u}),e(u)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}pi(e){var{flags:n,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(vs)||{};this._instance.register({[vs]:$({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(vs)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(ri)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=$({},r[i],e[i]),delete e[i]})),this._instance.register({[ri]:$({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(ri)||{};this._instance.register({[ri]:$({},n,{[e]:{}})})}else this._instance.unregister(ri)}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}},Q1=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ss=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&L.info("Persistence loaded",e.persistence,$({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){Q1.indexOf(e.persistence.toLowerCase())===-1&&(L.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&ke.H()?ke:n==="localstorage+cookie"&&Qa.H()?Qa:n==="sessionstorage"&&je.H()?je:n==="memory"?w1:n==="cookie"?hn:Qa.H()?Qa:hn}properties(){var e={};return pe(this.props,(function(n,r){if(r===Yi&&Ve(n))for(var i=Object.keys(n),o=0;o<i.length;o++)e["$feature/"+i[o]]=n[i[o]];else a=r,l=!1,(Ln(s=n1)?l:Bm&&s.indexOf===Bm?s.indexOf(a)!=-1:(pe(s,(function(u){if(l||(l=u===a))return al})),l))||(e[r]=n);var s,a,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Pe({},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,n,r){if(Ve(e)){N(n)&&(n="None"),this.xi=N(r)?this.$i:r;var i=!1;if(pe(e,((o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.props[s]=o,i=!0)})),i)return this.save(),!0}return!1}register(e,n){if(Ve(e)){this.xi=N(n)?this.$i:n;var r=!1;if(pe(e,((i,o)=>{e.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,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=ky(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);Zi(Ef(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=O?.referrer)?Ey(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Ay(),$referring_domain:O!=null&&O.referrer&&((e=hl(O.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[$d]||this.props[Dd]||this.register_once({[cl]:Ty(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};pe([Dd,$d],(s=>{var a=this.props[s];a&&pe(a,(function(l,u){e["$initial_"+vd(u)]=l}))}));var n,r,i=this.props[cl];if(i){var o=(n=Ry(i),r={},pe(n,(function(s,a){r["$initial_"+vd(a)]=s})),r);Pe(e,o)}return e}safe_merge(e){return pe(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,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!==n.persistence){var i=this.bi(e),o=this.props;this.clear(),this.Y=i,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,n){var r=this.props[gs]||{};r[e]=n,this.props[gs]=r,this.save()}remove_event_timer(e){var n=(this.props[gs]||{})[e];return N(n)||(delete this.props[gs][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},fs=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),q2=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),K2=(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})({}),G2=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),pd=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),Z2=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),Y2=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),X2=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),ol=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),Av=(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})({}),$y=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Rs=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.ki[e]||[])r(n);for(var i of this.ki["*"]||[])i(e,n)}};function Ki(t,e,n){if(de(t))return!1;switch(n){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 uf=class{constructor(e){this.Pi=new Rs,this.Ti=(n,r)=>this.Ri(n,r)&&this.Ii(n,r)&&this.Fi(n,r)&&this.Ci(n,r),this.Ri=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!N((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((r,i)=>{this.on(r,i)}))}}register(e){var n,r;if(!N((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((s=>{var a,l;(a=this.Oi)==null||a.add(s),(l=s.steps)==null||l.forEach((u=>{var c;(c=this.Mi)==null||c.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var i,o=new Set;e.forEach((s=>{var a;(a=s.steps)==null||a.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(o)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((i=>{this.Di(n,i)&&this.Pi.emit("actionCaptured",i.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!Ki(i,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var r;if(n==null||!n.href)return!0;var i=this.zi(e);if(i.length>0)return i.some((a=>Ki(a.href,n.href,n.href_matching||"exact")));var o,s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!s&&Ki((o=s.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var r;if(n==null||!n.text)return!0;var i=this.zi(e);if(i.length>0)return i.some((u=>Ki(u.text,n.text,n.text_matching||"exact")||Ki(u.$el_text,n.text,n.text_matching||"exact")));var o,s,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(u){for(var c,f=[],h=/(?::|")text="(.*?)"/g;!de(c=h.exec(u));)f.includes(c[1])||f.push(c[1]);return f})(l),s=n.text,a=n.text_matching||"exact",o.some((u=>Ki(u,s,a))))}Ui(e,n){var r,i;if(n==null||!n.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||Fy(n.properties.reduce(((r,i)=>{var o=fe(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:o,operator:i.operator||"exact"},r}),{}),e?.properties)}},ue=Fe("[Surveys]"),cf="seenSurvey_",J1=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},Tv=t=>{var e=""+cf+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+cf+t.id+"_"+t.current_iteration),e},eC=[pd.Popover,pd.Widget,pd.API],tC={ignoreConditions:!1,ignoreDelay:!1,displayType:$y.Popover},df=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&Fy(e.propertyFilters,n?.properties)}Gi(e,n){var r=new Map;return e.forEach((i=>{var o;(o=i.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((s=>{if(s!=null&&s.name){var a=r.get(s.name)||[];a.push(i.id),r.set(s.name,a)}}))})),r}Vi(e,n,r){var i,o=(r===fs.Activation?this.Hi:this.Bi).get(e),s=[];return(i=this._instance)==null||i.getSurveys((a=>{s=a.filter((l=>o?.includes(l.id)))})),s.filter((a=>{var l,u=(l=a.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((c=>c.name===e));return this.Wi(u,n)}))}register(e){var n;N((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((r=>{var i,o;return((i=r.conditions)==null?void 0:i.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new uf(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),n.forEach((r=>{var i,o,s,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.Yi)==null||a.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 n,r=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.events)&&((a=o.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),i=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.cancelEvents)&&((a=o.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));(r.length!==0||i.length!==0)&&((n=this._instance)==null||n.Ai(((o,s)=>{this.onEvent(o,s)})),this.Hi=this.Gi(e,fs.Activation),this.Bi=this.Gi(e,fs.Cancellation))}onEvent(e,n){var r,i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Xa])||[];if(ol.SHOWN===e&&n&&i.length>0){var o;ue.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:i});var s=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this.Xi(i))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,fs.Cancellation);l.length>0&&(ue.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((c=>c.id))}),l.forEach((c=>{var f,h=i.indexOf(c.id);h>=0&&i.splice(h,1),(f=this._instance)==null||f.cancelPendingSurvey(c.id)})),this.Xi(i))}if(this.Hi.has(e)){ue.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var u=this.Vi(e,n,fs.Activation);this.Xi(i.concat(u.map((c=>c.id))||[]))}}}onAction(e){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Xa])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var n;ue.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Xa]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Xa];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},ff=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 n=e.surveys;if(de(n))return ue.warn("Flags not loaded yet. Not loading surveys.");var r=fe(n);this.Zi=r?n.length>0:n,ue.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(cf)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((i=>localStorage.removeItem(i)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)ue.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ue.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ue.info("Not loading surveys in cookieless mode without consent.");else{var e=G?.__PosthogExtensions__;if(e){if(!N(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,n);var i=e.loadExternalDependency;if(!i)return void this.se("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else ue.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new df(this._instance),ue.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){ue.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ue.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(Ld);if(r&&!n)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:i=>{var o;this.te=!1;var s=i.statusCode;if(s!==200||!i.json){var a="Surveys API could not be loaded, status: "+s;return ue.error(a),e([],{isLoaded:!1,error:a})}var l,u=i.json.surveys||[],c=u.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(f)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(f))));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(o=this._instance.persistence)==null||o.register({[Ld]:u}),e(u,{isLoaded:!0})}})}catch(i){throw this.te=!1,i}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ue.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ue.warn("init was not called")}oe(e){var n=null;return this.getSurveys((r=>{var i;n=(i=r.find((o=>o.id===e)))!==null&&i!==void 0?i:null})),n}ae(e){if(de(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(de(this._surveyManager))return ue.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return de(this._surveyManager)?(ue.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((i=>{var o,s=(o=i.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(s){var a=this.ae(s);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var r;if(de(this._surveyManager))ue.warn("init was not called");else{var i=typeof e=="string"?this.oe(e):e;if(i!=null&&i.id)if(eC.includes(i.type)){var o=O?.querySelector(n);if(o)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(ue.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,a;ue.info("Rendering survey "+i.id+" with delay of "+((s=i.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,o),ue.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o);ue.warn("Survey element not found")}else ue.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ue.warn("Survey not found")}}displaySurvey(e,n){var r;if(de(this._surveyManager))ue.warn("init was not called");else{var i=this.oe(e);if(i){var o=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=$({},i,{appearance:$({},i.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var s=this.canRenderSurvey(i);if(!s.visible)return void ue.warn("Survey is not eligible to be displayed: ",s.disabledReason)}n.displayType!==$y.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else ue.warn("Survey not found")}}cancelPendingSurvey(e){de(this._surveyManager)?ue.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},Rv=Fe("[RateLimiter]"),pf=class{constructor(e){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=i=>{var o=i.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((s=>{Rv.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void Rv.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.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 n,r,i;e===void 0&&(e=!1);var o=new Date().getTime(),s=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Fd))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||e||(s.tokens=Math.max(0,s.tokens-1)),!a||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=a,(i=this.instance.persistence)==null||i.set_property(Fd,s),{isRateLimited:a,remainingTokens:s.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},ni=Fe("[RemoteConfig]"),hf=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(ni.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:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return ni.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void ni.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return ni.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){ni.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()):ni.info("__preview_remote_config is disabled. Logging config instead",e):ni.error("Failed to fetch remote config from PostHog.")}},gf=3e3,mf=class{constructor(e,n){this.he=!0,this.ve=[],this.de=fn(n?.flush_interval_ms||gf,250,5e3,L.createLogger("flush interval"),gf),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce($({},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 n=this._e(),r=function(){var o=n[i],s=new Date().getTime();o.data&&fe(o.data)&&pe(o.data,(a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp})),e.ce(o)};for(var i in n)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return pe(this.ve,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;N(e[o])&&(e[o]=$({},i,{data:[]})),(r=e[o].data)==null||r.push(i.data)})),this.ve=[],e}},nC=["retriesPerformedSoFar"],vf=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!N(E)&&"onLine"in E.navigator&&(this.be=E.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},Oe(E,"online",this.we),Oe(E,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=Mv(e,nC);gn(n)&&n>0&&(r.url=xl(r.url,{retry_count:n})),this._instance.ci($({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Se($({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(s){var a=3e3*Math.pow(2,s),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(n),i=Date.now()+r;this.ve.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),L.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(),n=[],r=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,N(E)||(this.we&&(E.removeEventListener("online",this.we),this.we=void 0),this.xe&&(E.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci($({},e,{transport:"sendBeacon"}))}catch(n){L.error(n)}this.ve=[]}},yf=class{constructor(e){this.ke=()=>{var n,r,i,o;this.Pe||(this.Pe={});var s=this.scrollElement(),a=this.scrollY(),l=s?Math.max(0,s.scrollHeight-s.clientHeight):0,u=a+(s?.clientHeight||0),c=s?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(a),this.Pe.maxScrollY=Math.max(a,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n: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,(i=this.Pe.maxContentY)!==null&&i!==void 0?i: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(){Oe(E,"scroll",this.ke,{capture:!0}),Oe(E,"scrollend",this.ke,{capture:!0}),Oe(E,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return E?.document.documentElement;var e=fe(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=E?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return E&&(E.scrollY||E.pageYOffset||E.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return E&&(E.scrollX||E.pageXOffset||E.document.documentElement.scrollLeft)||0}},rC=t=>Ty(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),bl=class{constructor(e,n,r,i){this.Te=o=>{var s=this.Re();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[Md]:a})}},this._instance=e,this.Ce=n,this.Fe=r,this.Ie=i||rC,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[Md]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?Ry(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return pe(Ef(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+vd(r)]=n})),e}},hd=Fe("[SessionId]"),kl=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,r){var i;if(this.Oe=[],this.Ae=void 0,this.Me=new Rs,this.De=(c,f)=>Math.abs(c-f)>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=n||pr,this.Ue=r||pr;var o=this.F.persistence_name||this.F.token,s=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*fn(s,60,36e3,hd.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 a=je.W(this.He),l=je.W(this.Be);a&&!l?this.je=a:je.V(this.He),je.G(this.Be,!0)}if((i=this.F.bootstrap)!=null&&i.sessionID)try{var u=(c=>{var f=c.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),u)}catch(c){hd.error("Invalid sessionID in bootstrap",c)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return N(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&je.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&je.G(this.He,e))}Je(){return this.je?this.je:this.qe()?je.W(this.He):null}We(e,n,r){e===this.Le&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[ll]:[n,e,r]}))}Ke(){var e=this.Fe.props[ll];return fe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&E&&(E.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&je.V(this.Be)},Oe(E,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,o,s]=this.Ke(),a=this.Je(),l=gn(s)&&s>0&&Math.abs(r-s)>864e5,u=!1,c=!o,f=!c&&!e&&this.De(r,i);c||f||l?(o=this.Ne(),a=this.Ue(),hd.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}}),s=r,u=!0):a||(a=this.Ue(),u=!0);var h=i===0||!e||l?r:i,g=s===0?new Date().getTime():s;return this.Ve(a),this.We(o,h,g),e||this.ze(),u&&this.Oe.forEach((v=>v(o,a,u?{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:a,sessionStartTimestamp:g,changeReason:u?{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},iC=["$set_once","$set"],dr=Fe("[SiteApps]"),_f=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var r=this.globalsForEvent(n);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=G._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 n,r,i,o,s,a,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(f))u[h]={id:c[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:$({},Mv(e,iC),{properties:$({},e.properties,_?{$set:$({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},_)}:{},v?{$set_once:$({},(i=(o=e.properties)==null?void 0:o.$set_once)!==null&&i!==void 0?i:{},v)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",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 n=this.apps[e.id],r=()=>{var a;!n.errored&&this.Xe.length&&(dr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((a=this.Ze)==null||a.call(this))},i=!1,o=a=>{n.errored=!a,n.loaded=!0,dr.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a)}});s&&(n.processEvent=s),i=!0}catch(a){dr.error("Error while initializing PostHog app with config id "+e.id,a),o(!1)}if(i&&n.loaded)try{r()}catch(a){dr.error("Error while processing buffered events PostHog app with config id "+e.id,a),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.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 n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){dr.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(u=>this.ir(u)))):void dr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var s=function(u){var c;G["__$$ph_site_app_"+u]=o._instance,(c=G.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,l,(f=>{if(f)return dr.error("Error while initializing PostHog app with config id "+u,f)}))};for(var{id:a,url:l}of e.siteApps)s(a)}else dr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Dy=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Um(n,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>Um(i?.brand,e))))return!0}catch{}return!!t.webdriver},ws=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),Iv="i.posthog.com",wf=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,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Iv,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=ws.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=ws.EU:this.er[this.apiHost]=ws.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===ws.CUSTOM)return this.apiHost+n;var r=Iv+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},oC={icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!E&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!E&&Sl(e.href,t),not_regex:(t,e)=>!!E&&!Sl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},xf=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((i=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,i.forEach((o=>{if(o.feature_flag_key){var s;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=n.sr)==null||s.set(o.feature_flag_key,o));var a=n._instance.getFeatureFlag(o.feature_flag_key);Me(a)&&o.variants[a]&&n.nr(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];t.ar(u)&&n.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(de(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(n)){var i,o=this._instance.getFeatureFlag(n),s=(i=this.sr)==null?void 0:i.get(n);o&&s!=null&&s.variants[o]&&this.nr(s.name,o,s.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=gl(e?.search,"__experiment_id"),r=gl(e?.search,"__experiment_variant");n&&r&&(t.rr("previewing web experiments "+n+" && "+r),this.getWebExperiments((i=>{this.lr(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);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 s=o.json.experiments||[];return e(s)}})}lr(e,n,r){var i=r.filter((o=>o.id===e));i&&i.length>0&&(t.rr("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.nr(i[0].name,n,i[0].variants[n].transforms))}static ar(e){return!de(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.url))return!0;var r,i,o,s=t.getWindowLocation();return!!s&&((r=e.conditions)==null||!r.url||oC[(i=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return E?.location}static hr(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.utm))return!0;var r=ky();if(r.utm_source){var i,o,s,a,l,u,c,f,h=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,v=(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,_=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return h&&v&&_&&g}return!1}static rr(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];L.info("[WebExperiments] "+e,r)}nr(e,n,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",i);var s=(o=document)==null?void 0:o.querySelectorAll(i.selector);s?.forEach((a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return kt&&this._instance?Dy(kt,this._instance.config.custom_blocked_useragents):void 0}},sC=Fe("[PostHog ExternalIntegrations]"),aC={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Sf=class{constructor(e){this._instance=e}it(e,n){var r;(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(i=>{if(i)return sC.error("failed to load script",i);n()}))}startIfEnabledOrStop(){var e=this,n=function(s){var a,l,u;!i||(a=G.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.it(aC[s],(()=>{var c;(c=G.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.start(e._instance)})),!i&&(l=G.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[s]&&((u=G.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.stop())};for(var[r,i]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(r)}}},bf="[SessionRecording]",ps=Fe(bf),Cl=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 ps.error("started without valid sessionManager"),new Error(bf+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(bf+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(nd))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return E&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var r=!N(Object.assign)&&!N(Array.from);this.cr&&r?(this.gr(e),ps.info("starting")):this.stopRecording()}}gr(e){var n,r,i;this.cr&&(G!=null&&(n=G.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=G.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(i=G.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return ps.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(Wv)}br(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,o=()=>{var s=e.sessionRecording===!1?void 0:e.sessionRecording,a=s?.sampleRate,l=de(a)?null:parseFloat(a);de(l)&&this.yr();var u=s?.minimumDurationMilliseconds;i.register({[nd]:$({enabled:!!s},s,{networkPayloadCapture:$({capturePerformance:e.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:N(u)?null:u,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers})})};o(),(n=this.pr)==null||n.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:ps.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,n):ps.warn("log called before recorder was ready")}get mr(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(nd);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,r;if((n=G.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=G.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,n))}},bs={},kf=()=>{},Gi="posthog",Vy=!Z1&&ct?.indexOf("MSIE")===-1&&ct?.indexOf("Mozilla")===-1,Pv=t=>{var e;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:t1(O?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:kf,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&&Me(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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(E==null||(e=E.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;L.error(r)},get_device_id:n=>n,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:gf},error_tracking:{},_onCapture:kf,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Nv=t=>{var e={};N(t.process_person)||(e.person_profiles=t.process_person),N(t.xhr_headers)||(e.request_headers=t.xhr_headers),N(t.cookie_name)||(e.persistence_name=t.cookie_name),N(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),N(t.store_google)||(e.save_campaign_params=t.store_google),N(t.verbose)||(e.debug=t.verbose);var n=Pe({},e,t);return fe(t.property_blacklist)&&(N(t.property_denylist)?n.property_denylist=t.property_blacklist:fe(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:L.error("Invalid value for property_denylist config: "+t.property_denylist)),n},Cf=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){L.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},El=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Cf,this.Sr=!1,this.version=In.LIB_VERSION,this.Er=new Rs,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Pv(),this.SentryIntegration=Kd,this.sentryIntegration=e=>(function(n,r){var i=ay(n,r);return{name:sy,processEvent:o=>i(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 lf(this),this.toolbar=new Gd(this),this.scrollManager=new yf(this),this.pageViewManager=new tf(this),this.surveys=new ff(this),this.experiments=new xf(this),this.exceptions=new af(this),this.rateLimiter=new pf(this),this.requestRouter=new wf(this),this.consent=new Ud(this),this.externalIntegrations=new Sf(this),this.people={set:(e,n,r)=>{var i=Me(e)?{[e]:n}:e;this.setPersonProperties(i),r?.({})},set_once:(e,n,r)=>{var i=Me(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r?.({})}},this.on("eventCaptured",(e=>L.info('send "'+e?.event+'"',e)))}init(e,n,r){if(r&&r!==Gi){var i,o=(i=bs[r])!==null&&i!==void 0?i:new t;return o._init(e,n,r),bs[r]=o,bs[Gi][r]=o,o}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),N(e)||yd(e))return L.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={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Pe({},Pv(n.defaults),Nv(n),{name:r,token:e})),this.config.on_xhr_error&&L.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:On.GZipJS;var o=this.Cr();this.persistence=new Ss(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ss($({},this.config,{persistence:"sessionStorage"}),o);var s=$({},this.persistence.props),a=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new mf((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new vf(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 kl(this),this.sessionPropsManager=new bl(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(L.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(L.info("Initializing extensions synchronously"),this.Dr(l)),In.DEBUG=In.DEBUG||this.config.debug,In.DEBUG&&L.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:s,s:a}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var u,c,f=this.config.get_device_id(pr()),h=(u=n.bootstrap)!=null&&u.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(Pn,(c=n.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,v,_=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((p=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[p])})).reduce(((p,m)=>{var y;return p[m]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[m])||!1,p}),{}),x=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,m)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[m]&&(p[m]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[m]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:os,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(pr());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(Pn,"anonymous")}return Oe(E,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?b1(this,(()=>this.Lr())):this.Lr(),hr(this.config._onCapture)&&this.config._onCapture!==kf&&(L.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&L.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 n=performance.now();this.historyAutocapture=new qd(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Zd(this).startIfEnabledOrStop()})),r.push((()=>{var i;this.siteApps=new _f(this),(i=this.siteApps)==null||i.init()})),e||r.push((()=>{this.sessionRecording=new Cl(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Bd(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new ef(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Jd(this)})),r.push((()=>{this.exceptionObserver=new Wd(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new vl(this,S1),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var i=this.Nr;this.Nr=void 0,this.fi(i)}})),this.Ur(r,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var r=e.shift();if(r)try{r()}catch(o){L.error("Error initializing extension:",o)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&L.info("PostHog extensions initialized ("+i+"ms)")}fi(e){var n,r,i,o,s,a,l,u;if(!O||!O.body)return L.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=te(e.supportedCompression,On.GZipJS)?On.GZipJS:te(e.supportedCompression,On.Base64)?On.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.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){L.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new hf(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()&&mr(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(Vy?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=xl(e.url,{ip:this.config.ip?1:0}),e.headers=$({},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,(n=>{var r,i,o,s=$({},n);s.timeout=s.timeout||6e4,s.url=xl(s.url,{_:new Date().getTime().toString(),ver:In.LIB_VERSION,compression:s.compression});var a=(r=s.transport)!==null&&r!==void 0?r:"fetch",l=il.filter((c=>!s.disableTransport||!c.transport||!s.disableTransport.includes(c.transport))),u=(i=(o=Hv(l,(c=>c.transport===a)))==null?void 0:o.method)!==null&&i!==void 0?i:l[0].method;if(!u)throw new Error("No available transport method");u(s)})($({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,r=[],i=[],o=[];mr(e,(a=>{a&&(n=a[0],fe(n)?o.push(a):hr(a)?a.call(this):fe(a)&&n==="alias"?r.push(a):fe(a)&&n.indexOf("capture")!==-1&&hr(this[n])?o.push(a):i.push(a))}));var s=function(a,l){mr(a,(function(u){if(fe(u[0])){var c=l;pe(u,(function(f){c=c[f[0]].apply(c,f.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};s(r,this),s(i,this),s(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!N(e)&&Me(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!Me(n?.$current_url)&&(L.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$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 a=new Date,l=r?.timestamp||a,u=pr(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,n||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),s&&(c.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(c.$set=r?.$set);var f,h=this.qr(r?.$set_once);if(h&&(c.$set_once=h),(c=Jk(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,N(r?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===ol.DISMISSED||e===ol.SENT){var g=n?.[Av.SURVEY_ID],v=n?.[Av.SURVEY_ITERATION];f={id:g,current_iteration:v},localStorage.getItem(Tv(f))||localStorage.setItem(Tv(f),"true"),c.$set=$({},c.$set,{[J1({id:g,current_iteration:v},e===ol.SENT?"responded":"dismissed")]:!0})}var _=$({},c.properties.$set,c.$set);if(Zi(_)||this.setPersonPropertiesForFlags(_),!de(this.config.before_send)){var x=this.Wr(c);if(!x)return;c=x}this.Er.emit("eventCaptured",c);var d={method:"POST",url:(i=r?._url)!==null&&i!==void 0?i: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(d):this.Mr.enqueue(d),c}L.critical("This capture call is ignored due to client rate limiting.")}}else L.error("No event name provided to posthog.capture")}else L.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,i,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var s=o?void 0:this.persistence.remove_event_timer(e),a=$({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=$({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Me(a.distinct_id)&&!gn(a.distinct_id)||yd(a.distinct_id))&&L.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=V1(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());a.$session_id=f,a.$window_id=h}this.sessionPropsManager&&Pe(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Pe(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(d){a.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===ws.CUSTOM&&(a.$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,i),a=Pe(a,u),e==="$pageview"&&O&&(a.title=O.title),!N(s)){var v=r.getTime()-s;a.$duration=parseFloat((v/1e3).toFixed(3))}ct&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Pe({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),fe(this.config.property_denylist)?pe(this.config.property_denylist,(function(d){delete a[d]})):L.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(L.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,e));var x=this.Gr();return a.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),a}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Pe({},r,i||{},e||{}),s=this.config.sanitize_properties;return s&&(L.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),this.Sr=!0,Zi(o)?void 0:o}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=tC),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return L.uninitializedWarning("posthog.identify");if(gn(e)&&(e=e.toString(),L.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()))L.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!==os){if(this.Vr("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(hs)&&(this.unregister(hs),this.register({distinct_id:e}));var s=(this.persistence.get_property(Pn)||"anonymous")==="anonymous";e!==i&&s?(this.persistence.set_property(Pn,"identified"),this.setPersonPropertiesForFlags($({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Tr=Sv(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(ul))}}else L.critical('The string "'+os+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else L.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var r=Sv(this.get_distinct_id(),e,n);this.Tr!==r?(this.setPersonPropertiesForFlags($({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=r):L.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){if(this.Vr("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:$({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else L.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,o;if(L.info("reset"),!this.__loaded)return L.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(Pn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:os,$device_id:null},"");else{var a=this.config.get_device_id(pr());this.register_once({distinct_id:a,$device_id:e?a:s},"")}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,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-s,0)}return i}alias(e,n){return e===this.get_property(jv)?(L.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(N(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(hs,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(L.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=$({},this.config);if(Ve(e)){var r,i,o,s,a;Pe(this.config,Nv(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ss($({},this.config,{persistence:"sessionStorage"}),l);var u=this.Rr(this.config.debug);gr(u)&&(this.config.debug=u),gr(this.config.debug)&&(this.config.debug?(In.DEBUG=!0,ke.H()&&ke.G("ph_debug","true"),L.info("set_config",{config:e,oldConfig:n,newConfig:$({},this.config)})):(In.DEBUG=!1,ke.H()&&ke.V("ph_debug"))),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(a=this.externalIntegrations)==null||a.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,o,s,a,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.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,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent($({},i,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Gi;return n!==Gi&&(n=Gi+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Pn))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Pn))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Zi(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[hs])&&((n=this.persistence)==null||(n=n.props)==null||!n[dl]))}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"?(L.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(dl,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,r,i,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((i=this.sessionPersistence)==null||i.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new kl(this),this.persistence&&(this.sessionPropsManager=new bl(this,this.sessionManager,this.persistence)),this.sessionRecording=new Cl(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(N(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e?.captureEventName)!==null&&i!==void 0?i:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else L.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;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:os,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):L.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Nn.GRANTED?"granted":e===Nn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return kt?Dy(kt,this.config.custom_blocked_useragents):void 0}Hr(){O&&(O.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:O.title},{send_instantly:!0}),this.kr&&(O.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),Oe(O,"visibilitychange",this.kr)))}debug(e){e===!1?(E?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(E?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,r,i,o,s,a,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?(L.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",i=!1,o=L,s=(n="advanced_disable_flags")in(e=l)&&!N(e[n]),a=r in e&&!N(e[r]),s?e[n]:a?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}Wr(e){if(de(this.config.before_send))return e;var n=fe(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),de(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Fk(e.event)?L.warn(o+". This can cause unexpected behavior."):L.info(o),null}r.properties&&!Zi(r.properties)||L.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,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Rr(e){var n=gr(e)&&!e,r=ke.H()&&ke.q("ph_debug")==="true";return!n&&(!!r||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=Qk(t.prototype[e[n]])})(El,["identify"]);var Ov,By=(Ov=bs[Gi]=new El,(function(){function t(){t.done||(t.done=!0,Vy=!1,pe(bs,(function(e){e._dom_loaded()})))}O!=null&&O.addEventListener?O.readyState==="complete"?t():Oe(O,"DOMContentLoaded",t,{capture:!1}):E&&L.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Ov);var Ff=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&typeof window<"u"&&e.apiKey){let n=e.enableFeatureFlags??!0,r="syntro_"+(e.apiKey.slice(-6)||"sdk");this.client=By.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:i=>{if(n&&this.featureFlagsCallback){i.onFeatureFlags(()=>{let s=this.getAllFeatureFlags();s&&this.featureFlagsCallback&&this.featureFlagsCallback(s)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&i.on("eventCaptured",o=>{let s=typeof o=="string"?o:o?.event,a=typeof o=="string"?void 0:o?.properties;typeof s=="string"&&this.captureCallback?.(s,a)})}},r)}}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[r,i]of Object.entries(e))r.startsWith("in_segment_")&&(n[r]=i===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,r){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,r){let i=`$experiment_${e}`;this.register({[i]:r??`variation_${n}`,[`${i}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:r??`variation_${n}`})}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 $f(t={}){return new Ff(t)}function lC(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var Df=class{constructor(){j(this,"sessionId");this.sessionId=lC(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,r){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,r){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}};function Vf(){return new Df}var Hy={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function jy(){return Hy}function Bf(t){let e=2166136261,n=t.length;for(let r=0;r<n;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Os(t,e,n){return n===2?Bf(Bf(t+e)+"")%1e4/1e4:n===1?Bf(e+t)%1e3/1e3:null}function uC(t){return t<=0?[]:new Array(t).fill(1/t)}function Il(t,e){return t>=e[0]&&t<e[1]}function Uy(t,e){let n=Os("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function Wy(t,e){for(let n=0;n<e.length;n++)if(Il(t,e[n]))return n;return-1}function Hf(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Pl(t,e){if(!e.length)return!1;let n=!1,r=!1;for(let i=0;i<e.length;i++){let o=fC(t,e[i].type,e[i].pattern);if(e[i].include===!1){if(o)return!1}else n=!0,o&&(r=!0)}return r||!n}function cC(t,e,n){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function dC(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&r.push([t.hash,n.hash,!1]),n.searchParams.forEach((i,o)=>{r.push([t.searchParams.get(o)||"",i,!1])}),!r.some(i=>!cC(i[0],i[1],i[2]))}catch{return!1}}function fC(t,e,n){try{let r=new URL(t,"https://_");if(e==="regex"){let i=Hf(n);return i?i.test(r.href)||i.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return dC(r,n);return!1}catch{return!1}}function qy(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=uC(t);n=n||r,n.length!==t&&(n=r);let i=n.reduce((s,a)=>a+s,0);(i<.99||i>1.01)&&(n=r);let o=0;return n.map(s=>{let a=o;return o+=s,[a,a+e*s]})}function Ky(t,e,n){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let i=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return i.length>0&&i[0]>=0&&i[0]<n?i[0]:null}function Gy(t){try{return t()}catch(e){return console.error(e),!1}}var zf=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function si(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||Hy.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let r=await n.importKey("raw",zf(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[i,o]=t.split("."),s=await n.decrypt({name:"AES-CBC",iv:zf(i)},r,zf(o));return new TextDecoder().decode(s)}catch{throw new Error("Failed to decrypt")}}function Ls(t){return typeof t=="string"?t:JSON.stringify(t)}function Ct(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(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function Zy(){let t;try{t="1.6.4"}catch{t=""}return t}function Yy(t,e){let n,r;try{n=new URL(t),r=new URL(e)}catch(i){return console.error(`Unable to merge query strings: ${i}`),e}return n.searchParams.forEach((i,o)=>{r.searchParams.has(o)||r.searchParams.set(o,i)}),r.toString()}function zy(t){return typeof t=="object"&&t!==null}function Nl(t){return t.urlPatterns&&t.variations.some(e=>zy(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>zy(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Ol(t,e){return new Promise(n=>{let r=!1,i,o=s=>{r||(r=!0,i&&clearTimeout(i),n(s||null))};e&&(i=setTimeout(()=>o(),e)),t.then(s=>o(s)).catch(()=>o())})}var Ye={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},mn=jy(),io={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>mn.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:r})=>{let i={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)};return mn.fetch(`${t}/api/eval/${e}`,i)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new mn.EventSource(`${t}/sub/${e}`,{headers:n}):new mn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),gC()):document.visibilityState==="hidden"&&(t=window.setTimeout(hC,Ye.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(mn.localStorage=globalThis.localStorage)}catch{}var oo=new Map,Xy=!1,Mn=new Map,Ll=new Map,so=new Map,ao=new Set;function Jy(t){Object.assign(Ye,t),Ye.backgroundSync||Gf()}async function e_({instance:t,timeout:e,skipCache:n,allowStale:r,backgroundSync:i}){return i||(Ye.backgroundSync=!1),mC({instance:t,allowStale:r,timeout:e,skipCache:n})}function pC(t){let e=Ms(t),n=oo.get(e)||new Set;n.add(t),oo.set(e,n)}function t_(t){oo.forEach(e=>e.delete(t))}function hC(){so.forEach(t=>{t&&(t.state="idle",qf(t))})}function gC(){so.forEach(t=>{t&&t.state==="idle"&&Kf(t)})}async function Qy(){try{if(!mn.localStorage)return;await mn.localStorage.setItem(Ye.cacheKey,JSON.stringify(Array.from(Mn.entries())))}catch{}}async function mC({instance:t,allowStale:e,timeout:n,skipCache:r}){let i=Ms(t),o=Uf(t),s=new Date,a=new Date(s.getTime()-Ye.maxAge+Ye.staleTTL);await vC();let l=!Ye.disableCache&&!r?Mn.get(o):void 0;return l&&(e||l.staleAt>s)&&l.staleAt>a?(l.sse&&ao.add(i),l.staleAt<s?jf(t):Wf(t),{data:l.data,success:!0,source:"cache"}):await Ol(jf(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Ms(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function Uf(t){let e=Ms(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),i={};r.forEach(a=>{i[a]=n[a]});let o=t.getForcedVariations(),s=t.getUrl();return`${e}||${JSON.stringify({ca:i,fv:o,url:s})}`}async function vC(){if(!Xy){Xy=!0;try{if(mn.localStorage){let t=await mn.localStorage.getItem(Ye.cacheKey);if(!Ye.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,r])=>{Mn.set(n,{...r,staleAt:new Date(r.staleAt)})}),n_()}}}catch{}if(!Ye.disableIdleStreams){let t=io.startIdleListener();t&&(io.stopIdleListener=t)}}}function n_(){let t=Array.from(Mn.entries()).map(([n,r])=>({key:n,staleAt:r.staleAt.getTime()})).sort((n,r)=>n.staleAt-r.staleAt),e=Math.min(Math.max(0,Mn.size-Ye.maxEntries),Mn.size);for(let n=0;n<e;n++)Mn.delete(t[n].key)}function r_(t,e,n){let r=n.dateUpdated||"",i=new Date(Date.now()+Ye.staleTTL),o=Ye.disableCache?void 0:Mn.get(e);if(o&&r&&o.version===r){o.staleAt=i,Qy();return}Ye.disableCache||(Mn.set(e,{data:n,version:r,staleAt:i,sse:ao.has(t)}),n_()),Qy();let s=oo.get(t);s&&s.forEach(a=>yC(a,n))}async function yC(t,e){await t.setPayload(e||t.getPayload())}async function jf(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),r=t.getClientKey(),i="isRemoteEval"in t&&t.isRemoteEval(),o=Ms(t),s=Uf(t),a=Ll.get(s);return a||(a=(i?io.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):io.fetchFeaturesCall({host:e,clientKey:r,headers:n})).then(u=>{if(!u.ok)throw new Error(`HTTP error: ${u.status}`);return u.headers.get("x-sse-support")==="enabled"&&ao.add(o),u.json()}).then(u=>(r_(o,s,u),Wf(t),Ll.delete(s),{data:u,success:!0,source:"network"})).catch(u=>(Ll.delete(s),{data:null,source:"error",success:!1,error:u})),Ll.set(s,a)),a}function Wf(t,e=!1){let n=Ms(t),r=Uf(t),{streamingHost:i,streamingHostRequestHeaders:o}=t.getApiHosts(),s=t.getClientKey();if(e&&ao.add(n),Ye.backgroundSync&&ao.has(n)&&mn.EventSource){if(so.has(n))return;let a={src:null,host:i,clientKey:s,headers:o,cb:l=>{try{if(l.type==="features-updated"){let u=oo.get(n);u&&u.forEach(c=>{jf(c)})}else if(l.type==="features"){let u=JSON.parse(l.data);r_(n,r,u)}a.errors=0}catch{i_(a)}},errors:0,state:"active"};so.set(n,a),Kf(a)}}function i_(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);qf(t),setTimeout(()=>{["idle","active"].includes(t.state)||Kf(t)},Math.min(e,3e5))}}function qf(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Kf(t){t.src=io.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=()=>i_(t),t.src.onopen=()=>{t.errors=0}}function _C(t,e){qf(t),so.delete(e)}function Gf(){ao.clear(),so.forEach(_C),oo.clear(),io.stopIdleListener()}function Ml(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Wf(t,!0),pC(t)}}var wC=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Xf={revert:function(){}},Vl=new Map,Qf=new Set;function xC(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function Bl(t){var e=Vl.get(t);return e||(e={element:t,attributes:{}},Vl.set(t,e)),e}function zl(t,e,n,r,i){var o=n(t),s={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&s._positionTimeout)){e==="position"&&(s._positionTimeout=setTimeout(function(){s._positionTimeout=null},1e3));var a=n(t);e==="position"&&a.parentNode===s.virtualValue.parentNode&&a.insertBeforeNode===s.virtualValue.insertBeforeNode||a!==s.virtualValue&&(s.originalValue=a,i(s))}}),mutationRunner:i,setValue:r,getCurrentValue:n};return e==="position"&&t.parentNode?s.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):s.observer.observe(t,xC(e)),s}function Hl(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,o_()):t!==n&&(e.isDirty=!0,o_())}function SC(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Hl(FC(e),t)}function bC(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),Hl(Array.from(e).filter(Boolean).join(" "),t)}function kC(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),Hl(e,t)}function CC(t){var e=t.parentSelector,n=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var i=n?document.querySelector(n):null;return n&&!i?null:{parentNode:r,insertBeforeNode:i}}function EC(t){var e=t.originalValue;t.mutations.forEach(function(n){var r=n.mutate(),i=CC(r);e=i||e}),Hl(e,t)}var AC=function(e){return e.innerHTML},TC=function(e,n){return e.innerHTML=n};function a_(t){var e=Bl(t);return e.html||(e.html=zl(t,"html",AC,TC,SC)),e.html}var RC=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},IC=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function l_(t){var e=Bl(t);return e.position||(e.position=zl(t,"position",RC,IC,EC)),e.position}var PC=function(e,n){return n?e.className=n:e.removeAttribute("class")},NC=function(e){return e.className};function u_(t){var e=Bl(t);return e.classes||(e.classes=zl(t,"class",NC,PC,bC)),e.classes}var OC=function(e){return function(n){var r;return(r=n.getAttribute(e))!=null?r:null}},LC=function(e){return function(n,r){return r!==null?n.setAttribute(e,r):n.removeAttribute(e)}};function c_(t,e){var n=Bl(t);return n.attributes[e]||(n.attributes[e]=zl(t,e,OC(e),LC(e),kC)),n.attributes[e]}function MC(t,e){var n=Vl.get(t);if(n)if(e==="html"){var r,i;(r=n.html)==null||(i=r.observer)==null||i.disconnect(),delete n.html}else if(e==="class"){var o,s;(o=n.classes)==null||(s=o.observer)==null||s.disconnect(),delete n.classes}else if(e==="position"){var a,l;(a=n.position)==null||(l=a.observer)==null||l.disconnect(),delete n.position}else{var u,c,f;(u=n.attributes)==null||(c=u[e])==null||(f=c.observer)==null||f.disconnect(),delete n.attributes[e]}}var Fl;function FC(t){return Fl||(Fl=document.createElement("div")),Fl.innerHTML=t,Fl.innerHTML}function $l(t,e,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||MC(t,e),n.setValue(t,r)}}function $C(t,e){t.html&&$l(e,"html",t.html),t.classes&&$l(e,"class",t.classes),t.position&&$l(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){$l(e,n,t.attributes[n])})}function o_(){Vl.forEach($C)}function DC(t,e){var n=null;t.kind==="html"?n=a_(e):t.kind==="class"?n=u_(e):t.kind==="attribute"?n=c_(e,t.attribute):t.kind==="position"&&(n=l_(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function VC(t,e){var n=null;if(t.kind==="html"?n=a_(e):t.kind==="class"?n=u_(e):t.kind==="attribute"?n=c_(e,t.attribute):t.kind==="position"&&(n=l_(e)),!!n){var r=n.mutations.indexOf(t);r!==-1&&n.mutations.splice(r,1),n.mutationRunner(n)}}function d_(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(r){e.has(r)||(t.elements.add(r),DC(t,r))})}}function BC(t){t.elements.forEach(function(e){return VC(t,e)}),t.elements.clear(),Qf.delete(t)}function s_(){Qf.forEach(d_)}var Zf;function zC(){typeof document>"u"||(Zf||(Zf=new MutationObserver(function(){s_()})),s_(),Zf.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}zC();function jl(t){return typeof document>"u"?Xf:(Qf.add(t),d_(t),{revert:function(){BC(t)}})}function Yf(t,e){return jl({kind:"html",elements:new Set,mutate:e,selector:t})}function f_(t,e){return jl({kind:"position",elements:new Set,mutate:e,selector:t})}function Fs(t,e){return jl({kind:"class",elements:new Set,mutate:e,selector:t})}function Dl(t,e,n){return wC.test(e)?e==="class"||e==="className"?Fs(t,function(r){var i=n(Array.from(r).join(" "));r.clear(),i&&i.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):jl({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):Xf}function HC(t){var e=t.selector,n=t.action,r=t.value,i=t.attribute,o=t.parentSelector,s=t.insertBeforeSelector;if(i==="html"){if(n==="append")return Yf(e,function(a){return a+(r??"")});if(n==="set")return Yf(e,function(){return r??""})}else if(i==="class"){if(n==="append")return Fs(e,function(a){r&&a.add(r)});if(n==="remove")return Fs(e,function(a){r&&a.delete(r)});if(n==="set")return Fs(e,function(a){a.clear(),r&&a.add(r)})}else if(i==="position"){if(n==="set"&&o)return f_(e,function(){return{insertBeforeSelector:s,parentSelector:o}})}else{if(n==="append")return Dl(e,i,function(a){return a!==null?a+(r??""):r??""});if(n==="set")return Dl(e,i,function(){return r??""});if(n==="remove")return Dl(e,i,function(){return null})}return Xf}var jC={html:Yf,classes:Fs,attribute:Dl,position:f_,declarative:HC},p_=jC;var Jf={};function yr(t,e,n){n=n||{};for(let[r,i]of Object.entries(e))switch(r){case"$or":if(!m_(t,i,n))return!1;break;case"$nor":if(m_(t,i,n))return!1;break;case"$and":if(!GC(t,i,n))return!1;break;case"$not":if(yr(t,i,n))return!1;break;default:if(!$s(i,UC(t,r),n))return!1}return!0}function UC(t,e){let n=e.split("."),r=t;for(let i=0;i<n.length;i++)if(r&&typeof r=="object"&&n[i]in r)r=r[n[i]];else return null;return r}function h_(t,e=!1){let n=`${t}${e?"/i":""}`;return Jf[n]||(Jf[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Jf[n]}function $s(t,e,n,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)||!v_(t))return JSON.stringify(e)===JSON.stringify(t);for(let i in t)if(!KC(i,e,t[i],n))return!1;return!0}function v_(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function WC(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 qC(t,e,n){if(!Array.isArray(t))return!1;let r=v_(e)?i=>$s(e,i,n):i=>yr(i,e,n);for(let i=0;i<t.length;i++)if(t[i]&&r(t[i]))return!0;return!1}function lo(t,e,n=!1){if(n){let r=i=>typeof i=="string"?i.toLowerCase():i;return Array.isArray(t)?t.some(i=>e.some(o=>r(i)===r(o))):e.some(i=>r(t)===r(i))}return Array.isArray(t)?t.some(r=>e.includes(r)):e.includes(t)}function g_(t,e,n,r=!1){if(!Array.isArray(t))return!1;for(let i=0;i<e.length;i++){let o=!1;for(let s=0;s<t.length;s++)if($s(e[i],t[s],n,r)){o=!0;break}if(!o)return!1}return!0}function KC(t,e,n,r){switch(t){case"$veq":return Ct(e)===Ct(n);case"$vne":return Ct(e)!==Ct(n);case"$vgt":return Ct(e)>Ct(n);case"$vgte":return Ct(e)>=Ct(n);case"$vlt":return Ct(e)<Ct(n);case"$vlte":return Ct(e)<=Ct(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?lo(e,n):!1;case"$ini":return Array.isArray(n)?lo(e,n,!0):!1;case"$inGroup":return lo(e,r[n]||[]);case"$notInGroup":return!lo(e,r[n]||[]);case"$nin":return Array.isArray(n)?!lo(e,n):!1;case"$nini":return Array.isArray(n)?!lo(e,n,!0):!1;case"$not":return!$s(n,e,r);case"$size":return Array.isArray(e)?$s(n,e.length,r):!1;case"$elemMatch":return qC(e,n,r);case"$all":return Array.isArray(n)?g_(e,n,r):!1;case"$alli":return Array.isArray(n)?g_(e,n,r,!0):!1;case"$regex":try{return h_(n).test(e)}catch{return!1}case"$regexi":try{return h_(n,!0).test(e)}catch{return!1}case"$type":return WC(e)===n;default:return console.error("Unknown operator: "+t),!1}}function m_(t,e,n){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(yr(t,e[r],n))return!0;return!1}function GC(t,e,n){for(let r=0;r<e.length;r++)if(!yr(t,e[r],n))return!1;return!0}var ZC="Feature Evaluated",YC="Experiment Viewed";function XC(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),e}function QC(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 uo(t){try{await t()}catch{}}function y_(t,e,n){if(t.user.trackedExperiments){let i=ql(e,n);if(t.user.trackedExperiments.has(i))return[];t.user.trackedExperiments.add(i)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let i=t.global.trackingCallback;r.push(uo(()=>i(e,n,t.user)))}if(t.user.trackingCallback){let i=t.user.trackingCallback;r.push(uo(()=>i(e,n)))}if(t.global.eventLogger){let i=t.global.eventLogger;r.push(uo(()=>i(YC,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return r}function JC(t,e,n){if(t.user.trackedFeatureUsage){let r=JSON.stringify(n.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:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;uo(()=>r(e,n,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;uo(()=>r(e,n))}if(t.global.eventLogger){let r=t.global.eventLogger;uo(()=>r(ZC,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function Ul(t,e){if(e.stack.evaluatedFeatures.has(t))return _r(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=XC(e);if(n.has(t))return _r(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return _r(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let i=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(i);let u=Ul(l.id,e);if(u.source==="cyclicPrerequisite")return _r(e,t,null,"cyclicPrerequisite");let c={value:u.value};if(!yr(c,l.condition||{})){if(l.gate)return _r(e,t,null,"prerequisite");continue e}}if(o.filters&&x_(o.filters,e))continue;if("force"in o){if(o.condition&&!w_(o.condition,e)||!eE(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=>{!y_(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),_r(e,t,o.force,"force",o.id)}if(!o.variations)continue;let s={variations:o.variations,key:o.key||t};"coverage"in o&&(s.coverage=o.coverage),o.weights&&(s.weights=o.weights),o.hashAttribute&&(s.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(s.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(s.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(s.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(s.minBucketVersion=o.minBucketVersion),o.namespace&&(s.namespace=o.namespace),o.meta&&(s.meta=o.meta),o.ranges&&(s.ranges=o.ranges),o.name&&(s.name=o.name),o.phase&&(s.phase=o.phase),o.seed&&(s.seed=o.seed),o.hashVersion&&(s.hashVersion=o.hashVersion),o.filters&&(s.filters=o.filters),o.condition&&(s.condition=o.condition);let{result:a}=Wl(s,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(s,a),a.inExperiment&&!a.passthrough)return _r(e,t,a.value,"experiment",o.id,s,a)}}return _r(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function Wl(t,e,n){let r=t.key,i=t.variations.length;if(i<2)return{result:Se(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:Se(n,t,-1,!1,e)};if(t=tE(t,n),t.urlPatterns&&!Pl(n.user.url||"",t.urlPatterns))return{result:Se(n,t,-1,!1,e)};let o=Ky(r,n.user.url||"",i);if(o!==null)return{result:Se(n,t,o,!1,e)};let s=QC(n);if(r in s){let x=s[r];return{result:Se(n,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Se(n,t,-1,!1,e)};let{hashAttribute:a,hashValue:l}=ai(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Se(n,t,-1,!1,e)};let u=-1,c=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:d}=iE({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});c=x>=0,u=x,f=!!d}if(!c){if(t.filters){if(x_(t.filters,n))return{result:Se(n,t,-1,!1,e)}}else if(t.namespace&&!Uy(l,t.namespace))return{result:Se(n,t,-1,!1,e)};if(t.include&&!Gy(t.include))return{result:Se(n,t,-1,!1,e)};if(t.condition&&!w_(t.condition,n))return{result:Se(n,t,-1,!1,e)};if(t.parentConditions){let x=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(x);let p=Ul(d.id,n);if(p.source==="cyclicPrerequisite")return{result:Se(n,t,-1,!1,e)};let m={value:p.value};if(!yr(m,d.condition||{}))return{result:Se(n,t,-1,!1,e)}}}if(t.groups&&!rE(t.groups,n))return{result:Se(n,t,-1,!1,e)}}if(t.url&&!nE(t.url,n))return{result:Se(n,t,-1,!1,e)};let h=Os(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:Se(n,t,-1,!1,e)};if(!c){let x=t.ranges||qy(i,t.coverage===void 0?1:t.coverage,t.weights);u=Wy(h,x)}if(f)return{result:Se(n,t,-1,!1,e,void 0,!0)};if(u<0)return{result:Se(n,t,-1,!1,e)};if("force"in t)return{result:Se(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:Se(n,t,-1,!1,e)};if(t.status==="stopped")return{result:Se(n,t,-1,!1,e)};let g=Se(n,t,u,!0,e,h,c);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:d,doc:p}=sE(n,a,Ls(l),{[ep(t.key,t.bucketVersion)]:g.key});x&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=p,n.user.saveStickyBucketAssignmentDoc(p))}let v=y_(n,t,g);v.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let _=v.length?v.length===1?v[0]:Promise.all(v).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:_}}function _r(t,e,n,r,i,o,s){let a={value:n,on:!!n,off:!n,source:r,ruleId:i||""};return o&&(a.experiment=o),s&&(a.experimentResult=s),r!=="override"&&JC(t,e,a),a}function __(t){return{...t.user.attributes,...t.user.attributeOverrides}}function w_(t,e){return yr(__(e),t,e.global.savedGroups||{})}function x_(t,e){return t.some(n=>{let{hashValue:r}=ai(e,n.attribute);if(!r)return!0;let i=Os(n.seed,r,n.hashVersion||2);return i===null?!0:!n.ranges.some(o=>Il(i,o))})}function eE(t,e,n,r,i,o,s){if(!i&&o===void 0)return!0;if(!i&&o===0)return!1;let{hashValue:a}=ai(t,n,r);if(!a)return!1;let l=Os(e,a,s||1);return l===null?!1:i?Il(l,i):o!==void 0?l<=o:!0}function Se(t,e,n,r,i,o,s){let a=!0;(n<0||n>=e.variations.length)&&(n=0,a=!1);let{hashAttribute:l,hashValue:u}=ai(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),c=e.meta?e.meta[n]:{},f={key:c.key||""+n,featureId:i,inExperiment:a,hashUsed:r,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:u,stickyBucketUsed:!!s};return c.name&&(f.name=c.name),o!==void 0&&(f.bucket=o),c.passthrough&&(f.passthrough=c.passthrough),f}function tE(t,e){let n=t.key,r=e.global.overrides;return r&&r[n]&&(t=Object.assign({},t,r[n]),typeof t.url=="string"&&(t.url=Hf(t.url))),t}function ai(t,e,n){let r=e||"id",i="",o=__(t);return o[r]&&(i=o[r]),!i&&n&&(o[n]&&(i=o[n]),i&&(r=n)),{hashAttribute:r,hashValue:i}}function nE(t,e){let n=e.user.url;if(!n)return!1;let r=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(r))}function rE(t,e){let n=e.global.groups||{};for(let r=0;r<t.length;r++)if(n[t[r]])return!0;return!1}function iE({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:r,expFallbackAttribute:i,expMinBucketVersion:o,expMeta:s}){n=n||0,o=o||0,r=r||"id",s=s||[];let a=ep(e,n),l=oE(t,r,i);if(o>0)for(let f=0;f<o;f++){let h=ep(e,f);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let u=l[a];if(u===void 0)return{variation:-1};let c=s.findIndex(f=>f.key===u);return c<0?{variation:-1}:{variation:c}}function ep(t,e){return e=e||0,`${t}__${e}`}function tp(t,e){return`${t}||${e}`}function oE(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:i}=ai(t,e),o=tp(r,Ls(i)),{hashAttribute:s,hashValue:a}=ai(t,n),l=a?tp(s,Ls(a)):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 sE(t,e,n,r){let i=tp(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[i]?t.user.stickyBucketAssignmentDocs[i].assignments||{}:{},s={...o,...r},a=JSON.stringify(o)!==JSON.stringify(s);return{key:i,doc:{attributeName:e,attributeValue:n,assignments:s},changed:a}}function aE(t,e){let n=new Set,r=e&&e.features?e.features:t.global.features||{},i=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let s=r[o];if(s.rules)for(let a of s.rules)a.variations&&(n.add(a.hashAttribute||"id"),a.fallbackAttribute&&n.add(a.fallbackAttribute))}),i.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function S_(t,e,n){let r=np(t,n);return e.getAllAssignments(r)}function np(t,e){let n={};return aE(t,e).forEach(i=>{let{hashValue:o}=ai(t,i);n[i]=Ls(o)}),n}async function b_(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await si(t.encryptedFeatures,e,n))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await si(t.encryptedExperiments,e,n))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await si(t.encryptedSavedGroups,e,n))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function k_(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 ql(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var co=typeof window<"u"&&typeof document<"u",lE=Zy(),Ds=class{constructor(e){if(e=e||{},this.version=lE,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 n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)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 n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>n.saveAssignments(r)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),co&&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 n in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[n];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await b_(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.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,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,Ml(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&Jy(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Ml(this,e),{success:!0,source:"init"};{let{data:n,...r}=await this._refresh({...e,allowStale:!0});return Ml(this,e),await this.setPayload(n||{}),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 n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return k_(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:n,allowStale:r,streaming:i}){if(!this._options.clientKey)throw new Error("Missing clientKey");return e_({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:r,backgroundSync:i??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,n,r){let i=await si(e,n||this._options.decryptionKey,r);this.setFeatures(JSON.parse(i))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,r){let i=await si(e,n||this._options.decryptionKey,r);this.setExperiments(JSON.parse(i))}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(n=>{try{n()}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,t_(this),e.destroyAllStreams&&Gf(),this.logs=[],co&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=Wl(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}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,n){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let i=this._isAutoExperimentBlockedByContext(e),o,s;i?o=Se(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:s}=Wl(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let a=JSON.stringify(o.value);if(!n&&o.inExperiment&&r&&r.valueHash===a)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Nl(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let u=e.persistQueryString?Yy(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Pl(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:f}=this._getNavigateFunction();if(c)if(co)Promise.all([...s?[Ol(s,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??f))]).then(()=>{try{c(u)}catch(h){console.error(h)}});else try{c(u)}catch(h){console.error(h)}}else if(l==="visual"){let u=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);u&&this._activeAutoExperiments.set(e,{undo:u,valueHash:a})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],r=new Set(n);this._activeAutoExperiments.forEach((i,o)=>{r.has(o)||(i.undo(),this._activeAutoExperiments.delete(o))});for(let i of n){let o=this._runAutoExperiment(i,e);if(o&&o.inExperiment&&Nl(i)==="redirect")break}}_onExperimentEval(e,n){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,r)}_fireSubscriptions(e,n,r){(!r||r.result.inExperiment!==n.inExperiment||r.result.variationId!==n.variationId)&&this._subscriptions.forEach(i=>{try{i(e,n)}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,n){let r=this.evalFeature(e).value;return r===null?n:r}feature(e){return this.evalFeature(e)}evalFeature(e){return Ul(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[ql(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.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,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(ql(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(co?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Nl(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let i of e.variations){if(!i||!i.urlRedirect)continue;let o=new URL(i.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}:co?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!co)return;let n=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),n.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),n.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{n.push(p_.declarative(r).revert)}),()=>{n.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),r=await S_(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),i=np(r,n);return e.getAllAssignmentsSync(i)}inDevMode(){return!!this._options.enableDevMode}};var uE="https://experiment.syntrologie.com",rp=class{constructor(e={}){j(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(r,i)=>{e.onExperimentViewed(r.key,i.variationId,typeof i.value=="string"?i.value:`variation_${i.variationId}`)}:void 0;this.gb=new Ds({...e,apiHost:e.apiHost??uE,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}shouldRenderRectangle(e){let n=e.experiment;if(!n||!n.featureKey)return!0;let r=this.gb.getFeatureValue(n.featureKey,null);if(r==null)return!1;if(typeof n.variationId=="number")return Number(r)===n.variationId;if(typeof n.variationValue<"u")return r===n.variationValue;if(n.predicate)try{return n.predicate(r)}catch{return!1}return!!r}};function ip(t={}){return new rp(t)}var wr=ee(Et(),1);var cp=!1;function D_(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function dp(t){if(D_()){cp=!0;return}cp=t??!1}function CE(){return D_()?!0:cp}function F(t,e,n){CE()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function ft(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function Yl(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var EE=t=>[...t].sort((e,n)=>(e.order??0)-(n.order??0));function V_({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:r}){let[i,o]=(0,wr.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,wr.useCallback)(async()=>{try{o(u=>({...u,isLoading:!0,error:void 0}));let a=await t();F("SmartCanvas Config","Raw config response",a);let l=a.tiles||[];r&&a.routes&&r.setRoutes(a.routes),r?(l=await r.filterTiles(l),n&&(l=l.filter(u=>n.shouldRenderRectangle(u)))):n&&(l=l.filter(u=>n.shouldRenderRectangle(u))),F("SmartCanvas Config",`Tile count after filtering: ${l.length}`),o({tiles:EE(l),actions:a.actions||[],isLoading:!1,fetchedAt:a.fetchedAt,canvasTitle:a.canvasTitle,configVersion:a.configVersion,theme:a.theme,launcher:a.launcher,routes:a.routes})}catch(a){o(l=>({...l,isLoading:!1,error:a instanceof Error?a.message:"Unknown error"}))}},[n,t,r]);return(0,wr.useEffect)(()=>{if(s(),!e)return;let a=setInterval(s,e);return()=>clearInterval(a)},[s,e]),(0,wr.useMemo)(()=>i,[i])}var $n=ee(Et(),1);var Bs=ee(Et(),1),ie=ee(ve(),1),OE={success:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M6 10l2.5 2.5L14 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("path",{d:"M10 2L18 17H2L10 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,ie.jsx)("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]}),error:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),info:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"6",r:"0.75",fill:"currentColor"})]}),alert:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]})};function LE({onClick:t,color:e}){return(0,ie.jsx)("button",{onClick:n=>{n.stopPropagation(),t()},style:{position:"absolute",top:"8px",right:"8px",width:"20px",height:"20px",padding:0,border:"none",background:"rgba(255, 255, 255, 0.1)",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:e,opacity:.6,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="1"},onMouseLeave:n=>{n.currentTarget.style.opacity="0.6"},"aria-label":"Dismiss",children:(0,ie.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,ie.jsx)("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})}function ME(t){let e={success:{bg:"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))",border:"var(--sc-color-success, #34c759)",icon:"var(--sc-color-success, #34c759)",text:"var(--sc-color-text, #f5f5f7)"},warning:{bg:"var(--sc-color-warning-muted, rgba(255, 159, 10, 0.15))",border:"var(--sc-color-warning, #ff9f0a)",icon:"var(--sc-color-warning, #ff9f0a)",text:"var(--sc-color-text, #f5f5f7)"},error:{bg:"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))",border:"var(--sc-color-error, #ff453a)",icon:"var(--sc-color-error, #ff453a)",text:"var(--sc-color-text, #f5f5f7)"},info:{bg:"var(--sc-color-info-muted, rgba(10, 132, 255, 0.15))",border:"var(--sc-color-info, #0a84ff)",icon:"var(--sc-color-info, #0a84ff)",text:"var(--sc-color-text, #f5f5f7)"},alert:{bg:"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))",border:"var(--sc-color-primary, #6366f1)",icon:"var(--sc-color-primary, #6366f1)",text:"var(--sc-color-text, #f5f5f7)"}};return e[t]||e.info}function fp({content:t,onDismiss:e,accentColor:n}){let[r,i]=(0,Bs.useState)(!1),[o,s]=(0,Bs.useState)(t.type==="warning"?t.countdown??null:null);(0,Bs.useEffect)(()=>{if(o===null||o<=0)return;let d=setInterval(()=>{s(p=>p!==null&&p>0?p-1:null)},1e3);return()=>clearInterval(d)},[o]);let a=()=>{i(!0),setTimeout(()=>e?.(),200)},l=ME(t.type),u=OE[t.type],c={position:"relative",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-md, 10px)",background:l.bg,borderLeft:`3px solid ${l.border}`,opacity:r?0:1,transform:r?"translateX(10px)":"translateX(0)",transition:"opacity 0.2s ease, transform 0.2s ease"},f={display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-sm, 0.5rem)"},h={color:l.icon,flexShrink:0,marginTop:"1px"},g={flex:1,minWidth:0,paddingRight:t.dismissible?"24px":0},v={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:l.text,margin:0,lineHeight:"var(--sc-line-height-tight, 1.25)"},_={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:"var(--sc-line-height-normal, 1.5)"},x={fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)",marginTop:"var(--sc-spacing-sm, 0.5rem)"};return(0,ie.jsxs)("div",{style:c,children:[(0,ie.jsxs)("div",{style:f,children:[(0,ie.jsx)("div",{style:h,children:(0,ie.jsx)(u,{})}),(0,ie.jsxs)("div",{style:g,children:[(0,ie.jsx)("h4",{style:v,children:t.title}),t.body&&(0,ie.jsx)("p",{style:_,children:t.body}),t.type==="error"&&t.errorCode&&(0,ie.jsxs)("p",{style:{..._,fontFamily:"var(--sc-font-family-mono, monospace)"},children:["Code: ",t.errorCode]}),t.type==="info"&&t.learnMoreUrl&&(0,ie.jsx)("a",{href:t.learnMoreUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-sm, 0.8rem)",color:l.icon,textDecoration:"none"},onClick:d=>d.stopPropagation(),children:"Learn more \u2192"}),o!==null&&o>0&&(0,ie.jsxs)("p",{style:{..._,color:l.icon},children:["Action required in ",o,"s"]}),t.timestamp&&(0,ie.jsx)("p",{style:x,children:t.timestamp})]})]}),t.dismissible&&(0,ie.jsx)(LE,{onClick:a,color:l.text})]})}var j_=ee(Et(),1),Ce=ee(ve(),1);function FE({trend:t}){let e=t.direction==="up",n=t.direction==="down";return(0,Ce.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"var(--sc-border-radius-full, 9999px)",background:e?"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))":n?"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))":"rgba(142, 142, 147, 0.15)",color:e?"var(--sc-color-success, #34c759)":n?"var(--sc-color-error, #ff453a)":"var(--sc-color-text-muted, #8e8e93)",fontSize:"var(--sc-font-size-xs, 0.7rem)",fontWeight:"var(--sc-font-weight-medium, 500)"},children:[(0,Ce.jsx)(()=>(0,Ce.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{transform:e?"rotate(0deg)":n?"rotate(180deg)":"rotate(90deg)"},children:(0,Ce.jsx)("path",{d:"M5 1v8M5 1L2 4M5 1l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),{}),t.value,t.timeframe&&(0,Ce.jsx)("span",{style:{color:"var(--sc-color-text-muted, #8e8e93)"},children:t.timeframe})]})}function $E({data:t,color:e}){let{path:n,width:r,height:i}=(0,j_.useMemo)(()=>{if(t.length<2)return{path:"",width:60,height:24};let l=Math.min(...t),c=Math.max(...t)-l||1;return{path:t.map((g,v)=>{let _=2+v/(t.length-1)*56,x=22-(g-l)/c*20;return{x:_,y:x}}).reduce((g,v,_)=>g+(_===0?`M ${v.x} ${v.y}`:` L ${v.x} ${v.y}`),""),width:60,height:24}},[t]);return n?(0,Ce.jsxs)("svg",{width:r,height:i,viewBox:`0 0 ${r} ${i}`,style:{overflow:"visible"},children:[(0,Ce.jsx)("path",{d:n,stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,Ce.jsx)("defs",{children:(0,Ce.jsxs)("linearGradient",{id:"sparkline-gradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,Ce.jsx)("stop",{offset:"0%",stopColor:e,stopOpacity:"0.3"}),(0,Ce.jsx)("stop",{offset:"100%",stopColor:e,stopOpacity:"0"})]})}),(0,Ce.jsx)("path",{d:`${n} L ${r-2} ${i} L 2 ${i} Z`,fill:"url(#sparkline-gradient)"})]}):null}function pp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"},i={display:"flex",alignItems:"baseline",gap:"var(--sc-spacing-xs, 0.25rem)"},o={fontSize:"var(--sc-font-size-xxl, 1.5rem)",fontWeight:"var(--sc-font-weight-bold, 700)",color:n,letterSpacing:"-0.02em",lineHeight:1},s={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-normal, 400)",color:"var(--sc-color-text-muted, #8e8e93)"},a={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:0},l={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"var(--sc-spacing-xs, 0.25rem)"};return(0,Ce.jsxs)("div",{style:r,children:[(0,Ce.jsxs)("div",{style:i,children:[t.prefix&&(0,Ce.jsx)("span",{style:s,children:t.prefix}),(0,Ce.jsx)("span",{style:o,children:t.value}),t.suffix&&(0,Ce.jsx)("span",{style:s,children:t.suffix})]}),(0,Ce.jsx)("p",{style:a,children:t.label}),(t.trend||t.sparkline)&&(0,Ce.jsxs)("div",{style:l,children:[t.trend&&(0,Ce.jsx)(FE,{trend:t.trend}),t.sparkline&&t.sparkline.length>1&&(0,Ce.jsx)($E,{data:t.sparkline,color:n})]})]})}var pt=ee(ve(),1);function DE({item:t,accentColor:e,layout:n}){let r=t.highlight,i={display:"flex",flexDirection:n==="list"?"row":"column",alignItems:n==="list"?"center":"flex-start",gap:n==="list"?"var(--sc-spacing-md, 0.75rem)":"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:r?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"var(--sc-color-background-subtle, rgba(0, 0, 0, 0.2))",border:r?`1px solid ${e}`:"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))",transition:"all 0.15s ease"},o={fontSize:"1.25rem",marginBottom:n==="list"?0:"var(--sc-spacing-xs, 0.25rem)"},s={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",flex:n==="list"?1:void 0},a={fontSize:"var(--sc-font-size-lg, 1rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:r?e:"var(--sc-color-text, #f5f5f7)"};return(0,pt.jsxs)("div",{style:i,children:[t.icon&&(0,pt.jsx)("span",{style:o,children:t.icon}),(0,pt.jsx)("span",{style:s,children:t.label}),(0,pt.jsx)("span",{style:a,children:t.value})]})}function hp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.layout||"grid",i=t.columns||2,o=t.items;if(t.highlightBest&&!t.items.some(a=>a.highlight)){let a=t.items.map(u=>({...u,numericValue:typeof u.value=="number"?u.value:parseFloat(String(u.value))})),l=Math.max(...a.map(u=>u.numericValue||0));o=a.map(u=>({...u,highlight:u.numericValue===l}))}let s={display:r==="table"?"block":r==="list"?"flex":"grid",flexDirection:r==="list"?"column":void 0,gridTemplateColumns:r==="grid"?`repeat(${i}, 1fr)`:void 0,gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"};return r==="table"?(0,pt.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--sc-font-size-sm, 0.8rem)"},children:(0,pt.jsx)("tbody",{children:o.map((a,l)=>(0,pt.jsxs)("tr",{style:{borderBottom:l<o.length-1?"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))":void 0},children:[(0,pt.jsxs)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",color:"var(--sc-color-text-secondary, #a1a1a6)",display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[a.icon&&(0,pt.jsx)("span",{children:a.icon}),a.label]}),(0,pt.jsx)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",textAlign:"right",fontWeight:"var(--sc-font-weight-semibold, 600)",color:a.highlight?n:"var(--sc-color-text, #f5f5f7)"},children:a.value})]},l))})}):(0,pt.jsx)("div",{style:s,children:o.map((a,l)=>(0,pt.jsx)(DE,{item:a,accentColor:n,layout:r},l))})}var Ql=ee(Et(),1),ae=ee(ve(),1);function VE({value:t,maxValue:e,onChange:n,color:r}){let[i,o]=(0,Ql.useState)(null);return(0,ae.jsx)("div",{style:{display:"flex",gap:"4px"},children:Array.from({length:e},(s,a)=>{let l=a+1,u=(i??t??0)>=l;return(0,ae.jsx)("button",{onClick:()=>n(l),onMouseEnter:()=>o(l),onMouseLeave:()=>o(null),style:{width:"28px",height:"28px",padding:0,border:"none",background:"none",cursor:"pointer",color:u?r:"var(--sc-color-text-muted, #8e8e93)",transition:"color 0.15s ease, transform 0.1s ease",transform:i===l?"scale(1.15)":"scale(1)"},"aria-label":`Rate ${l} out of ${e}`,children:(0,ae.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:u?"currentColor":"none",children:(0,ae.jsx)("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},a)})})}function BE({value:t,onChange:e,color:n}){let r=i=>({width:"48px",height:"48px",padding:"8px",border:"none",borderRadius:"var(--sc-border-radius-md, 10px)",background:i?n:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:i?"white":"var(--sc-color-text-muted, #8e8e93)",transition:"all 0.15s ease"});return(0,ae.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,ae.jsx)("button",{onClick:()=>e(1),style:r(t===1),"aria-label":"Thumbs up",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===1?"currentColor":"none"})})}),(0,ae.jsx)("button",{onClick:()=>e(0),style:r(t===0),"aria-label":"Thumbs down",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{transform:"rotate(180deg)"},children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===0?"currentColor":"none"})})})]})}function zE({value:t,maxValue:e,onChange:n,color:r}){return(0,ae.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[(0,ae.jsx)("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:Array.from({length:e+1},(i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>n(o),style:{width:"28px",height:"32px",padding:0,border:s?`2px solid ${r}`:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.12))",borderRadius:"var(--sc-border-radius-sm, 6px)",background:s?r:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:s?"white":"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-medium, 500)",transition:"all 0.15s ease"},"aria-label":`Rate ${o}`,children:o},o)})}),(0,ae.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Not likely"}),(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Very likely"})]})]})}function HE({value:t,onChange:e,color:n}){return(0,ae.jsx)("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F604}"].map((i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>e(o),style:{width:"44px",height:"44px",padding:0,border:s?`2px solid ${n}`:"1px solid transparent",borderRadius:"var(--sc-border-radius-md, 10px)",background:s?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"transparent",cursor:"pointer",fontSize:"1.75rem",transition:"all 0.15s ease",transform:s?"scale(1.1)":"scale(1)"},"aria-label":`Rate ${o+1} out of 5`,children:i},o)})})}function gp({content:t,onSubmit:e,accentColor:n}){let[r,i]=(0,Ql.useState)(null),[o,s]=(0,Ql.useState)(!1),a=n||"var(--sc-color-primary, #6366f1)",l=t.maxValue??(t.variant==="nps"?10:5),u=g=>{i(g)},c=()=>{r!==null&&(s(!0),e?.(r))},f={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0",alignItems:"center"},h={fontSize:"var(--sc-font-size-md, 0.9rem)",color:"var(--sc-color-text, #f5f5f7)",textAlign:"center",margin:0};return o?(0,ae.jsxs)("div",{style:{...f,padding:"var(--sc-spacing-lg, 1rem)"},children:[(0,ae.jsx)("span",{style:{fontSize:"2rem"},children:"\u2713"}),(0,ae.jsx)("p",{style:{...h,color:"var(--sc-color-success, #34c759)"},children:"Thanks for your feedback!"})]}):(0,ae.jsxs)("div",{style:f,children:[t.question&&(0,ae.jsx)("p",{style:h,children:t.question}),t.variant==="stars"&&(0,ae.jsx)(VE,{value:r,maxValue:l,onChange:u,color:a}),t.variant==="thumbs"&&(0,ae.jsx)(BE,{value:r,onChange:u,color:a}),t.variant==="nps"&&(0,ae.jsx)(zE,{value:r,maxValue:l,onChange:u,color:a}),t.variant==="emoji"&&(0,ae.jsx)(HE,{value:r,onChange:u,color:a}),r!==null&&t.submitActionId&&(0,ae.jsx)("button",{onClick:c,style:{marginTop:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) var(--sc-spacing-lg, 1rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"none",background:a,color:"white",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",cursor:"pointer",transition:"opacity 0.15s ease"},children:"Submit"})]})}var We=ee(ve(),1);function mp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.items.filter(x=>x.completed).length,i=t.items.length,o={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},s={display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)",marginBottom:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)"},a={flex:1,height:"4px",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",borderRadius:"2px",overflow:"hidden"},l={height:"100%",width:`${i>0?r/i*100:0}%`,background:n,borderRadius:"2px",transition:"width 0.3s ease"},u=x=>({display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-md, 0.75rem)",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.5))",borderRadius:"var(--sc-border-radius-md, 10px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.08))",opacity:x?.6:1,transition:"all 0.15s ease"}),c=x=>({width:"20px",height:"20px",borderRadius:"50%",border:x?"none":"2px solid var(--sc-color-border, rgba(255, 255, 255, 0.2))",background:x?"#34c759":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}),f={flex:1,minWidth:0},h=x=>({fontSize:"var(--sc-font-size-sm, 0.85rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:"var(--sc-color-text, #f5f5f7)",margin:0,textDecoration:x?"line-through":"none"}),g={fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:1.4},v={display:"inline-flex",alignItems:"center",gap:"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-xs, 0.25rem) var(--sc-spacing-sm, 0.5rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.15))",background:"transparent",color:"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-xs, 0.75rem)",fontWeight:"var(--sc-font-weight-medium, 500)",cursor:"pointer",textDecoration:"none",transition:"all 0.15s ease",flexShrink:0},_=x=>{x&&typeof window<"u"&&(window.location.href=x)};return(0,We.jsxs)("div",{style:o,children:[t.showProgress!==!1&&i>0&&(0,We.jsxs)("div",{style:s,children:[(0,We.jsxs)("span",{children:[r," of ",i]}),(0,We.jsx)("div",{style:a,children:(0,We.jsx)("div",{style:l})})]}),t.items.map(x=>(0,We.jsxs)("div",{style:u(x.completed??!1),children:[(0,We.jsx)("div",{style:c(x.completed??!1),children:x.completed&&(0,We.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,We.jsx)("path",{d:"M20 6L9 17l-5-5",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,We.jsxs)("div",{style:f,children:[(0,We.jsx)("p",{style:h(x.completed??!1),children:x.title}),x.description&&(0,We.jsx)("p",{style:g,children:x.description})]}),x.href&&!x.completed&&(0,We.jsxs)("button",{style:v,onClick:d=>{d.stopPropagation(),_(x.href)},onMouseEnter:d=>{d.currentTarget.style.background="var(--sc-color-surface, rgba(58, 58, 60, 0.8))"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[x.linkLabel||"Go",(0,We.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,We.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},x.id))]})}var po=ee(ve(),1);function jE(t){return["alert","success","warning","info","error"].includes(t.type)}function UE(t){return t.type==="stats"}function WE(t){return t.type==="comparison"}function qE(t){return t.type==="rating"}function KE(t){return t.type==="checklist"}function U_(t,e={}){return jE(t)?(0,po.jsx)(fp,{content:t,accentColor:e.accentColor,onDismiss:e.onDismiss}):UE(t)?(0,po.jsx)(pp,{content:t,accentColor:e.accentColor}):WE(t)?(0,po.jsx)(hp,{content:t,accentColor:e.accentColor}):qE(t)?(0,po.jsx)(gp,{content:t,accentColor:e.accentColor,onSubmit:e.onRatingSubmit}):KE(t)?(0,po.jsx)(mp,{content:t,accentColor:e.accentColor}):null}function W_(t){return["alert","success","warning","info","error","stats","comparison","chart","table","form","rating","progress","survey","checklist","video","gallery","code"].includes(t)}var ht=ee(Et(),1),q_=ee(ve(),1),vp=(0,ht.createContext)({runtime:null,context:null});function yp({runtime:t,children:e}){let[n,r]=(0,ht.useState)(t?t.context.get():null);(0,ht.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(s=>{r(s)})):void 0,[t]);let i=(0,ht.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,q_.jsx)(vp.Provider,{value:i,children:e})}function Fn(){let{runtime:t}=(0,ht.useContext)(vp);return t}function Jl(){let{context:t}=(0,ht.useContext)(vp);return t}function _p(){return Jl()?.page??null}function GE(){return Jl()?.session??null}function ZE(){return Jl()?.viewport??null}function YE(t,e,n=[]){let r=Fn();(0,ht.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...n])}function XE(){return Fn()?.state??null}function QE(t,e){let n=Fn(),[r,i]=(0,ht.useState)({value:e,isFallback:!0,isLoading:!0});return(0,ht.useEffect)(()=>{if(!n||!t){i({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(s=>{o||i({value:s.value,isFallback:s.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),r}var Ee={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",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ho="1.0.0";function Yt(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ho}}function JE(t){return Yt(Ee.CANVAS_OPENED,{surface:t})}function eA(t){return Yt(Ee.CANVAS_CLOSED,{surface:t})}function tA(t,e){return Yt(Ee.TILE_VIEWED,{tileId:t,surface:e})}function nA(t,e){return Yt(Ee.TILE_EXPANDED,{tileId:t,surface:e})}function rA(t,e){return Yt(Ee.TILE_COLLAPSED,{tileId:t,surface:e})}function iA(t,e,n){return Yt(Ee.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function oA(t,e){return Yt(Ee.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function sA(t,e){return Yt(Ee.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function aA(t,e,n){return Yt(Ee.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function lA(t,e,n){return Yt(Ee.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function uA(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return Yt(n,e)}var vn={canvasOpened:JE,canvasClosed:eA,tileViewed:tA,tileExpanded:nA,tileCollapsed:rA,tileAction:iA,overlayStarted:oA,overlayCompleted:sA,overlayDismissed:aA,overlayStepViewed:lA,custom:uA};var oe=ee(ve(),1);function cA({config:t,telemetry:e,surface:n}){let[r,i]=(0,$n.useState)([{author:"Lumi",text:"Hi! Need clarity on a deduction?"}]),[o,s]=(0,$n.useState)(""),a=Fn(),l=u=>{if(u.preventDefault(),!!o.trim()){if(i(c=>[...c,{author:"You",text:o.trim()}]),setTimeout(()=>{i(c=>[...c,{author:"Lumi",text:"I will route that to the experimentation server stub for now."}])},600),e?.trackAction("chatbot_message",t.id,n),a){let c=vn.tileAction(t.id,"chatbot_message",n);a.events.publish(c.name,c.props,c.source)}s("")}};return(0,oe.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",height:"100%"},children:[(0,oe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem",background:"rgba(0, 0, 0, 0.2)",borderRadius:"8px",fontSize:"0.85rem"},children:r.map((u,c)=>(0,oe.jsxs)("p",{style:{margin:"0 0 0.5rem"},children:[(0,oe.jsxs)("span",{style:{fontWeight:600,color:"#94a3b8"},children:[u.author,":"]})," ",(0,oe.jsx)("span",{style:{color:"#e2e8f0"},children:u.text})]},`${u.author}-${c}`))}),(0,oe.jsxs)("form",{onSubmit:l,style:{display:"flex",gap:"0.5rem"},children:[(0,oe.jsx)("input",{style:{flex:1,padding:"0.5rem 0.75rem",borderRadius:"6px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.3)",color:"#f1f5f9",fontSize:"0.85rem",outline:"none"},value:o,onChange:u=>s(u.target.value),placeholder:"Ask anything..."}),(0,oe.jsx)("button",{style:{padding:"0.5rem 0.75rem",borderRadius:"6px",border:"none",background:"#6366f1",color:"white",fontWeight:600,fontSize:"0.8rem",cursor:"pointer"},type:"submit",children:"Send"})]})]})}function dA({renderer:t,config:e,surface:n,telemetry:r,isExpanded:i,runtime:o}){let s=(0,$n.useRef)(null);return(0,$n.useEffect)(()=>{if(!s.current)return;let a=t.mount(s.current,{config:e,surface:n,telemetry:r,isExpanded:i,runtime:o});return()=>{a&&a()}},[t,e,n,r,i,o]),(0,oe.jsx)("div",{ref:s,style:{width:"100%",height:"100%"}})}function zs({config:t,surface:e,telemetry:n,style:r,customRenderers:i,isExpanded:o=!1,onToggleExpand:s}){let{title:a,subtitle:l,content:u,style:c}=t,f=Fn(),h=(0,$n.useCallback)(w=>{if(n?.trackAction(w,t.id,e),f){let b=vn.tileAction(t.id,w,e);f.events.publish(b.name,b.props,b.source)}},[n,f,t.id,e]),g=c?.accentColor??"#6366f1",v="72px",_={display:"flex",flexDirection:"column",borderRadius:"14px",background:c?.background??"rgba(28, 28, 30, 0.95)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:c?.textColor??"#f5f5f7",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:s?"pointer":"default",transition:"all 0.25s ease",...r},x={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:v},d={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${g} 0%, ${g}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${g}40`},p=()=>{switch(u.type){case"chatbot":return"\u{1F4AC}";case"metric":return"\u{1F4CA}";case"embed":return"\u{1F517}";case"custom":return"\u2699\uFE0F";case"checklist":return"\u{1F4CB}";default:return"\u{1F4C4}"}},m=()=>{switch(u.type){case"metric":return`${u.metricValue}${u.metricUnit?` ${u.metricUnit}`:""}`;case"text":return u.headline||u.body?.slice(0,50)||"";case"chatbot":return"Tap to chat";case"embed":return"Tap to view";case"custom":return"Tap to expand";case"checklist":{let w=u.items||[];return`${w.filter(k=>k.completed).length} of ${w.length} complete`}default:return""}},y=()=>{if(W_(u.type)){let w=U_(u,{accentColor:g,onDismiss:()=>{h("block_dismissed")},onRatingSubmit:b=>{h("rating_submitted")}});if(w)return w}switch(u.type){case"chatbot":return(0,oe.jsx)("div",{style:{height:"200px"},children:(0,oe.jsx)(cA,{config:t,surface:e,telemetry:n})});case"metric":return(0,oe.jsxs)("div",{style:{textAlign:"center",padding:"0.5rem 0"},children:[(0,oe.jsxs)("p",{style:{fontSize:"3rem",fontWeight:700,color:g,margin:0,letterSpacing:"-0.02em"},children:[u.metricValue,u.metricUnit&&(0,oe.jsx)("span",{style:{fontSize:"1.25rem",fontWeight:400,color:"#8e8e93",marginLeft:"0.5rem"},children:u.metricUnit})]}),u.headline&&(0,oe.jsx)("p",{style:{fontSize:"0.85rem",color:"#8e8e93",margin:"0.5rem 0 0"},children:u.headline})]});case"embed":return u.embedUrl?(0,oe.jsx)("iframe",{src:u.embedUrl,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",style:{width:"100%",height:"200px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.2)"},title:u.headline??t.title}):null;case"custom":{let w=u.component||u.customRendererKey;return!w||!i||!i[w]?(0,oe.jsxs)("div",{style:{color:"#ff6b6b",fontSize:"0.85rem",padding:"0.5rem 0"},children:["Unknown component: ",w]}):(0,oe.jsx)(dA,{renderer:i[w],config:t,surface:e,telemetry:n,isExpanded:o,runtime:f})}case"text":default:{let w=u;return(0,oe.jsxs)("div",{style:{padding:"0.25rem 0"},children:[w.headline&&(0,oe.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"#f5f5f7",margin:"0 0 0.5rem"},children:w.headline}),w.body&&(0,oe.jsx)("p",{style:{fontSize:"0.9rem",color:"#8e8e93",margin:0,lineHeight:1.5},children:w.body})]})}}};return(0,oe.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:_,onClick:w=>{o&&w.target.closest("[data-expanded-content]")||s?.()},children:[(0,oe.jsxs)("div",{style:x,children:[(0,oe.jsx)("div",{style:d,children:p()}),(0,oe.jsxs)("div",{style:{flex:1,minWidth:0},children:[l&&(0,oe.jsx)("p",{style:{fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.05em",color:"#8e8e93",margin:0},children:l}),(0,oe.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"#f5f5f7",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),!o&&(0,oe.jsx)("p",{style:{fontSize:"0.8rem",color:"#8e8e93",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m()})]}),(0,oe.jsx)("div",{style:{color:"#8e8e93",fontSize:"0.85rem",transform:o?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:"\u25BC"})]}),o&&(0,oe.jsxs)("div",{"data-expanded-content":!0,style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},onClick:w=>w.stopPropagation(),children:[(0,oe.jsx)("div",{style:{paddingTop:"0.875rem"},children:y()}),"actions"in u&&u.actions&&u.actions.length>0&&(0,oe.jsx)("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)",display:"flex",gap:"0.5rem"},children:u.actions.map((w,b)=>(0,oe.jsx)("button",{onClick:k=>{if(k.stopPropagation(),w.href&&typeof window<"u"&&window.open(w.href,"_blank","noreferrer"),w.onClickId&&(h(w.onClickId),w.onClickId.startsWith("syntro:restart-tour:")||w.onClickId.startsWith("syntro:start-tour:"))){let C=w.onClickId.replace("syntro:restart-tour:","").replace("syntro:start-tour:","");try{localStorage.removeItem("syntro_active_tour"),localStorage.setItem("syntro_active_tour",JSON.stringify({tourId:C,currentStepId:"",startedAt:Date.now()})),console.log(`[SmartCanvas] Starting tour "${C}"...`),window.location.reload()}catch(I){console.warn("[SmartCanvas] Failed to start tour:",I)}}},style:{flex:1,padding:"0.625rem 1rem",borderRadius:"8px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",border:"none",background:b===0?g:"rgba(255, 255, 255, 0.1)",color:"#fff",transition:"opacity 0.15s ease"},onMouseEnter:k=>{k.currentTarget.style.opacity="0.85"},onMouseLeave:k=>{k.currentTarget.style.opacity="1"},children:w.label},w.label))})]})]})}var Gn=ee(Et(),1),Og=ee(_c(),1);var we=ee(ve(),1),dS="syntro-launcher-styles";function hR(){if(typeof document>"u"||document.getElementById(dS))return;let t=document.createElement("style");t.id=dS,t.textContent=`
|
|
12
|
+
`)).length,r=0;r<i;r++){var s=t.charCodeAt(r),o=null;s<128?n++:o=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),ai(o)||(n>e&&(a+=t.substring(e,n)),a+=o,e=n=r+1)}return n>e&&(a+=t.substring(e,t.length)),a},sT=!!Wf||!!Xf,x0="text/plain",Pc=function(t,e,n){var i;n===void 0&&(n=!0);var[r,a]=t.split("?"),s=H({},e),o=(i=a?.split("&").map((c=>{var u,[f,g]=c.split("="),p=n&&(u=s[f])!==null&&u!==void 0?u:g;return delete s[f],f+"="+p})))!==null&&i!==void 0?i:[],l=Ek(s);return l&&o.push(l),r+"?"+o.join("&")},Oo=(t,e)=>JSON.stringify(t,((n,i)=>typeof i=="bigint"?i.toString():i),e),Pf=t=>{var{data:e,compression:n}=t;if(e){if(n===ri.GZipJS){var i=rT((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new sn(l.length+(l.length>>>1)),g=0,p=function(d){f[g++]=d},y=0;y<u;++y){if(g+5>f.length){var _=new sn(g+8+(u-y<<1));_.set(f),f=_}var b=l.charCodeAt(y);b<128||c?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(++y))>>>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 z_(f,0,g)})(Oo(e)),{mtime:0}),r=new Blob([i],{type:x0});return{contentType:x0,body:r,estimatedSize:r.size}}if(n===ri.Base64){var a=(function(l){var c,u,f,g,p,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,b=0,d="",h=[];if(!l)return l;l=aT(l);do c=(p=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=p>>12&63,f=p>>6&63,g=63&p,h[b++]=y.charAt(c)+y.charAt(u)+y.charAt(f)+y.charAt(g);while(_<l.length);switch(d=h.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(Oo(e)),s=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Oo(l)))(a);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Oo(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Tc=[];Xf&&Tc.push({transport:"fetch",method:t=>{var e,n,{contentType:i,body:r,estimatedSize:a}=(e=Pf(t))!==null&&e!==void 0?e:{},s=new Headers;we(t.headers,(function(u,f){s.append(f,u)})),i&&s.append("Content-Type",i);var o=t.url,l=null;if(Fy){var c=new Fy;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Xf(o,H({method:t?.method||"GET",headers:s,keepalive:t.method==="POST"&&(a||0)<52428.8,body:r,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((f=>{var g={statusCode:u.status,text:f};if(u.status===200)try{g.json=JSON.parse(f)}catch(p){z.error(p)}t.callback==null||t.callback(g)})))).catch((u=>{z.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Wf&&Tc.push({transport:"XHR",method:t=>{var e,n=new Wf;n.open(t.method||"GET",t.url,!0);var{contentType:i,body:r}=(e=Pf(t))!==null&&e!==void 0?e:{};we(t.headers,(function(a,s){n.setRequestHeader(s,a)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(a)}},n.send(r)}}),jt!=null&&jt.sendBeacon&&Tc.push({transport:"sendBeacon",method:t=>{var e=Pc(t.url,{beacon:"1"});try{var n,{contentType:i,body:r}=(n=Pf(t))!==null&&n!==void 0?n:{},a=typeof r=="string"?new Blob([r],{type:i}):r;jt.sendBeacon(e,a)}catch{}}});var Gc=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function E0(t,e,n){return Oo({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var B_={exact:(t,e)=>e.some((n=>t.some((i=>n===i)))),is_not:(t,e)=>e.every((n=>t.every((i=>n!==i)))),regex:(t,e)=>e.some((n=>t.some((i=>Gc(n,i))))),not_regex:(t,e)=>e.every((n=>t.every((i=>!Gc(n,i))))),icontains:(t,e)=>e.map(Ac).some((n=>t.map(Ac).some((i=>n.includes(i))))),not_icontains:(t,e)=>e.map(Ac).every((n=>t.map(Ac).every((i=>!n.includes(i)))))},Ac=t=>t.toLowerCase();function H_(t,e){return!t||Object.entries(t).every((n=>{var[i,r]=n,a=e?.[i];if(D(a)||ai(a))return!1;var s=[String(a)],o=B_[r.operator];return!!o&&o(r.values,s)}))}var Gf=et("[Error tracking]"),Ip=class{constructor(e){var n,i;this.Jt=[],this.Kt=new np([new rp,new dp,new sp,new ap,new cp,new lp,new op,new up],ak("web:javascript",tk,rk)),this._instance=e,this.Jt=(n=(i=this._instance.persistence)==null?void 0:i.get_property(pp))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,i,r,a=(n=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&n!==void 0?n:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Jt=a,this._instance.persistence&&this._instance.persistence.register({[pp]:this.Jt,[Jy]:s})}get Yt(){var e,n=!!this._instance.get_property(Jy),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void Gf.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void Gf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void Gf.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 n=e.reduce(((i,r)=>{var{type:a,value:s}=r;return Je(a)&&a.length>0&&i.$exception_types.push(a),Je(s)&&s.length>0&&i.$exception_values.push(s),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var r=i.values.map((a=>{var s,o=B_[a.operator],l=xe(a.value)?a.value:[a.value],c=(s=n[a.key])!==null&&s!==void 0?s:[];return l.length>0&&o(l,c)}));return i.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var i,r;return(i=(r=n.stacktrace)==null?void 0:r.frames)!==null&&i!==void 0?i:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,i,r,a,s=(n=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[],o=s[s.length-1];return(r=o==null||(a=o.filename)==null?void 0:a.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Xt(e){return!_e(e)&&xe(e)}},En=et("[FeatureFlags]"),So=et("[FeatureFlags]",{debugEnabled:!0}),Yf="$active_feature_flags",Va="$override_feature_flags",w0="$feature_flag_payloads",xo="$override_feature_flag_payloads",C0="$feature_flag_request_id",A0="$feature_flag_evaluated_at",k0=t=>{var e={};for(var[n,i]of kc(t||{}))i&&(e[n]=i);return e},oT=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var i;return[n,(i=e[n].variant)!==null&&i!==void 0?i:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var i;return(i=e[n].metadata)==null?void 0:i.payload})).map((n=>{var i;return[n,(i=e[n].metadata)==null?void 0:i.payload]})))):En.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},lT=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Fp=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((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||En.error("Invalid evaluation environment found:",n,"Expected non-empty string"),i})):[]}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(hp),n=this._instance.get_property(Va),i=this._instance.get_property(xo);if(!i&&!n)return e||{};var r=je({},e||{}),a=[...new Set([...Object.keys(i||{}),...Object.keys(n||{})])];for(var s of a){var o,l,c=r[s],u=n?.[s],f=D(u)?(o=c?.enabled)!==null&&o!==void 0&&o:!!u,g=D(u)?c.variant:typeof u=="string"?u:void 0,p=i?.[s],y=H({},c,{enabled:f,variant:f?g??c?.variant:void 0});f!==c?.enabled&&(y.original_enabled=c?.enabled),g!==c?.variant&&(y.original_variant=c?.variant),p&&(y.metadata=H({},c?.metadata,{payload:p,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[s]=y}return this.ii||(En.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(qa),n=this._instance.get_property(Va);if(!n)return e||{};for(var i=je({},e),r=Object.keys(n),a=0;a<r.length;a++)i[r[a]]=n[r[a]];return this.ii||(En.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(w0),n=this._instance.get_property(xo);if(!n)return e||{};for(var i=je({},e||{}),r=Object.keys(n),a=0;a<r.length;a++)i[r[a]]=n[r[a]];return this.ii||(En.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:i}),this.ii=!0),i}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 n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var i={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:H({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(To)||{}),group_properties:this._instance.get_property(Gr)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,a=r?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",a+s);r&&(i.timezone=M_()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:ri.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(lT.FeatureFlags))En.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 g;i.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,a=this._instance.get_property(C0)||void 0,s=this._instance.get_property(A0)||void 0,o=this._instance.get_property(Dc)||{};if((n.send_event||!("send_event"in n))&&(!(e in o)||!o[e].includes(r))){var l,c,u,f,g,p,y,_,b;xe(o[e])?o[e].push(r):o[e]=[r],(l=this._instance.persistence)==null||l.register({[Dc]:o});var d=this.getFeatureFlagDetails(e),h={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};D(d==null||(f=d.metadata)==null?void 0:f.version)||(h.$feature_flag_version=d.metadata.version);var m,v=(g=d==null||(p=d.reason)==null?void 0:p.description)!==null&&g!==void 0?g:d==null||(y=d.reason)==null?void 0:y.code;v&&(h.$feature_flag_reason=v),d!=null&&(_=d.metadata)!=null&&_.id&&(h.$feature_flag_id=d.metadata.id),D(d?.original_variant)&&D(d?.original_enabled)||(h.$feature_flag_original_response=D(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(b=d.metadata)!=null&&b.original_payload&&(h.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",h)}return i}En.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,n){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:ri.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var s,o=(s=a.json)==null?void 0:s.featureFlagPayloads;n(o?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,n);return D(i)?void 0:!!i}En.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((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(s,o,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=oT(s),g=f.flags,p=f.featureFlags,y=f.featureFlagPayloads;if(p){var _=s.requestId,b=s.evaluatedAt;if(xe(p)){En.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(p)for(var h=0;h<p.length;h++)d[p[h]]=!0;o&&o.register({[Yf]:p,[qa]:d})}else{var m=p,v=y,S=g;s.errorsWhileComputingFlags&&(m=H({},l,m),v=H({},c,v),S=H({},u,S)),o&&o.register(H({[Yf]:Object.keys(k0(m)),[qa]:m||{},[w0]:v||{},[hp]:S||{}},_?{[C0]:_}:{},b?{[A0]:b}:{}))}}})(e,this._instance.persistence,i,r,a),this.pi(n)}}override(e,n){n===void 0&&(n=!1),En.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return En.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Va),this._instance.persistence.unregister(xo),this.pi(),So.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,i=e;if(this.ii=!!((n=i.suppressWarning)!==null&&n!==void 0&&n),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Va),So.info("Flag overrides cleared");else if(i.flags){if(xe(i.flags)){for(var r={},a=0;a<i.flags.length;a++)r[i.flags[a]]=!0;this._instance.persistence.register({[Va]:r})}else this._instance.persistence.register({[Va]:i.flags});So.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this._instance.persistence.unregister(xo),So.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[xo]:i.payloads}),So.info("Payload overrides set",{payloads:i.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:i}=this.gi();e(n,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,i){var r,a=(this._instance.get_property(ko)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:n},o={$feature_flag:e,$feature_enrollment:n,$set:s};a&&(o.$early_access_feature_name=a.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var l=H({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Yf]:Object.keys(k0(l)),[qa]:l}),this.pi()}getEarlyAccessFeatures(e,n,i){n===void 0&&(n=!1);var r=this._instance.get_property(ko),a=i?"&"+i.map((s=>"stage="+s)).join("&"):"";if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+a),method:"GET",callback:s=>{var o,l;if(s.json){var c=s.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(ko),(l=this._instance.persistence)==null||l.register({[ko]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((i=>n[i])),flagVariants:Object.keys(n).filter((i=>n[i])).reduce(((i,r)=>(i[r]=n[r],i)),{})}}pi(e){var{flags:n,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((r=>r(n,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(To)||{};this._instance.register({[To]:H({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(To)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var i=this._instance.get_property(Gr)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((r=>{i[r]=H({},i[r],e[r]),delete e[r]})),this._instance.register({[Gr]:H({},i,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Gr)||{};this._instance.register({[Gr]:H({},n,{[e]:{}})})}else this._instance.unregister(Gr)}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}},cT=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Do=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(i=>{var r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&z.info("Persistence loaded",e.persistence,H({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){cT.indexOf(e.persistence.toLowerCase())===-1&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&Ue.H()?Ue:n==="localstorage+cookie"&&xc.H()?xc:n==="sessionstorage"&&ct.H()?ct:n==="memory"?Mk:n==="cookie"?Un:xc.H()?xc:Un}properties(){var e={};return we(this.props,(function(n,i){if(i===qa&&rt(n))for(var r=Object.keys(n),a=0;a<r.length;a++)e["$feature/"+r[a]]=n[r[a]];else o=i,l=!1,(ai(s=pk)?l:Iy&&s.indexOf===Iy?s.indexOf(o)!=-1:(we(s,(function(c){if(l||(l=c===o))return Mc})),l))||(e[i]=n);var s,o,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=je({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,i){if(rt(e)){D(n)&&(n="None"),this.xi=D(i)?this.$i:i;var r=!1;if(we(e,((a,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.props[s]=a,r=!0)})),r)return this.save(),!0}return!1}register(e,n){if(rt(e)){this.xi=D(n)?this.$i:n;var i=!1;if(we(e,((r,a)=>{e.hasOwnProperty(a)&&this.props[a]!==r&&(this.props[a]=r,i=!0)})),i)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=C_(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);ja(sh(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=L?.referrer)?k_(e):{})}update_referrer_info(){var e;this.register_once({$referrer:T_(),$referring_domain:L!=null&&L.referrer&&((e=Uc(L.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[yp]||this.props[_p]||this.register_once({[Lc]:R_(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};we([_p,yp],(s=>{var o=this.props[s];o&&we(o,(function(l,c){e["$initial_"+Qf(c)]=l}))}));var n,i,r=this.props[Lc];if(r){var a=(n=O_(r),i={},we(n,(function(s,o){i["$initial_"+Qf(o)]=s})),i);je(e,a)}return e}safe_merge(e){return we(this.props,(function(n,i){i in e||(e[i]=n)})),e}update_config(e,n,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var r=this.bi(e),a=this.props;this.clear(),this.Y=r,this.props=a,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,n){var i=this.props[Ao]||{};i[e]=n,this.props[Ao]=i,this.save()}remove_event_timer(e){var n=(this.props[Ao]||{})[e];return D(n)||(delete this.props[Ao][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},Eo=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),T4=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),R4=(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})({}),O4=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Zf=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),M4=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),N4=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),D4=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),Rc=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),T0=(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})({}),U_=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Vo=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((i=>i!==n))}}emit(e,n){for(var i of this.ki[e]||[])i(n);for(var r of this.ki["*"]||[])r(e,n)}};function Ia(t,e,n){if(_e(t))return!1;switch(n){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var jp=class{constructor(e){this.Pi=new Vo,this.Ti=(n,i)=>this.Ri(n,i)&&this.Ii(n,i)&&this.Fi(n,i)&&this.Ci(n,i),this.Ri=(n,i)=>i==null||!i.event||n?.event===i?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!D((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((i,r)=>{this.on(i,r)}))}}register(e){var n,i;if(!D((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((s=>{var o,l;(o=this.Oi)==null||o.add(s),(l=s.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(i=this._instance)!=null&&i.autocapture)){var r,a=new Set;e.forEach((s=>{var o;(o=s.steps)==null||o.forEach((l=>{l!=null&&l.selector&&a.add(l?.selector)}))})),(r=this._instance)==null||r.autocapture.setElementSelectors(a)}}on(e,n){var i;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((i=this.Oi)==null?void 0:i.size)>0&&this.Oi.forEach((r=>{this.Di(n,r)&&this.Pi.emit("actionCaptured",r.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var i of n.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!Ia(r,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var i;if(n==null||!n.href)return!0;var r=this.zi(e);if(r.length>0)return r.some((o=>Ia(o.href,n.href,n.href_matching||"exact")));var a,s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!s&&Ia((a=s.match(/(?::|")href="(.*?)"/))?a[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var i;if(n==null||!n.text)return!0;var r=this.zi(e);if(r.length>0)return r.some((c=>Ia(c.text,n.text,n.text_matching||"exact")||Ia(c.$el_text,n.text,n.text_matching||"exact")));var a,s,o,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(a=(function(c){for(var u,f=[],g=/(?::|")text="(.*?)"/g;!_e(u=g.exec(c));)f.includes(u[1])||f.push(u[1]);return f})(l),s=n.text,o=n.text_matching||"exact",a.some((c=>Ia(c,s,o))))}Ui(e,n){var i,r;if(n==null||!n.selector)return!0;var a=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(a!=null&&a.includes(n.selector))return!0;var s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||H_(n.properties.reduce(((i,r)=>{var a=xe(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:a,operator:r.operator||"exact"},i}),{}),e?.properties)}},me=et("[Surveys]"),qp="seenSurvey_",uT=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},R0=t=>{var e=""+qp+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+qp+t.id+"_"+t.current_iteration),e},dT=[Zf.Popover,Zf.Widget,Zf.API],fT={ignoreConditions:!1,ignoreDelay:!1,displayType:U_.Popover},Pp=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&H_(e.propertyFilters,n?.properties)}Gi(e,n){var i=new Map;return e.forEach((r=>{var a;(a=r.conditions)==null||(a=a[n])==null||(a=a.values)==null||a.forEach((s=>{if(s!=null&&s.name){var o=i.get(s.name)||[];o.push(r.id),i.set(s.name,o)}}))})),i}Vi(e,n,i){var r,a=(i===Eo.Activation?this.Hi:this.Bi).get(e),s=[];return(r=this._instance)==null||r.getSurveys((o=>{s=o.filter((l=>a?.includes(l.id)))})),s.filter((o=>{var l,c=(l=o.conditions)==null||(l=l[i])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;D((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((i=>{var r,a;return((r=i.conditions)==null?void 0:r.actions)&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new jp(this._instance),this.Yi.init(),this.Yi.ji((i=>{this.onAction(i)}))),n.forEach((i=>{var r,a,s,o,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(a=i.conditions)!=null&&(a=a.actions)!=null&&a.values&&((s=i.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((o=this.Yi)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(i.id),this.qi.set(c.name,u||[i.id])}})))})))}Ji(e){var n,i=e.filter((a=>{var s,o;return((s=a.conditions)==null?void 0:s.events)&&((o=a.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),r=e.filter((a=>{var s,o;return((s=a.conditions)==null?void 0:s.cancelEvents)&&((o=a.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(i.length!==0||r.length!==0)&&((n=this._instance)==null||n.Ai(((a,s)=>{this.onEvent(a,s)})),this.Hi=this.Gi(e,Eo.Activation),this.Bi=this.Gi(e,Eo.Cancellation))}onEvent(e,n){var i,r=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Sc])||[];if(Rc.SHOWN===e&&n&&r.length>0){var a;me.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:r});var s=n==null||(a=n.properties)==null?void 0:a.$survey_id;if(s){var o=r.indexOf(s);o>=0&&(r.splice(o,1),this.Xi(r))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,Eo.Cancellation);l.length>0&&(me.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var f,g=r.indexOf(u.id);g>=0&&r.splice(g,1),(f=this._instance)==null||f.cancelPendingSurvey(u.id)})),this.Xi(r))}if(this.Hi.has(e)){me.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,Eo.Activation);this.Xi(r.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Sc])||[];this.qi.has(e)&&this.Xi(i.concat(this.qi.get(e)||[]))}Xi(e){var n;me.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Sc]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Sc];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Gp=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 n=e.surveys;if(_e(n))return me.warn("Flags not loaded yet. Not loading surveys.");var i=xe(n);this.Zi=i?n.length>0:n,me.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(i!=null&&i.startsWith(qp)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)me.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)me.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())me.info("Not loading surveys in cookieless mode without consent.");else{var e=K?.__PosthogExtensions__;if(e){if(!D(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var i=e.generateSurveys;if(i)return void this.re(i,n);var r=e.loadExternalDependency;if(!r)return void this.se("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(a=>{a||!e.generateSurveys?this.se("Could not load surveys script",a):this.re(e.generateSurveys,n)}))}catch(a){throw this.se("Error initializing surveys",a),a}finally{this.ie=!1}}}else me.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new Pp(this._instance),me.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){me.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return me.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(gp);if(i&&!n)return e(i,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var a;this.te=!1;var s=r.statusCode;if(s!==200||!r.json){var o="Surveys API could not be loaded, status: "+s;return me.error(o),e([],{isLoaded:!1,error:o})}var l,c=r.json.surveys||[],u=c.filter((f=>(function(g){return!(!g.start_date||g.end_date)})(f)&&((function(g){var p;return!((p=g.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)})(f)||(function(g){var p;return!((p=g.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)})(f))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(a=this._instance.persistence)==null||a.register({[gp]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.te=!1,r}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(i){me.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!_e(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);me.warn("init was not called")}oe(e){var n=null;return this.getSurveys((i=>{var r;n=(r=i.find((a=>a.id===e)))!==null&&r!==void 0?r:null})),n}ae(e){if(_e(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(_e(this._surveyManager))return me.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return _e(this._surveyManager)?(me.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((r=>{var a,s=(a=r.find((l=>l.id===e)))!==null&&a!==void 0?a:null;if(s){var o=this.ae(s);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var i;if(_e(this._surveyManager))me.warn("init was not called");else{var r=typeof e=="string"?this.oe(e):e;if(r!=null&&r.id)if(dT.includes(r.type)){var a=L?.querySelector(n);if(a)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(me.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,o;me.info("Rendering survey "+r.id+" with delay of "+((s=r.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(r,a),me.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,a);me.warn("Survey element not found")}else me.warn("Surveys of type "+r.type+" cannot be rendered in the app");else me.warn("Survey not found")}}displaySurvey(e,n){var i;if(_e(this._surveyManager))me.warn("init was not called");else{var r=this.oe(e);if(r){var a=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&n.ignoreDelay&&(a=H({},r,{appearance:H({},r.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void me.warn("Survey is not eligible to be displayed: ",s.disabledReason)}n.displayType!==U_.Inline?this._surveyManager.handlePopoverSurvey(a):this.renderSurvey(a,n.selector)}else me.warn("Survey not found")}}cancelPendingSurvey(e){_e(this._surveyManager)?me.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},O0=et("[RateLimiter]"),Yp=class{constructor(e){var n,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var a=r.text;if(a&&a.length)try{(JSON.parse(a).quota_limited||[]).forEach((s=>{O0.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void O0.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:a})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,i,r;e===void 0&&(e=!1);var a=new Date().getTime(),s=(n=(i=this.instance.persistence)==null?void 0:i.get_property(vp))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:a};s.tokens+=(a-s.last)/1e3*this.captureEventsPerSecond,s.last=a,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||e||(s.tokens=Math.max(0,s.tokens-1)),!o||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=o,(r=this.instance.persistence)==null||r.set_property(vp,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},Pr=et("[RemoteConfig]"),Zp=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=K._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,i;(n=K.__PosthogExtensions__)!=null&&n.loadExternalDependency?(i=K.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Pr.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:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return Pr.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void Pr.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return Pr.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){Pr.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()):Pr.info("__preview_remote_config is disabled. Logging config instead",e):Pr.error("Failed to fetch remote config from PostHog.")}},Kp=3e3,Xp=class{constructor(e,n){this.he=!0,this.ve=[],this.de=Bn(n?.flush_interval_ms||Kp,250,5e3,z.createLogger("flush interval"),Kp),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ce(H({},i,{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 n=this._e(),i=function(){var a=n[r],s=new Date().getTime();a.data&&xe(a.data)&&we(a.data,(o=>{o.offset=Math.abs(o.timestamp-s),delete o.timestamp})),e.ce(a)};for(var r in n)i()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return we(this.ve,(n=>{var i,r=n,a=(r?r.batchKey:null)||r.url;D(e[a])&&(e[a]=H({},r,{data:[]})),(i=e[a].data)==null||i.push(r.data)})),this.ve=[],e}},pT=["retriesPerformedSoFar"],Wp=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!D(A)&&"onLine"in A.navigator&&(this.be=A.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},Ge(A,"online",this.we),Ge(A,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,i=B0(e,pT);$n(n)&&n>0&&(i.url=Pc(i.url,{retry_count:n})),this._instance.ci(H({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.Se(H({retriesPerformedSoFar:n},i)):i.callback==null||i.callback(r)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var i=(function(s){var o=3e3*Math.pow(2,s),l=o/2,c=Math.min(18e5,o),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),r=Date.now()+i;this.ve.push({retryAt:r,requestOptions:e});var a="Enqueued failed request for retry in "+i;navigator.onLine||(a+=" (Browser is offline)"),z.warn(a),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(),n=[],i=this.ve.filter((a=>a.retryAt<e||(n.push(a),!1)));if(this.ve=n,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,D(A)||(this.we&&(A.removeEventListener("online",this.we),this.we=void 0),this.xe&&(A.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(H({},e,{transport:"sendBeacon"}))}catch(n){z.error(n)}this.ve=[]}},Qp=class{constructor(e){this.ke=()=>{var n,i,r,a;this.Pe||(this.Pe={});var s=this.scrollElement(),o=this.scrollY(),l=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=o+(s?.clientHeight||0),u=s?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(o),this.Pe.maxScrollY=Math.max(o,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(i=this.Pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(r=this.Pe.maxContentY)!==null&&r!==void 0?r:0),this.Pe.maxContentHeight=Math.max(u,(a=this.Pe.maxContentHeight)!==null&&a!==void 0?a:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){Ge(A,"scroll",this.ke,{capture:!0}),Ge(A,"scrollend",this.ke,{capture:!0}),Ge(A,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return A?.document.documentElement;var e=xe(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var i=A?.document.querySelector(n);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return A&&(A.scrollY||A.pageYOffset||A.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return A&&(A.scrollX||A.pageXOffset||A.document.documentElement.scrollLeft)||0}},hT=t=>R_(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Yc=class{constructor(e,n,i,r){this.Te=a=>{var s=this.Re();if(!s||s.sessionId!==a){var o={sessionId:a,props:this.Ie(this._instance)};this.Fe.register({[mp]:o})}},this._instance=e,this.Ce=n,this.Fe=i,this.Ie=r||hT,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[mp]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?O_(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return we(sh(this.getSetOnceProps()),((n,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Qf(i)]=n})),e}},Kf=et("[SessionId]"),Zc=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,i){var r;if(this.Oe=[],this.Ae=void 0,this.Me=new Vo,this.De=(u,f)=>Math.abs(u-f)>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=n||Zi,this.Ue=i||Zi;var a=this.F.persistence_name||this.F.token,s=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Bn(s,60,36e3,Kf.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+a+"_window_id",this.Be="ph_"+a+"_primary_window_exists",this.qe()){var o=ct.W(this.He),l=ct.W(this.Be);o&&!l?this.je=o:ct.V(this.He),ct.G(this.Be,!0)}if((r=this.F.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Kf.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return D(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&ct.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&ct.G(this.He,e))}Je(){return this.je?this.je:this.qe()?ct.W(this.He):null}We(e,n,i){e===this.Le&&n===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[Nc]:[n,e,i]}))}Ke(){var e=this.Fe.props[Nc];return xe(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&&A&&(A.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&ct.V(this.Be)},Ge(A,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),[r,a,s]=this.Ke(),o=this.Je(),l=$n(s)&&s>0&&Math.abs(i-s)>864e5,c=!1,u=!a,f=!u&&!e&&this.De(i,r);u||f||l?(a=this.Ne(),o=this.Ue(),Kf.info("new session ID generated",{sessionId:a,windowId:o,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),s=i,c=!0):o||(o=this.Ue(),c=!0);var g=r===0||!e||l?i:r,p=s===0?new Date().getTime():s;return this.Ve(o),this.We(a,g,p),e||this.ze(),c&&this.Oe.forEach((y=>y(a,o,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:a,windowId:o,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},gT=["$set_once","$set"],Gi=et("[SiteApps]"),Jp=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var i=this.globalsForEvent(n);this.Xe.push(i),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=K._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 n,i,r,a,s,o,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[g,p]of Object.entries(f))c[g]={id:u[g],type:g,properties:p};var{$set_once:y,$set:_}=e;return{event:H({},B0(e,gT),{properties:H({},e.properties,_?{$set:H({},(n=(i=e.properties)==null?void 0:i.$set)!==null&&n!==void 0?n:{},_)}:{},y?{$set_once:H({},(r=(a=e.properties)==null?void 0:a.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(s=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],i=()=>{var o;!n.errored&&this.Xe.length&&(Gi.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((o=this.Ze)==null||o.call(this))},r=!1,a=o=>{n.errored=!o,n.loaded=!0,Gi.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&i()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:o=>{a(o)}});s&&(n.processEvent=s),r=!0}catch(o){Gi.error("Error while initializing PostHog app with config id "+e.id,o),a(!1)}if(r&&n.loaded)try{i()}catch(o){Gi.error("Error while processing buffered events PostHog app with config id "+e.id,o),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(n)}catch(r){Gi.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var n,i,r,a=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Gi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(c){var u;K["__$$ph_site_app_"+c]=a._instance,(u=K.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(a._instance,l,(f=>{if(f)return Gi.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:o,url:l}of e.siteApps)s(o)}else Gi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},$_=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Py(n,e))return!0;try{var i=t?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>Py(r?.brand,e))))return!0}catch{}return!!t.webdriver},Mo=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),M0="i.posthog.com",eh=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,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+M0,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Mo.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Mo.EU:this.er[this.apiHost]=Mo.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Mo.CUSTOM)return this.apiHost+n;var i=M0+n;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},mT={icontains:(t,e)=>!!A&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!A&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!A&&Gc(e.href,t),not_regex:(t,e)=>!!A&&!Gc(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},th=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),n.getWebExperiments((r=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,r.forEach((a=>{if(a.feature_flag_key){var s;n.sr&&(t.rr("setting flag key ",a.feature_flag_key," to web experiment ",a),(s=n.sr)==null||s.set(a.feature_flag_key,a));var o=n._instance.getFeatureFlag(a.feature_flag_key);Je(o)&&a.variants[o]&&n.nr(a.name,o,a.variants[o].transforms)}else if(a.variants)for(var l in a.variants){var c=a.variants[l];t.ar(c)&&n.nr(a.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}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(_e(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var i;if(this.sr&&(i=this.sr)!=null&&i.has(n)){var r,a=this._instance.getFeatureFlag(n),s=(r=this.sr)==null?void 0:r.get(n);a&&s!=null&&s.variants[a]&&this.nr(s.name,a,s.variants[a].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=$c(e?.search,"__experiment_id"),i=$c(e?.search,"__experiment_variant");n&&i&&(t.rr("previewing web experiments "+n+" && "+i),this.getWebExperiments((r=>{this.lr(parseInt(n),i,r)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:a=>{if(a.statusCode!==200||!a.json)return e([]);var s=a.json.experiments||[];return e(s)}})}lr(e,n,i){var r=i.filter((a=>a.id===e));r&&r.length>0&&(t.rr("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.nr(r[0].name,n,r[0].variants[n].transforms))}static ar(e){return!_e(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(_e(e.conditions)||_e((n=e.conditions)==null?void 0:n.url))return!0;var i,r,a,s=t.getWindowLocation();return!!s&&((i=e.conditions)==null||!i.url||mT[(r=(a=e.conditions)==null?void 0:a.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,s))}static getWindowLocation(){return A?.location}static hr(e){var n;if(_e(e.conditions)||_e((n=e.conditions)==null?void 0:n.utm))return!0;var i=C_();if(i.utm_source){var r,a,s,o,l,c,u,f,g=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_campaign)==i.utm_campaign,p=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,y=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==i.utm_term;return g&&y&&_&&p}return!1}static rr(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];z.info("[WebExperiments] "+e,i)}nr(e,n,i){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?i.forEach((r=>{if(r.selector){var a;t.rr("applying transform of variant "+n+" for experiment "+e+" ",r);var s=(a=document)==null?void 0:a.querySelectorAll(r.selector);s?.forEach((o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return jt&&this._instance?$_(jt,this._instance.config.custom_blocked_useragents):void 0}},vT=et("[PostHog ExternalIntegrations]"),yT={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},nh=class{constructor(e){this._instance=e}it(e,n){var i;(i=K.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return vT.error("failed to load script",r);n()}))}startIfEnabledOrStop(){var e=this,n=function(s){var o,l,c;!r||(o=K.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[s]||e.it(yT[s],(()=>{var u;(u=K.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)})),!r&&(l=K.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[s]&&((c=K.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.stop())};for(var[i,r]of Object.entries((a=this._instance.config.integrations)!==null&&a!==void 0?a:{})){var a;n(i)}}},ih="[SessionRecording]",wo=et(ih),Kc=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 wo.error("started without valid sessionManager"),new Error(ih+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(ih+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property(Hf))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return A&&n&&i&&!r}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var i=!D(Object.assign)&&!D(Array.from);this.cr&&i?(this.gr(e),wo.info("starting")):this.stopRecording()}}gr(e){var n,i,r;this.cr&&(K!=null&&(n=K.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(i=K.__PosthogExtensions__)!=null&&i.initSessionRecording?this._r(e):(r=K.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.mr,(a=>{if(a)return wo.error("could not load recorder",a);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(G0)}br(e){if(this._instance.persistence){var n,i,r=this._instance.persistence,a=()=>{var s=e.sessionRecording===!1?void 0:e.sessionRecording,o=s?.sampleRate,l=_e(o)?null:parseFloat(o);_e(l)&&this.yr();var c=s?.minimumDurationMilliseconds;r.register({[Hf]:H({enabled:!!s},s,{networkPayloadCapture:H({capturePerformance:e.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:D(c)?null:c,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers})})};a(),(n=this.pr)==null||n.call(this),this.pr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(a)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:wo.info("skipping remote config with no sessionRecording",e)}log(e,n){var i;n===void 0&&(n="log"),(i=this.vr)!=null&&i.log?this.vr.log(e,n):wo.warn("log called before recorder was ready")}get mr(){var e,n,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Hf);return(i==null||(n=i.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,i;if((n=K.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(i=K.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,i;this.vr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var i;return!((i=this.vr)==null||!i.tryAddCustomEvent(e,n))}},Lo={},rh=()=>{},Fa="posthog",V_=!sT&&kt?.indexOf("MSIE")===-1&&kt?.indexOf("Mozilla")===-1,N0=t=>{var e;return H({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:fk(L?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:rh,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:Tt&&Je(Tt?.search)&&Tt.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:(A==null||(e=A.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:n=>{var i="Bad HTTP status: "+n.statusCode+" "+n.text;z.error(i)},get_device_id:n=>n,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:Kp},error_tracking:{},_onCapture:rh,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},D0=t=>{var e={};D(t.process_person)||(e.person_profiles=t.process_person),D(t.xhr_headers)||(e.request_headers=t.xhr_headers),D(t.cookie_name)||(e.persistence_name=t.cookie_name),D(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),D(t.store_google)||(e.save_campaign_params=t.store_google),D(t.verbose)||(e.debug=t.verbose);var n=je({},e,t);return xe(t.property_blacklist)&&(D(t.property_denylist)?n.property_denylist=t.property_blacklist:xe(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:z.error("Invalid value for property_denylist config: "+t.property_denylist)),n},ah=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Xc=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new ah,this.Sr=!1,this.version=ti.LIB_VERSION,this.Er=new Vo,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=N0(),this.SentryIntegration=Tp,this.sentryIntegration=e=>(function(n,i){var r=l_(n,i);return{name:o_,processEvent:a=>r(a)}})(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 Fp(this),this.toolbar=new Rp(this),this.scrollManager=new Qp(this),this.pageViewManager=new Bp(this),this.surveys=new Gp(this),this.experiments=new th(this),this.exceptions=new Ip(this),this.rateLimiter=new Yp(this),this.requestRouter=new eh(this),this.consent=new Cp(this),this.externalIntegrations=new nh(this),this.people={set:(e,n,i)=>{var r=Je(e)?{[e]:n}:e;this.setPersonProperties(r),i?.({})},set_once:(e,n,i)=>{var r=Je(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",(e=>z.info('send "'+e?.event+'"',e)))}init(e,n,i){if(i&&i!==Fa){var r,a=(r=Lo[i])!==null&&r!==void 0?r:new t;return a._init(e,n,i),Lo[i]=a,Lo[Fa][i]=a,a}return this._init(e,n,i)}_init(e,n,i){var r;if(n===void 0&&(n={}),D(e)||Jf(e))return z.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(je({},N0(n.defaults),D0(n),{name:i,token:e})),this.config.on_xhr_error&&z.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:ri.GZipJS;var a=this.Cr();this.persistence=new Do(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Do(H({},this.config,{persistence:"sessionStorage"}),a);var s=H({},this.persistence.props),o=H({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Xp((h=>this.Or(h)),this.config.request_queue_config),this.Ar=new Wp(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 Zc(this),this.sessionPropsManager=new Yc(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(z.info("Initializing extensions synchronously"),this.Dr(l)),ti.DEBUG=ti.DEBUG||this.config.debug,ti.DEBUG&&z.info("Starting in debug mode",{this:this,config:n,thisC:H({},this.config),p:s,s:o}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var c,u,f=this.config.get_device_id(Zi()),g=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(ni,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:g})}if(this.jr()){var p,y,_=Object.keys(((p=n.bootstrap)==null?void 0:p.featureFlags)||{}).filter((h=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[h])})).reduce(((h,m)=>{var v;return h[m]=((v=n.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[m])||!1,h}),{}),b=Object.keys(((y=n.bootstrap)==null?void 0:y.featureFlagPayloads)||{}).filter((h=>_[h])).reduce(((h,m)=>{var v,S;return(v=n.bootstrap)!=null&&(v=v.featureFlagPayloads)!=null&&v[m]&&(h[m]=(S=n.bootstrap)==null||(S=S.featureFlagPayloads)==null?void 0:S[m]),h}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:b})}if(l)this.register_once({distinct_id:mo,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(Zi());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(ni,"anonymous")}return Ge(A,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Lk(this,(()=>this.Lr())):this.Lr(),Ki(this.config._onCapture)&&this.config._onCapture!==rh&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(h=>this.config._onCapture(h.event,h)))),this.config.ip&&z.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new kp(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new Op(this).startIfEnabledOrStop()})),i.push((()=>{var r;this.siteApps=new Jp(this),(r=this.siteApps)==null||r.init()})),e||i.push((()=>{this.sessionRecording=new Kc(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new Sp(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new zp(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new Lp(this)})),i.push((()=>{this.exceptionObserver=new Ap(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new Ic(this,Dk),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Nr){var r=this.Nr;this.Nr=void 0,this.fi(r)}})),this.Ur(i,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var i=e.shift();if(i)try{i()}catch(a){z.error("Error initializing extension:",a)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&z.info("PostHog extensions initialized ("+r+"ms)")}fi(e){var n,i,r,a,s,o,l,c;if(!L||!L.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=re(e.supportedCompression,ri.GZipJS)?ri.GZipJS:re(e.supportedCompression,ri.Base64)?ri.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(a=this.autocapture)==null||a.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Zp(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()&&Wi(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(V_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Pc(e.url,{ip:this.config.ip?1:0}),e.headers=H({},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,(n=>{var i,r,a,s=H({},n);s.timeout=s.timeout||6e4,s.url=Pc(s.url,{_:new Date().getTime().toString(),ver:ti.LIB_VERSION,compression:s.compression});var o=(i=s.transport)!==null&&i!==void 0?i:"fetch",l=Tc.filter((u=>!s.disableTransport||!u.transport||!s.disableTransport.includes(u.transport))),c=(r=(a=j0(l,(u=>u.transport===o)))==null?void 0:a.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(s)})(H({},e,{callback:n=>{var i,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,i=[],r=[],a=[];Wi(e,(o=>{o&&(n=o[0],xe(n)?a.push(o):Ki(o)?o.call(this):xe(o)&&n==="alias"?i.push(o):xe(o)&&n.indexOf("capture")!==-1&&Ki(this[n])?a.push(o):r.push(o))}));var s=function(o,l){Wi(o,(function(c){if(xe(c[0])){var u=l;we(c,(function(f){u=u[f[0]].apply(u,f.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};s(i,this),s(r,this),s(a,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!D(e)&&Je(e)){var a=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(a&&!this.config.__preview_capture_bot_pageviews)){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!Je(n?.$current_url)&&(z.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$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 o=new Date,l=i?.timestamp||o,c=Zi(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&a&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(u.$set=i?.$set);var f,g=this.qr(i?.$set_once);if(g&&(u.$set_once=g),(u=uk(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,D(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===Rc.DISMISSED||e===Rc.SENT){var p=n?.[T0.SURVEY_ID],y=n?.[T0.SURVEY_ITERATION];f={id:p,current_iteration:y},localStorage.getItem(R0(f))||localStorage.setItem(R0(f),"true"),u.$set=H({},u.$set,{[uT({id:p,current_iteration:y},e===Rc.SENT?"responded":"dismissed")]:!0})}var _=H({},u.properties.$set,u.$set);if(ja(_)||this.setPersonPropertiesForFlags(_),!_e(this.config.before_send)){var b=this.Wr(u);if(!b)return;u=b}this.Er.emit("eventCaptured",u);var d={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Or(d):this.Mr.enqueue(d),u}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}else z.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,i,r,a){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;var s=a?void 0:this.persistence.remove_event_timer(e),o=H({},n);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=H({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Je(o.distinct_id)&&!$n(o.distinct_id)||Jf(o.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=Xk(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,i.getTime());o.$session_id=f,o.$window_id=g}this.sessionPropsManager&&je(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&je(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.Ar)==null?void 0:p.length}catch(d){o.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===Mo.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||a?e!=="$pageleave"||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),o=je(o,c),e==="$pageview"&&L&&(o.title=L.title),!D(s)){var y=i.getTime()-s;o.$duration=parseFloat((y/1e3).toFixed(3))}kt&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=je({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),xe(this.config.property_denylist)?we(this.config.property_denylist,(function(d){delete o[d]})):z.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(z.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var b=this.Gr();return o.$process_person_profile=b,b&&!a&&this.Vr("_calculate_event_properties"),o}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var i=this.persistence.get_initial_props(),r=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),a=je({},i,r||{},e||{}),s=this.config.sanitize_properties;return s&&(z.error("sanitize_properties is deprecated. Use before_send instead"),a=s(a,"$set_once")),this.Sr=!0,ja(a)?void 0:a}register(e,n){var i;(i=this.persistence)==null||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)==null||r.register_once(e,n,i)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n,i){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,i;return(n=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=fT),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,i){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if($n(e)&&(e=e.toString(),z.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))z.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==mo){if(this.Vr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var a=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}e!==r&&e!==this.get_property(Co)&&(this.unregister(Co),this.register({distinct_id:e}));var s=(this.persistence.get_property(ni)||"anonymous")==="anonymous";e!==r&&s?(this.persistence.set_property(ni,"identified"),this.setPersonPropertiesForFlags(H({},i||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:i||{}}),this.Tr=E0(e,n,i),this.featureFlags.setAnonymousDistinctId(r)):(n||i)&&this.setPersonProperties(n,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Dc))}}else z.critical('The string "'+mo+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else z.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var i=E0(this.get_distinct_id(),e,n);this.Tr!==i?(this.setPersonPropertiesForFlags(H({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=i):z.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,i){if(e&&n){if(this.Vr("posthog.group")){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:H({},r,{[e]:n})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===n||i||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,i,r,a;if(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(ni,"anonymous"),(a=this.sessionManager)==null||a.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:mo,$device_id:null},"");else{var o=this.config.get_device_id(Zi());this.register_once({distinct_id:o,$device_id:e?o:s},"")}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,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&i){var a,s=(a=e.timestampLookBack)!==null&&a!==void 0?a:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-s,0)}return r}alias(e,n){return e===this.get_property(q0)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(D(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Co,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=H({},this.config);if(rt(e)){var i,r,a,s,o;je(this.config,D0(e));var l=this.Cr();(i=this.persistence)==null||i.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Do(H({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Xi(c)&&(this.config.debug=c),Xi(this.config.debug)&&(this.config.debug?(ti.DEBUG=!0,Ue.H()&&Ue.G("ph_debug","true"),z.info("set_config",{config:e,oldConfig:n,newConfig:H({},this.config)})):(ti.DEBUG=!1,Ue.H()&&Ue.V("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,i={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,a,s,o,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((a=this.sessionRecording)==null||a.overrideSampling()),i.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.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,n){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(H({},r,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Fa;return n!==Fa&&(n=Fa+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(ni))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(ni))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ja(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Co])&&((n=this.persistence)==null||(n=n.props)==null||!n[zc]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(zc,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,i,r,a=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==a&&((i=this.persistence)==null||i.set_disabled(a)),((n=this.sessionPersistence)==null?void 0:n.wi)!==a&&((r=this.sessionPersistence)==null||r.set_disabled(a)),a}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var i,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(i=this.sessionManager)==null||i.destroy(),this.sessionManager=new Zc(this),this.persistence&&(this.sessionPropsManager=new Yc(this,this.sessionManager,this.persistence)),this.sessionRecording=new Kc(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(D(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((r=e?.captureEventName)!==null&&r!==void 0?r:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;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:mo,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):z.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===ii.GRANTED?"granted":e===ii.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 jt?$_(jt,this.config.custom_blocked_useragents):void 0}Hr(){L&&(L.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:L.title},{send_instantly:!0}),this.kr&&(L.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),Ge(L,"visibilitychange",this.kr)))}debug(e){e===!1?(A?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(A?.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,n,i,r,a,s,o,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(z.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",r=!1,a=z,s=(n="advanced_disable_flags")in(e=l)&&!D(e[n]),o=i in e&&!D(e[i]),s?e[n]:o?(a&&a.warn("Config field '"+i+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[i]):r)}Wr(e){if(_e(this.config.before_send))return e;var n=xe(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of n){if(i=r(i),_e(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return YA(e.event)?z.warn(a+". This can cause unexpected behavior."):z.info(a),null}i.properties&&!ja(i.properties)||z.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Rr(e){var n=Xi(e)&&!e,i=Ue.H()&&Ue.q("ph_debug")==="true";return!n&&(!!i||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=ck(t.prototype[e[n]])})(Xc,["identify"]);var L0,I_=(L0=Lo[Fa]=new Xc,(function(){function t(){t.done||(t.done=!0,V_=!1,we(Lo,(function(e){e._dom_loaded()})))}L!=null&&L.addEventListener?L.readyState==="complete"?t():Ge(L,"DOMContentLoaded",t,{capture:!1}):A&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),L0);var mh=class{constructor(e={}){this.options=e;F(this,"client");F(this,"featureFlagsCallback");F(this,"captureCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&typeof window<"u"&&e.apiKey){let n=e.enableFeatureFlags??!0,i=`syntro_${e.apiKey.slice(-6)||"sdk"}`;this.client=I_.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{if(n&&this.featureFlagsCallback){r.onFeatureFlags(()=>{let s=this.getAllFeatureFlags();s&&this.featureFlagsCallback&&this.featureFlagsCallback(s)});let a=this.getAllFeatureFlags();a&&Object.keys(a).length>0&&this.featureFlagsCallback(a)}this.captureCallback&&r.on("eventCaptured",a=>{let s=typeof a=="string"?a:a?.event,o=typeof a=="string"?void 0:a?.properties;typeof s=="string"&&this.captureCallback?.(s,o)})}},i)}}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[i,r]of Object.entries(e))i.startsWith("in_segment_")&&(n[i]=r===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,i){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:i})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,i){let r=`$experiment_${e}`;this.register({[r]:i??`variation_${n}`,[`${r}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:i??`variation_${n}`})}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 vh(t={}){return new mh(t)}function _T(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var yh=class{constructor(){F(this,"sessionId");this.sessionId=_T(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,i){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,i){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}};function _h(){return new yh}var j_={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function q_(){return j_}function bh(t){let e=2166136261,n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function qo(t,e,n){return n===2?bh(bh(t+e)+"")%1e4/1e4:n===1?bh(e+t)%1e3/1e3:null}function bT(t){return t<=0?[]:new Array(t).fill(1/t)}function eu(t,e){return t>=e[0]&&t<e[1]}function P_(t,e){let n=qo("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function G_(t,e){for(let n=0;n<e.length;n++)if(eu(t,e[n]))return n;return-1}function xh(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function tu(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){let a=ET(t,e[r].type,e[r].pattern);if(e[r].include===!1){if(a)return!1}else n=!0,a&&(i=!0)}return i||!n}function ST(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch{return!1}}function xT(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach((r,a)=>{i.push([t.searchParams.get(a)||"",r,!1])}),!i.some(r=>!ST(r[0],r[1],r[2]))}catch{return!1}}function ET(t,e,n){try{let i=new URL(t,"https://_");if(e==="regex"){let r=xh(n);return r?r.test(i.href)||r.test(i.href.substring(i.origin.length)):!1}else if(e==="simple")return xT(i,n);return!1}catch{return!1}}function Y_(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let i=bT(t);n=n||i,n.length!==t&&(n=i);let r=n.reduce((s,o)=>o+s,0);(r<.99||r>1.01)&&(n=i);let a=0;return n.map(s=>{let o=a;return a+=s,[o,o+e*s]})}function Z_(t,e,n){if(!e)return null;let i=e.split("?")[1];if(!i)return null;let r=i.replace(/#.*/,"").split("&").map(a=>a.split("=",2)).filter(([a])=>a===t).map(([,a])=>parseInt(a));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}function K_(t){try{return t()}catch(e){return console.error(e),!1}}var Sh=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Kr(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||j_.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let i=await n.importKey("raw",Sh(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,a]=t.split("."),s=await n.decrypt({name:"AES-CBC",iv:Sh(r)},i,Sh(a));return new TextDecoder().decode(s)}catch{throw new Error("Failed to decrypt")}}function Po(t){return typeof t=="string"?t:JSON.stringify(t)}function qt(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(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function X_(){let t;try{t="1.6.4"}catch{t=""}return t}function W_(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(r){return console.error(`Unable to merge query strings: ${r}`),e}return n.searchParams.forEach((r,a)=>{i.searchParams.has(a)||i.searchParams.set(a,r)}),i.toString()}function F_(t){return typeof t=="object"&&t!==null}function nu(t){return t.urlPatterns&&t.variations.some(e=>F_(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>F_(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function iu(t,e){return new Promise(n=>{let i=!1,r,a=s=>{i||(i=!0,r&&clearTimeout(r),n(s||null))};e&&(r=setTimeout(()=>a(),e)),t.then(s=>a(s)).catch(()=>a())})}var yt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},Vn=q_(),Qa={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>Vn.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{let r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return Vn.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new Vn.EventSource(`${t}/sub/${e}`,{headers:n}):new Vn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),AT()):document.visibilityState==="hidden"&&(t=window.setTimeout(CT,yt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(Vn.localStorage=globalThis.localStorage)}catch{}var Ja=new Map,Q_=!1,si=new Map,ru=new Map,es=new Map,ts=new Set;function eb(t){Object.assign(yt,t),yt.backgroundSync||Th()}async function tb({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(yt.backgroundSync=!1),kT({instance:t,allowStale:i,timeout:e,skipCache:n})}function wT(t){let e=Go(t),n=Ja.get(e)||new Set;n.add(t),Ja.set(e,n)}function nb(t){Ja.forEach(e=>e.delete(t))}function CT(){es.forEach(t=>{t&&(t.state="idle",Ah(t))})}function AT(){es.forEach(t=>{t&&t.state==="idle"&&kh(t)})}async function J_(){try{if(!Vn.localStorage)return;await Vn.localStorage.setItem(yt.cacheKey,JSON.stringify(Array.from(si.entries())))}catch{}}async function kT({instance:t,allowStale:e,timeout:n,skipCache:i}){let r=Go(t),a=wh(t),s=new Date,o=new Date(s.getTime()-yt.maxAge+yt.staleTTL);await TT();let l=!yt.disableCache&&!i?si.get(a):void 0;return l&&(e||l.staleAt>s)&&l.staleAt>o?(l.sse&&ts.add(r),l.staleAt<s?Eh(t):Ch(t),{data:l.data,success:!0,source:"cache"}):await iu(Eh(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Go(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function wh(t){let e=Go(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};i.forEach(o=>{r[o]=n[o]});let a=t.getForcedVariations(),s=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:a,url:s})}`}async function TT(){if(!Q_){Q_=!0;try{if(Vn.localStorage){let t=await Vn.localStorage.getItem(yt.cacheKey);if(!yt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,i])=>{si.set(n,{...i,staleAt:new Date(i.staleAt)})}),ib()}}}catch{}if(!yt.disableIdleStreams){let t=Qa.startIdleListener();t&&(Qa.stopIdleListener=t)}}}function ib(){let t=Array.from(si.entries()).map(([n,i])=>({key:n,staleAt:i.staleAt.getTime()})).sort((n,i)=>n.staleAt-i.staleAt),e=Math.min(Math.max(0,si.size-yt.maxEntries),si.size);for(let n=0;n<e;n++)si.delete(t[n].key)}function rb(t,e,n){let i=n.dateUpdated||"",r=new Date(Date.now()+yt.staleTTL),a=yt.disableCache?void 0:si.get(e);if(a&&i&&a.version===i){a.staleAt=r,J_();return}yt.disableCache||(si.set(e,{data:n,version:i,staleAt:r,sse:ts.has(t)}),ib()),J_();let s=Ja.get(t);s&&s.forEach(o=>RT(o,n))}async function RT(t,e){await t.setPayload(e||t.getPayload())}async function Eh(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),a=Go(t),s=wh(t),o=ru.get(s);return o||(o=(r?Qa.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):Qa.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&ts.add(a),c.json()}).then(c=>(rb(a,s,c),Ch(t),ru.delete(s),{data:c,success:!0,source:"network"})).catch(c=>(ru.delete(s),{data:null,source:"error",success:!1,error:c})),ru.set(s,o)),o}function Ch(t,e=!1){let n=Go(t),i=wh(t),{streamingHost:r,streamingHostRequestHeaders:a}=t.getApiHosts(),s=t.getClientKey();if(e&&ts.add(n),yt.backgroundSync&&ts.has(n)&&Vn.EventSource){if(es.has(n))return;let o={src:null,host:r,clientKey:s,headers:a,cb:l=>{try{if(l.type==="features-updated"){let c=Ja.get(n);c&&c.forEach(u=>{Eh(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);rb(n,i,c)}o.errors=0}catch{ab(o)}},errors:0,state:"active"};es.set(n,o),kh(o)}}function ab(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);Ah(t),setTimeout(()=>{["idle","active"].includes(t.state)||kh(t)},Math.min(e,3e5))}}function Ah(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function kh(t){t.src=Qa.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=()=>ab(t),t.src.onopen=()=>{t.errors=0}}function OT(t,e){Ah(t),es.delete(e)}function Th(){ts.clear(),es.forEach(OT),Ja.clear(),Qa.stopIdleListener()}function au(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Ch(t,!0),wT(t)}}var MT=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Mh={revert:function(){}},cu=new Map,Nh=new Set;function NT(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function uu(t){var e=cu.get(t);return e||(e={element:t,attributes:{}},cu.set(t,e)),e}function du(t,e,n,i,r){var a=n(t),s={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&s._positionTimeout)){e==="position"&&(s._positionTimeout=setTimeout(function(){s._positionTimeout=null},1e3));var o=n(t);e==="position"&&o.parentNode===s.virtualValue.parentNode&&o.insertBeforeNode===s.virtualValue.insertBeforeNode||o!==s.virtualValue&&(s.originalValue=o,r(s))}}),mutationRunner:r,setValue:i,getCurrentValue:n};return e==="position"&&t.parentNode?s.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):s.observer.observe(t,NT(e)),s}function fu(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,sb()):t!==n&&(e.isDirty=!0,sb())}function DT(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),fu(YT(e),t)}function LT(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),fu(Array.from(e).filter(Boolean).join(" "),t)}function zT(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),fu(e,t)}function BT(t){var e=t.parentSelector,n=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var r=n?document.querySelector(n):null;return n&&!r?null:{parentNode:i,insertBeforeNode:r}}function HT(t){var e=t.originalValue;t.mutations.forEach(function(n){var i=n.mutate(),r=BT(i);e=r||e}),fu(e,t)}var UT=function(e){return e.innerHTML},$T=function(e,n){return e.innerHTML=n};function lb(t){var e=uu(t);return e.html||(e.html=du(t,"html",UT,$T,DT)),e.html}var VT=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},IT=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function cb(t){var e=uu(t);return e.position||(e.position=du(t,"position",VT,IT,HT)),e.position}var FT=function(e,n){return n?e.className=n:e.removeAttribute("class")},jT=function(e){return e.className};function ub(t){var e=uu(t);return e.classes||(e.classes=du(t,"class",jT,FT,LT)),e.classes}var qT=function(e){return function(n){var i;return(i=n.getAttribute(e))!=null?i:null}},PT=function(e){return function(n,i){return i!==null?n.setAttribute(e,i):n.removeAttribute(e)}};function db(t,e){var n=uu(t);return n.attributes[e]||(n.attributes[e]=du(t,e,qT(e),PT(e),zT)),n.attributes[e]}function GT(t,e){var n=cu.get(t);if(n)if(e==="html"){var i,r;(i=n.html)==null||(r=i.observer)==null||r.disconnect(),delete n.html}else if(e==="class"){var a,s;(a=n.classes)==null||(s=a.observer)==null||s.disconnect(),delete n.classes}else if(e==="position"){var o,l;(o=n.position)==null||(l=o.observer)==null||l.disconnect(),delete n.position}else{var c,u,f;(c=n.attributes)==null||(u=c[e])==null||(f=u.observer)==null||f.disconnect(),delete n.attributes[e]}}var su;function YT(t){return su||(su=document.createElement("div")),su.innerHTML=t,su.innerHTML}function ou(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||GT(t,e),n.setValue(t,i)}}function ZT(t,e){t.html&&ou(e,"html",t.html),t.classes&&ou(e,"class",t.classes),t.position&&ou(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){ou(e,n,t.attributes[n])})}function sb(){cu.forEach(ZT)}function KT(t,e){var n=null;t.kind==="html"?n=lb(e):t.kind==="class"?n=ub(e):t.kind==="attribute"?n=db(e,t.attribute):t.kind==="position"&&(n=cb(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function XT(t,e){var n=null;if(t.kind==="html"?n=lb(e):t.kind==="class"?n=ub(e):t.kind==="attribute"?n=db(e,t.attribute):t.kind==="position"&&(n=cb(e)),!!n){var i=n.mutations.indexOf(t);i!==-1&&n.mutations.splice(i,1),n.mutationRunner(n)}}function fb(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(i){e.has(i)||(t.elements.add(i),KT(t,i))})}}function WT(t){t.elements.forEach(function(e){return XT(t,e)}),t.elements.clear(),Nh.delete(t)}function ob(){Nh.forEach(fb)}var Rh;function QT(){typeof document>"u"||(Rh||(Rh=new MutationObserver(function(){ob()})),ob(),Rh.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}QT();function pu(t){return typeof document>"u"?Mh:(Nh.add(t),fb(t),{revert:function(){WT(t)}})}function Oh(t,e){return pu({kind:"html",elements:new Set,mutate:e,selector:t})}function pb(t,e){return pu({kind:"position",elements:new Set,mutate:e,selector:t})}function Yo(t,e){return pu({kind:"class",elements:new Set,mutate:e,selector:t})}function lu(t,e,n){return MT.test(e)?e==="class"||e==="className"?Yo(t,function(i){var r=n(Array.from(i).join(" "));i.clear(),r&&r.split(/\s+/g).filter(Boolean).forEach(function(a){return i.add(a)})}):pu({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):Mh}function JT(t){var e=t.selector,n=t.action,i=t.value,r=t.attribute,a=t.parentSelector,s=t.insertBeforeSelector;if(r==="html"){if(n==="append")return Oh(e,function(o){return o+(i??"")});if(n==="set")return Oh(e,function(){return i??""})}else if(r==="class"){if(n==="append")return Yo(e,function(o){i&&o.add(i)});if(n==="remove")return Yo(e,function(o){i&&o.delete(i)});if(n==="set")return Yo(e,function(o){o.clear(),i&&o.add(i)})}else if(r==="position"){if(n==="set"&&a)return pb(e,function(){return{insertBeforeSelector:s,parentSelector:a}})}else{if(n==="append")return lu(e,r,function(o){return o!==null?o+(i??""):i??""});if(n==="set")return lu(e,r,function(){return i??""});if(n==="remove")return lu(e,r,function(){return null})}return Mh}var eR={html:Oh,classes:Yo,attribute:lu,position:pb,declarative:JT},hb=eR;var Dh={};function Ji(t,e,n){n=n||{};for(let[i,r]of Object.entries(e))switch(i){case"$or":if(!vb(t,r,n))return!1;break;case"$nor":if(vb(t,r,n))return!1;break;case"$and":if(!aR(t,r,n))return!1;break;case"$not":if(Ji(t,r,n))return!1;break;default:if(!Zo(r,tR(t,i),n))return!1}return!0}function tR(t,e){let n=e.split("."),i=t;for(let r=0;r<n.length;r++)if(i&&typeof i=="object"&&n[r]in i)i=i[n[r]];else return null;return i}function gb(t,e=!1){let n=`${t}${e?"/i":""}`;return Dh[n]||(Dh[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Dh[n]}function Zo(t,e,n,i=!1){if(typeof t=="string")return i?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)||!yb(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!rR(r,e,t[r],n))return!1;return!0}function yb(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function nR(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 iR(t,e,n){if(!Array.isArray(t))return!1;let i=yb(e)?r=>Zo(e,r,n):r=>Ji(r,e,n);for(let r=0;r<t.length;r++)if(t[r]&&i(t[r]))return!0;return!1}function ns(t,e,n=!1){if(n){let i=r=>typeof r=="string"?r.toLowerCase():r;return Array.isArray(t)?t.some(r=>e.some(a=>i(r)===i(a))):e.some(r=>i(t)===i(r))}return Array.isArray(t)?t.some(i=>e.includes(i)):e.includes(t)}function mb(t,e,n,i=!1){if(!Array.isArray(t))return!1;for(let r=0;r<e.length;r++){let a=!1;for(let s=0;s<t.length;s++)if(Zo(e[r],t[s],n,i)){a=!0;break}if(!a)return!1}return!0}function rR(t,e,n,i){switch(t){case"$veq":return qt(e)===qt(n);case"$vne":return qt(e)!==qt(n);case"$vgt":return qt(e)>qt(n);case"$vgte":return qt(e)>=qt(n);case"$vlt":return qt(e)<qt(n);case"$vlte":return qt(e)<=qt(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?ns(e,n):!1;case"$ini":return Array.isArray(n)?ns(e,n,!0):!1;case"$inGroup":return ns(e,i[n]||[]);case"$notInGroup":return!ns(e,i[n]||[]);case"$nin":return Array.isArray(n)?!ns(e,n):!1;case"$nini":return Array.isArray(n)?!ns(e,n,!0):!1;case"$not":return!Zo(n,e,i);case"$size":return Array.isArray(e)?Zo(n,e.length,i):!1;case"$elemMatch":return iR(e,n,i);case"$all":return Array.isArray(n)?mb(e,n,i):!1;case"$alli":return Array.isArray(n)?mb(e,n,i,!0):!1;case"$regex":try{return gb(n).test(e)}catch{return!1}case"$regexi":try{return gb(n,!0).test(e)}catch{return!1}case"$type":return nR(e)===n;default:return console.error("Unknown operator: "+t),!1}}function vb(t,e,n){if(!e.length)return!0;for(let i=0;i<e.length;i++)if(Ji(t,e[i],n))return!0;return!1}function aR(t,e,n){for(let i=0;i<e.length;i++)if(!Ji(t,e[i],n))return!1;return!0}var sR="Feature Evaluated",oR="Experiment Viewed";function lR(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,i)=>e.set(i,n)),e}function cR(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 is(t){try{await t()}catch{}}function _b(t,e,n){if(t.user.trackedExperiments){let r=mu(e,n);if(t.user.trackedExperiments.has(r))return[];t.user.trackedExperiments.add(r)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let i=[];if(t.global.trackingCallback){let r=t.global.trackingCallback;i.push(is(()=>r(e,n,t.user)))}if(t.user.trackingCallback){let r=t.user.trackingCallback;i.push(is(()=>r(e,n)))}if(t.global.eventLogger){let r=t.global.eventLogger;i.push(is(()=>r(oR,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return i}function uR(t,e,n){if(t.user.trackedFeatureUsage){let i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let i=t.global.onFeatureUsage;is(()=>i(e,n,t.user))}if(t.user.onFeatureUsage){let i=t.user.onFeatureUsage;is(()=>i(e,n))}if(t.global.eventLogger){let i=t.global.eventLogger;is(()=>i(sR,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function hu(t,e){if(e.stack.evaluatedFeatures.has(t))return er(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=lR(e);if(n.has(t))return er(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return er(e,t,null,"unknownFeature");let i=e.global.features[t];if(i.rules){let r=new Set(e.stack.evaluatedFeatures);e:for(let a of i.rules){if(a.parentConditions)for(let l of a.parentConditions){e.stack.evaluatedFeatures=new Set(r);let c=hu(l.id,e);if(c.source==="cyclicPrerequisite")return er(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Ji(u,l.condition||{})){if(l.gate)return er(e,t,null,"prerequisite");continue e}}if(a.filters&&xb(a.filters,e))continue;if("force"in a){if(a.condition&&!Sb(a.condition,e)||!dR(e,a.seed||t,a.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!a.disableStickyBucketing?a.fallbackAttribute:void 0,a.range,a.coverage,a.hashVersion))continue;return a.tracks&&a.tracks.forEach(l=>{!_b(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),er(e,t,a.force,"force",a.id)}if(!a.variations)continue;let s={variations:a.variations,key:a.key||t};"coverage"in a&&(s.coverage=a.coverage),a.weights&&(s.weights=a.weights),a.hashAttribute&&(s.hashAttribute=a.hashAttribute),a.fallbackAttribute&&(s.fallbackAttribute=a.fallbackAttribute),a.disableStickyBucketing&&(s.disableStickyBucketing=a.disableStickyBucketing),a.bucketVersion!==void 0&&(s.bucketVersion=a.bucketVersion),a.minBucketVersion!==void 0&&(s.minBucketVersion=a.minBucketVersion),a.namespace&&(s.namespace=a.namespace),a.meta&&(s.meta=a.meta),a.ranges&&(s.ranges=a.ranges),a.name&&(s.name=a.name),a.phase&&(s.phase=a.phase),a.seed&&(s.seed=a.seed),a.hashVersion&&(s.hashVersion=a.hashVersion),a.filters&&(s.filters=a.filters),a.condition&&(s.condition=a.condition);let{result:o}=gu(s,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(s,o),o.inExperiment&&!o.passthrough)return er(e,t,o.value,"experiment",a.id,s,o)}}return er(e,t,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function gu(t,e,n){let i=t.key,r=t.variations.length;if(r<2)return{result:ze(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:ze(n,t,-1,!1,e)};if(t=fR(t,n),t.urlPatterns&&!tu(n.user.url||"",t.urlPatterns))return{result:ze(n,t,-1,!1,e)};let a=Z_(i,n.user.url||"",r);if(a!==null)return{result:ze(n,t,a,!1,e)};let s=cR(n);if(i in s){let b=s[i];return{result:ze(n,t,b,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:ze(n,t,-1,!1,e)};let{hashAttribute:o,hashValue:l}=Xr(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:ze(n,t,-1,!1,e)};let c=-1,u=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:b,versionIsBlocked:d}=gR({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=b>=0,c=b,f=!!d}if(!u){if(t.filters){if(xb(t.filters,n))return{result:ze(n,t,-1,!1,e)}}else if(t.namespace&&!P_(l,t.namespace))return{result:ze(n,t,-1,!1,e)};if(t.include&&!K_(t.include))return{result:ze(n,t,-1,!1,e)};if(t.condition&&!Sb(t.condition,n))return{result:ze(n,t,-1,!1,e)};if(t.parentConditions){let b=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(b);let h=hu(d.id,n);if(h.source==="cyclicPrerequisite")return{result:ze(n,t,-1,!1,e)};let m={value:h.value};if(!Ji(m,d.condition||{}))return{result:ze(n,t,-1,!1,e)}}}if(t.groups&&!hR(t.groups,n))return{result:ze(n,t,-1,!1,e)}}if(t.url&&!pR(t.url,n))return{result:ze(n,t,-1,!1,e)};let g=qo(t.seed||i,l,t.hashVersion||1);if(g===null)return{result:ze(n,t,-1,!1,e)};if(!u){let b=t.ranges||Y_(r,t.coverage===void 0?1:t.coverage,t.weights);c=G_(g,b)}if(f)return{result:ze(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:ze(n,t,-1,!1,e)};if("force"in t)return{result:ze(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:ze(n,t,-1,!1,e)};if(t.status==="stopped")return{result:ze(n,t,-1,!1,e)};let p=ze(n,t,c,!0,e,g,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:b,key:d,doc:h}=vR(n,o,Po(l),{[Lh(t.key,t.bucketVersion)]:p.key});b&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=h,n.user.saveStickyBucketAssignmentDoc(h))}let y=_b(n,t,p);y.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:p});let _=y.length?y.length===1?y[0]:Promise.all(y).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:p,trackingCall:_}}function er(t,e,n,i,r,a,s){let o={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return a&&(o.experiment=a),s&&(o.experimentResult=s),i!=="override"&&uR(t,e,o),o}function bb(t){return{...t.user.attributes,...t.user.attributeOverrides}}function Sb(t,e){return Ji(bb(e),t,e.global.savedGroups||{})}function xb(t,e){return t.some(n=>{let{hashValue:i}=Xr(e,n.attribute);if(!i)return!0;let r=qo(n.seed,i,n.hashVersion||2);return r===null?!0:!n.ranges.some(a=>eu(r,a))})}function dR(t,e,n,i,r,a,s){if(!r&&a===void 0)return!0;if(!r&&a===0)return!1;let{hashValue:o}=Xr(t,n,i);if(!o)return!1;let l=qo(e,o,s||1);return l===null?!1:r?eu(l,r):a!==void 0?l<=a:!0}function ze(t,e,n,i,r,a,s){let o=!0;(n<0||n>=e.variations.length)&&(n=0,o=!1);let{hashAttribute:l,hashValue:c}=Xr(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},f={key:u.key||""+n,featureId:r,inExperiment:o,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!s};return u.name&&(f.name=u.name),a!==void 0&&(f.bucket=a),u.passthrough&&(f.passthrough=u.passthrough),f}function fR(t,e){let n=t.key,i=e.global.overrides;return i&&i[n]&&(t=Object.assign({},t,i[n]),typeof t.url=="string"&&(t.url=xh(t.url))),t}function Xr(t,e,n){let i=e||"id",r="",a=bb(t);return a[i]&&(r=a[i]),!r&&n&&(a[n]&&(r=a[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function pR(t,e){let n=e.user.url;if(!n)return!1;let i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(i))}function hR(t,e){let n=e.global.groups||{};for(let i=0;i<t.length;i++)if(n[t[i]])return!0;return!1}function gR({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:a,expMeta:s}){n=n||0,a=a||0,i=i||"id",s=s||[];let o=Lh(e,n),l=mR(t,i,r);if(a>0)for(let f=0;f<a;f++){let g=Lh(e,f);if(l[g]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[o];if(c===void 0)return{variation:-1};let u=s.findIndex(f=>f.key===c);return u<0?{variation:-1}:{variation:u}}function Lh(t,e){return e=e||0,`${t}__${e}`}function zh(t,e){return`${t}||${e}`}function mR(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:i,hashValue:r}=Xr(t,e),a=zh(i,Po(r)),{hashAttribute:s,hashValue:o}=Xr(t,n),l=o?zh(s,Po(o)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[a]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[a].assignments||{}),c}function vR(t,e,n,i){let r=zh(e,n),a=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]?t.user.stickyBucketAssignmentDocs[r].assignments||{}:{},s={...a,...i},o=JSON.stringify(a)!==JSON.stringify(s);return{key:r,doc:{attributeName:e,attributeValue:n,assignments:s},changed:o}}function yR(t,e){let n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(i).forEach(a=>{let s=i[a];if(s.rules)for(let o of s.rules)o.variations&&(n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute))}),r.map(a=>{n.add(a.hashAttribute||"id"),a.fallbackAttribute&&n.add(a.fallbackAttribute)}),Array.from(n)}async function Eb(t,e,n){let i=Bh(t,n);return e.getAllAssignments(i)}function Bh(t,e){let n={};return yR(t,e).forEach(r=>{let{hashValue:a}=Xr(t,r);n[r]=Po(a)}),n}async function wb(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await Kr(t.encryptedFeatures,e,n))}catch(i){console.error(i)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await Kr(t.encryptedExperiments,e,n))}catch(i){console.error(i)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await Kr(t.encryptedSavedGroups,e,n))}catch(i){console.error(i)}delete t.encryptedSavedGroups}return t}function Cb(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 mu(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var rs=typeof window<"u"&&typeof document<"u",_R=X_(),Ko=class{constructor(e){if(e=e||{},this.version=_R,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 n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)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 n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=i=>n.saveAssignments(i)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),rs&&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 n in this._options.stickyBucketAssignmentDocs){let i=this._options.stickyBucketAssignmentDocs[n];i&&this._options.stickyBucketService.saveAssignments(i).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await wb(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.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,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,au(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&eb(e.cacheSettings),e.payload)return await this.setPayload(e.payload),au(this,e),{success:!0,source:"init"};{let{data:n,...i}=await this._refresh({...e,allowStale:!0});return au(this,e),await this.setPayload(n||{}),i}}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 n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return Cb(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:n,allowStale:i,streaming:r}){if(!this._options.clientKey)throw new Error("Missing clientKey");return tb({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:i,backgroundSync:r??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,i){let r=await Kr(e,n||this._options.decryptionKey,i);this.setFeatures(JSON.parse(r))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,i){let r=await Kr(e,n||this._options.decryptionKey,i);this.setExperiments(JSON.parse(r))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(i){console.error(i)}}),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,nb(this),e.destroyAllStreams&&Th(),this.logs=[],rs&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=gu(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(i=>i.key===e).map(i=>this._runAutoExperiment(i)).filter(i=>i!==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,n){let i=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!i)return null;let r=this._isAutoExperimentBlockedByContext(e),a,s;r?a=ze(this._getEvalContext(),e,-1,!1,""):({result:a,trackingCall:s}=gu(e,null,this._getEvalContext()),this._onExperimentEval(e,a));let o=JSON.stringify(a.value);if(!n&&a.inExperiment&&i&&i.valueHash===o)return a;if(i&&this._undoActiveAutoExperiment(e),a.inExperiment){let l=nu(e);if(l==="redirect"&&a.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?W_(this._getContextUrl(),a.value.urlRedirect):a.value.urlRedirect;if(tu(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),a;this._redirectedUrl=c;let{navigate:u,delay:f}=this._getNavigateFunction();if(u)if(rs)Promise.all([...s?[iu(s,this._options.maxNavigateDelay??1e3)]:[],new Promise(g=>window.setTimeout(g,this._options.navigateDelay??f))]).then(()=>{try{u(c)}catch(g){console.error(g)}});else try{u(c)}catch(g){console.error(g)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(a.value):this._applyDOMChanges(a.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:o})}}return a}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],i=new Set(n);this._activeAutoExperiments.forEach((r,a)=>{i.has(a)||(r.undo(),this._activeAutoExperiments.delete(a))});for(let r of n){let a=this._runAutoExperiment(r,e);if(a&&a.inExperiment&&nu(r)==="redirect")break}}_onExperimentEval(e,n){let i=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,i)}_fireSubscriptions(e,n,i){(!i||i.result.inExperiment!==n.inExperiment||i.result.variationId!==n.variationId)&&this._subscriptions.forEach(r=>{try{r(e,n)}catch(a){console.error(a)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let i=this.evalFeature(e).value;return i===null?n:i}feature(e){return this.evalFeature(e)}evalFeature(e){return hu(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[mu(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.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,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(i){console.error(i)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(mu(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(rs?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=nu(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(i=>i.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let i=new URL(this._getContextUrl());for(let r of e.variations){if(!r||!r.urlRedirect)continue;let a=new URL(r.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(a.protocol!==i.protocol||a.host!==i.host))return!0}}catch(i){return this.log("Error parsing current or redirect URL",{id:e.key,error:i}),!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}:rs?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!rs)return;let n=[];if(e.css){let i=document.createElement("style");i.innerHTML=e.css,document.head.appendChild(i),n.push(()=>i.remove())}if(e.js){let i=document.createElement("script");i.innerHTML=e.js,this._options.jsInjectionNonce&&(i.nonce=this._options.jsInjectionNonce),document.head.appendChild(i),n.push(()=>i.remove())}return e.domMutations&&e.domMutations.forEach(i=>{n.push(hb.declarative(i).revert)}),()=>{n.forEach(i=>i())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),i=await Eb(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=i}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let i=this._getEvalContext(),r=Bh(i,n);return e.getAllAssignmentsSync(r)}inDevMode(){return!!this._options.enableDevMode}};var bR="https://experiment.syntrologie.com",Hh=class{constructor(e={}){F(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(i,r)=>{e.onExperimentViewed(i.key,r.variationId,typeof r.value=="string"?r.value:`variation_${r.variationId}`)}:void 0;this.gb=new Ko({...e,apiHost:e.apiHost??bR,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}shouldRenderRectangle(e){let{experiment:n}=e;if(!n||!n.featureKey)return!0;let i=this.gb.getFeatureValue(n.featureKey,null);if(i==null)return!1;if(typeof n.variationId=="number")return Number(i)===n.variationId;if(typeof n.variationValue<"u")return i===n.variationValue;if(n.predicate)try{return n.predicate(i)}catch{return!1}return!!i}};function Uh(t={}){return new Hh(t)}var tr=ie(Pt(),1);var Gh=!1;function Ub(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function Yh(t){if(Ub()){Gh=!0;return}Gh=t??!1}function HR(){return Ub()?!0:Gh}function j(t,e,n){HR()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function Rt(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function yu(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var UR=t=>[...t].sort((e,n)=>(e.order??0)-(n.order??0));function $b({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:i}){let[r,a]=(0,tr.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,tr.useCallback)(async()=>{try{a(c=>({...c,isLoading:!0,error:void 0}));let o=await t();j("SmartCanvas Config","Raw config response",o);let l=o.tiles||[];i&&o.routes&&i.setRoutes(o.routes),i?(l=await i.filterTiles(l),n&&(l=l.filter(c=>n.shouldRenderRectangle(c)))):n&&(l=l.filter(c=>n.shouldRenderRectangle(c))),j("SmartCanvas Config",`Tile count after filtering: ${l.length}`),a({tiles:UR(l),actions:o.actions||[],isLoading:!1,fetchedAt:o.fetchedAt,canvasTitle:o.canvasTitle,configVersion:o.configVersion,theme:o.theme,launcher:o.launcher,routes:o.routes})}catch(o){a(l=>({...l,isLoading:!1,error:o instanceof Error?o.message:"Unknown error"}))}},[n,t,i]);return(0,tr.useEffect)(()=>{if(s(),!e)return;let o=setInterval(s,e);return()=>clearInterval(o)},[s,e]),(0,tr.useMemo)(()=>r,[r])}var li=ie(Pt(),1);var nr={white:"#ffffff",black:"#000000"},Ae={0:"#2c0b0a",1:"#5b1715",2:"#89221f",3:"#b72e2a",4:"#d44844",5:"#dd6d69",6:"#e5918f",7:"#eeb6b4",8:"#f6dada",9:"#faebea"},R={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"},Ye={0:"#07230a",1:"#0e4514",2:"#16681e",3:"#1d8a28",4:"#24ad32",5:"#4fbd5a",6:"#7acd82",7:"#a5deab",8:"#d0eed3",9:"#e5f6e7"},In={0:"#301f09",1:"#5f3e12",2:"#8f5e1b",3:"#be7d24",4:"#ee9c2d",5:"#f1b057",6:"#f5c481",7:"#f8d7ab",8:"#fcebd5",9:"#fdf5ea"},tt={0:"#330707",1:"#660f0e",2:"#991616",3:"#cc1e1d",4:"#ff2524",5:"#ff5150",6:"#ff7c7c",7:"#ffa8a7",8:"#ffd3d3",9:"#ffe9e9"},Xo={0:"#051533",1:"#0a2a66",2:"#0f3f98",3:"#1454cb",4:"#1969fe",5:"#4787fe",6:"#75a5fe",7:"#a3c3ff",8:"#d1e1ff",9:"#e8f0ff"},Wo={0:"#662500",1:"#993d00",2:"#cc5800",3:"#ff7700",4:"#fea85d",5:"#fec58f",6:"#ffd6ae",7:"#fee6cd",8:"#fff1e1",9:"#fff8f0"},Qo={0:"#151229",1:"#2a2452",2:"#40357c",3:"#5547a5",4:"#6a59ce",5:"#887ad8",6:"#a69be2",7:"#c3bdeb",8:"#e1def5",9:"#f0eefa"},Jo={0:"#37091f",1:"#69123c",2:"#9b1c58",3:"#cd2575",4:"#ff2e92",5:"#ff58a8",6:"#ff82be",7:"#ffabd3",8:"#ffd5e9",9:"#ffeaf4"};var Ze={primary:R[10],secondary:R[9],tertiary:R[8]},m5={primary:R[2],secondary:R[0]},wn={primary:R[4],secondary:R[3]},v5={primary:{text:nr.white,icon:nr.white,border:Ae[3],backgroundDefault:Ae[3],backgroundHover:Ae[2]},neutral:{text:R[10],textHover:nr.white,icon:R[10],iconHover:nr.white,border:R[4],background:R[2]},link:{text:nr.white,icon:nr.white,hover:Ae[5]},error:{text:tt[5],hover:tt[6]},success:{text:Ye[5],hover:Ye[6]}},y5={slateGrey:{content:R[10],pillOutline:R[10],borderPrimary:R[5],borderSecondary:R[5],background:R[3]},brand:{content:Ae[9],pillOutline:Ae[9],borderPrimary:Ae[6],borderSecondary:Ae[6],background:Ae[0]},red:{content:tt[8],pillOutline:tt[4],borderPrimary:tt[2],borderSecondary:tt[2],background:tt[0]},yellow:{content:In[8],pillOutline:In[4],borderPrimary:In[2],borderSecondary:In[2],background:In[0]},green:{content:Ye[8],pillOutline:Ye[4],borderPrimary:Ye[2],borderSecondary:Ye[2],background:Ye[0]},purple:{content:Qo[8],pillOutline:Qo[4],borderPrimary:Qo[2],borderSecondary:Qo[2],background:Qo[0]},blue:{content:Xo[8],pillOutline:Xo[4],borderPrimary:Xo[2],borderSecondary:Xo[2],background:Xo[0]},orange:{content:Wo[8],pillOutline:Wo[4],borderPrimary:Wo[2],borderSecondary:Wo[2],background:Wo[0]},pink:{content:Jo[8],pillOutline:Jo[4],borderPrimary:Jo[2],borderSecondary:Jo[2],background:Jo[0]}},_5={green:{content:Ye[8],border:Ye[2],background:Ye[0]},yellow:{content:In[8],border:In[2],background:In[0]},red:{content:tt[8],border:tt[2],background:tt[0]}},b5={green:{content:Ye[1],background:Ye[9]},yellow:{content:In[1],background:In[9]},red:{content:tt[1],background:tt[9]}},S5={content:R[10],border:R[4],background:"#1c2124"},x5={backgroundDefault:R[2],backgroundHover:R[1],selected:R[3]},E5={background:R[2],icon:R[10],borderDefault:R[4],borderSelected:Ae[3],textLabel:R[9],textPlaceholder:R[8],textHint:R[8]},w5={backgroundDefault:R[2],backgroundDisabled:R[0],textLabel:R[9],textPlaceholder:R[8],textHint:R[8],textError:tt[5],iconDefault:R[9],iconPlaceholder:R[10],iconError:tt[5],borderDefault:R[4],borderSelected:Ae[3],borderError:tt[5]},C5={handleDefault:nr.white,handleDisabled:R[10],off:{backgroundDefault:R[4],backgroundHover:R[5],backgroundDisabled:R[4]},on:{backgroundDefault:Ye[3],backgroundHover:Ye[2],backgroundDisabled:R[4]}},A5={off:{backgroundDefault:"#00000000",backgroundHover:R[5],backgroundDisabled:R[2],border:R[6]},on:{backgroundDefault:Ye[0],backgroundHover:Ye[1],backgroundDisabled:R[2],border:Ye[3]}},k5={content:R[10],background:R[4]},T5={background:R[4],active:Ye[3]},R5={background:R[1],content:R[9],border:R[4]},O5={backgroundDefault:R[1],backgroundHover:R[3],backgroundActive:R[4],border:R[4],contentPrimary:R[10],contentSecondary:R[9],contentTertiary:R[8]},M5={background:R[1],content:R[9],border:R[4]},N5={activeBackground:R[3],activeContent:Ae[5],inactiveContent:R[9],border:R[4]},D5={header:{textDefault:R[9],textHover:R[8],backgroundDefault:R[1]},border:R[4],cell:{textPrimary:R[10],textSecondary:R[9],backgroundDefault:R[2],backgroundHover:R[1]}},L5={textPrimaryDefault:R[10],textPrimaryHover:R[10],textSecondaryDefault:R[8],textSecondaryHover:R[9],iconPrimary:R[10],iconSecondary:R[8]},z5={background:Ye[1],active:Ye[5]},B5={textDefault:R[10],textSelected:nr.white,textDisabled:R[7],backgroundDefault:R[2],backgroundMiddle:R[3],backgroundSelected:Ae[3],border:R[4]},H5=R[9];var jb=ie(Pt(),1),$e=ie(Re(),1);function IR({trend:t}){let e=t.direction==="up",n=t.direction==="down";return(0,$e.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"var(--sc-border-radius-full, 9999px)",background:e?"var(--sc-color-success-muted, #07230a)":n?"var(--sc-color-error-muted, #330707)":"#87919f26",color:e?"var(--sc-color-success, #24ad32)":n?"var(--sc-color-error, #ff2524)":"var(--sc-color-text-muted, #87919f)",fontSize:"var(--sc-font-size-xs, 0.7rem)",fontWeight:"var(--sc-font-weight-medium, 500)"},children:[(0,$e.jsx)(()=>(0,$e.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{transform:e?"rotate(0deg)":n?"rotate(180deg)":"rotate(90deg)"},children:(0,$e.jsx)("path",{d:"M5 1v8M5 1L2 4M5 1l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),{}),t.value,t.timeframe&&(0,$e.jsx)("span",{style:{color:"var(--sc-color-text-muted, #87919f)"},children:t.timeframe})]})}function FR({data:t,color:e}){let{path:n,width:i,height:r}=(0,jb.useMemo)(()=>{if(t.length<2)return{path:"",width:60,height:24};let l=Math.min(...t),u=Math.max(...t)-l||1;return{path:t.map((p,y)=>{let _=2+y/(t.length-1)*56,b=22-(p-l)/u*20;return{x:_,y:b}}).reduce((p,y,_)=>p+(_===0?`M ${y.x} ${y.y}`:` L ${y.x} ${y.y}`),""),width:60,height:24}},[t]);return n?(0,$e.jsxs)("svg",{width:i,height:r,viewBox:`0 0 ${i} ${r}`,style:{overflow:"visible"},children:[(0,$e.jsx)("path",{d:n,stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,$e.jsx)("defs",{children:(0,$e.jsxs)("linearGradient",{id:"sparkline-gradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,$e.jsx)("stop",{offset:"0%",stopColor:e,stopOpacity:"0.3"}),(0,$e.jsx)("stop",{offset:"100%",stopColor:e,stopOpacity:"0"})]})}),(0,$e.jsx)("path",{d:`${n} L ${i-2} ${r} L 2 ${r} Z`,fill:"url(#sparkline-gradient)"})]}):null}function Zh({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #b72e2a)",i={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"},r={display:"flex",alignItems:"baseline",gap:"var(--sc-spacing-xs, 0.25rem)"},a={fontSize:"var(--sc-font-size-xxl, 1.5rem)",fontWeight:"var(--sc-font-weight-bold, 700)",color:n,letterSpacing:"-0.02em",lineHeight:1},s={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-normal, 400)",color:"var(--sc-color-text-muted, #87919f)"},o={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a8afba)",margin:0},l={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"var(--sc-spacing-xs, 0.25rem)"};return(0,$e.jsxs)("div",{style:i,children:[(0,$e.jsxs)("div",{style:r,children:[t.prefix&&(0,$e.jsx)("span",{style:s,children:t.prefix}),(0,$e.jsx)("span",{style:a,children:t.value}),t.suffix&&(0,$e.jsx)("span",{style:s,children:t.suffix})]}),(0,$e.jsx)("p",{style:o,children:t.label}),(t.trend||t.sparkline)&&(0,$e.jsxs)("div",{style:l,children:[t.trend&&(0,$e.jsx)(IR,{trend:t.trend}),t.sparkline&&t.sparkline.length>1&&(0,$e.jsx)(FR,{data:t.sparkline,color:n})]})]})}var Ot=ie(Re(),1);function jR({item:t,accentColor:e,layout:n}){let i=t.highlight,r={display:"flex",flexDirection:n==="list"?"row":"column",alignItems:n==="list"?"center":"flex-start",gap:n==="list"?"var(--sc-spacing-md, 0.75rem)":"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:i?"var(--sc-color-primary-muted, #2c0b0a)":"var(--sc-color-background-subtle, #07080a33)",border:i?`1px solid ${e}`:"1px solid var(--sc-color-border-subtle, #1c222a)",transition:"all 0.15s ease"},a={fontSize:"1.25rem",marginBottom:n==="list"?0:"var(--sc-spacing-xs, 0.25rem)"},s={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a8afba)",flex:n==="list"?1:void 0},o={fontSize:"var(--sc-font-size-lg, 1rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:i?e:"var(--sc-color-text, #cbd0d7)"};return(0,Ot.jsxs)("div",{style:r,children:[t.icon&&(0,Ot.jsx)("span",{style:a,children:t.icon}),(0,Ot.jsx)("span",{style:s,children:t.label}),(0,Ot.jsx)("span",{style:o,children:t.value})]})}function Kh({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #b72e2a)",i=t.layout||"grid",r=t.columns||2,a=t.items;if(t.highlightBest&&!t.items.some(o=>o.highlight)){let o=t.items.map(c=>({...c,numericValue:typeof c.value=="number"?c.value:parseFloat(String(c.value))})),l=Math.max(...o.map(c=>c.numericValue||0));a=o.map(c=>({...c,highlight:c.numericValue===l}))}let s={display:i==="table"?"block":i==="list"?"flex":"grid",flexDirection:i==="list"?"column":void 0,gridTemplateColumns:i==="grid"?`repeat(${r}, 1fr)`:void 0,gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"};return i==="table"?(0,Ot.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--sc-font-size-sm, 0.8rem)"},children:(0,Ot.jsx)("tbody",{children:a.map((o,l)=>(0,Ot.jsxs)("tr",{style:{borderBottom:l<a.length-1?"1px solid var(--sc-color-border-subtle, #1c222a)":void 0},children:[(0,Ot.jsxs)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",color:"var(--sc-color-text-secondary, #a8afba)",display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[o.icon&&(0,Ot.jsx)("span",{children:o.icon}),o.label]}),(0,Ot.jsx)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",textAlign:"right",fontWeight:"var(--sc-font-weight-semibold, 600)",color:o.highlight?n:"var(--sc-color-text, #cbd0d7)"},children:o.value})]},l))})}):(0,Ot.jsx)("div",{style:s,children:a.map((o,l)=>(0,Ot.jsx)(jR,{item:o,accentColor:n,layout:i},l))})}var bu=ie(Pt(),1),fe=ie(Re(),1);function qR({value:t,maxValue:e,onChange:n,color:i}){let[r,a]=(0,bu.useState)(null);return(0,fe.jsx)("div",{style:{display:"flex",gap:"4px"},children:Array.from({length:e},(s,o)=>{let l=o+1,c=(r??t??0)>=l;return(0,fe.jsx)("button",{onClick:()=>n(l),onMouseEnter:()=>a(l),onMouseLeave:()=>a(null),style:{width:"28px",height:"28px",padding:0,border:"none",background:"none",cursor:"pointer",color:c?i:"var(--sc-color-text-muted, #87919f)",transition:"color 0.15s ease, transform 0.1s ease",transform:r===l?"scale(1.15)":"scale(1)"},"aria-label":`Rate ${l} out of ${e}`,children:(0,fe.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:c?"currentColor":"none",children:(0,fe.jsx)("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},o)})})}function PR({value:t,onChange:e,color:n}){let i=r=>({width:"48px",height:"48px",padding:"8px",border:"none",borderRadius:"var(--sc-border-radius-md, 10px)",background:r?n:"var(--sc-color-surface, #2b333fcc)",cursor:"pointer",color:r?"white":"var(--sc-color-text-muted, #87919f)",transition:"all 0.15s ease"});return(0,fe.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,fe.jsx)("button",{onClick:()=>e(1),style:i(t===1),"aria-label":"Thumbs up",children:(0,fe.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:(0,fe.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===1?"currentColor":"none"})})}),(0,fe.jsx)("button",{onClick:()=>e(0),style:i(t===0),"aria-label":"Thumbs down",children:(0,fe.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{transform:"rotate(180deg)"},children:(0,fe.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===0?"currentColor":"none"})})})]})}function GR({value:t,maxValue:e,onChange:n,color:i}){return(0,fe.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[(0,fe.jsx)("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:Array.from({length:e+1},(r,a)=>{let s=t===a;return(0,fe.jsx)("button",{onClick:()=>n(a),style:{width:"28px",height:"32px",padding:0,border:s?`2px solid ${i}`:"1px solid var(--sc-color-border, #2b333f)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:s?i:"var(--sc-color-surface, #2b333fcc)",cursor:"pointer",color:s?"white":"var(--sc-color-text, #cbd0d7)",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-medium, 500)",transition:"all 0.15s ease"},"aria-label":`Rate ${a}`,children:a},a)})}),(0,fe.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[(0,fe.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #87919f)"},children:"Not likely"}),(0,fe.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #87919f)"},children:"Very likely"})]})]})}function YR({value:t,onChange:e,color:n}){return(0,fe.jsx)("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F604}"].map((r,a)=>{let s=t===a;return(0,fe.jsx)("button",{onClick:()=>e(a),style:{width:"44px",height:"44px",padding:0,border:s?`2px solid ${n}`:"1px solid transparent",borderRadius:"var(--sc-border-radius-md, 10px)",background:s?"var(--sc-color-primary-muted, #2c0b0a)":"transparent",cursor:"pointer",fontSize:"1.75rem",transition:"all 0.15s ease",transform:s?"scale(1.1)":"scale(1)"},"aria-label":`Rate ${a+1} out of 5`,children:r},a)})})}function Xh({content:t,onSubmit:e,accentColor:n}){let[i,r]=(0,bu.useState)(null),[a,s]=(0,bu.useState)(!1),o=n||"var(--sc-color-primary, #b72e2a)",l=t.maxValue??(t.variant==="nps"?10:5),c=p=>{r(p)},u=()=>{i!==null&&(s(!0),e?.(i))},f={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0",alignItems:"center"},g={fontSize:"var(--sc-font-size-md, 0.9rem)",color:"var(--sc-color-text, #cbd0d7)",textAlign:"center",margin:0};return a?(0,fe.jsxs)("div",{style:{...f,padding:"var(--sc-spacing-lg, 1rem)"},children:[(0,fe.jsx)("span",{style:{fontSize:"2rem"},children:"\u2713"}),(0,fe.jsx)("p",{style:{...g,color:"var(--sc-color-success, #24ad32)"},children:"Thanks for your feedback!"})]}):(0,fe.jsxs)("div",{style:f,children:[t.question&&(0,fe.jsx)("p",{style:g,children:t.question}),t.variant==="stars"&&(0,fe.jsx)(qR,{value:i,maxValue:l,onChange:c,color:o}),t.variant==="thumbs"&&(0,fe.jsx)(PR,{value:i,onChange:c,color:o}),t.variant==="nps"&&(0,fe.jsx)(GR,{value:i,maxValue:l,onChange:c,color:o}),t.variant==="emoji"&&(0,fe.jsx)(YR,{value:i,onChange:c,color:o}),i!==null&&t.submitActionId&&(0,fe.jsx)("button",{onClick:u,style:{marginTop:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) var(--sc-spacing-lg, 1rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"none",background:o,color:"white",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",cursor:"pointer",transition:"opacity 0.15s ease"},children:"Submit"})]})}var dt=ie(Re(),1);function Wh({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #b72e2a)",i=t.items.filter(b=>b.completed).length,r=t.items.length,a={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},s={display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)",marginBottom:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #87919f)"},o={flex:1,height:"4px",background:"var(--sc-color-surface, #2b333fcc)",borderRadius:"2px",overflow:"hidden"},l={height:"100%",width:`${r>0?i/r*100:0}%`,background:n,borderRadius:"2px",transition:"width 0.3s ease"},c=b=>({display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-md, 0.75rem)",background:"var(--sc-color-surface, #2b333f80)",borderRadius:"var(--sc-border-radius-md, 10px)",border:"1px solid var(--sc-color-border, #2b333f)",opacity:b?.6:1,transition:"all 0.15s ease"}),u=b=>({width:"20px",height:"20px",borderRadius:"50%",border:b?"none":"2px solid var(--sc-color-border, #2b333f)",background:b?"#24ad32":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}),f={flex:1,minWidth:0},g=b=>({fontSize:"var(--sc-font-size-sm, 0.85rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:"var(--sc-color-text, #cbd0d7)",margin:0,textDecoration:b?"line-through":"none"}),p={fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #87919f)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:1.4},y={display:"inline-flex",alignItems:"center",gap:"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-xs, 0.25rem) var(--sc-spacing-sm, 0.5rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"1px solid var(--sc-color-border, #2b333f)",background:"transparent",color:"var(--sc-color-text, #cbd0d7)",fontSize:"var(--sc-font-size-xs, 0.75rem)",fontWeight:"var(--sc-font-weight-medium, 500)",cursor:"pointer",textDecoration:"none",transition:"all 0.15s ease",flexShrink:0},_=b=>{b&&typeof window<"u"&&(window.location.href=b)};return(0,dt.jsxs)("div",{style:a,children:[t.showProgress!==!1&&r>0&&(0,dt.jsxs)("div",{style:s,children:[(0,dt.jsxs)("span",{children:[i," of ",r]}),(0,dt.jsx)("div",{style:o,children:(0,dt.jsx)("div",{style:l})})]}),t.items.map(b=>(0,dt.jsxs)("div",{style:c(b.completed??!1),children:[(0,dt.jsx)("div",{style:u(b.completed??!1),children:b.completed&&(0,dt.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,dt.jsx)("path",{d:"M20 6L9 17l-5-5",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,dt.jsxs)("div",{style:f,children:[(0,dt.jsx)("p",{style:g(b.completed??!1),children:b.title}),b.description&&(0,dt.jsx)("p",{style:p,children:b.description})]}),b.href&&!b.completed&&(0,dt.jsxs)("button",{style:y,onClick:d=>{d.stopPropagation(),_(b.href)},onMouseEnter:d=>{d.currentTarget.style.background="var(--sc-color-surface, #2b333fcc)"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[b.linkLabel||"Go",(0,dt.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,dt.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},b.id))]})}var el=ie(Pt(),1),ce=ie(Re(),1),ZR={success:()=>(0,ce.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ce.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ce.jsx)("path",{d:"M6 10l2.5 2.5L14 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:()=>(0,ce.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ce.jsx)("path",{d:"M10 2L18 17H2L10 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ce.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]}),error:()=>(0,ce.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ce.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ce.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),info:()=>(0,ce.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ce.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ce.jsx)("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ce.jsx)("circle",{cx:"10",cy:"6",r:"0.75",fill:"currentColor"})]}),alert:()=>(0,ce.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ce.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ce.jsx)("path",{d:"M10 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ce.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]})};function KR({onClick:t,color:e}){return(0,ce.jsx)("button",{onClick:n=>{n.stopPropagation(),t()},style:{position:"absolute",top:"8px",right:"8px",width:"20px",height:"20px",padding:0,border:"none",background:"#1c222a",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:e,opacity:.6,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="1"},onMouseLeave:n=>{n.currentTarget.style.opacity="0.6"},"aria-label":"Dismiss",children:(0,ce.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,ce.jsx)("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})}function XR(t){let e={success:{bg:"var(--sc-color-success-muted, #07230a)",border:"var(--sc-color-success, #24ad32)",icon:"var(--sc-color-success, #24ad32)",text:"var(--sc-color-text, #cbd0d7)"},warning:{bg:"var(--sc-color-warning-muted, #301f09)",border:"var(--sc-color-warning, #ee9c2d)",icon:"var(--sc-color-warning, #ee9c2d)",text:"var(--sc-color-text, #cbd0d7)"},error:{bg:"var(--sc-color-error-muted, #330707)",border:"var(--sc-color-error, #ff2524)",icon:"var(--sc-color-error, #ff2524)",text:"var(--sc-color-text, #cbd0d7)"},info:{bg:"var(--sc-color-info-muted, #051533)",border:"var(--sc-color-info, #1969fe)",icon:"var(--sc-color-info, #1969fe)",text:"var(--sc-color-text, #cbd0d7)"},alert:{bg:"var(--sc-color-primary-muted, #2c0b0a)",border:"var(--sc-color-primary, #b72e2a)",icon:"var(--sc-color-primary, #b72e2a)",text:"var(--sc-color-text, #cbd0d7)"}};return e[t]||e.info}function Qh({content:t,onDismiss:e,accentColor:n}){let[i,r]=(0,el.useState)(!1),[a,s]=(0,el.useState)(t.type==="warning"?t.countdown??null:null);(0,el.useEffect)(()=>{if(a===null||a<=0)return;let d=setInterval(()=>{s(h=>h!==null&&h>0?h-1:null)},1e3);return()=>clearInterval(d)},[a]);let o=()=>{r(!0),setTimeout(()=>e?.(),200)},l=XR(t.type),c=ZR[t.type],u={position:"relative",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-md, 10px)",background:l.bg,borderLeft:`3px solid ${l.border}`,opacity:i?0:1,transform:i?"translateX(10px)":"translateX(0)",transition:"opacity 0.2s ease, transform 0.2s ease"},f={display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-sm, 0.5rem)"},g={color:l.icon,flexShrink:0,marginTop:"1px"},p={flex:1,minWidth:0,paddingRight:t.dismissible?"24px":0},y={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:l.text,margin:0,lineHeight:"var(--sc-line-height-tight, 1.25)"},_={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a8afba)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:"var(--sc-line-height-normal, 1.5)"},b={fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #87919f)",marginTop:"var(--sc-spacing-sm, 0.5rem)"};return(0,ce.jsxs)("div",{style:u,children:[(0,ce.jsxs)("div",{style:f,children:[(0,ce.jsx)("div",{style:g,children:(0,ce.jsx)(c,{})}),(0,ce.jsxs)("div",{style:p,children:[(0,ce.jsx)("h4",{style:y,children:t.title}),t.body&&(0,ce.jsx)("p",{style:_,children:t.body}),t.type==="error"&&t.errorCode&&(0,ce.jsxs)("p",{style:{..._,fontFamily:"var(--sc-font-family-mono, monospace)"},children:["Code: ",t.errorCode]}),t.type==="info"&&t.learnMoreUrl&&(0,ce.jsx)("a",{href:t.learnMoreUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-sm, 0.8rem)",color:l.icon,textDecoration:"none"},onClick:d=>d.stopPropagation(),children:"Learn more \u2192"}),a!==null&&a>0&&(0,ce.jsxs)("p",{style:{..._,color:l.icon},children:["Action required in ",a,"s"]}),t.timestamp&&(0,ce.jsx)("p",{style:b,children:t.timestamp})]})]}),t.dismissible&&(0,ce.jsx)(KR,{onClick:o,color:l.text})]})}var os=ie(Re(),1);function WR(t){return["alert","success","warning","info","error"].includes(t.type)}function QR(t){return t.type==="stats"}function JR(t){return t.type==="comparison"}function e2(t){return t.type==="rating"}function t2(t){return t.type==="checklist"}function qb(t,e={}){return WR(t)?(0,os.jsx)(Qh,{content:t,accentColor:e.accentColor,onDismiss:e.onDismiss}):QR(t)?(0,os.jsx)(Zh,{content:t,accentColor:e.accentColor}):JR(t)?(0,os.jsx)(Kh,{content:t,accentColor:e.accentColor}):e2(t)?(0,os.jsx)(Xh,{content:t,accentColor:e.accentColor,onSubmit:e.onRatingSubmit}):t2(t)?(0,os.jsx)(Wh,{content:t,accentColor:e.accentColor}):null}function Pb(t){return["alert","success","warning","info","error","stats","comparison","chart","table","form","rating","progress","survey","checklist","video","gallery","code"].includes(t)}var Ve={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",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},ls="1.0.0";function Cn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:ls}}function n2(t){return Cn(Ve.CANVAS_OPENED,{surface:t})}function i2(t){return Cn(Ve.CANVAS_CLOSED,{surface:t})}function r2(t,e){return Cn(Ve.TILE_VIEWED,{tileId:t,surface:e})}function a2(t,e){return Cn(Ve.TILE_EXPANDED,{tileId:t,surface:e})}function s2(t,e){return Cn(Ve.TILE_COLLAPSED,{tileId:t,surface:e})}function o2(t,e,n){return Cn(Ve.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function l2(t,e){return Cn(Ve.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function c2(t,e){return Cn(Ve.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function u2(t,e,n){return Cn(Ve.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function d2(t,e,n){return Cn(Ve.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function f2(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return Cn(n,e)}var Fn={canvasOpened:n2,canvasClosed:i2,tileViewed:r2,tileExpanded:a2,tileCollapsed:s2,tileAction:o2,overlayStarted:l2,overlayCompleted:c2,overlayDismissed:u2,overlayStepViewed:d2,custom:f2};var Mt=ie(Pt(),1),Gb=ie(Re(),1),Jh=(0,Mt.createContext)({runtime:null,context:null});function eg({runtime:t,children:e}){let[n,i]=(0,Mt.useState)(t?t.context.get():null);(0,Mt.useEffect)(()=>t?(i(t.context.get()),t.context.subscribe(s=>{i(s)})):void 0,[t]);let r=(0,Mt.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,Gb.jsx)(Jh.Provider,{value:r,children:e})}function oi(){let{runtime:t}=(0,Mt.useContext)(Jh);return t}function Su(){let{context:t}=(0,Mt.useContext)(Jh);return t}function tg(){return Su()?.page??null}function p2(){return Su()?.session??null}function h2(){return Su()?.viewport??null}function g2(t,e,n=[]){let i=oi();(0,Mt.useEffect)(()=>i?t?i.events.subscribe(t,e):i.events.subscribe(e):void 0,[i,...n])}function m2(){return oi()?.state??null}function v2(t,e){let n=oi(),[i,r]=(0,Mt.useState)({value:e,isFallback:!0,isLoading:!0});return(0,Mt.useEffect)(()=>{if(!n||!t){r({value:e,isFallback:!0,isLoading:!1});return}let a=!1;return n.evaluate(t).then(s=>{a||r({value:s.value,isFallback:s.isFallback,isLoading:!1})}),()=>{a=!0}},[n,t,e]),i}var ue=ie(Re(),1);function y2({config:t,telemetry:e,surface:n}){let[i,r]=(0,li.useState)([{author:"Lumi",text:"Hi! Need clarity on a deduction?"}]),[a,s]=(0,li.useState)(""),o=oi(),l=c=>{if(c.preventDefault(),!!a.trim()){if(r(u=>[...u,{author:"You",text:a.trim()}]),setTimeout(()=>{r(u=>[...u,{author:"Lumi",text:"I will route that to the experimentation server stub for now."}])},600),e?.trackAction("chatbot_message",t.id,n),o){let u=Fn.tileAction(t.id,"chatbot_message",n);o.events.publish(u.name,u.props,u.source)}s("")}};return(0,ue.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",height:"100%"},children:[(0,ue.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem",background:`${R[0]}33`,borderRadius:"8px",fontSize:"0.85rem"},children:i.map((c,u)=>(0,ue.jsxs)("p",{style:{margin:"0 0 0.5rem"},children:[(0,ue.jsxs)("span",{style:{fontWeight:600,color:Ze.secondary},children:[c.author,":"]})," ",(0,ue.jsx)("span",{style:{color:Ze.primary},children:c.text})]},`${c.author}-${u}`))}),(0,ue.jsxs)("form",{onSubmit:l,style:{display:"flex",gap:"0.5rem"},children:[(0,ue.jsx)("input",{style:{flex:1,padding:"0.5rem 0.75rem",borderRadius:"6px",border:`1px solid ${wn.secondary}`,background:`${R[0]}4d`,color:Ze.primary,fontSize:"0.85rem",outline:"none"},value:a,onChange:c=>s(c.target.value),placeholder:"Ask anything..."}),(0,ue.jsx)("button",{style:{padding:"0.5rem 0.75rem",borderRadius:"6px",border:"none",background:Ae[3],color:"white",fontWeight:600,fontSize:"0.8rem",cursor:"pointer"},type:"submit",children:"Send"})]})]})}function _2({renderer:t,config:e,surface:n,telemetry:i,isExpanded:r,runtime:a}){let s=(0,li.useRef)(null);return(0,li.useEffect)(()=>{if(!s.current)return;let o=t.mount(s.current,{config:e,surface:n,telemetry:i,isExpanded:r,runtime:a});return()=>{o&&o()}},[t,e,n,i,r,a]),(0,ue.jsx)("div",{ref:s,style:{width:"100%",height:"100%"}})}function tl({config:t,surface:e,telemetry:n,style:i,customRenderers:r,isExpanded:a=!1,onToggleExpand:s}){let{title:o,subtitle:l,content:c,style:u}=t,f=oi(),g=(0,li.useCallback)(S=>{if(n?.trackAction(S,t.id,e),f){let w=Fn.tileAction(t.id,S,e);f.events.publish(w.name,w.props,w.source)}},[n,f,t.id,e]),p=u?.accentColor??Ae[3],y="72px",_={display:"flex",flexDirection:"column",borderRadius:"14px",background:u?.background??`${R[1]}f2`,border:`1px solid ${wn.secondary}`,boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:u?.textColor??Ze.primary,fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:s?"pointer":"default",transition:"all 0.25s ease",...i},b={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:y},d={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${p} 0%, ${p}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${p}40`},h=()=>{switch(c.type){case"chatbot":return"\u{1F4AC}";case"metric":return"\u{1F4CA}";case"embed":return"\u{1F517}";case"custom":return"\u2699\uFE0F";case"checklist":return"\u{1F4CB}";default:return"\u{1F4C4}"}},m=()=>{switch(c.type){case"metric":return`${c.metricValue}${c.metricUnit?` ${c.metricUnit}`:""}`;case"text":return c.headline||c.body?.slice(0,50)||"";case"chatbot":return"Tap to chat";case"embed":return"Tap to view";case"custom":return"Tap to expand";case"checklist":{let S=c.items||[];return`${S.filter(E=>E.completed).length} of ${S.length} complete`}default:return""}},v=()=>{if(Pb(c.type)){let S=qb(c,{accentColor:p,onDismiss:()=>{g("block_dismissed")},onRatingSubmit:w=>{g("rating_submitted")}});if(S)return S}switch(c.type){case"chatbot":return(0,ue.jsx)("div",{style:{height:"200px"},children:(0,ue.jsx)(y2,{config:t,surface:e,telemetry:n})});case"metric":return(0,ue.jsxs)("div",{style:{textAlign:"center",padding:"0.5rem 0"},children:[(0,ue.jsxs)("p",{style:{fontSize:"3rem",fontWeight:700,color:p,margin:0,letterSpacing:"-0.02em"},children:[c.metricValue,c.metricUnit&&(0,ue.jsx)("span",{style:{fontSize:"1.25rem",fontWeight:400,color:Ze.tertiary,marginLeft:"0.5rem"},children:c.metricUnit})]}),c.headline&&(0,ue.jsx)("p",{style:{fontSize:"0.85rem",color:Ze.tertiary,margin:"0.5rem 0 0"},children:c.headline})]});case"embed":return c.embedUrl?(0,ue.jsx)("iframe",{src:c.embedUrl,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",style:{width:"100%",height:"200px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.2)"},title:c.headline??t.title}):null;case"custom":{let S=c.component||c.customRendererKey;return!S||!r||!r[S]?(0,ue.jsxs)("div",{style:{color:tt[5],fontSize:"0.85rem",padding:"0.5rem 0"},children:["Unknown component: ",S]}):(0,ue.jsx)(_2,{renderer:r[S],config:t,surface:e,telemetry:n,isExpanded:a,runtime:f})}default:{let S=c;return(0,ue.jsxs)("div",{style:{padding:"0.25rem 0"},children:[S.headline&&(0,ue.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:Ze.primary,margin:"0 0 0.5rem"},children:S.headline}),S.body&&(0,ue.jsx)("p",{style:{fontSize:"0.9rem",color:Ze.tertiary,margin:0,lineHeight:1.5},children:S.body})]})}}};return(0,ue.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:_,onClick:S=>{a&&S.target.closest("[data-expanded-content]")||s?.()},children:[(0,ue.jsxs)("div",{style:b,children:[(0,ue.jsx)("div",{style:d,children:h()}),(0,ue.jsxs)("div",{style:{flex:1,minWidth:0},children:[l&&(0,ue.jsx)("p",{style:{fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.05em",color:Ze.tertiary,margin:0},children:l}),(0,ue.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:Ze.primary,margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),!a&&(0,ue.jsx)("p",{style:{fontSize:"0.8rem",color:Ze.tertiary,margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m()})]}),(0,ue.jsx)("div",{style:{color:Ze.tertiary,fontSize:"0.85rem",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:"\u25BC"})]}),a&&(0,ue.jsxs)("div",{"data-expanded-content":!0,style:{padding:"0 1rem 1rem",borderTop:`1px solid ${wn.secondary}`},onClick:S=>S.stopPropagation(),children:[(0,ue.jsx)("div",{style:{paddingTop:"0.875rem"},children:v()}),"actions"in c&&c.actions&&c.actions.length>0&&(0,ue.jsx)("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:`1px solid ${wn.secondary}`,display:"flex",gap:"0.5rem"},children:c.actions.map((S,w)=>(0,ue.jsx)("button",{onClick:E=>{if(E.stopPropagation(),S.href&&typeof window<"u"&&window.open(S.href,"_blank","noreferrer"),S.onClickId&&(g(S.onClickId),S.onClickId.startsWith("syntro:restart-tour:")||S.onClickId.startsWith("syntro:start-tour:"))){let C=S.onClickId.replace("syntro:restart-tour:","").replace("syntro:start-tour:","");try{localStorage.removeItem("syntro_active_tour"),localStorage.setItem("syntro_active_tour",JSON.stringify({tourId:C,currentStepId:"",startedAt:Date.now()})),console.log(`[SmartCanvas] Starting tour "${C}"...`),window.location.reload()}catch(O){console.warn("[SmartCanvas] Failed to start tour:",O)}}},style:{flex:1,padding:"0.625rem 1rem",borderRadius:"8px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",border:"none",background:w===0?p:R[4],color:"#fff",transition:"opacity 0.15s ease"},onMouseEnter:E=>{E.currentTarget.style.opacity="0.85"},onMouseLeave:E=>{E.currentTarget.style.opacity="1"},children:S.label},S.label))})]})]})}var ci=ie(Pt(),1),ng=ie(Eu(),1);var Oe=ie(Re(),1),Wb="syntro-launcher-styles";function E2(){if(typeof document>"u"||document.getElementById(Wb))return;let t=document.createElement("style");t.id=Wb,t.textContent=`
|
|
12
13
|
@keyframes syntro-launcher-pulse {
|
|
13
14
|
0%, 100% {
|
|
14
|
-
box-shadow: 0 20px 45px
|
|
15
|
+
box-shadow: 0 20px 45px ${R[0]}59, 0 0 0 0 ${Ae[3]}66;
|
|
15
16
|
}
|
|
16
17
|
50% {
|
|
17
|
-
box-shadow: 0 20px 45px
|
|
18
|
+
box-shadow: 0 20px 45px ${R[0]}59, 0 0 0 8px ${Ae[3]}00;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
@keyframes syntro-launcher-glow {
|
|
21
22
|
0%, 100% {
|
|
22
|
-
border-color:
|
|
23
|
+
border-color: ${R[5]};
|
|
23
24
|
}
|
|
24
25
|
50% {
|
|
25
|
-
border-color:
|
|
26
|
+
border-color: ${Ae[4]}99;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
.syntro-launcher-animate {
|
|
@@ -31,7 +32,7 @@ Error generating stack: `+o.message+`
|
|
|
31
32
|
.syntro-launcher-animate:hover {
|
|
32
33
|
animation: none;
|
|
33
34
|
}
|
|
34
|
-
`,document.head.appendChild(t)}var gR={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:"#6366f1",colorBackground:"#1c1c1e",colorText:"#f5f5f7",colorTextSecondary:"#a1a1a6",borderRadius:"12px"};function fS({isOpen:t,onToggle:e,telemetry:n,launcherLabel:r="Adaptives",launcherAnimate:i=!1,launcherAnimationStyle:o="pulse",footerSlot:s,tiles:a,isLoading:l,error:u,canvasTitle:c,displayMode:f="standard",theme:h,customRenderers:g}){let[v,_]=(0,Gn.useState)(!1),[x,d]=(0,Gn.useState)(null),p=Fn(),m={...gR,...h},y=(0,Gn.useCallback)(V=>{let X=x===V;if(d(X?null:V),p){let B=X?vn.tileCollapsed(V,"overlay"):vn.tileExpanded(V,"overlay");p.events.publish(B.name,B.props,B.source)}},[x,p]);(0,Gn.useEffect)(()=>{t&&a.forEach(V=>{if(n?.trackRectangleViewed(V.id,"overlay"),p){let X=vn.tileViewed(V.id,"overlay");p.events.publish(X.name,X.props,X.source)}})},[n,p,t,a]),(0,Gn.useEffect)(()=>{_(!0),hR()},[]);let w=(0,Gn.useCallback)(()=>{let V=!t;if(V?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let X=V?vn.canvasOpened("overlay"):vn.canvasClosed("overlay");p.events.publish(X.name,X.props,X.source)}e()},[t,n,p,e]),b=f==="focused",k=m.position==="right",C=m.colorBackground||"#1c1c1e",I=m.mode==="light",A=m.colorPrimary||"#6366f1",H=b?`linear-gradient(to top right, ${A}22 0%, ${C}fa 50%, ${C}fc 100%)`:`linear-gradient(to top right, ${A}33 0%, ${C}f2 45%, ${C}f7 100%)`,K=b?`linear-gradient(to top right, ${A}11 0%, ${C}fa 50%, ${C}fc 100%)`:`linear-gradient(to top right, ${A}15 0%, ${C}f2 45%, ${C}f7 100%)`,Y={display:"flex",flexDirection:"column",width:b?m.expandedWidth:m.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:.8,transition:"all 340ms cubic-bezier(0.16, 1, 0.3, 1)",color:m.colorText||"#f5f5f7",background:b?I?K:H:"transparent",backdropFilter:b?`blur(${m.backdropBlur})`:void 0,WebkitBackdropFilter:b?`blur(${m.backdropBlur})`:void 0,border:b?k?void 0:`1px solid ${I?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.06)"}`:"none",borderLeft:b&&k?`1px solid ${I?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRight:b&&!k?`1px solid ${I?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRadius:b?"0":void 0,boxShadow:b?"none":void 0,transform:t?"translateX(0)":k?"translateX(120%)":"translateX(-120%)"},W={position:"absolute",inset:0,display:"flex",flexDirection:k?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:b?"0":"1rem"},le=(0,we.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:m.zIndex},children:(0,we.jsxs)("div",{style:W,children:[(0,we.jsxs)("div",{style:Y,children:[b&&c&&(0,we.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,we.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"rgba(255, 255, 255, 0.6)"},children:c})}),(0,we.jsx)("div",{style:{flex:1,overflowY:"auto",padding:b?"0":"1rem"},children:l?(0,we.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.85)",padding:b?"1rem":"0"},children:"Loading..."}):u?(0,we.jsxs)("div",{style:{color:"#fecdd3",padding:b?"1rem":"0"},children:["Failed to load: ",u]}):b?a.length>0?(0,we.jsx)(zs,{config:a[0],surface:"overlay",telemetry:n,customRenderers:g,isExpanded:!0,onToggleExpand:()=>{},style:{width:"100%",height:"100%"}}):null:(0,we.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:a.map(V=>{let X=x===V.id;return(0,we.jsx)(zs,{config:V,surface:"overlay",telemetry:n,customRenderers:g,isExpanded:X,onToggleExpand:()=>y(V.id),style:{width:"100%"}},V.id)})})}),s]}),(0,we.jsx)("div",{onClick:w,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return v?(0,we.jsxs)(we.Fragment,{children:[(0,Og.createPortal)((0,we.jsx)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:m.zIndex+47},children:(0,we.jsxs)("button",{onClick:w,"aria-label":"Toggle shadow canvas",className:i&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",bottom:"2.5rem",right:k?"2.5rem":void 0,left:k?void 0:"2.5rem",pointerEvents:"auto",display:"flex",alignItems:"center",gap:"0.75rem",borderRadius:"18px",color:"white",boxShadow:"0 20px 45px rgba(15, 23, 42, 0.35)",transition:"transform 0.2s ease",outline:"none",padding:"0.65rem 1.25rem",border:"2px solid rgba(255, 255, 255, 0.25)",backgroundColor:"rgba(2, 6, 23, 0.8)",backdropFilter:"blur(12px)",cursor:"pointer"},onMouseEnter:V=>V.currentTarget.style.transform="translateY(-2px)",onMouseLeave:V=>V.currentTarget.style.transform="translateY(0)",children:[(0,we.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:t?"linear-gradient(135deg, #f472b6, #ec4899)":"linear-gradient(135deg, #94a3b8, #0f172a)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,we.jsx)("span",{style:{width:"14px",height:"2px",backgroundColor:"#fff",display:"block",transform:t?"rotate(45deg)":"rotate(0)",position:"relative",transition:"transform 200ms ease"},children:t?null:(0,we.jsx)("span",{style:{position:"absolute",top:0,left:0,width:"14px",height:"2px",backgroundColor:"#fff",transform:"rotate(90deg)"}})})}),(0,we.jsxs)("div",{style:{display:"flex",flexDirection:"column",textAlign:"left"},children:[(0,we.jsx)("span",{style:{fontSize:"0.55rem",letterSpacing:"0.35em",color:"rgba(255,255,255,0.7)"},children:t?"Hide":"Open"}),(0,we.jsx)("span",{style:{fontSize:"0.85rem",letterSpacing:"0.25em"},children:r})]})]})}),document.body),t?(0,Og.createPortal)(le,document.body):null]}):null}var jr=ee(Et(),1);var Hr=ee(ve(),1);function PO({tiles:t,intervalMs:e=7e3,telemetry:n}){let[r,i]=(0,jr.useState)(0),o=(0,jr.useMemo)(()=>[...t].filter(s=>s.size!=="half").sort((s,a)=>(s.order??0)-(a.order??0)),[t]);return(0,jr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,jr.useEffect)(()=>{if(o.length<=1)return;let s=setInterval(()=>{i(a=>(a+1)%o.length)},e);return()=>clearInterval(s)},[o,e]),(0,jr.useEffect)(()=>{let s=o[r];s&&n?.trackRectangleViewed(s.id,"wheel")},[r,o,n]),o.length?(0,Hr.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 p-6 shadow-2xl","data-shadow-canvas-id":"wheel",children:[(0,Hr.jsx)("div",{className:"flex transition-transform duration-700 ease-out",style:{transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(s=>(0,Hr.jsx)("div",{className:"w-full shrink-0 px-4",children:(0,Hr.jsx)(zs,{config:{...s,size:"half"},surface:"wheel",telemetry:n})},s.id))}),(0,Hr.jsx)("div",{className:"mt-4 flex justify-center gap-2",children:o.map((s,a)=>(0,Hr.jsx)("button",{className:`h-2 w-6 rounded-full ${a===r?"bg-slate-800":"bg-slate-300"}`,onClick:()=>i(a)},s.id))})]}):null}var Lg=class{constructor(e){j(this,"state");j(this,"listeners",new Set);this.state={open:e?.open??!1}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){this.state.open!==e&&(this.state={...this.state,open:e},this.emit())}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},pS=t=>new Lg(t);var sn=ee(Et(),1);var mR=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function vR(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):mR.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function yR(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var Mg=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(n,null);if(r)return r},Uo=({configUri:t,experiments:e,featureKey:n,credentials:r,configFeatureKey:i="smart-canvas-config"})=>async()=>{if(e&&i){let u=e.getFeatureValue?.(i,null);if(u&&typeof u=="object")return F("SmartCanvas Config","Resolved config directly from feature flag",u),u}let o=Mg({configUri:t,experiments:e,featureKey:n});if(!o)return F("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],overlays:[]};if(!vR(o))throw new Error(`SmartCanvas: config URI not allowed: ${o}`);let s=r??(yR(o)?"include":"omit"),a=await fetch(o,{credentials:s,headers:{"X-SDK-Version":Jc,"X-SDK-Schema-Version":lr}});if(!a.ok)throw new Error(`SmartCanvas: failed to fetch config (${a.status})`);let l=await a.json();return F("SmartCanvas Config","Fetched config from URI",l),l};var Oa=ee(ve(),1);function _R(t,e){return t?t.include?.length?t.include.some(n=>hS(n,e)):t.exclude?.length?!t.exclude.some(n=>hS(n,e)):!0:!0}function hS(t,e){if(t.endsWith("/*")){let n=t.slice(0,-2);return e===n||e.startsWith(n+"/")}return e===t}function mS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){return u?(0,Oa.jsx)(yp,{runtime:u,children:(0,Oa.jsx)(gS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}):(0,Oa.jsx)(gS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,overlayFetcher:c,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}function gS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:u,overlayFetcher:c,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){let[m,y]=(0,sn.useState)(t.getState().open),w=_p(),[b,k]=(0,sn.useState)(()=>typeof window<"u"?window.location.pathname:"/"),C=w?.url?new URL(w.url).pathname:b;(0,sn.useEffect)(()=>{if(u||typeof window>"u")return;let W=()=>k(window.location.pathname);window.addEventListener("popstate",W);let le=history.pushState,V=history.replaceState;return history.pushState=function(...X){le.apply(this,X),W()},history.replaceState=function(...X){V.apply(this,X),W()},()=>{window.removeEventListener("popstate",W),history.pushState=le,history.replaceState=V}},[u]);let I=(0,sn.useMemo)(()=>e||Uo({configUri:n,experiments:a,featureKey:r,configFeatureKey:i,credentials:o}),[e,n,a,r,i,o]),A=V_({fetcher:I,pollIntervalMs:s,experiments:a,runtime:u}),H=A.tiles.length>0&&!A.error;(0,sn.useEffect)(()=>t.subscribe(W=>y(W.open)),[t]),(0,sn.useEffect)(()=>{!H&&t.getState().open&&t.setOpen(!1)},[t,H]),(0,sn.useEffect)(()=>{u?.actions&&A.actions.length>0&&u.actions.applyBatch(A.actions).catch(W=>{console.error("[SmartCanvas] Failed to apply actions:",W)})},[u,A.actions]);let K=(0,sn.useMemo)(()=>{let W=A.theme;return W?{...W,...p}:p},[A.theme,p]),Y=_R(A.routes,C);return!A.isLoading&&(!H||!Y)?null:(0,Oa.jsx)(fS,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:_??A.launcher?.label,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,footerSlot:v,isOpen:m,onToggle:()=>t.toggle(),customRenderers:d,displayMode:A.displayMode,theme:K})}var xS=ee(yS(),1);var bS=ee(ve(),1),_S="smart-canvas",wS=`
|
|
35
|
+
`,document.head.appendChild(t)}var w2={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:Ae[3],colorBackground:R[1],colorText:Ze.primary,colorTextSecondary:Ze.secondary,borderRadius:"12px"};function Qb({isOpen:t,onToggle:e,telemetry:n,launcherLabel:i="Adaptives",launcherAnimate:r=!1,launcherAnimationStyle:a="pulse",footerSlot:s,tiles:o,isLoading:l,error:c,canvasTitle:u,displayMode:f="standard",theme:g,customRenderers:p}){let[y,_]=(0,ci.useState)(!1),[b,d]=(0,ci.useState)(null),h=oi(),m={...w2,...g},v=(0,ci.useCallback)(U=>{let J=b===U;if(d(J?null:U),h){let $=J?Fn.tileCollapsed(U,"overlay"):Fn.tileExpanded(U,"overlay");h.events.publish($.name,$.props,$.source)}},[b,h]);(0,ci.useEffect)(()=>{t&&o.forEach(U=>{if(n?.trackRectangleViewed(U.id,"overlay"),h){let J=Fn.tileViewed(U.id,"overlay");h.events.publish(J.name,J.props,J.source)}})},[n,h,t,o]),(0,ci.useEffect)(()=>{_(!0),E2()},[]);let S=(0,ci.useCallback)(()=>{let U=!t;if(U?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),h){let J=U?Fn.canvasOpened("overlay"):Fn.canvasClosed("overlay");h.events.publish(J.name,J.props,J.source)}e()},[t,n,h,e]),w=f==="focused",E=m.position==="right",C=m.colorBackground||R[1],O=m.mode==="light",T=m.colorPrimary||Ae[3],I=w?`linear-gradient(to top right, ${T}22 0%, ${C}fa 50%, ${C}fc 100%)`:`linear-gradient(to top right, ${T}33 0%, ${C}f2 45%, ${C}f7 100%)`,Y=w?`linear-gradient(to top right, ${T}11 0%, ${C}fa 50%, ${C}fc 100%)`:`linear-gradient(to top right, ${T}15 0%, ${C}f2 45%, ${C}f7 100%)`,Q={display:"flex",flexDirection:"column",width:w?m.expandedWidth:m.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:.8,transition:"all 340ms cubic-bezier(0.16, 1, 0.3, 1)",color:m.colorText||Ze.primary,background:w?O?Y:I:"transparent",backdropFilter:w?`blur(${m.backdropBlur})`:void 0,WebkitBackdropFilter:w?`blur(${m.backdropBlur})`:void 0,border:w?E?void 0:`1px solid ${O?"rgba(0, 0, 0, 0.06)":wn.secondary}`:"none",borderLeft:w&&E?`1px solid ${O?"rgba(0, 0, 0, 0.08)":wn.primary}`:void 0,borderRight:w&&!E?`1px solid ${O?"rgba(0, 0, 0, 0.08)":wn.primary}`:void 0,borderRadius:w?"0":void 0,boxShadow:w?"none":void 0,transform:t?"translateX(0)":E?"translateX(120%)":"translateX(-120%)"},P={position:"absolute",inset:0,display:"flex",flexDirection:E?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:w?"0":"1rem"},ge=(0,Oe.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:m.zIndex},children:(0,Oe.jsxs)("div",{style:P,children:[(0,Oe.jsxs)("div",{style:Q,children:[w&&u&&(0,Oe.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,Oe.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:Ze.tertiary},children:u})}),(0,Oe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:w?"0":"1rem"},children:l?(0,Oe.jsx)("div",{style:{color:Ze.primary,padding:w?"1rem":"0"},children:"Loading..."}):c?(0,Oe.jsxs)("div",{style:{color:tt[8],padding:w?"1rem":"0"},children:["Failed to load: ",c]}):w?o.length>0?(0,Oe.jsx)(tl,{config:o[0],surface:"overlay",telemetry:n,customRenderers:p,isExpanded:!0,onToggleExpand:()=>{},style:{width:"100%",height:"100%"}}):null:(0,Oe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:o.map(U=>{let J=b===U.id;return(0,Oe.jsx)(tl,{config:U,surface:"overlay",telemetry:n,customRenderers:p,isExpanded:J,onToggleExpand:()=>v(U.id),style:{width:"100%"}},U.id)})})}),s]}),(0,Oe.jsx)("div",{onClick:S,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return y?(0,Oe.jsxs)(Oe.Fragment,{children:[(0,ng.createPortal)((0,Oe.jsx)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:m.zIndex+47},children:(0,Oe.jsxs)("button",{onClick:S,"aria-label":"Toggle shadow canvas",className:r&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",bottom:"2.5rem",right:E?"2.5rem":void 0,left:E?void 0:"2.5rem",pointerEvents:"auto",display:"flex",alignItems:"center",gap:"0.75rem",borderRadius:"18px",color:"white",boxShadow:`0 20px 45px ${R[0]}59`,transition:"transform 0.2s ease",outline:"none",padding:"0.65rem 1.25rem",border:`2px solid ${R[5]}`,backgroundColor:`${R[0]}cc`,backdropFilter:"blur(12px)",cursor:"pointer"},onMouseEnter:U=>U.currentTarget.style.transform="translateY(-2px)",onMouseLeave:U=>U.currentTarget.style.transform="translateY(0)",children:[(0,Oe.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:t?`linear-gradient(135deg, ${Ae[4]}, ${Ae[3]})`:`linear-gradient(135deg, ${R[8]}, ${R[0]})`,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,Oe.jsx)("span",{style:{width:"14px",height:"2px",backgroundColor:"#fff",display:"block",transform:t?"rotate(45deg)":"rotate(0)",position:"relative",transition:"transform 200ms ease"},children:t?null:(0,Oe.jsx)("span",{style:{position:"absolute",top:0,left:0,width:"14px",height:"2px",backgroundColor:"#fff",transform:"rotate(90deg)"}})})}),(0,Oe.jsxs)("div",{style:{display:"flex",flexDirection:"column",textAlign:"left"},children:[(0,Oe.jsx)("span",{style:{fontSize:"0.55rem",letterSpacing:"0.35em",color:Ze.secondary},children:t?"Hide":"Open"}),(0,Oe.jsx)("span",{style:{fontSize:"0.85rem",letterSpacing:"0.25em"},children:i})]})]})}),document.body),t?(0,ng.createPortal)(ge,document.body):null]}):null}var ar=ie(Pt(),1);var rr=ie(Re(),1);function IL({tiles:t,intervalMs:e=7e3,telemetry:n}){let[i,r]=(0,ar.useState)(0),a=(0,ar.useMemo)(()=>[...t].filter(s=>s.size!=="half").sort((s,o)=>(s.order??0)-(o.order??0)),[t]);return(0,ar.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,ar.useEffect)(()=>{if(a.length<=1)return;let s=setInterval(()=>{r(o=>(o+1)%a.length)},e);return()=>clearInterval(s)},[a,e]),(0,ar.useEffect)(()=>{let s=a[i];s&&n?.trackRectangleViewed(s.id,"wheel")},[i,a,n]),a.length?(0,rr.jsxs)("div",{style:{position:"relative",overflow:"hidden",borderRadius:"1.5rem",border:`1px solid ${wn.primary}`,background:R[1],padding:"1.5rem",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},"data-shadow-canvas-id":"wheel",children:[(0,rr.jsx)("div",{style:{display:"flex",transition:"transform 700ms ease-out",transform:`translateX(-${i*100}%)`,width:`${a.length*100}%`},children:a.map(s=>(0,rr.jsx)("div",{style:{width:"100%",flexShrink:0,padding:"0 1rem"},children:(0,rr.jsx)(tl,{config:{...s,size:"half"},surface:"wheel",telemetry:n})},s.id))}),(0,rr.jsx)("div",{style:{marginTop:"1rem",display:"flex",justifyContent:"center",gap:"0.5rem"},children:a.map((s,o)=>(0,rr.jsx)("button",{style:{height:"0.5rem",width:"1.5rem",borderRadius:"9999px",background:o===i?Ae[3]:R[6],border:"none",cursor:"pointer",padding:0},onClick:()=>r(o)},s.id))})]}):null}var ig=class{constructor(e){F(this,"state");F(this,"listeners",new Set);this.state={open:e?.open??!1}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){this.state.open!==e&&(this.state={...this.state,open:e},this.emit())}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},Jb=t=>new ig(t);var An=ie(Pt(),1);var C2=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function A2(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):C2.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function k2(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var rg=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let i=e?.getFeatureValue?.(n,null);if(i)return i},cs=({configUri:t,experiments:e,featureKey:n,credentials:i,configFeatureKey:r="smart-canvas-config"})=>async()=>{if(e&&r){let c=e.getFeatureValue?.(r,null);if(c&&typeof c=="object")return j("SmartCanvas Config","Resolved config directly from feature flag",c),c}let a=rg({configUri:t,experiments:e,featureKey:n});if(!a)return j("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],overlays:[]};if(!A2(a))throw new Error(`SmartCanvas: config URI not allowed: ${a}`);let s=i??(k2(a)?"include":"omit"),o=await fetch(a,{credentials:s,headers:{"X-SDK-Version":Lf,"X-SDK-Schema-Version":ji}});if(!o.ok)throw new Error(`SmartCanvas: failed to fetch config (${o.status})`);let l=await o.json();return j("SmartCanvas Config","Fetched config from URI",l),l};var il=ie(Re(),1);function T2(t,e){return t?t.include?.length?t.include.some(n=>eS(n,e)):t.exclude?.length?!t.exclude.some(n=>eS(n,e)):!0:!0}function eS(t,e){if(t.endsWith("/*")){let n=t.slice(0,-2);return e===n||e.startsWith(`${n}/`)}return e===t}function nS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:a="include",pollIntervalMs:s,experiments:o,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:g="smart-canvas-overlay-uri",overlayFetchCredentials:p="include",footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:h}){return c?(0,il.jsx)(eg,{runtime:c,children:(0,il.jsx)(tS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:a,pollIntervalMs:s,experiments:o,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:g,overlayFetchCredentials:p,footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:h})}):(0,il.jsx)(tS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:i,configFeatureKey:r,fetchCredentials:a,pollIntervalMs:s,experiments:o,telemetry:l,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:g,overlayFetchCredentials:p,footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:h})}function tS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:i="smart-canvas-config-uri",configFeatureKey:r="smart-canvas-config",fetchCredentials:a="include",pollIntervalMs:s,experiments:o,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:g="smart-canvas-overlay-uri",overlayFetchCredentials:p="include",footerSlot:y,launcherLabel:_,canvasHost:b,customRenderers:d,theme:h}){let[m,v]=(0,An.useState)(t.getState().open),S=tg(),[w,E]=(0,An.useState)(()=>typeof window<"u"?window.location.pathname:"/"),C=S?.url?new URL(S.url).pathname:w;(0,An.useEffect)(()=>{if(c||typeof window>"u")return;let P=()=>E(window.location.pathname);window.addEventListener("popstate",P);let ge=history.pushState,U=history.replaceState;return history.pushState=function(...J){ge.apply(this,J),queueMicrotask(P)},history.replaceState=function(...J){U.apply(this,J),queueMicrotask(P)},()=>{window.removeEventListener("popstate",P),history.pushState=ge,history.replaceState=U}},[c]);let O=(0,An.useMemo)(()=>e||cs({configUri:n,experiments:o,featureKey:i,configFeatureKey:r,credentials:a}),[e,n,o,i,r,a]),T=$b({fetcher:O,pollIntervalMs:s,experiments:o,runtime:c}),I=T.tiles.length>0&&!T.error;(0,An.useEffect)(()=>t.subscribe(P=>v(P.open)),[t]),(0,An.useEffect)(()=>{!I&&t.getState().open&&t.setOpen(!1)},[t,I]),(0,An.useEffect)(()=>{c?.actions&&T.actions.length>0&&c.actions.applyBatch(T.actions).catch(P=>{console.error("[SmartCanvas] Failed to apply actions:",P)})},[c,T.actions]);let Y=(0,An.useMemo)(()=>{let P=T.theme;return P?{...P,...h}:h},[T.theme,h]),Q=T2(T.routes,C);return!T.isLoading&&(!I||!Q)?null:(0,il.jsx)(Qb,{tiles:T.tiles,isLoading:T.isLoading,error:T.error,canvasTitle:T.canvasTitle,telemetry:l,launcherLabel:_??T.launcher?.label,launcherAnimate:T.launcher?.animate,launcherAnimationStyle:T.launcher?.animationStyle,footerSlot:y,isOpen:m,onToggle:()=>t.toggle(),customRenderers:d,displayMode:T.displayMode,theme:Y})}var Nw=ie(Rw(),1);var Lw=ie(Re(),1),Ow="smart-canvas",Mw=`
|
|
35
36
|
:host {
|
|
36
37
|
font: inherit;
|
|
37
38
|
color: inherit;
|
|
@@ -44,25 +45,25 @@ Error generating stack: `+o.message+`
|
|
|
44
45
|
*, *::before, *::after {
|
|
45
46
|
box-sizing: border-box;
|
|
46
47
|
}
|
|
47
|
-
`,
|
|
48
|
+
`,tN=()=>{let t="smartcanvas-overlays",e=document.getElementById(t);return e||(e=document.createElement("div"),e.id=t,e.setAttribute("data-smart-canvas-overlay","true"),document.body?document.body.appendChild(e):document.addEventListener("DOMContentLoaded",()=>{e.parentNode||document.body.appendChild(e)},{once:!0})),e},Dr,Lr,rc,Oi,zr,Mi,eo,Hv=class extends HTMLElement{constructor(){super();Fi(this,Dr);Fi(this,Lr);Fi(this,rc);Fi(this,Oi);Fi(this,zr,null);Fi(this,Mi,null);Fi(this,eo,{});zn(this,Dr,this.attachShadow({mode:"open",delegatesFocus:!0})),zn(this,Lr,document.createElement("div")),Le(this,Lr).setAttribute("part","mount"),Le(this,Dr).appendChild(Le(this,Lr)),zn(this,rc,tN()),zn(this,Oi,Jb()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){Le(this,zr)?.unmount(),zn(this,zr,null)}getMountNode(){return Le(this,Lr)}getController(){return Le(this,Oi)}getOverlayRoot(){return Le(this,rc)}open(){Le(this,Oi).setOpen(!0)}close(){Le(this,Oi).setOpen(!1)}toggle(){Le(this,Oi).toggle()}registerComponent(n,i){zn(this,eo,{...Le(this,eo),[n]:i}),this.render()}setOverrideFetcher(n){Le(this,Mi)&&(zn(this,Mi,{...Le(this,Mi),fetcher:n}),this.render())}mountReactApp(n){zn(this,Mi,n),this.render()}render(){!this.isConnected||!Le(this,Mi)||(Le(this,zr)||zn(this,zr,(0,Nw.createRoot)(Le(this,Lr))),Le(this,zr).render((0,Lw.jsx)(nS,{...Le(this,Mi),controller:Le(this,Oi),canvasHost:this,customRenderers:Le(this,eo)})))}applyBaseStyles(){if(Le(this,Dr).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(Mw),Le(this,Dr).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=Mw,Le(this,Dr).appendChild(n)}}};Dr=new WeakMap,Lr=new WeakMap,rc=new WeakMap,Oi=new WeakMap,zr=new WeakMap,Mi=new WeakMap,eo=new WeakMap;var Dw=()=>{typeof window>"u"||customElements.get(Ow)||customElements.define(Ow,Hv)};var Qd=ie(Pt(),1),zw=ie(Eu(),1);function pz({element:t,children:e}){let[n,i]=(0,Qd.useState)(null);return(0,Qd.useLayoutEffect)(()=>{if(!t){i(null);return}return i(t.getMountNode()),()=>i(null)},[t]),n?(0,zw.createPortal)(e,n):null}var Bw={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important"};function Hw(t={}){let{timeout:e,className:n,style:i}={...Bw,...t},r=document.createElement("style");r.textContent=`.${n} { ${i} }`,document.head.appendChild(r),document.documentElement.classList.add(n);let a=setTimeout(()=>{document.documentElement.classList.remove(n)},e);return()=>{clearTimeout(a),document.documentElement.classList.remove(n),r.remove()}}function nN(t={}){let{className:e,style:n}={...Bw,...t};return`
|
|
48
49
|
(function() {
|
|
49
50
|
var s = document.createElement('style');
|
|
50
51
|
s.textContent = '.${e} { ${n} }';
|
|
51
52
|
document.head.appendChild(s);
|
|
52
53
|
document.documentElement.className += ' ${e}';
|
|
53
|
-
})();`}var AS="https://cdn.syntrologie.com/editor-sdk/latest/editor-sdk.js",TS=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function SR(t){F("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return F("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);if(F("Syntro Runtime","Parsed URL:",{hostname:e.hostname,protocol:e.protocol,isLocalhost:n}),e.protocol!=="https:"&&!n)return ft("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1;let r=TS.some(i=>i.startsWith(".")?e.hostname.endsWith(i)||e.hostname===i.slice(1):e.hostname===i);return F("Syntro Runtime","Host allowlist check:",{hostname:e.hostname,allowedHosts:TS,isAllowed:r}),r?(F("Syntro Runtime","\u2713 Editor URL validated"),!0):(ft("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return ft("Syntro Runtime","\u274C Invalid editor URL: "+t,e),!1}}var bR=()=>{if(F("Syntro Runtime","====== EDITOR LOAD CHECK ======"),typeof window>"u")return F("Syntro Runtime","Not in browser - skipping editor"),!1;let t=new URLSearchParams(window.location.search);F("Syntro Runtime","URL:",window.location.href),F("Syntro Runtime","Search params:",window.location.search);let e=t.has("syntro_editor")||t.has("syntro-editor"),n=t.has("editor_token");if(F("Syntro Runtime","Editor flags:",{hasEditorFlag:e,hasEditorToken:n,syntro_editor:t.get("syntro_editor"),"syntro-editor":t.get("syntro-editor"),editor_token:n?`${t.get("editor_token")?.slice(0,10)}...`:"none"}),e&&!n)return ft("Syntro Runtime","\u274C Editor activation requires editor_token parameter"),F("Syntro Runtime","================================"),!1;let r=e&&n;return F("Syntro Runtime","Should load editor:",r),F("Syntro Runtime","================================"),r},kR=()=>{if(F("Syntro Runtime","====== AUDIT MODE CHECK ======"),typeof window>"u")return F("Syntro Runtime","Not in browser - skipping audit"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit"),n=t.has("audit_token"),r=t.get("audit_session_id");return F("Syntro Runtime","Audit flags:",{hasAuditFlag:e,hasAuditToken:n,auditSessionId:r?`${r.slice(0,8)}...`:"none",audit_token:n?`${t.get("audit_token")?.slice(0,10)}...`:"none"}),e?n?(F("Syntro Runtime","\u2713 Audit mode active"),F("Syntro Runtime","================================"),!0):(ft("Syntro Runtime","\u274C Audit activation requires audit_token parameter"),F("Syntro Runtime","================================"),!1):(F("Syntro Runtime","No syntro_audit param - not in audit mode"),F("Syntro Runtime","================================"),!1)},RS=()=>bR()?"editor":kR()?"audit":null;function CR(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search);return t.get("editor_token")||t.get("audit_token")}var IS=async t=>{if(F("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){F("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){F("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}let e=typeof t=="string"?{editorUrl:t}:t??{},n=new URLSearchParams(window.location.search),r=n.get("syntro_editor_sdk_url"),i=n.get("api_base"),o=i?`${i}/api/editor/sdk/editor-sdk.js`:null,s=r||o||e.editorUrl||AS,a=CR();if(!a){ft("Syntro Runtime","\u274C No token found in URL params. SDK requires editor_token or audit_token."),F("Syntro Runtime","================================");return}let l=`${s}?token=${encodeURIComponent(a)}`;if(F("Syntro Runtime","Editor URL:",l),F("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,isDefault:s===AS,hasApiBase:!!i,tokenPrefix:a.slice(0,10)+"..."}),!SR(s)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",s),F("Syntro Runtime","================================");return}return F("Syntro Runtime","\u2713 URL validated, injecting script tag..."),new Promise((u,c)=>{let f=document.createElement("script");f.src=l,f.async=!0,e.integrity&&(f.integrity=e.integrity,f.crossOrigin="anonymous",F("Syntro Runtime","SRI integrity check enabled")),f.onload=()=>{F("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),F("Syntro Runtime","window.SyntroEditor:",!!window.SyntroEditor),F("Syntro Runtime","================================"),u()},f.onerror=h=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",h),console.error("[Syntro Runtime] URL attempted:",l),console.error("[Syntro Runtime] Check: Is the URL accessible? CORS? Network? Token valid?"),F("Syntro Runtime","================================"),c(h)},document.head.appendChild(f),F("Syntro Runtime","Script tag appended to <head>")})};var Dg=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 d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=ES(d)}let n=null,r=null,i=null,o=!0,s=t.runtime;async function a(d){!s?.actions||d.length===0||(i?.isApplied()&&await i.revertAll(),i=await s.actions.applyBatch(d))}async function l(){i?.isApplied()&&(await i.revertAll(),i=null)}if(t.fetcher)try{r=t.fetcher;let d=await t.fetcher();n=d,d.actions&&d.actions.length>0&&s?.actions&&await a(d.actions)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let u=RS();u&&(console.log(`[SmartCanvas] Loading editor SDK for ${u} mode`),IS(t.editorUrl).catch(console.error)),SS();let c=document.createElement("smart-canvas");if(t.tokens)for(let[d,p]of Object.entries(t.tokens))c.style.setProperty(d,p);let f=()=>{let d=t.target??document.body;d&&d.appendChild(c)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});let h=t.integrations?.experiments,g=t.integrations?.telemetry,v=t.fetcher??Uo({configUri:t.configUri,experiments:h,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=v);let _={fetcher:v,pollIntervalMs:t.pollIntervalMs,experiments:h,telemetry:g,runtime:s,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme};c.mountReactApp(_),t.defaultOpen&&c.open();let x={el:c,open:()=>c.open(),close:()=>c.close(),destroy:()=>{l(),c.remove()},setTokens:d=>{for(let[p,m]of Object.entries(d))c.style.setProperty(p,m)},getConfig:async()=>{if(r)try{let d=await r();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n??{tiles:[],actions:[],fetchedAt:""}},updateConfig:async d=>{n=d,o&&await a(d.actions)},setEnabled:async d=>{o=d,d?n&&await a(n.actions):await l()},registerComponent:(d,p)=>c.registerComponent(d,p),setOverrideFetcher:d=>{r=d,c.setOverrideFetcher(d)},registerTelemetryProperties:d=>{g?.register?.(d)},getSessionId:()=>g?.getSessionId?.(),startSessionRecording:()=>{g?.startSessionRecording?.()},runtime:s};return typeof window<"u"&&u&&(window.__smartCanvasHandle=x),x};typeof window<"u"&&(window.SmartCanvas={async create(t){return Dg(t)}});var S={};Tk(S,{BRAND:()=>XR,DIRTY:()=>bi,EMPTY_PATH:()=>RR,INVALID:()=>U,NEVER:()=>MI,OK:()=>nt,ParseStatus:()=>Ze,Schema:()=>J,ZodAny:()=>Zr,ZodArray:()=>er,ZodBigInt:()=>Ci,ZodBoolean:()=>Ei,ZodBranded:()=>Fa,ZodCatch:()=>$i,ZodDate:()=>Ai,ZodDefault:()=>Fi,ZodDiscriminatedUnion:()=>bc,ZodEffects:()=>qt,ZodEnum:()=>Li,ZodError:()=>wt,ZodFirstPartyTypeKind:()=>q,ZodFunction:()=>Cc,ZodIntersection:()=>Pi,ZodIssueCode:()=>T,ZodLazy:()=>Ni,ZodLiteral:()=>Oi,ZodMap:()=>Xo,ZodNaN:()=>Jo,ZodNativeEnum:()=>Mi,ZodNever:()=>an,ZodNull:()=>Ri,ZodNullable:()=>En,ZodNumber:()=>ki,ZodObject:()=>xt,ZodOptional:()=>Ut,ZodParsedType:()=>M,ZodPipeline:()=>$a,ZodPromise:()=>Yr,ZodReadonly:()=>Di,ZodRecord:()=>kc,ZodSchema:()=>J,ZodSet:()=>Qo,ZodString:()=>Gr,ZodSymbol:()=>Zo,ZodTransformer:()=>qt,ZodTuple:()=>Cn,ZodType:()=>J,ZodUndefined:()=>Ti,ZodUnion:()=>Ii,ZodUnknown:()=>Jn,ZodVoid:()=>Yo,addIssueToContext:()=>P,any:()=>sI,array:()=>cI,bigint:()=>tI,boolean:()=>zS,coerce:()=>LI,custom:()=>DS,date:()=>nI,datetimeRegex:()=>FS,defaultErrorMap:()=>Xn,discriminatedUnion:()=>hI,effect:()=>EI,enum:()=>bI,function:()=>wI,getErrorMap:()=>qo,getParsedType:()=>kn,instanceof:()=>JR,intersection:()=>gI,isAborted:()=>xc,isAsync:()=>Ko,isDirty:()=>Sc,isValid:()=>Kr,late:()=>QR,lazy:()=>xI,literal:()=>SI,makeIssue:()=>Ma,map:()=>yI,nan:()=>eI,nativeEnum:()=>kI,never:()=>lI,null:()=>oI,nullable:()=>TI,number:()=>BS,object:()=>dI,objectUtil:()=>Vg,oboolean:()=>OI,onumber:()=>NI,optional:()=>AI,ostring:()=>PI,pipeline:()=>II,preprocess:()=>RI,promise:()=>CI,quotelessJson:()=>ER,record:()=>vI,set:()=>_I,setErrorMap:()=>TR,strictObject:()=>fI,string:()=>VS,symbol:()=>rI,transformer:()=>EI,tuple:()=>mI,undefined:()=>iI,union:()=>pI,unknown:()=>aI,util:()=>re,void:()=>uI});var re;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Vg;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Vg||(Vg={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kn=t=>{switch(typeof t){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN(t)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(t)?M.array:t===null?M.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?M.promise:typeof Map<"u"&&t instanceof Map?M.map:typeof Set<"u"&&t instanceof Set?M.set:typeof Date<"u"&&t instanceof Date?M.date:M.object;default:return M.unknown}};var T=re.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"]),ER=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),wt=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 n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(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,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};wt.create=t=>new wt(t);var AR=(t,e)=>{let n;switch(t.code){case T.invalid_type:t.received===M.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case T.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case T.invalid_union:n="Invalid input";break;case T.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case T.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case T.invalid_arguments:n="Invalid function arguments";break;case T.invalid_return_type:n="Invalid function return type";break;case T.invalid_date:n="Invalid date";break;case T.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case T.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case T.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case T.custom:n="Invalid input";break;case T.invalid_intersection_types:n="Intersection results could not be merged";break;case T.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case T.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},Xn=AR;var PS=Xn;function TR(t){PS=t}function qo(){return PS}var Ma=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},RR=[];function P(t,e){let n=qo(),r=Ma({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xn?void 0:Xn].filter(i=>!!i)});t.common.issues.push(r)}var Ze=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return U;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,s=await i.value;r.push({key:o,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return U;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}},U=Object.freeze({status:"aborted"}),bi=t=>({status:"dirty",value:t}),nt=t=>({status:"valid",value:t}),xc=t=>t.status==="aborted",Sc=t=>t.status==="dirty",Kr=t=>t.status==="valid",Ko=t=>typeof Promise<"u"&&t instanceof Promise;var z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(z||(z={}));var Wt=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}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}},NS=(t,e)=>{if(Kr(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 n=new wt(t.common.issues);return this._error=n,this._error}}};function Q(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}var J=class{get description(){return this._def.description}_getType(e){return kn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ze,ctx:{common:e.parent.common,data:e.data,parsedType:kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ko(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return NS(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kn(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Kr(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Kr(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kn(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(Ko(i)?i:Promise.resolve(i));return NS(r,o)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:T.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new qt({schema:this,typeName:q.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:n=>this["~validate"](n)}}optional(){return Ut.create(this,this._def)}nullable(){return En.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return er.create(this)}promise(){return Yr.create(this,this._def)}or(e){return Ii.create([this,e],this._def)}and(e){return Pi.create(this,e,this._def)}transform(e){return new qt({...Q(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Fi({...Q(this._def),innerType:this,defaultValue:n,typeName:q.ZodDefault})}brand(){return new Fa({typeName:q.ZodBranded,type:this,...Q(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new $i({...Q(this._def),innerType:this,catchValue:n,typeName:q.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return $a.create(this,e)}readonly(){return Di.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},IR=/^c[^\s-]{8,}$/i,PR=/^[0-9a-z]+$/,NR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,OR=/^[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,LR=/^[a-z0-9_-]{21}$/i,MR=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FR=/^[-+]?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)?)??$/,$R=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Bg,VR=/^(?:(?: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])$/,BR=/^(?:(?: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])$/,zR=/^(([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]))$/,HR=/^(([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])$/,jR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UR=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,LS="((\\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])))",WR=new RegExp(`^${LS}$`);function MS(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function qR(t){return new RegExp(`^${MS(t)}$`)}function FS(t){let e=`${LS}T${MS(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function KR(t,e){return!!((e==="v4"||!e)&&VR.test(t)||(e==="v6"||!e)&&zR.test(t))}function GR(t,e){if(!MR.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function ZR(t,e){return!!((e==="v4"||!e)&&BR.test(t)||(e==="v6"||!e)&&HR.test(t))}var Gr=class t extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_type,expected:M.string,received:o.parsedType}),U}let r=new Ze,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.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&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?P(i,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&P(i,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")$R.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"email",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Bg||(Bg=new RegExp(DR,"u")),Bg.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"emoji",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")OR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"uuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")LR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"nanoid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")IR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")PR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid2",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")NR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ulid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),P(i,{validation:"url",code:T.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"regex",code:T.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)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.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)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?FS(o).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?WR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?qR(o).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?FR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"duration",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?KR(e.data,o.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ip",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?GR(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"jwt",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?ZR(e.data,o.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cidr",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?jR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?UR.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64url",code:T.invalid_string,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:T.invalid_string,...z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...z.errToObj(n)})}nonempty(e){return this.min(1,z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Gr.create=t=>new Gr({checks:[],typeName:q.ZodString,coerce:t?.coerce??!1,...Q(t)});function YR(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var ki=class t extends J{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)!==M.number){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_type,expected:M.number,received:o.parsedType}),U}let r,i=new Ze;for(let o of this._def.checks)o.kind==="int"?re.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:T.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?YR(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:T.not_finite,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,z.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};ki.create=t=>new ki({checks:[],typeName:q.ZodNumber,coerce:t?.coerce||!1,...Q(t)});var Ci=class t extends J{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)!==M.bigint)return this._getInvalidInput(e);let r,i=new Ze;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return P(n,{code:T.invalid_type,expected:M.bigint,received:n.parsedType}),U}gte(e,n){return this.setLimit("min",e,!0,z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,z.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ci.create=t=>new Ci({checks:[],typeName:q.ZodBigInt,coerce:t?.coerce??!1,...Q(t)});var Ei=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.boolean,received:r.parsedType}),U}return nt(e.data)}};Ei.create=t=>new Ei({typeName:q.ZodBoolean,coerce:t?.coerce||!1,...Q(t)});var Ai=class t extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_type,expected:M.date,received:o.parsedType}),U}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_date}),U}let r=new Ze,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):re.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,n){return this._addCheck({kind:"min",value:e.getTime(),message:z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ai.create=t=>new Ai({checks:[],coerce:t?.coerce||!1,typeName:q.ZodDate,...Q(t)});var Zo=class extends J{_parse(e){if(this._getType(e)!==M.symbol){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.symbol,received:r.parsedType}),U}return nt(e.data)}};Zo.create=t=>new Zo({typeName:q.ZodSymbol,...Q(t)});var Ti=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.undefined,received:r.parsedType}),U}return nt(e.data)}};Ti.create=t=>new Ti({typeName:q.ZodUndefined,...Q(t)});var Ri=class extends J{_parse(e){if(this._getType(e)!==M.null){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.null,received:r.parsedType}),U}return nt(e.data)}};Ri.create=t=>new Ri({typeName:q.ZodNull,...Q(t)});var Zr=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return nt(e.data)}};Zr.create=t=>new Zr({typeName:q.ZodAny,...Q(t)});var Jn=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nt(e.data)}};Jn.create=t=>new Jn({typeName:q.ZodUnknown,...Q(t)});var an=class extends J{_parse(e){let n=this._getOrReturnCtx(e);return P(n,{code:T.invalid_type,expected:M.never,received:n.parsedType}),U}};an.create=t=>new an({typeName:q.ZodNever,...Q(t)});var Yo=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.void,received:r.parsedType}),U}return nt(e.data)}};Yo.create=t=>new Yo({typeName:q.ZodVoid,...Q(t)});var er=class t extends J{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==M.array)return P(n,{code:T.invalid_type,expected:M.array,received:n.parsedType}),U;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(P(n,{code:s?T.too_big:T.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(P(n,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(P(n,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Wt(n,s,n.path,a)))).then(s=>Ze.mergeArray(r,s));let o=[...n.data].map((s,a)=>i.type._parseSync(new Wt(n,s,n.path,a)));return Ze.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:z.toString(n)}})}nonempty(e){return this.min(1,e)}};er.create=(t,e)=>new er({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...Q(e)});function Go(t){if(t instanceof xt){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ut.create(Go(r))}return new xt({...t._def,shape:()=>e})}else return t instanceof er?new er({...t._def,type:Go(t.element)}):t instanceof Ut?Ut.create(Go(t.unwrap())):t instanceof En?En.create(Go(t.unwrap())):t instanceof Cn?Cn.create(t.items.map(e=>Go(e))):t}var xt=class t extends J{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(),n=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==M.object){let u=this._getOrReturnCtx(e);return P(u,{code:T.invalid_type,expected:M.object,received:u.parsedType}),U}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof an&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let l=[];for(let u of s){let c=o[u],f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Wt(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof an){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(P(i,{code:T.unrecognized_keys,keys:a}),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 a){let f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Wt(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let f=await c.key,h=await c.value;u.push({key:f,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>Ze.mergeObjectSync(r,u)):Ze.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:z.errToObj(e).message??i}:{message:i}}}:{}})}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:q.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of re.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of re.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Go(this)}partial(e){let n={};for(let r of re.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of re.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ut;)o=o._def.innerType;n[r]=o}return new t({...this._def,shape:()=>n})}keyof(){return $S(re.objectKeys(this.shape))}};xt.create=(t,e)=>new xt({shape:()=>t,unknownKeys:"strip",catchall:an.create(),typeName:q.ZodObject,...Q(e)});xt.strictCreate=(t,e)=>new xt({shape:()=>t,unknownKeys:"strict",catchall:an.create(),typeName:q.ZodObject,...Q(e)});xt.lazycreate=(t,e)=>new xt({shape:t,unknownKeys:"strip",catchall:an.create(),typeName:q.ZodObject,...Q(e)});var Ii=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new wt(a.ctx.common.issues));return P(n,{code:T.invalid_union,unionErrors:s}),U}if(n.common.async)return Promise.all(r.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let l of r){let u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(l=>new wt(l));return P(n,{code:T.invalid_union,unionErrors:a}),U}}get options(){return this._def.options}};Ii.create=(t,e)=>new Ii({options:t,typeName:q.ZodUnion,...Q(e)});var Qn=t=>t instanceof Ni?Qn(t.schema):t instanceof qt?Qn(t.innerType()):t instanceof Oi?[t.value]:t instanceof Li?t.options:t instanceof Mi?re.objectValues(t.enum):t instanceof Fi?Qn(t._def.innerType):t instanceof Ti?[void 0]:t instanceof Ri?[null]:t instanceof Ut?[void 0,...Qn(t.unwrap())]:t instanceof En?[null,...Qn(t.unwrap())]:t instanceof Fa||t instanceof Di?Qn(t.unwrap()):t instanceof $i?Qn(t._def.innerType):[],bc=class t extends J{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.object)return P(n,{code:T.invalid_type,expected:M.object,received:n.parsedType}),U;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(P(n,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let s=Qn(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Q(r)})}};function zg(t,e){let n=kn(t),r=kn(e);if(t===e)return{valid:!0,data:t};if(n===M.object&&r===M.object){let i=re.objectKeys(e),o=re.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let l=zg(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===M.array&&r===M.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],l=zg(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pi=class extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(xc(o)||xc(s))return U;let a=zg(o.value,s.value);return a.valid?((Sc(o)||Sc(s))&&n.dirty(),{status:n.value,value:a.data}):(P(r,{code:T.invalid_intersection_types}),U)};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,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Pi.create=(t,e,n)=>new Pi({left:t,right:e,typeName:q.ZodIntersection,...Q(n)});var Cn=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return P(r,{code:T.invalid_type,expected:M.array,received:r.parsedType}),U;if(r.data.length<this._def.items.length)return P(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&r.data.length>this._def.items.length&&(P(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Wt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Ze.mergeArray(n,s)):Ze.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Cn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cn({items:t,typeName:q.ZodTuple,rest:null,...Q(e)})};var kc=class t extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.object)return P(r,{code:T.invalid_type,expected:M.object,received:r.parsedType}),U;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in r.data)i.push({key:o._parse(new Wt(r,a,r.path,a)),value:s._parse(new Wt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ze.mergeObjectAsync(n,i):Ze.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof J?new t({keyType:e,valueType:n,typeName:q.ZodRecord,...Q(r)}):new t({keyType:Gr.create(),valueType:e,typeName:q.ZodRecord,...Q(n)})}},Xo=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.map)return P(r,{code:T.invalid_type,expected:M.map,received:r.parsedType}),U;let i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new Wt(r,a,r.path,[u,"key"])),value:o._parse(new Wt(r,l,r.path,[u,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return U;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of s){let u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return U;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}};Xo.create=(t,e,n)=>new Xo({valueType:e,keyType:t,typeName:q.ZodMap,...Q(n)});var Qo=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return P(r,{code:T.invalid_type,expected:M.set,received:r.parsedType}),U;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(P(r,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(P(r,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function s(l){let u=new Set;for(let c of l){if(c.status==="aborted")return U;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}let a=[...r.data.values()].map((l,u)=>o._parse(new Wt(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Qo.create=(t,e)=>new Qo({valueType:t,minSize:null,maxSize:null,typeName:q.ZodSet,...Q(e)});var Cc=class t extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.function)return P(n,{code:T.invalid_type,expected:M.function,received:n.parsedType}),U;function r(a,l){return Ma({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qo(),Xn].filter(u=>!!u),issueData:{code:T.invalid_arguments,argumentsError:l}})}function i(a,l){return Ma({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qo(),Xn].filter(u=>!!u),issueData:{code:T.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Yr){let a=this;return nt(async function(...l){let u=new wt([]),c=await a._def.args.parseAsync(l,o).catch(g=>{throw u.addIssue(r(l,g)),u}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(g=>{throw u.addIssue(i(f,g)),u})})}else{let a=this;return nt(function(...l){let u=a._def.args.safeParse(l,o);if(!u.success)throw new wt([r(l,u.error)]);let c=Reflect.apply(s,this,u.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new wt([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Cn.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,n,r){return new t({args:e||Cn.create([]).rest(Jn.create()),returns:n||Jn.create(),typeName:q.ZodFunction,...Q(r)})}},Ni=class extends J{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ni.create=(t,e)=>new Ni({getter:t,typeName:q.ZodLazy,...Q(e)});var Oi=class extends J{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return P(n,{received:n.data,code:T.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:e.data}}get value(){return this._def.value}};Oi.create=(t,e)=>new Oi({value:t,typeName:q.ZodLiteral,...Q(e)});function $S(t,e){return new Li({values:t,typeName:q.ZodEnum,...Q(e)})}var Li=class t extends J{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return P(n,{expected:re.joinValues(r),received:n.parsedType,code:T.invalid_type}),U}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return P(n,{received:n.data,code:T.invalid_enum_value,options:r}),U}return nt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Li.create=$S;var Mi=class extends J{_parse(e){let n=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=re.objectValues(n);return P(r,{expected:re.joinValues(i),received:r.parsedType,code:T.invalid_type}),U}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=re.objectValues(n);return P(r,{received:r.data,code:T.invalid_enum_value,options:i}),U}return nt(e.data)}get enum(){return this._def.values}};Mi.create=(t,e)=>new Mi({values:t,typeName:q.ZodNativeEnum,...Q(e)});var Yr=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.promise&&n.common.async===!1)return P(n,{code:T.invalid_type,expected:M.promise,received:n.parsedType}),U;let r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return nt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Yr.create=(t,e)=>new Yr({type:t,typeName:q.ZodPromise,...Q(e)});var qt=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{P(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return U;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?U:l.status==="dirty"?bi(l.value):n.value==="dirty"?bi(l.value):l});{if(n.value==="aborted")return U;let a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?U:a.status==="dirty"?bi(a.value):n.value==="dirty"?bi(a.value):a}}if(i.type==="refinement"){let s=a=>{let l=i.refinement(a,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 a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Kr(s))return U;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Kr(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):U);re.assertNever(i)}};qt.create=(t,e,n)=>new qt({schema:t,typeName:q.ZodEffects,effect:e,...Q(n)});qt.createWithPreprocess=(t,e,n)=>new qt({schema:e,effect:{type:"preprocess",transform:t},typeName:q.ZodEffects,...Q(n)});var Ut=class extends J{_parse(e){return this._getType(e)===M.undefined?nt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:q.ZodOptional,...Q(e)});var En=class extends J{_parse(e){return this._getType(e)===M.null?nt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};En.create=(t,e)=>new En({innerType:t,typeName:q.ZodNullable,...Q(e)});var Fi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Fi.create=(t,e)=>new Fi({innerType:t,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var $i=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ko(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new wt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new wt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};$i.create=(t,e)=>new $i({innerType:t,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var Jo=class extends J{_parse(e){if(this._getType(e)!==M.nan){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.nan,received:r.parsedType}),U}return{status:"valid",value:e.data}}};Jo.create=t=>new Jo({typeName:q.ZodNaN,...Q(t)});var XR=Symbol("zod_brand"),Fa=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},$a=class t extends J{_parse(e){let{status:n,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"?U:o.status==="dirty"?(n.dirty(),bi(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?U:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:q.ZodPipeline})}},Di=class extends J{_parse(e){let n=this._def.innerType._parse(e),r=i=>(Kr(i)&&(i.value=Object.freeze(i.value)),i);return Ko(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Di.create=(t,e)=>new Di({innerType:t,typeName:q.ZodReadonly,...Q(e)});function OS(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function DS(t,e={},n){return t?Zr.create().superRefine((r,i)=>{let o=t(r);if(o instanceof Promise)return o.then(s=>{if(!s){let a=OS(e,r),l=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:l})}});if(!o){let s=OS(e,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):Zr.create()}var QR={object:xt.lazycreate},q;(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"})(q||(q={}));var JR=(t,e={message:`Input not instance of ${t.name}`})=>DS(n=>n instanceof t,e),VS=Gr.create,BS=ki.create,eI=Jo.create,tI=Ci.create,zS=Ei.create,nI=Ai.create,rI=Zo.create,iI=Ti.create,oI=Ri.create,sI=Zr.create,aI=Jn.create,lI=an.create,uI=Yo.create,cI=er.create,dI=xt.create,fI=xt.strictCreate,pI=Ii.create,hI=bc.create,gI=Pi.create,mI=Cn.create,vI=kc.create,yI=Xo.create,_I=Qo.create,wI=Cc.create,xI=Ni.create,SI=Oi.create,bI=Li.create,kI=Mi.create,CI=Yr.create,EI=qt.create,AI=Ut.create,TI=En.create,RI=qt.createWithPreprocess,II=$a.create,PI=()=>VS().optional(),NI=()=>BS().optional(),OI=()=>zS().optional(),LI={string:(t=>Gr.create({...t,coerce:!0})),number:(t=>ki.create({...t,coerce:!0})),boolean:(t=>Ei.create({...t,coerce:!0})),bigint:(t=>Ci.create({...t,coerce:!0})),date:(t=>Ai.create({...t,coerce:!0}))};var MI=U;var HS=S.union([S.object({type:S.literal("data"),key:S.string(),value:S.string().optional()}),S.object({type:S.literal("css"),value:S.string()}),S.object({type:S.literal("aria"),role:S.string().optional(),label:S.string().optional()}),S.object({type:S.literal("shadow-css"),value:S.string()}),S.object({type:S.literal("ref"),el:S.any()})]),FI=S.object({kind:S.literal("tooltip"),id:S.string(),anchor:HS,content:S.object({title:S.string().optional(),body:S.string()}),placement:S.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:S.number().optional(),blocking:S.boolean().optional(),trigger:S.enum(["immediate","hover","click"]).optional(),dismiss:S.object({onEsc:S.boolean().optional(),closeButton:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),$I=S.object({kind:S.literal("highlight"),id:S.string(),anchor:HS,copy:S.string().optional(),ring:S.object({paddingPx:S.number().optional(),radiusPx:S.number().optional()}).optional(),scrim:S.object({opacity:S.number().optional()}).optional(),ringColor:S.string().optional(),blocking:S.boolean().optional(),dismiss:S.object({onClickOutside:S.boolean().optional(),onEsc:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),Hg=S.object({id:S.string(),version:S.number(),routes:S.array(S.string()).optional(),steps:S.array(S.union([FI,$I]))});function VL(t){return Hg.parse(t)}var jL=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let i=Mg({configUri:t,experiments:e,featureKey:n});if(!i)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(i,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let s=await o.json();return Hg.parse(s)};var jS="syntro_session_metrics",Ec=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let i=(this.metrics.get(e)??0)+n;return this.metrics.set(e,i),this.saveToStorage(),this.updateExperimentAttributes(e,i),this.onMetricChange?.(e,i),i}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}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 n={};for(let r of e)n[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,r]of this.metrics)e[`${this.attributePrefix}${n}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(jS);if(e){let n=JSON.parse(e);for(let[r,i]of Object.entries(n))this.metrics.set(r,i.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[n,r]of this.metrics)e[n]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(jS,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function jg(t={}){return new Ec(t)}var DI=S.object({url:S.string(),routeId:S.string().optional(),title:S.string().optional(),locale:S.string().optional()}),VI=S.object({url:S.string(),ts:S.number()}),BI=S.object({sessionId:S.string(),startTs:S.number(),pageHistory:S.array(VI).optional()}),zI=S.object({width:S.number(),height:S.number()}),HI=S.object({x:S.number(),y:S.number(),w:S.number(),h:S.number()}),jI=S.object({anchorId:S.string(),present:S.boolean(),visible:S.boolean().optional(),boundingBox:HI.optional()}),UI=S.record(S.union([S.number(),S.string(),S.boolean(),S.undefined()])),WI=S.object({page:DI,session:BI,viewport:zI,anchors:S.array(jI).optional(),augmented:UI.optional()});function YL(t){return WI.safeParse(t)}function qI(){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 Ug(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let r of e.exclude)if(US(n,r))return}if(e.include){for(let r of e.include)if(US(n,r))return r;return}return n}function US(t,e){let n=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(n===r)return!0;let i=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(n)}var Ac=class{constructor(e={}){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.context=qI(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Ug(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 n=Ug(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}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,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n));let r=()=>{this.updatePage()};window.addEventListener("popstate",r),this.cleanupFns.push(()=>window.removeEventListener("popstate",r));let i=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...s)=>{i(...s),this.updatePage()},history.replaceState=(...s)=>{o(...s),this.updatePage()},this.cleanupFns.push(()=>{history.pushState=i,history.replaceState=o})}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,n=document.title,r=Ug(e,this.routes),i={url:e,title:n,routeId:r};(i.url!==this.context.page.url||i.title!==this.context.page.title||i.routeId!==this.context.page.routeId)&&(i.url!==this.context.page.url&&this.addPageToHistory(i.url),this.updateContext({page:i}))}addPageToHistory(e){let n={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],n];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(n){console.error("[ContextManager] Listener error:",n)}}};function Wg(t={}){return new Ac(t)}var WS=S.enum(["posthog","canvas","derived"]),KI=S.object({ts:S.number(),name:S.string(),source:WS,props:S.record(S.unknown()).optional(),schemaVersion:S.string()}),GI=S.object({names:S.array(S.string()).optional(),patterns:S.array(S.string()).optional(),sources:S.array(WS).optional()});function oM(t){return KI.safeParse(t)}function sM(t){return GI.safeParse(t)}function qg(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 Tc=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let r,i;typeof e=="function"?(r=void 0,i=e):(r=e,i=n);let o={filter:r,callback:i};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,r="canvas"){let i={ts:Date.now(),name:e,source:r,props:n,schemaVersion:ho};this.publishEvent(i)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(qg(e,n.filter))try{n.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,n){let r=this.history;return e&&(r=r.filter(i=>qg(i,e))),n&&n>0&&(r=r.slice(-n)),r}hasRecentEvent(e,n,r){let i=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=i&&(r===void 0||o.source===r))}countRecentEvents(e,n){let r=this.history.filter(i=>qg(i,e));if(n!==void 0){let i=Date.now()-n;r=r.filter(o=>o.ts>=i)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function Da(t={}){return new Tc(t)}var qS={$autocapture:"ui.click",$click:Ee.UI_CLICK,$scroll:Ee.UI_SCROLL,$input:Ee.UI_INPUT,$change:Ee.UI_CHANGE,$submit:Ee.UI_SUBMIT,$pageview:Ee.NAV_PAGE_VIEW,$pageleave:Ee.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function ZI(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(qS[e])return qS[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?Ee.UI_SUBMIT:r==="change"?Ee.UI_CHANGE:n==="input"||n==="textarea"?Ee.UI_INPUT:Ee.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function YI(t){let e={},n=t.properties||{};return n.$tag_name&&(e.tagName=n.$tag_name),n.$el_text&&(e.elementText=n.$el_text),n.$elements&&(e.elements=n.$elements),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function KS(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:ZI(t),source:"posthog",props:YI(t),schemaVersion:ho}}function GS(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 Kg(t){return(e,n)=>{if(typeof e!="string")return;let r={event:e,properties:n,timestamp:Date.now()};if(GS(r)){let i=KS(r);t(i)}}}var XI=S.object({value:S.unknown(),expiresAt:S.number().optional()}),QI=S.object({count:S.number(),resetAt:S.number().optional()});function wM(t){return XI.safeParse(t)}function xM(t){return QI.safeParse(t)}var Va="dismissed:";function ZS(t,e){return{mark(n,r=!1){let i=Va+n;(r?e:t).set(i,!0)},isDismissed(n){let r=Va+n;return t.has(r)||e.has(r)},clear(n){let r=Va+n;t.remove(r),e.remove(r)},clearAll(){for(let n of t.keys())n.startsWith(Va)&&t.remove(n);for(let n of e.keys())n.startsWith(Va)&&e.remove(n)}}}var Gg="cooldown:";function YS(t){return{set(e,n){let r=Gg+e,i=Date.now()+n;t.set(r,i)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Gg+e,r=t.get(n);if(r===void 0)return 0;let i=r-Date.now();return i<=0?(t.remove(n),0):i},clear(e){let n=Gg+e;t.remove(n)}}}var Zg="freq:";function XS(t){function e(n){let r=Zg+n,i=t.get(r);if(i){if(i.resetAt&&Date.now()>=i.resetAt){t.remove(r);return}return i}}return{increment(n,r){let i=Zg+n,o=e(n),s=(o?.count??0)+1,a={count:s,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(i,a),s},count(n){return e(n)?.count??0},reset(n){let r=Zg+n;t.remove(r)},hasReachedLimit(n,r){return this.count(n)>=r}}}var JI="syntro";function Yg(t,e){let n=`${e}:`;return{get(r){if(t)try{let i=t.getItem(n+r);if(!i)return;let o=JSON.parse(i);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+r);return}return o.value}catch{return}},set(r,i,o){if(t)try{let s={value:i,expiresAt:o?Date.now()+o:void 0};t.setItem(n+r,JSON.stringify(s))}catch(s){console.warn("[StateStore] Failed to save:",s)}},remove(r){t&&t.removeItem(n+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let i=0;i<t.length;i++){let o=t.key(i);o?.startsWith(n)&&r.push(o.slice(n.length))}return r},clear(){if(!t)return;let r=this.keys();for(let i of r)t.removeItem(n+i)}}}function Xg(t){let e=new Map,n=`${t}:`;return{get(r){let i=e.get(n+r);if(i){if(i.expiresAt&&Date.now()>=i.expiresAt){e.delete(n+r);return}return i.value}},set(r,i,o){e.set(n+r,{value:i,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(n+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let i of e.keys())i.startsWith(n)&&r.push(i.slice(n.length));return r},clear(){for(let r of e.keys())r.startsWith(n)&&e.delete(r)}}}var Rc=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??JI,typeof window<"u"?(this.session=Yg(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Yg(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Xg(this.namespace),this.user=Xg(this.namespace)),this.dismissals=ZS(this.session,this.user),this.cooldowns=YS(this.user),this.frequency=XS(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let r=typeof window<"u"&&typeof sessionStorage<"u"?Yg(sessionStorage,n):Xg(n);this.namespacedStorages.set(n,r)}return this.namespacedStorages.get(n)}};function Qg(t={}){return new Rc(t)}var eP=S.object({type:S.literal("page_url"),url:S.string()}),tP=S.object({type:S.literal("route"),routeId:S.string()}),nP=S.object({type:S.literal("anchor_visible"),anchorId:S.string(),state:S.enum(["visible","present","absent"])}),rP=S.object({type:S.literal("event_occurred"),eventName:S.string(),withinMs:S.number().optional()}),iP=S.object({type:S.literal("state_equals"),key:S.string(),value:S.unknown()}),oP=S.object({type:S.literal("viewport"),minWidth:S.number().optional(),maxWidth:S.number().optional(),minHeight:S.number().optional(),maxHeight:S.number().optional()}),sP=S.object({type:S.literal("session_metric"),key:S.string(),operator:S.enum(["gte","lte","eq","gt","lt"]),threshold:S.number()}),aP=S.object({type:S.literal("dismissed"),key:S.string(),inverted:S.boolean().optional()}),lP=S.object({type:S.literal("cooldown_active"),key:S.string(),inverted:S.boolean().optional()}),uP=S.object({type:S.literal("frequency_limit"),key:S.string(),limit:S.number(),inverted:S.boolean().optional()}),QS=S.discriminatedUnion("type",[eP,tP,nP,rP,iP,oP,sP,aP,lP,uP]),cP=S.object({conditions:S.array(QS),value:S.unknown()}),dP=S.object({type:S.literal("rules"),rules:S.array(cP),default:S.unknown()}),fP=S.object({type:S.literal("score"),field:S.string(),threshold:S.number(),above:S.unknown(),below:S.unknown()}),pP=S.object({type:S.literal("model"),modelId:S.string(),inputs:S.array(S.string()),outputMapping:S.record(S.unknown()),default:S.unknown()}),hP=S.object({type:S.literal("external"),endpoint:S.string(),method:S.enum(["GET","POST"]).optional(),default:S.unknown(),timeoutMs:S.number().optional()}),JS=S.discriminatedUnion("type",[dP,fP,pP,hP]),gP=S.object({include:S.array(S.string()).optional(),exclude:S.array(S.string()).optional()}),mP=S.object({routes:gP.optional(),strategy:JS.optional()});function FM(t){return QS.safeParse(t)}function $M(t){return JS.safeParse(t)}function DM(t){return mP.safeParse(t)}function eb(t,e){let{context:n,state:r,events:i}=e;switch(t.type){case"page_url":{let{url:o}=t,s=n.page.url,a=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${a}$`).test(s)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=n.anchors?.find(s=>s.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(!i)return!1;let o=t.withinMs??6e4;return i.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:s}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&s<t.minHeight||t.maxHeight!==void 0&&s>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:s,threshold:a}=t;switch(s){case"gte":return o>=a;case"lte":return o<=a;case"eq":return o===a;case"gt":return o>a;case"lt":return o<a;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 s=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!s:s}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function tb(t,e){let n=[];for(let r of t.conditions){let i=eb(r,e);if(n.push({condition:r,result:i}),!i)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function Ic(t,e){for(let n=0;n<t.rules.length;n++){let r=t.rules[n],{matched:i,conditionResults:o}=tb(r,e);if(i)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function Pc(t,e){let{context:n}=e,r=n.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 nb(t,e){let{state:n,events:r,sessionMetrics:i}=e;return{context:t,state:n?{isDismissed:o=>n.dismissals.isDismissed(o),isCooldownActive:o=>n.cooldowns.isActive(o),getFrequencyCount:o=>n.frequency.count(o),getSessionMetric:o=>i?.get(o)??0}:void 0,events:r?{hasRecentEvent:(o,s)=>r.hasRecentEvent(o,s)}:void 0}}async function rb(t,e,n={}){let r=nb(e,n);switch(t.type){case"rules":return Ic(t,r);case"score":return Pc(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 ib(t,e,n={}){let r=nb(e,n);switch(t.type){case"rules":return Ic(t,r);case"score":return Pc(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 Jg(t){return{evaluate:(e,n)=>rb(e,n,t),evaluateSync:(e,n)=>ib(e,n,t)}}var vP=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function em(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!vP.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),f=u.startsWith("on"),h=(u==="href"||u==="src")&&c.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}var ob=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=em(t.html),i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),i.innerHTML=r;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",i);break;case"after":n.insertAdjacentElement("afterend",i);break;case"prepend":n.insertBefore(i,n.firstChild);break;case"append":n.appendChild(i);break;case"replace":o=n.innerHTML,n.replaceWith(i);break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position}),{cleanup:()=>{if(t.position==="replace"&&o!==null){let s=document.createElement(n.tagName);s.innerHTML=o,Array.from(n.attributes).forEach(a=>{s.setAttribute(a.name,a.value)}),i.replaceWith(s)}else i.remove()},updateFn:s=>{"html"in s&&typeof s.html=="string"&&(i.innerHTML=em(s.html))}}},sb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=r},updateFn:i=>{"text"in i&&typeof i.text=="string"&&(n.textContent=i.text)}}},ab=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);if(["onclick","onerror","onload","onmouseover","onfocus","onblur"].includes(t.attr.toLowerCase())||t.attr.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);let i=n.getAttribute(t.attr),o=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{o&&i!==null?n.setAttribute(t.attr,i):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},lb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||n.classList.remove(t.className)}}},ub=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&n.classList.add(t.className)}}},cb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=new Map;for(let i of Object.keys(t.styles)){let o=n.style.getPropertyValue(i);r.set(i,o)}for(let[i,o]of Object.entries(t.styles))n.style.setProperty(i,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[i,o]of r)o?n.style.setProperty(i,o):n.style.removeProperty(i)},updateFn:i=>{if("styles"in i&&typeof i.styles=="object"&&i.styles)for(let[o,s]of Object.entries(i.styles))n.style.setProperty(o,s)}}},tm=[{kind:"content:insertHtml",executor:ob},{kind:"content:setText",executor:sb},{kind:"content:setAttr",executor:ab},{kind:"content:addClass",executor:lb},{kind:"content:removeClass",executor:ub},{kind:"content:setStyle",executor:cb}],yP={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:tm};var db=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function fb(t,e,n){let r=n?.paddingPx??12,i=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),s=n?.ringColor??"var(--syntro-ring, #5b8cff)",a=n?.blocking??!1,l=n?.onClickOutside??!0,u=n?.onEsc??!0,c=getComputedStyle(document.documentElement),f=c.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=c.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let v=a||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:v?"auto":"none",background:f||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${i}px`,border:`2px solid ${s||h||"#5b8cff"}`,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(_);let x=[];if(!db)for(let I=0;I<4;I++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",x.push(A),g.appendChild(A)}let d=I=>{g.style.clipPath=I,g.style.webkitClipPath=I},p=()=>{let I=t.getBoundingClientRect(),A=Math.max(0,I.left-r),H=Math.max(0,I.top-r),K=Math.min(window.innerWidth,I.width+r*2),Y=Math.min(window.innerHeight,I.height+r*2);if(Object.assign(_.style,{left:`${A}px`,top:`${H}px`,width:`${K}px`,height:`${Y}px`}),db){let W=window.innerWidth,le=window.innerHeight,V=Math.min(i,K/2,Y/2),X=`M 0 0 L ${W} 0 L ${W} ${le} L 0 ${le} Z`,B=`M ${A+V} ${H} A ${V} ${V} 0 0 0 ${A} ${H+V} L ${A} ${H+Y-V} A ${V} ${V} 0 0 0 ${A+V} ${H+Y} L ${A+K-V} ${H+Y} A ${V} ${V} 0 0 0 ${A+K} ${H+Y-V} L ${A+K} ${H+V} A ${V} ${V} 0 0 0 ${A+K-V} ${H} L ${A+V} ${H} Z`;d(`path('${X} ${B}')`)}else{let[W,le,V,X]=x;Object.assign(W.style,{left:"0px",top:"0px",width:"100vw",height:`${H}px`}),Object.assign(V.style,{left:"0px",top:`${H+Y}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(H+Y))}px`}),Object.assign(X.style,{left:"0px",top:`${H}px`,width:`${A}px`,height:`${Y}px`}),Object.assign(le.style,{left:`${A+K}px`,top:`${H}px`,width:`${Math.max(0,window.innerWidth-(A+K))}px`,height:`${Y}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(p));m.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let b=I=>{I.key==="Escape"&&u&&C.destroy()};u&&window.addEventListener("keydown",b);let k=I=>{a?(I.preventDefault(),I.stopPropagation()):l&&C.destroy()};g.addEventListener("click",k);let C={destroy(){m.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),u&&window.removeEventListener("keydown",b),g.removeEventListener("click",k),g.style.opacity="0",setTimeout(()=>{g.remove(),_.remove()},220)}};return p(),C}var gb=["top","right","bottom","left"];var Xr=Math.min,tr=Math.max,za=Math.round,Ha=Math.floor,ln=t=>({x:t,y:t}),_P={left:"right",right:"left",bottom:"top",top:"bottom"},wP={start:"end",end:"start"};function Oc(t,e,n){return tr(t,Xr(e,n))}function Vi(t,e){return typeof t=="function"?t(e):t}function Qr(t){return t.split("-")[0]}function es(t){return t.split("-")[1]}function nm(t){return t==="x"?"y":"x"}function Lc(t){return t==="y"?"height":"width"}var xP=new Set(["top","bottom"]);function nr(t){return xP.has(Qr(t))?"y":"x"}function Mc(t){return nm(nr(t))}function mb(t,e,n){n===void 0&&(n=!1);let r=es(t),i=Mc(t),o=Lc(i),s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ba(s)),[s,Ba(s)]}function vb(t){let e=Ba(t);return[Nc(t),e,Nc(e)]}function Nc(t){return t.replace(/start|end/g,e=>wP[e])}var pb=["left","right"],hb=["right","left"],SP=["top","bottom"],bP=["bottom","top"];function kP(t,e,n){switch(t){case"top":case"bottom":return n?e?hb:pb:e?pb:hb;case"left":case"right":return e?SP:bP;default:return[]}}function yb(t,e,n,r){let i=es(t),o=kP(Qr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Nc)))),o}function Ba(t){return t.replace(/left|right|bottom|top/g,e=>_P[e])}function CP(t){return{top:0,right:0,bottom:0,left:0,...t}}function rm(t){return typeof t!="number"?CP(t):{top:t,right:t,bottom:t,left:t}}function Bi(t){let{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function _b(t,e,n){let{reference:r,floating:i}=t,o=nr(e),s=Mc(e),a=Lc(s),l=Qr(e),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2,g;switch(l){case"top":g={x:c,y:r.y-i.height};break;case"bottom":g={x:c,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-i.width,y:f};break;default:g={x:r.x,y:r.y}}switch(es(e)){case"start":g[s]-=h*(n&&u?-1:1);break;case"end":g[s]+=h*(n&&u?-1:1);break}return g}async function Sb(t,e){var n;e===void 0&&(e={});let{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Vi(e,t),v=rm(g),x=a[h?f==="floating"?"reference":"floating":f],d=Bi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),p=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),y=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Bi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:m,strategy:l}):p);return{top:(d.top-w.top+v.top)/y.y,bottom:(w.bottom-d.bottom+v.bottom)/y.y,left:(d.left-w.left+v.left)/y.x,right:(w.right-d.right+v.right)/y.x}}var bb=async(t,e,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=_b(u,r,l),h=r,g={},v=0;for(let x=0;x<a.length;x++){var _;let{name:d,fn:p}=a[x],{x:m,y,data:w,reset:b}=await p({x:c,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:g,rects:u,platform:{...s,detectOverflow:(_=s.detectOverflow)!=null?_:Sb},elements:{reference:t,floating:e}});c=m??c,f=y??f,g={...g,[d]:{...g[d],...w}},b&&v<=50&&(v++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(u=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:c,y:f}=_b(u,h,l)),x=-1)}return{x:c,y:f,placement:h,strategy:i,middlewareData:g}},kb=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Vi(t,e)||{};if(u==null)return{};let f=rm(c),h={x:n,y:r},g=Mc(i),v=Lc(g),_=await s.getDimensions(u),x=g==="y",d=x?"top":"left",p=x?"bottom":"right",m=x?"clientHeight":"clientWidth",y=o.reference[v]+o.reference[g]-h[g]-o.floating[v],w=h[g]-o.reference[g],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u)),k=b?b[m]:0;(!k||!await(s.isElement==null?void 0:s.isElement(b)))&&(k=a.floating[m]||o.floating[v]);let C=y/2-w/2,I=k/2-_[v]/2-1,A=Xr(f[d],I),H=Xr(f[p],I),K=A,Y=k-_[v]-H,W=k/2-_[v]/2+C,le=Oc(K,W,Y),V=!l.arrow&&es(i)!=null&&W!==le&&o.reference[v]/2-(W<K?A:H)-_[v]/2<0,X=V?W<K?W-K:W-Y:0;return{[g]:h[g]+X,data:{[g]:le,centerOffset:W-le-X,...V&&{alignmentOffset:X}},reset:V}}});var Cb=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;let{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:_=!0,...x}=Vi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let d=Qr(i),p=nr(a),m=Qr(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=h||(m||!_?[Ba(a)]:vb(a)),b=v!=="none";!h&&b&&w.push(...yb(a,_,v,y));let k=[a,...w],C=await l.detectOverflow(e,x),I=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&I.push(C[d]),f){let W=mb(i,s,y);I.push(C[W[0]],C[W[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(W=>W<=0)){var H,K;let W=(((H=o.flip)==null?void 0:H.index)||0)+1,le=k[W];if(le&&(!(f==="alignment"?p!==nr(le):!1)||A.every(B=>nr(B.placement)===p?B.overflows[0]>0:!0)))return{data:{index:W,overflows:A},reset:{placement:le}};let V=(K=A.filter(X=>X.overflows[0]<=0).sort((X,B)=>X.overflows[1]-B.overflows[1])[0])==null?void 0:K.placement;if(!V)switch(g){case"bestFit":{var Y;let X=(Y=A.filter(B=>{if(b){let Z=nr(B.placement);return Z===p||Z==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Z=>Z>0).reduce((Z,ut)=>Z+ut,0)]).sort((B,Z)=>B[1]-Z[1])[0])==null?void 0:Y[0];X&&(V=X);break}case"initialPlacement":V=a;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function wb(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function xb(t){return gb.some(e=>t[e]>=0)}var Eb=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:r}=e,{strategy:i="referenceHidden",...o}=Vi(t,e);switch(i){case"referenceHidden":{let s=await r.detectOverflow(e,{...o,elementContext:"reference"}),a=wb(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:xb(a)}}}case"escaped":{let s=await r.detectOverflow(e,{...o,altBoundary:!0}),a=wb(s,n.floating);return{data:{escapedOffsets:a,escaped:xb(a)}}}default:return{}}}}};var EP=new Set(["left","top"]);async function AP(t,e){let{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Qr(n),a=es(n),l=nr(n)==="y",u=EP.has(s)?-1:1,c=o&&l?-1:1,f=Vi(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*c,y:h*u}:{x:h*u,y:g*c}}var Ab=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;let{x:i,y:o,placement:s,middlewareData:a}=e,l=await AP(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Tb=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:r,placement:i,platform:o}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:d=>{let{x:p,y:m}=d;return{x:p,y:m}}},...u}=Vi(t,e),c={x:n,y:r},f=await o.detectOverflow(e,u),h=nr(Qr(i)),g=nm(h),v=c[g],_=c[h];if(s){let d=g==="y"?"top":"left",p=g==="y"?"bottom":"right",m=v+f[d],y=v-f[p];v=Oc(m,v,y)}if(a){let d=h==="y"?"top":"left",p=h==="y"?"bottom":"right",m=_+f[d],y=_-f[p];_=Oc(m,_,y)}let x=l.fn({...e,[g]:v,[h]:_});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:s,[h]:a}}}}}};function Fc(){return typeof window<"u"}function zi(t){return Ib(t)?(t.nodeName||"").toLowerCase():"#document"}function St(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function un(t){var e;return(e=(Ib(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ib(t){return Fc()?t instanceof Node||t instanceof St(t).Node:!1}function Kt(t){return Fc()?t instanceof Element||t instanceof St(t).Element:!1}function cn(t){return Fc()?t instanceof HTMLElement||t instanceof St(t).HTMLElement:!1}function Rb(t){return!Fc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof St(t).ShadowRoot}var TP=new Set(["inline","contents"]);function ns(t){let{overflow:e,overflowX:n,overflowY:r,display:i}=Gt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!TP.has(i)}var RP=new Set(["table","td","th"]);function Pb(t){return RP.has(zi(t))}var IP=[":popover-open",":modal"];function ja(t){return IP.some(e=>{try{return t.matches(e)}catch{return!1}})}var PP=["transform","translate","scale","rotate","perspective"],NP=["transform","translate","scale","rotate","perspective","filter"],OP=["paint","layout","strict","content"];function $c(t){let e=Dc(),n=Kt(t)?Gt(t):t;return PP.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||NP.some(r=>(n.willChange||"").includes(r))||OP.some(r=>(n.contain||"").includes(r))}function Nb(t){let e=rr(t);for(;cn(e)&&!Hi(e);){if($c(e))return e;if(ja(e))return null;e=rr(e)}return null}function Dc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var LP=new Set(["html","body","#document"]);function Hi(t){return LP.has(zi(t))}function Gt(t){return St(t).getComputedStyle(t)}function Ua(t){return Kt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function rr(t){if(zi(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Rb(t)&&t.host||un(t);return Rb(e)?e.host:e}function Ob(t){let e=rr(t);return Hi(e)?t.ownerDocument?t.ownerDocument.body:t.body:cn(e)&&ns(e)?e:Ob(e)}function ts(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Ob(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=St(i);if(o){let a=Vc(s);return e.concat(s,s.visualViewport||[],ns(i)?i:[],a&&n?ts(a):[])}return e.concat(i,ts(i,[],n))}function Vc(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Fb(t){let e=Gt(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=cn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=za(n)!==o||za(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function om(t){return Kt(t)?t:t.contextElement}function rs(t){let e=om(t);if(!cn(e))return ln(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Fb(e),s=(o?za(n.width):n.width)/r,a=(o?za(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var MP=ln(0);function $b(t){let e=St(t);return!Dc()||!e.visualViewport?MP:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function FP(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==St(t)?!1:e}function ji(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=om(t),s=ln(1);e&&(r?Kt(r)&&(s=rs(r)):s=rs(t));let a=FP(o,n,r)?$b(o):ln(0),l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,f=i.height/s.y;if(o){let h=St(o),g=r&&Kt(r)?St(r):r,v=h,_=Vc(v);for(;_&&r&&g!==v;){let x=rs(_),d=_.getBoundingClientRect(),p=Gt(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=m,u+=y,v=St(_),_=Vc(v)}}return Bi({width:c,height:f,x:l,y:u})}function sm(t,e){let n=Ua(t).scrollLeft;return e?e.left+n:ji(un(t)).left+n}function Db(t,e,n){n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:sm(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function $P(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=un(r),a=e?ja(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ln(1),c=ln(0),f=cn(r);if((f||!f&&!o)&&((zi(r)!=="body"||ns(s))&&(l=Ua(r)),cn(r))){let g=ji(r);u=rs(r),c.x=g.x+r.clientLeft,c.y=g.y+r.clientTop}let h=s&&!f&&!o?Db(s,l,!0):ln(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function DP(t){return Array.from(t.getClientRects())}function VP(t){let e=un(t),n=Ua(t),r=t.ownerDocument.body,i=tr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=tr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+sm(t),a=-n.scrollTop;return Gt(r).direction==="rtl"&&(s+=tr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function BP(t,e){let n=St(t),r=un(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let u=Dc();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function zP(t,e){let n=ji(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=cn(t)?rs(t):ln(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function Lb(t,e,n){let r;if(e==="viewport")r=BP(t,n);else if(e==="document")r=VP(un(t));else if(Kt(e))r=zP(e,n);else{let i=$b(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Bi(r)}function Vb(t,e){let n=rr(t);return n===e||!Kt(n)||Hi(n)?!1:Gt(n).position==="fixed"||Vb(n,e)}function HP(t,e){let n=e.get(t);if(n)return n;let r=ts(t,[],!1).filter(a=>Kt(a)&&zi(a)!=="body"),i=null,o=Gt(t).position==="fixed",s=o?rr(t):t;for(;Kt(s)&&!Hi(s);){let a=Gt(s),l=$c(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ns(s)&&!l&&Vb(t,s))?r=r.filter(c=>c!==s):i=a,s=rr(s)}return e.set(t,r),r}function jP(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?ja(e)?[]:HP(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,c)=>{let f=Lb(e,c,i);return u.top=tr(f.top,u.top),u.right=Xr(f.right,u.right),u.bottom=Xr(f.bottom,u.bottom),u.left=tr(f.left,u.left),u},Lb(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function UP(t){let{width:e,height:n}=Fb(t);return{width:e,height:n}}function WP(t,e,n){let r=cn(e),i=un(e),o=n==="fixed",s=ji(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=ln(0);if(r||!r&&!o)if((zi(e)!=="body"||ns(i))&&(a=Ua(e)),r){let h=ji(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=sm(i));let u=i&&!r&&!o?Db(i,a):ln(0),c=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:c,y:f,width:s.width,height:s.height}}function im(t){return Gt(t).position==="static"}function Mb(t,e){if(!cn(t)||Gt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return un(t)===n&&(n=n.ownerDocument.body),n}function Bb(t,e){let n=St(t);if(ja(t))return n;if(!cn(t)){let i=rr(t);for(;i&&!Hi(i);){if(Kt(i)&&!im(i))return i;i=rr(i)}return n}let r=Mb(t,e);for(;r&&Pb(r)&&im(r);)r=Mb(r,e);return r&&Hi(r)&&im(r)&&!$c(r)?n:r||Nb(t)||n}var qP=async function(t){let e=this.getOffsetParent||Bb,n=this.getDimensions,r=await n(t.floating);return{reference:WP(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KP(t){return Gt(t).direction==="rtl"}var GP={convertOffsetParentRelativeRectToViewportRelativeRect:$P,getDocumentElement:un,getClippingRect:jP,getOffsetParent:Bb,getElementRects:qP,getClientRects:DP,getDimensions:UP,getScale:rs,isElement:Kt,isRTL:KP};function zb(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ZP(t,e){let n=null,r,i=un(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let u=t.getBoundingClientRect(),{left:c,top:f,width:h,height:g}=u;if(a||e(),!h||!g)return;let v=Ha(f),_=Ha(i.clientWidth-(c+h)),x=Ha(i.clientHeight-(f+g)),d=Ha(c),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:tr(0,Xr(1,l))||1},y=!0;function w(b){let k=b[0].intersectionRatio;if(k!==l){if(!y)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!zb(u,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function Bc(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=om(t),c=i||o?[...u?ts(u):[],...ts(e)]:[];c.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=u&&a?ZP(u,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),u&&!l&&g.observe(u),g.observe(e));let v,_=l?ji(t):null;l&&x();function x(){let d=ji(t);_&&!zb(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;c.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var zc=Ab;var Hc=Tb,jc=Cb;var Hb=Eb,jb=kb;var Uc=(t,e,n)=>{let r=new Map,i={platform:GP,...n},o={...i.platform,_c:r};return bb(t,e,{...i,platform:o})};var YP=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Ot(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!YP.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let u=l.name.toLowerCase(),c=l.value.trim().toLowerCase(),f=u.startsWith("on"),h=(u==="href"||u==="src")&&c.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}function XP(t){let e=t.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;if(!(e.width>n*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),s=Math.max(e.top,0),a=Math.min(e.right,n),l=Math.min(e.bottom,r),u=(o+a)/2,c=(s+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:u,y:c,top:c,left:u,right:u,bottom:c}}}}function Ub(t,e,n){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=Ot(n.html);let s=o.querySelectorAll("[data-syntro-action]"),a=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};s.forEach(d=>d.addEventListener("click",a));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let u=[zc(n.offsetPx??8),jc(),Hc({padding:8}),Hb(),jb({element:l})],c=n.placement&&n.placement!=="auto"?n.placement:"top",f=Bc(t,o,async()=>{let d=XP(t),p=await Uc(d,o,{placement:c,middleware:u}),{x:m,y,strategy:w,middlewareData:b,placement:k}=p;if(Object.assign(o.style,{left:`${m}px`,top:`${y}px`,position:w}),b.arrow){let{x:C,y:I}=b.arrow,A=k.split("-")[0],H={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:C!=null?`${C}px`:"",top:I!=null?`${I}px`:"",right:"",bottom:"",[H[A]]:"-4px"});let K={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${K[A]||"0deg"})`}}),h=d=>{d.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let g=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),g.push(p.id||p.tagName))});let d=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let p=d[0],m=d[d.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(m.focus(),w.preventDefault()):document.activeElement===m&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let d=()=>{o.style.visibility="visible",o.style.opacity="1"},p=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",d),t.addEventListener("mouseleave",p),t.addEventListener("focus",d),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",d),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let d=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",d),()=>t.removeEventListener("click",d)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){f(),_(),window.removeEventListener("keydown",h),s.forEach(d=>d.removeEventListener("click",a)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var am=async(t,e)=>{let{content:n,size:r="md",blocking:i=!1,scrim:o,dismiss:s,ctaButtons:a}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
54
|
+
})();`}var iN=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function Uw(t){if(typeof window>"u")return null;let n=new URLSearchParams(window.location.search).get(t);if(!n)return null;try{let i=n.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(i))}catch(i){return Rt("Syntro Runtime",`Failed to decode ${t}:`,i),null}}var Uv,$v;function to(){return Uv===void 0&&(Uv=Uw("editor_source")),Uv}function Jd(){return $v===void 0&&($v=Uw("editor_conf")),$v}function rN(t){j("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return j("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(Rt("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1):iN.some(r=>r.startsWith(".")?e.hostname.endsWith(r)||e.hostname===r.slice(1):e.hostname===r)?(j("Syntro Runtime","\u2713 Editor URL validated"),!0):(Rt("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return Rt("Syntro Runtime",`\u274C Invalid editor URL: ${t}`,e),!1}}var $w=()=>{let t=Jd();return!to()?.token||!t?null:t.mode==="editor"||t.mode==="audit"?t.mode:null};function aN(){return to()?.token??null}function sN(){return to()?.api_base??null}var Vw=async t=>{if(j("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){j("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){j("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}let e=typeof t=="string"?{editorUrl:t}:t??{},n=sN(),r=(n?`${n}/api/editor/sdk/editor-sdk.js`:null)||e.editorUrl;if(!r){Rt("Syntro Runtime","\u274C No editor SDK URL available (no api_base, no editorUrl option)"),j("Syntro Runtime","================================");return}let a=aN();if(!a){Rt("Syntro Runtime","\u274C No token found in editor_source."),j("Syntro Runtime","================================");return}let s=`${r}?token=${encodeURIComponent(a)}`;if(j("Syntro Runtime","Editor URL:",s),j("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,hasEditorUrl:!!r,hasApiBase:!!n,tokenPrefix:`${a.slice(0,10)}...`}),!rN(r)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",r),j("Syntro Runtime","================================");return}return j("Syntro Runtime","\u2713 URL validated, injecting script tag..."),new Promise((o,l)=>{let c=document.createElement("script");c.src=s,c.async=!0,e.integrity&&(c.integrity=e.integrity,c.crossOrigin="anonymous",j("Syntro Runtime","SRI integrity check enabled")),c.onload=()=>{j("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),j("Syntro Runtime","================================"),o()},c.onerror=u=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",u),console.error("[Syntro Runtime] URL attempted:",s),j("Syntro Runtime","================================"),l(u)},document.head.appendChild(c),j("Syntro Runtime","Script tag appended to <head>")})};var Vv=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 d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=Hw(d)}let n=null,i=null,r=null,a=!0,{runtime:s}=t;async function o(d){!s?.actions||d.length===0||(r?.isApplied()&&await r.revertAll(),r=await s.actions.applyBatch(d))}async function l(){r?.isApplied()&&(await r.revertAll(),r=null)}if(t.fetcher)try{i=t.fetcher;let d=await t.fetcher();n=d,d.actions&&d.actions.length>0&&s?.actions&&await o(d.actions)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let c=$w();c&&(console.log(`[SmartCanvas] Loading editor SDK for ${c} mode`),Vw(t.editorUrl).catch(console.error)),Dw();let u=document.createElement("smart-canvas");if(t.tokens)for(let[d,h]of Object.entries(t.tokens))u.style.setProperty(d,h);let f=()=>{let d=t.target??document.body;d&&d.appendChild(u)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});let g=t.integrations?.experiments,p=t.integrations?.telemetry,y=t.fetcher??cs({configUri:t.configUri,experiments:g,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});i||(i=y);let _={fetcher:y,pollIntervalMs:t.pollIntervalMs,experiments:g,telemetry:p,runtime:s,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme};u.mountReactApp(_),t.defaultOpen&&u.open();let b={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{l(),u.remove()},setTokens:d=>{for(let[h,m]of Object.entries(d))u.style.setProperty(h,m)},getConfig:async()=>{if(i)try{let d=await i();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n??{tiles:[],actions:[],fetchedAt:""}},updateConfig:async d=>{n=d,a&&await o(d.actions)},setEnabled:async d=>{a=d,d?n&&await o(n.actions):await l()},registerComponent:(d,h)=>u.registerComponent(d,h),setOverrideFetcher:d=>{i=d,u.setOverrideFetcher(d)},registerTelemetryProperties:d=>{p?.register?.(d)},getSessionId:()=>p?.getSessionId?.(),startSessionRecording:()=>{p?.startSessionRecording?.()},runtime:s};return typeof window<"u"&&c&&(window.__smartCanvasHandle=b),b};typeof window<"u"&&(window.SmartCanvas={async create(t){return Vv(t)}});var x={};$A(x,{BRAND:()=>NN,DIRTY:()=>va,EMPTY_PATH:()=>uN,INVALID:()=>q,NEVER:()=>mD,OK:()=>bt,ParseStatus:()=>vt,Schema:()=>ne,ZodAny:()=>Ur,ZodArray:()=>zi,ZodBigInt:()=>_a,ZodBoolean:()=>ba,ZodBranded:()=>sc,ZodCatch:()=>Ma,ZodDate:()=>Sa,ZodDefault:()=>Oa,ZodDiscriminatedUnion:()=>nf,ZodEffects:()=>bn,ZodEnum:()=>Ta,ZodError:()=>$t,ZodFirstPartyTypeKind:()=>G,ZodFunction:()=>af,ZodIntersection:()=>Ca,ZodIssueCode:()=>M,ZodLazy:()=>Aa,ZodLiteral:()=>ka,ZodMap:()=>oo,ZodNaN:()=>co,ZodNativeEnum:()=>Ra,ZodNever:()=>On,ZodNull:()=>Ea,ZodNullable:()=>Qn,ZodNumber:()=>ya,ZodObject:()=>Vt,ZodOptional:()=>yn,ZodParsedType:()=>B,ZodPipeline:()=>oc,ZodPromise:()=>$r,ZodReadonly:()=>Na,ZodRecord:()=>rf,ZodSchema:()=>ne,ZodSet:()=>lo,ZodString:()=>Hr,ZodSymbol:()=>ao,ZodTransformer:()=>bn,ZodTuple:()=>Wn,ZodType:()=>ne,ZodUndefined:()=>xa,ZodUnion:()=>wa,ZodUnknown:()=>Li,ZodVoid:()=>so,addIssueToContext:()=>N,any:()=>IN,array:()=>PN,bigint:()=>BN,boolean:()=>Ww,coerce:()=>gD,custom:()=>Zw,date:()=>HN,datetimeRegex:()=>Gw,defaultErrorMap:()=>Ni,discriminatedUnion:()=>KN,effect:()=>oD,enum:()=>rD,function:()=>tD,getErrorMap:()=>no,getParsedType:()=>Xn,instanceof:()=>LN,intersection:()=>XN,isAborted:()=>ef,isAsync:()=>io,isDirty:()=>tf,isValid:()=>Br,late:()=>DN,lazy:()=>nD,literal:()=>iD,makeIssue:()=>ac,map:()=>JN,nan:()=>zN,nativeEnum:()=>aD,never:()=>jN,null:()=>VN,nullable:()=>cD,number:()=>Xw,object:()=>GN,objectUtil:()=>Iv,oboolean:()=>hD,onumber:()=>pD,optional:()=>lD,ostring:()=>fD,pipeline:()=>dD,preprocess:()=>uD,promise:()=>sD,quotelessJson:()=>oN,record:()=>QN,set:()=>eD,setErrorMap:()=>cN,strictObject:()=>YN,string:()=>Kw,symbol:()=>UN,transformer:()=>oD,tuple:()=>WN,undefined:()=>$N,union:()=>ZN,unknown:()=>FN,util:()=>oe,void:()=>qN});var oe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let a={};for(let s of r)a[s]=s;return a},t.getValidEnumValues=r=>{let a=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),s={};for(let o of a)s[o]=r[o];return t.objectValues(s)},t.objectValues=r=>t.objectKeys(r).map(function(a){return r[a]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let a=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&a.push(s);return a},t.find=(r,a)=>{for(let s of r)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,a=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=i,t.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(oe||(oe={}));var Iv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Iv||(Iv={}));var B=oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xn=t=>{switch(typeof t){case"undefined":return B.undefined;case"string":return B.string;case"number":return Number.isNaN(t)?B.nan:B.number;case"boolean":return B.boolean;case"function":return B.function;case"bigint":return B.bigint;case"symbol":return B.symbol;case"object":return Array.isArray(t)?B.array:t===null?B.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?B.promise:typeof Map<"u"&&t instanceof Map?B.map:typeof Set<"u"&&t instanceof Set?B.set:typeof Date<"u"&&t instanceof Date?B.date:B.object;default:return B.unknown}};var M=oe.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"]),oN=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),$t=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(a){return a.message},i={_errors:[]},r=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let o=i,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return r(this),i}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,oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},i=[];for(let r of this.issues)if(r.path.length>0){let a=r.path[0];n[a]=n[a]||[],n[a].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};$t.create=t=>new $t(t);var lN=(t,e)=>{let n;switch(t.code){case M.invalid_type:t.received===B.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,oe.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${oe.joinValues(t.keys,", ")}`;break;case M.invalid_union:n="Invalid input";break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${oe.joinValues(t.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${oe.joinValues(t.options)}, received '${t.received}'`;break;case M.invalid_arguments:n="Invalid function arguments";break;case M.invalid_return_type:n="Invalid function return type";break;case M.invalid_date:n="Invalid date";break;case M.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case M.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case M.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case M.custom:n="Invalid input";break;case M.invalid_intersection_types:n="Intersection results could not be merged";break;case M.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case M.not_finite:n="Number must be finite";break;default:n=e.defaultError,oe.assertNever(t)}return{message:n}},Ni=lN;var Iw=Ni;function cN(t){Iw=t}function no(){return Iw}var ac=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,a=[...n,...r.path||[]],s={...r,path:a};if(r.message!==void 0)return{...r,path:a,message:r.message};let o="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)o=c(s,{data:e,defaultError:o}).message;return{...r,path:a,message:o}},uN=[];function N(t,e){let n=no(),i=ac({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Ni?void 0:Ni].filter(r=>!!r)});t.common.issues.push(i)}var vt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return q;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let a=await r.key,s=await r.value;i.push({key:a,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:a,value:s}=r;if(a.status==="aborted"||s.status==="aborted")return q;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[a.value]=s.value)}return{status:e.value,value:i}}},q=Object.freeze({status:"aborted"}),va=t=>({status:"dirty",value:t}),bt=t=>({status:"valid",value:t}),ef=t=>t.status==="aborted",tf=t=>t.status==="dirty",Br=t=>t.status==="valid",io=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var _n=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Fw=(t,e)=>{if(Br(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 n=new $t(t.common.issues);return this._error=n,this._error}}};function te(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(s,o)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??i??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(e){return Xn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:Xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(io(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)},r=this._parseSync({data:e,path:i.path,parent:i});return Fw(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Br(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Br(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xn(e)},r=this._parse({data:e,path:i.path,parent:i}),a=await(io(r)?r:Promise.resolve(r));return Fw(i,a)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,a)=>{let s=e(r),o=()=>a.addIssue({code:M.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new bn({schema:this,typeName:G.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:n=>this["~validate"](n)}}optional(){return yn.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zi.create(this)}promise(){return $r.create(this,this._def)}or(e){return wa.create([this,e],this._def)}and(e){return Ca.create(this,e,this._def)}transform(e){return new bn({...te(this._def),schema:this,typeName:G.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Oa({...te(this._def),innerType:this,defaultValue:n,typeName:G.ZodDefault})}brand(){return new sc({typeName:G.ZodBranded,type:this,...te(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ma({...te(this._def),innerType:this,catchValue:n,typeName:G.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return oc.create(this,e)}readonly(){return Na.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},dN=/^c[^\s-]{8,}$/i,fN=/^[0-9a-z]+$/,pN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hN=/^[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,gN=/^[a-z0-9_-]{21}$/i,mN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vN=/^[-+]?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)?)??$/,yN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_N="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Fv,bN=/^(?:(?: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])$/,SN=/^(?:(?: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])$/,xN=/^(([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]))$/,EN=/^(([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])$/,wN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,CN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qw="((\\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])))",AN=new RegExp(`^${qw}$`);function Pw(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function kN(t){return new RegExp(`^${Pw(t)}$`)}function Gw(t){let e=`${qw}T${Pw(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function TN(t,e){return!!((e==="v4"||!e)&&bN.test(t)||(e==="v6"||!e)&&xN.test(t))}function RN(t,e){if(!mN.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function ON(t,e){return!!((e==="v4"||!e)&&SN.test(t)||(e==="v6"||!e)&&EN.test(t))}var Hr=class t extends ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==B.string){let a=this._getOrReturnCtx(e);return N(a,{code:M.invalid_type,expected:B.string,received:a.parsedType}),q}let i=new vt,r;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),N(r,{code:M.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),N(r,{code:M.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(r=this._getOrReturnCtx(e,r),s?N(r,{code:M.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&N(r,{code:M.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if(a.kind==="email")yN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"email",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="emoji")Fv||(Fv=new RegExp(_N,"u")),Fv.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"emoji",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="uuid")hN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"uuid",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="nanoid")gN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"nanoid",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid")dN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"cuid",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid2")fN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"cuid2",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="ulid")pN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"ulid",code:M.invalid_string,message:a.message}),i.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),N(r,{validation:"url",code:M.invalid_string,message:a.message}),i.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"regex",code:M.invalid_string,message:a.message}),i.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),N(r,{code:M.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),i.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),N(r,{code:M.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),N(r,{code:M.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty()):a.kind==="datetime"?Gw(a).test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{code:M.invalid_string,validation:"datetime",message:a.message}),i.dirty()):a.kind==="date"?AN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{code:M.invalid_string,validation:"date",message:a.message}),i.dirty()):a.kind==="time"?kN(a).test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{code:M.invalid_string,validation:"time",message:a.message}),i.dirty()):a.kind==="duration"?vN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"duration",code:M.invalid_string,message:a.message}),i.dirty()):a.kind==="ip"?TN(e.data,a.version)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"ip",code:M.invalid_string,message:a.message}),i.dirty()):a.kind==="jwt"?RN(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"jwt",code:M.invalid_string,message:a.message}),i.dirty()):a.kind==="cidr"?ON(e.data,a.version)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"cidr",code:M.invalid_string,message:a.message}),i.dirty()):a.kind==="base64"?wN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"base64",code:M.invalid_string,message:a.message}),i.dirty()):a.kind==="base64url"?CN.test(e.data)||(r=this._getOrReturnCtx(e,r),N(r,{validation:"base64url",code:M.invalid_string,message:a.message}),i.dirty()):oe.assertNever(a);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:M.invalid_string,...V.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.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,...V.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,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...V.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...V.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...V.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...V.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...V.errToObj(n)})}nonempty(e){return this.min(1,V.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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Hr.create=t=>new Hr({checks:[],typeName:G.ZodString,coerce:t?.coerce??!1,...te(t)});function MN(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,a=Number.parseInt(t.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return a%s/10**r}var ya=class t extends ne{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)!==B.number){let a=this._getOrReturnCtx(e);return N(a,{code:M.invalid_type,expected:B.number,received:a.parsedType}),q}let i,r=new vt;for(let a of this._def.checks)a.kind==="int"?oe.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:M.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:M.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:M.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?MN(e.data,a.value)!==0&&(i=this._getOrReturnCtx(e,i),N(i,{code:M.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:M.not_finite,message:a.message}),r.dirty()):oe.assertNever(a);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,V.toString(n))}gt(e,n){return this.setLimit("min",e,!1,V.toString(n))}lte(e,n){return this.setLimit("max",e,!0,V.toString(n))}lt(e,n){return this.setLimit("max",e,!1,V.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:V.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};ya.create=t=>new ya({checks:[],typeName:G.ZodNumber,coerce:t?.coerce||!1,...te(t)});var _a=class t extends ne{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)!==B.bigint)return this._getInvalidInput(e);let i,r=new vt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:M.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:M.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),N(i,{code:M.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):oe.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return N(n,{code:M.invalid_type,expected:B.bigint,received:n.parsedType}),q}gte(e,n){return this.setLimit("min",e,!0,V.toString(n))}gt(e,n){return this.setLimit("min",e,!1,V.toString(n))}lte(e,n){return this.setLimit("max",e,!0,V.toString(n))}lt(e,n){return this.setLimit("max",e,!1,V.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:V.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_a.create=t=>new _a({checks:[],typeName:G.ZodBigInt,coerce:t?.coerce??!1,...te(t)});var ba=class extends ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==B.boolean){let i=this._getOrReturnCtx(e);return N(i,{code:M.invalid_type,expected:B.boolean,received:i.parsedType}),q}return bt(e.data)}};ba.create=t=>new ba({typeName:G.ZodBoolean,coerce:t?.coerce||!1,...te(t)});var Sa=class t extends ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==B.date){let a=this._getOrReturnCtx(e);return N(a,{code:M.invalid_type,expected:B.date,received:a.parsedType}),q}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return N(a,{code:M.invalid_date}),q}let i=new vt,r;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),N(r,{code:M.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),N(r,{code:M.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):oe.assertNever(a);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Sa.create=t=>new Sa({checks:[],coerce:t?.coerce||!1,typeName:G.ZodDate,...te(t)});var ao=class extends ne{_parse(e){if(this._getType(e)!==B.symbol){let i=this._getOrReturnCtx(e);return N(i,{code:M.invalid_type,expected:B.symbol,received:i.parsedType}),q}return bt(e.data)}};ao.create=t=>new ao({typeName:G.ZodSymbol,...te(t)});var xa=class extends ne{_parse(e){if(this._getType(e)!==B.undefined){let i=this._getOrReturnCtx(e);return N(i,{code:M.invalid_type,expected:B.undefined,received:i.parsedType}),q}return bt(e.data)}};xa.create=t=>new xa({typeName:G.ZodUndefined,...te(t)});var Ea=class extends ne{_parse(e){if(this._getType(e)!==B.null){let i=this._getOrReturnCtx(e);return N(i,{code:M.invalid_type,expected:B.null,received:i.parsedType}),q}return bt(e.data)}};Ea.create=t=>new Ea({typeName:G.ZodNull,...te(t)});var Ur=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(e){return bt(e.data)}};Ur.create=t=>new Ur({typeName:G.ZodAny,...te(t)});var Li=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return bt(e.data)}};Li.create=t=>new Li({typeName:G.ZodUnknown,...te(t)});var On=class extends ne{_parse(e){let n=this._getOrReturnCtx(e);return N(n,{code:M.invalid_type,expected:B.never,received:n.parsedType}),q}};On.create=t=>new On({typeName:G.ZodNever,...te(t)});var so=class extends ne{_parse(e){if(this._getType(e)!==B.undefined){let i=this._getOrReturnCtx(e);return N(i,{code:M.invalid_type,expected:B.void,received:i.parsedType}),q}return bt(e.data)}};so.create=t=>new so({typeName:G.ZodVoid,...te(t)});var zi=class t extends ne{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==B.array)return N(n,{code:M.invalid_type,expected:B.array,received:n.parsedType}),q;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,o=n.data.length<r.exactLength.value;(s||o)&&(N(n,{code:s?M.too_big:M.too_small,minimum:o?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(N(n,{code:M.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(N(n,{code:M.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>r.type._parseAsync(new _n(n,s,n.path,o)))).then(s=>vt.mergeArray(i,s));let a=[...n.data].map((s,o)=>r.type._parseSync(new _n(n,s,n.path,o)));return vt.mergeArray(i,a)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:V.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:V.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:V.toString(n)}})}nonempty(e){return this.min(1,e)}};zi.create=(t,e)=>new zi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:G.ZodArray,...te(e)});function ro(t){if(t instanceof Vt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=yn.create(ro(i))}return new Vt({...t._def,shape:()=>e})}else return t instanceof zi?new zi({...t._def,type:ro(t.element)}):t instanceof yn?yn.create(ro(t.unwrap())):t instanceof Qn?Qn.create(ro(t.unwrap())):t instanceof Wn?Wn.create(t.items.map(e=>ro(e))):t}var Vt=class t extends ne{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(),n=oe.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==B.object){let c=this._getOrReturnCtx(e);return N(c,{code:M.invalid_type,expected:B.object,received:c.parsedType}),q}let{status:i,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof On&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||o.push(c);let l=[];for(let c of s){let u=a[c],f=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new _n(r,f,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof On){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")o.length>0&&(N(r,{code:M.unrecognized_keys,keys:o}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of o){let f=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new _n(r,f,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,g=await u.value;c.push({key:f,value:g,alwaysSet:u.alwaysSet})}return c}).then(c=>vt.mergeObjectSync(i,c)):vt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:V.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:G.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of oe.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of oe.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return ro(this)}partial(e){let n={};for(let i of oe.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of oe.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let a=this.shape[i];for(;a instanceof yn;)a=a._def.innerType;n[i]=a}return new t({...this._def,shape:()=>n})}keyof(){return Yw(oe.objectKeys(this.shape))}};Vt.create=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strip",catchall:On.create(),typeName:G.ZodObject,...te(e)});Vt.strictCreate=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strict",catchall:On.create(),typeName:G.ZodObject,...te(e)});Vt.lazycreate=(t,e)=>new Vt({shape:t,unknownKeys:"strip",catchall:On.create(),typeName:G.ZodObject,...te(e)});var wa=class extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new $t(o.ctx.common.issues));return N(n,{code:M.invalid_union,unionErrors:s}),q}if(n.common.async)return Promise.all(i.map(async a=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let a,s=[];for(let l of i){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(l=>new $t(l));return N(n,{code:M.invalid_union,unionErrors:o}),q}}get options(){return this._def.options}};wa.create=(t,e)=>new wa({options:t,typeName:G.ZodUnion,...te(e)});var Di=t=>t instanceof Aa?Di(t.schema):t instanceof bn?Di(t.innerType()):t instanceof ka?[t.value]:t instanceof Ta?t.options:t instanceof Ra?oe.objectValues(t.enum):t instanceof Oa?Di(t._def.innerType):t instanceof xa?[void 0]:t instanceof Ea?[null]:t instanceof yn?[void 0,...Di(t.unwrap())]:t instanceof Qn?[null,...Di(t.unwrap())]:t instanceof sc||t instanceof Na?Di(t.unwrap()):t instanceof Ma?Di(t._def.innerType):[],nf=class t extends ne{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==B.object)return N(n,{code:M.invalid_type,expected:B.object,received:n.parsedType}),q;let i=this.discriminator,r=n.data[i],a=this.optionsMap.get(r);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(N(n,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let a of n){let s=Di(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,a)}}return new t({typeName:G.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...te(i)})}};function jv(t,e){let n=Xn(t),i=Xn(e);if(t===e)return{valid:!0,data:t};if(n===B.object&&i===B.object){let r=oe.objectKeys(e),a=oe.objectKeys(t).filter(o=>r.indexOf(o)!==-1),s={...t,...e};for(let o of a){let l=jv(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===B.array&&i===B.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let a=0;a<t.length;a++){let s=t[a],o=e[a],l=jv(s,o);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===B.date&&i===B.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ca=class extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(a,s)=>{if(ef(a)||ef(s))return q;let o=jv(a.value,s.value);return o.valid?((tf(a)||tf(s))&&n.dirty(),{status:n.value,value:o.data}):(N(i,{code:M.invalid_intersection_types}),q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([a,s])=>r(a,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Ca.create=(t,e,n)=>new Ca({left:t,right:e,typeName:G.ZodIntersection,...te(n)});var Wn=class t extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==B.array)return N(i,{code:M.invalid_type,expected:B.array,received:i.parsedType}),q;if(i.data.length<this._def.items.length)return N(i,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&i.data.length>this._def.items.length&&(N(i,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...i.data].map((s,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new _n(i,s,i.path,o)):null}).filter(s=>!!s);return i.common.async?Promise.all(a).then(s=>vt.mergeArray(n,s)):vt.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Wn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wn({items:t,typeName:G.ZodTuple,rest:null,...te(e)})};var rf=class t extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==B.object)return N(i,{code:M.invalid_type,expected:B.object,received:i.parsedType}),q;let r=[],a=this._def.keyType,s=this._def.valueType;for(let o in i.data)r.push({key:a._parse(new _n(i,o,i.path,o)),value:s._parse(new _n(i,i.data[o],i.path,o)),alwaysSet:o in i.data});return i.common.async?vt.mergeObjectAsync(n,r):vt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ne?new t({keyType:e,valueType:n,typeName:G.ZodRecord,...te(i)}):new t({keyType:Hr.create(),valueType:e,typeName:G.ZodRecord,...te(n)})}},oo=class extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==B.map)return N(i,{code:M.invalid_type,expected:B.map,received:i.parsedType}),q;let r=this._def.keyType,a=this._def.valueType,s=[...i.data.entries()].map(([o,l],c)=>({key:r._parse(new _n(i,o,i.path,[c,"key"])),value:a._parse(new _n(i,l,i.path,[c,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{let o=new Map;for(let l of s){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return q;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}};oo.create=(t,e,n)=>new oo({valueType:e,keyType:t,typeName:G.ZodMap,...te(n)});var lo=class t extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==B.set)return N(i,{code:M.invalid_type,expected:B.set,received:i.parsedType}),q;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(N(i,{code:M.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(N(i,{code:M.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let a=this._def.valueType;function s(l){let c=new Set;for(let u of l){if(u.status==="aborted")return q;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let o=[...i.data.values()].map((l,c)=>a._parse(new _n(i,l,i.path,c)));return i.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new t({...this._def,minSize:{value:e,message:V.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:V.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};lo.create=(t,e)=>new lo({valueType:t,minSize:null,maxSize:null,typeName:G.ZodSet,...te(e)});var af=class t extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==B.function)return N(n,{code:M.invalid_type,expected:B.function,received:n.parsedType}),q;function i(o,l){return ac({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,no(),Ni].filter(c=>!!c),issueData:{code:M.invalid_arguments,argumentsError:l}})}function r(o,l){return ac({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,no(),Ni].filter(c=>!!c),issueData:{code:M.invalid_return_type,returnTypeError:l}})}let a={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof $r){let o=this;return bt(async function(...l){let c=new $t([]),u=await o._def.args.parseAsync(l,a).catch(p=>{throw c.addIssue(i(l,p)),c}),f=await Reflect.apply(s,this,u);return await o._def.returns._def.type.parseAsync(f,a).catch(p=>{throw c.addIssue(r(f,p)),c})})}else{let o=this;return bt(function(...l){let c=o._def.args.safeParse(l,a);if(!c.success)throw new $t([i(l,c.error)]);let u=Reflect.apply(s,this,c.data),f=o._def.returns.safeParse(u,a);if(!f.success)throw new $t([r(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Wn.create(e).rest(Li.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,n,i){return new t({args:e||Wn.create([]).rest(Li.create()),returns:n||Li.create(),typeName:G.ZodFunction,...te(i)})}},Aa=class extends ne{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Aa.create=(t,e)=>new Aa({getter:t,typeName:G.ZodLazy,...te(e)});var ka=class extends ne{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return N(n,{received:n.data,code:M.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}};ka.create=(t,e)=>new ka({value:t,typeName:G.ZodLiteral,...te(e)});function Yw(t,e){return new Ta({values:t,typeName:G.ZodEnum,...te(e)})}var Ta=class t extends ne{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return N(n,{expected:oe.joinValues(i),received:n.parsedType,code:M.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return N(n,{received:n.data,code:M.invalid_enum_value,options:i}),q}return bt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Ta.create=Yw;var Ra=class extends ne{_parse(e){let n=oe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==B.string&&i.parsedType!==B.number){let r=oe.objectValues(n);return N(i,{expected:oe.joinValues(r),received:i.parsedType,code:M.invalid_type}),q}if(this._cache||(this._cache=new Set(oe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=oe.objectValues(n);return N(i,{received:i.data,code:M.invalid_enum_value,options:r}),q}return bt(e.data)}get enum(){return this._def.values}};Ra.create=(t,e)=>new Ra({values:t,typeName:G.ZodNativeEnum,...te(e)});var $r=class extends ne{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==B.promise&&n.common.async===!1)return N(n,{code:M.invalid_type,expected:B.promise,received:n.parsedType}),q;let i=n.parsedType===B.promise?n.data:Promise.resolve(n.data);return bt(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};$r.create=(t,e)=>new $r({type:t,typeName:G.ZodPromise,...te(e)});var bn=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===G.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:s=>{N(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){let s=r.transform(i.data,a);if(i.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return q;let l=await this._def.schema._parseAsync({data:o,path:i.path,parent:i});return l.status==="aborted"?q:l.status==="dirty"?va(l.value):n.value==="dirty"?va(l.value):l});{if(n.value==="aborted")return q;let o=this._def.schema._parseSync({data:s,path:i.path,parent:i});return o.status==="aborted"?q:o.status==="dirty"?va(o.value):n.value==="dirty"?va(o.value):o}}if(r.type==="refinement"){let s=o=>{let l=r.refinement(o,a);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?q:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?q:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Br(s))return q;let o=r.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>Br(s)?Promise.resolve(r.transform(s.value,a)).then(o=>({status:n.value,value:o})):q);oe.assertNever(r)}};bn.create=(t,e,n)=>new bn({schema:t,typeName:G.ZodEffects,effect:e,...te(n)});bn.createWithPreprocess=(t,e,n)=>new bn({schema:e,effect:{type:"preprocess",transform:t},typeName:G.ZodEffects,...te(n)});var yn=class extends ne{_parse(e){return this._getType(e)===B.undefined?bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yn.create=(t,e)=>new yn({innerType:t,typeName:G.ZodOptional,...te(e)});var Qn=class extends ne{_parse(e){return this._getType(e)===B.null?bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Qn.create=(t,e)=>new Qn({innerType:t,typeName:G.ZodNullable,...te(e)});var Oa=class extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===B.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Oa.create=(t,e)=>new Oa({innerType:t,typeName:G.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...te(e)});var Ma=class extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return io(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new $t(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new $t(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ma.create=(t,e)=>new Ma({innerType:t,typeName:G.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...te(e)});var co=class extends ne{_parse(e){if(this._getType(e)!==B.nan){let i=this._getOrReturnCtx(e);return N(i,{code:M.invalid_type,expected:B.nan,received:i.parsedType}),q}return{status:"valid",value:e.data}}};co.create=t=>new co({typeName:G.ZodNaN,...te(t)});var NN=Symbol("zod_brand"),sc=class extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},oc=class t extends ne{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?q:a.status==="dirty"?(n.dirty(),va(a.value)):this._def.out._parseAsync({data:a.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?q:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:G.ZodPipeline})}},Na=class extends ne{_parse(e){let n=this._def.innerType._parse(e),i=r=>(Br(r)&&(r.value=Object.freeze(r.value)),r);return io(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Na.create=(t,e)=>new Na({innerType:t,typeName:G.ZodReadonly,...te(e)});function jw(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Zw(t,e={},n){return t?Ur.create().superRefine((i,r)=>{let a=t(i);if(a instanceof Promise)return a.then(s=>{if(!s){let o=jw(e,i),l=o.fatal??n??!0;r.addIssue({code:"custom",...o,fatal:l})}});if(!a){let s=jw(e,i),o=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:o})}}):Ur.create()}var DN={object:Vt.lazycreate},G;(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"})(G||(G={}));var LN=(t,e={message:`Input not instance of ${t.name}`})=>Zw(n=>n instanceof t,e),Kw=Hr.create,Xw=ya.create,zN=co.create,BN=_a.create,Ww=ba.create,HN=Sa.create,UN=ao.create,$N=xa.create,VN=Ea.create,IN=Ur.create,FN=Li.create,jN=On.create,qN=so.create,PN=zi.create,GN=Vt.create,YN=Vt.strictCreate,ZN=wa.create,KN=nf.create,XN=Ca.create,WN=Wn.create,QN=rf.create,JN=oo.create,eD=lo.create,tD=af.create,nD=Aa.create,iD=ka.create,rD=Ta.create,aD=Ra.create,sD=$r.create,oD=bn.create,lD=yn.create,cD=Qn.create,uD=bn.createWithPreprocess,dD=oc.create,fD=()=>Kw().optional(),pD=()=>Xw().optional(),hD=()=>Ww().optional(),gD={string:(t=>Hr.create({...t,coerce:!0})),number:(t=>ya.create({...t,coerce:!0})),boolean:(t=>ba.create({...t,coerce:!0})),bigint:(t=>_a.create({...t,coerce:!0})),date:(t=>Sa.create({...t,coerce:!0}))};var mD=q;var Qw=x.union([x.object({type:x.literal("data"),key:x.string(),value:x.string().optional()}),x.object({type:x.literal("css"),value:x.string()}),x.object({type:x.literal("aria"),role:x.string().optional(),label:x.string().optional()}),x.object({type:x.literal("shadow-css"),value:x.string()}),x.object({type:x.literal("ref"),el:x.any()})]),vD=x.object({kind:x.literal("tooltip"),id:x.string(),anchor:Qw,content:x.object({title:x.string().optional(),body:x.string()}),placement:x.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:x.number().optional(),blocking:x.boolean().optional(),trigger:x.enum(["immediate","hover","click"]).optional(),dismiss:x.object({onEsc:x.boolean().optional(),closeButton:x.boolean().optional(),timeoutMs:x.number().optional()}).optional()}),yD=x.object({kind:x.literal("highlight"),id:x.string(),anchor:Qw,copy:x.string().optional(),ring:x.object({paddingPx:x.number().optional(),radiusPx:x.number().optional()}).optional(),scrim:x.object({opacity:x.number().optional()}).optional(),ringColor:x.string().optional(),blocking:x.boolean().optional(),dismiss:x.object({onClickOutside:x.boolean().optional(),onEsc:x.boolean().optional(),timeoutMs:x.number().optional()}).optional()}),qv=x.object({id:x.string(),version:x.number(),routes:x.array(x.string()).optional(),steps:x.array(x.union([vD,yD]))});function Qz(t){return qv.parse(t)}var n6=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:i="include"}={})=>async()=>{let r=rg({configUri:t,experiments:e,featureKey:n});if(!r)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let a=await fetch(r,{credentials:i});if(!a.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${a.status})`);let s=await a.json();return qv.parse(s)};var Jw="syntro_session_metrics",sf=class{constructor(e={}){F(this,"metrics",new Map);F(this,"experiments");F(this,"attributePrefix");F(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let r=(this.metrics.get(e)??0)+n;return this.metrics.set(e,r),this.saveToStorage(),this.updateExperimentAttributes(e,r),this.onMetricChange?.(e,r),r}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}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 n={};for(let i of e)n[`${this.attributePrefix}${i}`]=0,this.onMetricChange?.(i,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let i=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[i]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,i]of this.metrics)e[`${this.attributePrefix}${n}`]=i;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(Jw);if(e){let n=JSON.parse(e);for(let[i,r]of Object.entries(n))this.metrics.set(i,r.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,i]of this.metrics)e[n]={count:i,lastUpdated:Date.now()};sessionStorage.setItem(Jw,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Pv(t={}){return new sf(t)}var _D=x.object({url:x.string(),routeId:x.string().optional(),title:x.string().optional(),locale:x.string().optional()}),bD=x.object({url:x.string(),ts:x.number()}),SD=x.object({sessionId:x.string(),startTs:x.number(),pageHistory:x.array(bD).optional()}),xD=x.object({width:x.number(),height:x.number()}),ED=x.object({x:x.number(),y:x.number(),w:x.number(),h:x.number()}),wD=x.object({anchorId:x.string(),present:x.boolean(),visible:x.boolean().optional(),boundingBox:ED.optional()}),CD=x.record(x.string(),x.union([x.number(),x.string(),x.boolean(),x.undefined()])),AD=x.object({page:_D,session:SD,viewport:xD,anchors:x.array(wD).optional(),augmented:CD.optional()});function c6(t){return AD.safeParse(t)}function kD(){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 Gv(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let i of e.exclude)if(eC(n,i))return}if(e.include){for(let i of e.include)if(eC(n,i))return i;return}return n}function eC(t,e){let n=t.replace(/\/$/,"")||"/",i=e.replace(/\/$/,"")||"/";if(n===i)return!0;let r=i.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${r}$`).test(n)}var of=class{constructor(e={}){F(this,"context");F(this,"previousContext");F(this,"listeners",new Set);F(this,"telemetry");F(this,"routes");F(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.context=kD(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Gv(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 n=Gv(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}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,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n));let i=()=>{this.updatePage()};window.addEventListener("popstate",i),this.cleanupFns.push(()=>window.removeEventListener("popstate",i));let r=history.pushState.bind(history),a=history.replaceState.bind(history);history.pushState=(...s)=>{r(...s),queueMicrotask(()=>this.updatePage())},history.replaceState=(...s)=>{a(...s),queueMicrotask(()=>this.updatePage())},this.cleanupFns.push(()=>{history.pushState=r,history.replaceState=a})}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:n}=document,i=Gv(e,this.routes),r={url:e,title:n,routeId:i};(r.url!==this.context.page.url||r.title!==this.context.page.title||r.routeId!==this.context.page.routeId)&&(r.url!==this.context.page.url&&this.addPageToHistory(r.url),this.updateContext({page:r}))}addPageToHistory(e){let n={url:e,ts:Date.now()},i=[...this.context.session.pageHistory||[],n];i.length>50&&i.shift(),this.context.session.pageHistory=i}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(n){console.error("[ContextManager] Listener error:",n)}}};function Yv(t={}){return new of(t)}var tC=x.enum(["posthog","canvas","derived"]),TD=x.object({ts:x.number(),name:x.string(),source:tC,props:x.record(x.string(),x.unknown()).optional(),schemaVersion:x.string()}),RD=x.object({names:x.array(x.string()).optional(),patterns:x.array(x.string()).optional(),sources:x.array(tC).optional()});function y6(t){return TD.safeParse(t)}function _6(t){return RD.safeParse(t)}function Zv(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(i=>{try{return new RegExp(i).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var lf=class{constructor(e={}){F(this,"subscriptions",new Set);F(this,"history",[]);F(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let i,r;typeof e=="function"?(i=void 0,r=e):(i=e,r=n);let a={filter:i,callback:r};return this.subscriptions.add(a),()=>{this.subscriptions.delete(a)}}publish(e,n,i="canvas"){let r={ts:Date.now(),name:e,source:i,props:n,schemaVersion:ls};this.publishEvent(r)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(Zv(e,n.filter))try{n.callback(e)}catch(i){console.error("[EventBus] Subscriber error:",i)}}getRecent(e,n){let i=this.history;return e&&(i=i.filter(r=>Zv(r,e))),n&&n>0&&(i=i.slice(-n)),i}hasRecentEvent(e,n,i){let r=Date.now()-n;return this.history.some(a=>a.name===e&&a.ts>=r&&(i===void 0||a.source===i))}countRecentEvents(e,n){let i=this.history.filter(r=>Zv(r,e));if(n!==void 0){let r=Date.now()-n;i=i.filter(a=>a.ts>=r)}return i.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function lc(t={}){return new lf(t)}var nC={$autocapture:"ui.click",$click:Ve.UI_CLICK,$scroll:Ve.UI_SCROLL,$input:Ve.UI_INPUT,$change:Ve.UI_CHANGE,$submit:Ve.UI_SUBMIT,$pageview:Ve.NAV_PAGE_VIEW,$pageleave:Ve.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function OD(t){let e=t.event;if(typeof e!="string")return"posthog.unknown";if(nC[e])return nC[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,i=t.properties?.$event_type;return i==="submit"?Ve.UI_SUBMIT:i==="change"?Ve.UI_CHANGE:n==="input"||n==="textarea"?Ve.UI_INPUT:Ve.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function MD(t){let e={},n=t.properties||{};return n.$tag_name&&(e.tagName=n.$tag_name),n.$el_text&&(e.elementText=n.$el_text),n.$elements&&(e.elements=n.$elements),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function iC(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:OD(t),source:"posthog",props:MD(t),schemaVersion:ls}}function rC(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 Kv(t){return(e,n)=>{if(typeof e!="string")return;let i={event:e,properties:n,timestamp:Date.now()};if(rC(i)){let r=iC(i);t(r)}}}var ND=x.object({value:x.unknown(),expiresAt:x.number().optional()}),DD=x.object({count:x.number(),resetAt:x.number().optional()});function D6(t){return ND.safeParse(t)}function L6(t){return DD.safeParse(t)}var Xv="cooldown:";function aC(t){return{set(e,n){let i=Xv+e,r=Date.now()+n;t.set(i,r)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Xv+e,i=t.get(n);if(i===void 0)return 0;let r=i-Date.now();return r<=0?(t.remove(n),0):r},clear(e){let n=Xv+e;t.remove(n)}}}var cc="dismissed:";function sC(t,e){return{mark(n,i=!1){let r=cc+n;(i?e:t).set(r,!0)},isDismissed(n){let i=cc+n;return t.has(i)||e.has(i)},clear(n){let i=cc+n;t.remove(i),e.remove(i)},clearAll(){for(let n of t.keys())n.startsWith(cc)&&t.remove(n);for(let n of e.keys())n.startsWith(cc)&&e.remove(n)}}}var Wv="freq:";function oC(t){function e(n){let i=Wv+n,r=t.get(i);if(r){if(r.resetAt&&Date.now()>=r.resetAt){t.remove(i);return}return r}}return{increment(n,i){let r=Wv+n,a=e(n),s=(a?.count??0)+1,o={count:s,resetAt:a?.resetAt??(i?Date.now()+i:void 0)};return t.set(r,o),s},count(n){return e(n)?.count??0},reset(n){let i=Wv+n;t.remove(i)},hasReachedLimit(n,i){return this.count(n)>=i}}}var LD="syntro";function Qv(t,e){let n=`${e}:`;return{get(i){if(t)try{let r=t.getItem(n+i);if(!r)return;let a=JSON.parse(r);if(a.expiresAt&&Date.now()>=a.expiresAt){t.removeItem(n+i);return}return a.value}catch{return}},set(i,r,a){if(t)try{let s={value:r,expiresAt:a?Date.now()+a:void 0};t.setItem(n+i,JSON.stringify(s))}catch(s){console.warn("[StateStore] Failed to save:",s)}},remove(i){t&&t.removeItem(n+i)},has(i){return t?this.get(i)!==void 0:!1},keys(){if(!t)return[];let i=[];for(let r=0;r<t.length;r++){let a=t.key(r);a?.startsWith(n)&&i.push(a.slice(n.length))}return i},clear(){if(!t)return;let i=this.keys();for(let r of i)t.removeItem(n+r)}}}function Jv(t){let e=new Map,n=`${t}:`;return{get(i){let r=e.get(n+i);if(r){if(r.expiresAt&&Date.now()>=r.expiresAt){e.delete(n+i);return}return r.value}},set(i,r,a){e.set(n+i,{value:r,expiresAt:a?Date.now()+a:void 0})},remove(i){e.delete(n+i)},has(i){return this.get(i)!==void 0},keys(){let i=[];for(let r of e.keys())r.startsWith(n)&&i.push(r.slice(n.length));return i},clear(){for(let i of e.keys())i.startsWith(n)&&e.delete(i)}}}var cf=class{constructor(e={}){F(this,"session");F(this,"user");F(this,"dismissals");F(this,"cooldowns");F(this,"frequency");F(this,"namespace");F(this,"namespacedStorages",new Map);this.namespace=e.namespace??LD,typeof window<"u"?(this.session=Qv(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Qv(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Jv(this.namespace),this.user=Jv(this.namespace)),this.dismissals=sC(this.session,this.user),this.cooldowns=aC(this.user),this.frequency=oC(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let i=typeof window<"u"&&typeof sessionStorage<"u"?Qv(sessionStorage,n):Jv(n);this.namespacedStorages.set(n,i)}return this.namespacedStorages.get(n)}};function ey(t={}){return new cf(t)}var zD=x.object({type:x.literal("page_url"),url:x.string()}),BD=x.object({type:x.literal("route"),routeId:x.string()}),HD=x.object({type:x.literal("anchor_visible"),anchorId:x.string(),state:x.enum(["visible","present","absent"])}),UD=x.object({type:x.literal("event_occurred"),eventName:x.string(),withinMs:x.number().optional()}),$D=x.object({type:x.literal("state_equals"),key:x.string(),value:x.unknown()}),VD=x.object({type:x.literal("viewport"),minWidth:x.number().optional(),maxWidth:x.number().optional(),minHeight:x.number().optional(),maxHeight:x.number().optional()}),ID=x.object({type:x.literal("session_metric"),key:x.string(),operator:x.enum(["gte","lte","eq","gt","lt"]),threshold:x.number()}),FD=x.object({type:x.literal("dismissed"),key:x.string(),inverted:x.boolean().optional()}),jD=x.object({type:x.literal("cooldown_active"),key:x.string(),inverted:x.boolean().optional()}),qD=x.object({type:x.literal("frequency_limit"),key:x.string(),limit:x.number(),inverted:x.boolean().optional()}),lC=x.discriminatedUnion("type",[zD,BD,HD,UD,$D,VD,ID,FD,jD,qD]),PD=x.object({conditions:x.array(lC),value:x.unknown()}),GD=x.object({type:x.literal("rules"),rules:x.array(PD),default:x.unknown()}),YD=x.object({type:x.literal("score"),field:x.string(),threshold:x.number(),above:x.unknown(),below:x.unknown()}),ZD=x.object({type:x.literal("model"),modelId:x.string(),inputs:x.array(x.string()),outputMapping:x.record(x.string(),x.unknown()),default:x.unknown()}),KD=x.object({type:x.literal("external"),endpoint:x.string(),method:x.enum(["GET","POST"]).optional(),default:x.unknown(),timeoutMs:x.number().optional()}),cC=x.discriminatedUnion("type",[GD,YD,ZD,KD]),XD=x.object({include:x.array(x.string()).optional(),exclude:x.array(x.string()).optional()}),WD=x.object({routes:XD.optional(),strategy:cC.optional()});function K6(t){return lC.safeParse(t)}function X6(t){return cC.safeParse(t)}function W6(t){return WD.safeParse(t)}function uC(t,e){let{context:n,state:i,events:r}=e;switch(t.type){case"page_url":{let{url:a}=t,s=n.page.url,o=a.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${o}$`).test(s)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let a=n.anchors?.find(s=>s.anchorId===t.anchorId);switch(t.state){case"visible":return a?.visible===!0;case"present":return a?.present===!0;case"absent":return!a?.present;default:return!1}}case"event_occurred":{if(!r)return!1;let a=t.withinMs??6e4;return r.hasRecentEvent(t.eventName,a)}case"state_equals":return!1;case"viewport":{let{width:a,height:s}=n.viewport;return!(t.minWidth!==void 0&&a<t.minWidth||t.maxWidth!==void 0&&a>t.maxWidth||t.minHeight!==void 0&&s<t.minHeight||t.maxHeight!==void 0&&s>t.maxHeight)}case"session_metric":{if(!i)return!1;let a=i.getSessionMetric(t.key),{operator:s,threshold:o}=t;switch(s){case"gte":return a>=o;case"lte":return a<=o;case"eq":return a===o;case"gt":return a>o;case"lt":return a<o;default:return!1}}case"dismissed":{if(!i)return t.inverted??!1;let a=i.isDismissed(t.key);return t.inverted?!a:a}case"cooldown_active":{if(!i)return t.inverted??!1;let a=i.isCooldownActive(t.key);return t.inverted?!a:a}case"frequency_limit":{if(!i)return t.inverted??!1;let s=i.getFrequencyCount(t.key)>=t.limit;return t.inverted?!s:s}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function dC(t,e){let n=[];for(let i of t.conditions){let r=uC(i,e);if(n.push({condition:i,result:r}),!r)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function uf(t,e){for(let n=0;n<t.rules.length;n++){let i=t.rules[n],{matched:r,conditionResults:a}=dC(i,e);if(r)return{value:i.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:a}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function df(t,e){let{context:n}=e,i=n.augmented?.[t.field];return i===void 0||typeof i!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:i>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function fC(t,e){let{state:n,events:i,sessionMetrics:r}=e;return{context:t,state:n?{isDismissed:a=>n.dismissals.isDismissed(a),isCooldownActive:a=>n.cooldowns.isActive(a),getFrequencyCount:a=>n.frequency.count(a),getSessionMetric:a=>r?.get(a)??0}:void 0,events:i?{hasRecentEvent:(a,s)=>i.hasRecentEvent(a,s)}:void 0}}async function pC(t,e,n={}){let i=fC(e,n);switch(t.type){case"rules":return uf(t,i);case"score":return df(t,i);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 hC(t,e,n={}){let i=fC(e,n);switch(t.type){case"rules":return uf(t,i);case"score":return df(t,i);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 ty(t){return{evaluate:(e,n)=>pC(e,n,t),evaluateSync:(e,n)=>hC(e,n,t)}}var QD=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function ny(t){if(typeof window.Sanitizer=="function")try{let o=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(o),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),a=[];for(;r.nextNode();){let s=r.currentNode,o=s.tagName.toLowerCase();if(!QD.has(o)){a.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),g=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||g)&&s.removeAttribute(l.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}var gC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=ny(t.html),r=document.createElement("div");r.setAttribute("data-syntro-action-id",e.generateId()),r.innerHTML=i;let a=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",r);break;case"after":n.insertAdjacentElement("afterend",r);break;case"prepend":n.insertBefore(r,n.firstChild);break;case"append":n.appendChild(r);break;case"replace":a=n.innerHTML,n.replaceWith(r);break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position}),{cleanup:()=>{if(t.position==="replace"&&a!==null){let s=document.createElement(n.tagName);s.innerHTML=a,Array.from(n.attributes).forEach(o=>{s.setAttribute(o.name,o.value)}),r.replaceWith(s)}else r.remove()},updateFn:s=>{"html"in s&&typeof s.html=="string"&&(r.innerHTML=ny(s.html))}}},mC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=i},updateFn:r=>{"text"in r&&typeof r.text=="string"&&(n.textContent=r.text)}}},vC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);if(["onclick","onerror","onload","onmouseover","onfocus","onblur"].includes(t.attr.toLowerCase())||t.attr.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);let r=n.getAttribute(t.attr),a=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{a&&r!==null?n.setAttribute(t.attr,r):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},yC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i||n.classList.remove(t.className)}}},_C=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{i&&n.classList.add(t.className)}}},bC=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=new Map;for(let r of Object.keys(t.styles)){let a=n.style.getPropertyValue(r);i.set(r,a)}for(let[r,a]of Object.entries(t.styles))n.style.setProperty(r,a);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[r,a]of i)a?n.style.setProperty(r,a):n.style.removeProperty(r)},updateFn:r=>{if("styles"in r&&typeof r.styles=="object"&&r.styles)for(let[a,s]of Object.entries(r.styles))n.style.setProperty(a,s)}}},iy=[{kind:"content:insertHtml",executor:gC},{kind:"content:setText",executor:mC},{kind:"content:setAttr",executor:vC},{kind:"content:addClass",executor:yC},{kind:"content:removeClass",executor:_C},{kind:"content:setStyle",executor:bC}],JD={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:iy};var SC=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function xC(t,e,n){let i=n?.paddingPx??12,r=n?.radiusPx??12,a=Math.min(Math.max(n?.scrimOpacity??.55,0),1),s=n?.ringColor??"var(--syntro-ring, #5b8cff)",o=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),f=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),g=u.getPropertyValue("--syntro-ring").trim(),p=document.createElement("div");p.className="syntro-spotlight-scrim";let y=o||l;Object.assign(p.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:y?"auto":"none",background:f||`rgba(2, 6, 23, ${a})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(p),requestAnimationFrame(()=>p.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${r}px`,border:`2px solid ${s||g||"#5b8cff"}`,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(_);let b=[];if(!SC)for(let O=0;O<4;O++){let T=document.createElement("div");T.style.position="fixed",T.style.background="inherit",b.push(T),p.appendChild(T)}let d=O=>{p.style.clipPath=O,p.style.webkitClipPath=O},h=()=>{let O=t.getBoundingClientRect(),T=Math.max(0,O.left-i),I=Math.max(0,O.top-i),Y=Math.min(window.innerWidth,O.width+i*2),Q=Math.min(window.innerHeight,O.height+i*2);if(Object.assign(_.style,{left:`${T}px`,top:`${I}px`,width:`${Y}px`,height:`${Q}px`}),SC){let P=window.innerWidth,ge=window.innerHeight,U=Math.min(r,Y/2,Q/2),J=`M 0 0 L ${P} 0 L ${P} ${ge} L 0 ${ge} Z`,$=`M ${T+U} ${I} A ${U} ${U} 0 0 0 ${T} ${I+U} L ${T} ${I+Q-U} A ${U} ${U} 0 0 0 ${T+U} ${I+Q} L ${T+Y-U} ${I+Q} A ${U} ${U} 0 0 0 ${T+Y} ${I+Q-U} L ${T+Y} ${I+U} A ${U} ${U} 0 0 0 ${T+Y-U} ${I} L ${T+U} ${I} Z`;d(`path('${J} ${$}')`)}else{let[P,ge,U,J]=b;Object.assign(P.style,{left:"0px",top:"0px",width:"100vw",height:`${I}px`}),Object.assign(U.style,{left:"0px",top:`${I+Q}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(I+Q))}px`}),Object.assign(J.style,{left:"0px",top:`${I}px`,width:`${T}px`,height:`${Q}px`}),Object.assign(ge.style,{left:`${T+Y}px`,top:`${I}px`,width:`${Math.max(0,window.innerWidth-(T+Y))}px`,height:`${Q}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(h));m.observe(t);let v=()=>requestAnimationFrame(h),S=()=>requestAnimationFrame(h);window.addEventListener("scroll",v,!0),window.addEventListener("resize",S);let w=O=>{O.key==="Escape"&&c&&C.destroy()};c&&window.addEventListener("keydown",w);let E=O=>{o?(O.preventDefault(),O.stopPropagation()):l&&C.destroy()};p.addEventListener("click",E);let C={destroy(){m.disconnect(),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",S),c&&window.removeEventListener("keydown",w),p.removeEventListener("click",E),p.style.opacity="0",setTimeout(()=>{p.remove(),_.remove()},220)}};return h(),C}var e3=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function nn(t){if(typeof window.Sanitizer=="function")try{let o=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(o),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),a=[];for(;r.nextNode();){let s=r.currentNode,o=s.tagName.toLowerCase();if(!e3.has(o)){a.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),g=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||g)&&s.removeAttribute(l.name)}}for(let s of a){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}var ry=async(t,e)=>{let{content:n,size:i="md",blocking:r=!1,scrim:a,dismiss:s,ctaButtons:o}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
54
55
|
position: fixed;
|
|
55
56
|
inset: 0;
|
|
56
|
-
background: rgba(0, 0, 0, ${
|
|
57
|
+
background: rgba(0, 0, 0, ${a?.opacity??.6});
|
|
57
58
|
z-index: 2147483645;
|
|
58
59
|
opacity: 0;
|
|
59
60
|
transition: opacity 200ms ease-out;
|
|
60
|
-
`,e.overlayRoot.appendChild(l);let
|
|
61
|
+
`,e.overlayRoot.appendChild(l);let c=document.createElement("div");c.className=`syntro-modal syntro-modal-${i}`,c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true");let u={sm:"360px",md:"480px",lg:"640px"};c.style.cssText=`
|
|
61
62
|
position: fixed;
|
|
62
63
|
top: 50%;
|
|
63
64
|
left: 50%;
|
|
64
65
|
transform: translate(-50%, -50%) scale(0.95);
|
|
65
|
-
max-width: ${
|
|
66
|
+
max-width: ${u[i]};
|
|
66
67
|
width: 90%;
|
|
67
68
|
background: white;
|
|
68
69
|
border-radius: 12px;
|
|
@@ -71,7 +72,7 @@ Error generating stack: `+o.message+`
|
|
|
71
72
|
opacity: 0;
|
|
72
73
|
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
|
73
74
|
padding: 24px;
|
|
74
|
-
`;let f="";if(n.title&&(f+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #111827;">${
|
|
75
|
+
`;let f="";if(n.title&&(f+=`<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #111827;">${nn(n.title)}</h2>`),f+=`<div class="syntro-modal-body" style="color: #4b5563; line-height: 1.5;">${nn(n.body)}</div>`,s?.closeButton!==!1&&(f+=`
|
|
75
76
|
<button class="syntro-modal-close" data-syntro-action="dismiss" style="
|
|
76
77
|
position: absolute;
|
|
77
78
|
top: 16px;
|
|
@@ -86,10 +87,10 @@ Error generating stack: `+o.message+`
|
|
|
86
87
|
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
87
88
|
</svg>
|
|
88
89
|
</button>
|
|
89
|
-
`),
|
|
90
|
+
`),o&&o.length>0){f+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let S of o){let w=S.primary??!1;f+=`
|
|
90
91
|
<button
|
|
91
|
-
class="syntro-modal-btn ${
|
|
92
|
-
data-syntro-action="${
|
|
92
|
+
class="syntro-modal-btn ${w?"syntro-modal-btn-primary":""}"
|
|
93
|
+
data-syntro-action="${nn(S.actionId)}"
|
|
93
94
|
style="
|
|
94
95
|
padding: 10px 20px;
|
|
95
96
|
border-radius: 8px;
|
|
@@ -97,12 +98,12 @@ Error generating stack: `+o.message+`
|
|
|
97
98
|
font-weight: 500;
|
|
98
99
|
cursor: pointer;
|
|
99
100
|
transition: background 150ms ease;
|
|
100
|
-
${
|
|
101
|
+
${w?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
|
|
101
102
|
"
|
|
102
103
|
>
|
|
103
|
-
${
|
|
104
|
+
${nn(S.label)}
|
|
104
105
|
</button>
|
|
105
|
-
`}f+="</div>"}u.innerHTML=f,e.overlayRoot.appendChild(u);let h=null,g=u.querySelectorAll("[data-syntro-action]"),v=w=>{let k=w.currentTarget.getAttribute("data-syntro-action");k&&(h=k,e.publishEvent("action.modal_cta_clicked",{actionId:k}),k==="dismiss"&&y.destroy())};g.forEach(w=>w.addEventListener("click",v));let _=w=>{w.key==="Escape"&&s?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let x=()=>{i||y.destroy()};l.addEventListener("click",x);let d=[];i&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&(w.setAttribute("inert",""),d.push(w))});let p;s?.timeoutMs&&(p=setTimeout(()=>{y.destroy()},s.timeoutMs));let m=u.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m.length>0&&requestAnimationFrame(()=>m[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:i});let y={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",_),l.removeEventListener("click",x),g.forEach(w=>w.removeEventListener("click",v)),d.forEach(w=>w.removeAttribute("inert")),u.style.opacity="0",u.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{u.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var Wb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=fb(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:!1,onClickOutside:!1,onEsc:!1});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{r.destroy()}}},qb=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=t.duration??2e3,i="syntro-pulse-effect";if(!document.querySelector("[data-syntro-pulse-styles]")){let s=document.createElement("style");s.setAttribute("data-syntro-pulse-styles",""),s.textContent=`
|
|
106
|
+
`}f+="</div>"}c.innerHTML=f,e.overlayRoot.appendChild(c);let g=null,p=c.querySelectorAll("[data-syntro-action]"),y=S=>{let E=S.currentTarget.getAttribute("data-syntro-action");E&&(g=E,e.publishEvent("action.modal_cta_clicked",{actionId:E}),E==="dismiss"&&v.destroy())};p.forEach(S=>S.addEventListener("click",y));let _=S=>{S.key==="Escape"&&s?.onEsc!==!1&&v.destroy()};window.addEventListener("keydown",_);let b=()=>{r||v.destroy()};l.addEventListener("click",b);let d=[];r&&Array.from(document.body.children).forEach(S=>{S!==e.overlayRoot&&S.getAttribute("inert")===null&&(S.setAttribute("inert",""),d.push(S))});let h;s?.timeoutMs&&(h=setTimeout(()=>{v.destroy()},s.timeoutMs));let m=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m.length>0&&requestAnimationFrame(()=>m[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:i,blocking:r});let v={destroy(){h&&clearTimeout(h),window.removeEventListener("keydown",_),l.removeEventListener("click",b),p.forEach(S=>S.removeEventListener("click",y)),d.forEach(S=>S.removeAttribute("inert")),c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:g})}};return{cleanup:()=>{v.destroy()}}};var CC=["top","right","bottom","left"];var Vr=Math.min,Bi=Math.max,dc=Math.round,fc=Math.floor,Mn=t=>({x:t,y:t}),t3={left:"right",right:"left",bottom:"top",top:"bottom"},n3={start:"end",end:"start"};function pf(t,e,n){return Bi(t,Vr(e,n))}function Da(t,e){return typeof t=="function"?t(e):t}function Ir(t){return t.split("-")[0]}function uo(t){return t.split("-")[1]}function ay(t){return t==="x"?"y":"x"}function hf(t){return t==="y"?"height":"width"}var i3=new Set(["top","bottom"]);function Hi(t){return i3.has(Ir(t))?"y":"x"}function gf(t){return ay(Hi(t))}function AC(t,e,n){n===void 0&&(n=!1);let i=uo(t),r=gf(t),a=hf(r),s=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=uc(s)),[s,uc(s)]}function kC(t){let e=uc(t);return[ff(t),e,ff(e)]}function ff(t){return t.replace(/start|end/g,e=>n3[e])}var EC=["left","right"],wC=["right","left"],r3=["top","bottom"],a3=["bottom","top"];function s3(t,e,n){switch(t){case"top":case"bottom":return n?e?wC:EC:e?EC:wC;case"left":case"right":return e?r3:a3;default:return[]}}function TC(t,e,n,i){let r=uo(t),a=s3(Ir(t),n==="start",i);return r&&(a=a.map(s=>s+"-"+r),e&&(a=a.concat(a.map(ff)))),a}function uc(t){return t.replace(/left|right|bottom|top/g,e=>t3[e])}function o3(t){return{top:0,right:0,bottom:0,left:0,...t}}function sy(t){return typeof t!="number"?o3(t):{top:t,right:t,bottom:t,left:t}}function La(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function RC(t,e,n){let{reference:i,floating:r}=t,a=Hi(e),s=gf(e),o=hf(s),l=Ir(e),c=a==="y",u=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,g=i[o]/2-r[o]/2,p;switch(l){case"top":p={x:u,y:i.y-r.height};break;case"bottom":p={x:u,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-r.width,y:f};break;default:p={x:i.x,y:i.y}}switch(uo(e)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}async function NC(t,e){var n;e===void 0&&(e={});let{x:i,y:r,platform:a,rects:s,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Da(e,t),y=sy(p),b=o[g?f==="floating"?"reference":"floating":f],d=La(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),h=f==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,m=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),v=await(a.isElement==null?void 0:a.isElement(m))?await(a.getScale==null?void 0:a.getScale(m))||{x:1,y:1}:{x:1,y:1},S=La(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:h,offsetParent:m,strategy:l}):h);return{top:(d.top-S.top+y.top)/v.y,bottom:(S.bottom-d.bottom+y.bottom)/v.y,left:(d.left-S.left+y.left)/v.x,right:(S.right-d.right+y.right)/v.x}}var DC=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=RC(c,i,l),g=i,p={},y=0;for(let b=0;b<o.length;b++){var _;let{name:d,fn:h}=o[b],{x:m,y:v,data:S,reset:w}=await h({x:u,y:f,initialPlacement:i,placement:g,strategy:r,middlewareData:p,rects:c,platform:{...s,detectOverflow:(_=s.detectOverflow)!=null?_:NC},elements:{reference:t,floating:e}});u=m??u,f=v??f,p={...p,[d]:{...p[d],...S}},w&&y<=50&&(y++,typeof w=="object"&&(w.placement&&(g=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):w.rects),{x:u,y:f}=RC(c,g,l)),b=-1)}return{x:u,y:f,placement:g,strategy:r,middlewareData:p}},LC=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:r,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=Da(t,e)||{};if(c==null)return{};let f=sy(u),g={x:n,y:i},p=gf(r),y=hf(p),_=await s.getDimensions(c),b=p==="y",d=b?"top":"left",h=b?"bottom":"right",m=b?"clientHeight":"clientWidth",v=a.reference[y]+a.reference[p]-g[p]-a.floating[y],S=g[p]-a.reference[p],w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),E=w?w[m]:0;(!E||!await(s.isElement==null?void 0:s.isElement(w)))&&(E=o.floating[m]||a.floating[y]);let C=v/2-S/2,O=E/2-_[y]/2-1,T=Vr(f[d],O),I=Vr(f[h],O),Y=T,Q=E-_[y]-I,P=E/2-_[y]/2+C,ge=pf(Y,P,Q),U=!l.arrow&&uo(r)!=null&&P!==ge&&a.reference[y]/2-(P<Y?T:I)-_[y]/2<0,J=U?P<Y?P-Y:P-Q:0;return{[p]:g[p]+J,data:{[p]:ge,centerOffset:P-ge-J,...U&&{alignmentOffset:J}},reset:U}}});var zC=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:r,middlewareData:a,rects:s,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...b}=Da(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let d=Ir(r),h=Hi(o),m=Ir(o)===o,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=g||(m||!_?[uc(o)]:kC(o)),w=y!=="none";!g&&w&&S.push(...TC(o,_,y,v));let E=[o,...S],C=await l.detectOverflow(e,b),O=[],T=((i=a.flip)==null?void 0:i.overflows)||[];if(u&&O.push(C[d]),f){let P=AC(r,s,v);O.push(C[P[0]],C[P[1]])}if(T=[...T,{placement:r,overflows:O}],!O.every(P=>P<=0)){var I,Y;let P=(((I=a.flip)==null?void 0:I.index)||0)+1,ge=E[P];if(ge&&(!(f==="alignment"?h!==Hi(ge):!1)||T.every($=>Hi($.placement)===h?$.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:ge}};let U=(Y=T.filter(J=>J.overflows[0]<=0).sort((J,$)=>J.overflows[1]-$.overflows[1])[0])==null?void 0:Y.placement;if(!U)switch(p){case"bestFit":{var Q;let J=(Q=T.filter($=>{if(w){let X=Hi($.placement);return X===h||X==="y"}return!0}).map($=>[$.placement,$.overflows.filter(X=>X>0).reduce((X,At)=>X+At,0)]).sort(($,X)=>$[1]-X[1])[0])==null?void 0:Q[0];J&&(U=J);break}case"initialPlacement":U=o;break}if(r!==U)return{reset:{placement:U}}}return{}}}};function OC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function MC(t){return CC.some(e=>t[e]>=0)}var BC=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:i}=e,{strategy:r="referenceHidden",...a}=Da(t,e);switch(r){case"referenceHidden":{let s=await i.detectOverflow(e,{...a,elementContext:"reference"}),o=OC(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:MC(o)}}}case"escaped":{let s=await i.detectOverflow(e,{...a,altBoundary:!0}),o=OC(s,n.floating);return{data:{escapedOffsets:o,escaped:MC(o)}}}default:return{}}}}};var l3=new Set(["left","top"]);async function c3(t,e){let{placement:n,platform:i,elements:r}=t,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),s=Ir(n),o=uo(n),l=Hi(n)==="y",c=l3.has(s)?-1:1,u=a&&l?-1:1,f=Da(e,t),{mainAxis:g,crossAxis:p,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof y=="number"&&(p=o==="end"?y*-1:y),l?{x:p*u,y:g*c}:{x:g*c,y:p*u}}var HC=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:r,y:a,placement:s,middlewareData:o}=e,l=await c3(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:s}}}}},UC=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:r,platform:a}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:d=>{let{x:h,y:m}=d;return{x:h,y:m}}},...c}=Da(t,e),u={x:n,y:i},f=await a.detectOverflow(e,c),g=Hi(Ir(r)),p=ay(g),y=u[p],_=u[g];if(s){let d=p==="y"?"top":"left",h=p==="y"?"bottom":"right",m=y+f[d],v=y-f[h];y=pf(m,y,v)}if(o){let d=g==="y"?"top":"left",h=g==="y"?"bottom":"right",m=_+f[d],v=_-f[h];_=pf(m,_,v)}let b=l.fn({...e,[p]:y,[g]:_});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[p]:s,[g]:o}}}}}};function mf(){return typeof window<"u"}function za(t){return VC(t)?(t.nodeName||"").toLowerCase():"#document"}function It(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Nn(t){var e;return(e=(VC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function VC(t){return mf()?t instanceof Node||t instanceof It(t).Node:!1}function Sn(t){return mf()?t instanceof Element||t instanceof It(t).Element:!1}function Dn(t){return mf()?t instanceof HTMLElement||t instanceof It(t).HTMLElement:!1}function $C(t){return!mf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof It(t).ShadowRoot}var u3=new Set(["inline","contents"]);function po(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=xn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!u3.has(r)}var d3=new Set(["table","td","th"]);function IC(t){return d3.has(za(t))}var f3=[":popover-open",":modal"];function pc(t){return f3.some(e=>{try{return t.matches(e)}catch{return!1}})}var p3=["transform","translate","scale","rotate","perspective"],h3=["transform","translate","scale","rotate","perspective","filter"],g3=["paint","layout","strict","content"];function vf(t){let e=yf(),n=Sn(t)?xn(t):t;return p3.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||h3.some(i=>(n.willChange||"").includes(i))||g3.some(i=>(n.contain||"").includes(i))}function FC(t){let e=Ui(t);for(;Dn(e)&&!Ba(e);){if(vf(e))return e;if(pc(e))return null;e=Ui(e)}return null}function yf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var m3=new Set(["html","body","#document"]);function Ba(t){return m3.has(za(t))}function xn(t){return It(t).getComputedStyle(t)}function hc(t){return Sn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ui(t){if(za(t)==="html")return t;let e=t.assignedSlot||t.parentNode||$C(t)&&t.host||Nn(t);return $C(e)?e.host:e}function jC(t){let e=Ui(t);return Ba(e)?t.ownerDocument?t.ownerDocument.body:t.body:Dn(e)&&po(e)?e:jC(e)}function fo(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=jC(t),a=r===((i=t.ownerDocument)==null?void 0:i.body),s=It(r);if(a){let o=_f(s);return e.concat(s,s.visualViewport||[],po(r)?r:[],o&&n?fo(o):[])}return e.concat(r,fo(r,[],n))}function _f(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function YC(t){let e=xn(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=Dn(t),a=r?t.offsetWidth:n,s=r?t.offsetHeight:i,o=dc(n)!==a||dc(i)!==s;return o&&(n=a,i=s),{width:n,height:i,$:o}}function ly(t){return Sn(t)?t:t.contextElement}function ho(t){let e=ly(t);if(!Dn(e))return Mn(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:a}=YC(e),s=(a?dc(n.width):n.width)/i,o=(a?dc(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}var v3=Mn(0);function ZC(t){let e=It(t);return!yf()||!e.visualViewport?v3:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function y3(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==It(t)?!1:e}function Ha(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),a=ly(t),s=Mn(1);e&&(i?Sn(i)&&(s=ho(i)):s=ho(t));let o=y3(a,n,i)?ZC(a):Mn(0),l=(r.left+o.x)/s.x,c=(r.top+o.y)/s.y,u=r.width/s.x,f=r.height/s.y;if(a){let g=It(a),p=i&&Sn(i)?It(i):i,y=g,_=_f(y);for(;_&&i&&p!==y;){let b=ho(_),d=_.getBoundingClientRect(),h=xn(_),m=d.left+(_.clientLeft+parseFloat(h.paddingLeft))*b.x,v=d.top+(_.clientTop+parseFloat(h.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=m,c+=v,y=It(_),_=_f(y)}}return La({width:u,height:f,x:l,y:c})}function bf(t,e){let n=hc(t).scrollLeft;return e?e.left+n:Ha(Nn(t)).left+n}function KC(t,e){let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-bf(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function _3(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,a=r==="fixed",s=Nn(i),o=e?pc(e.floating):!1;if(i===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Mn(1),u=Mn(0),f=Dn(i);if((f||!f&&!a)&&((za(i)!=="body"||po(s))&&(l=hc(i)),Dn(i))){let p=Ha(i);c=ho(i),u.x=p.x+i.clientLeft,u.y=p.y+i.clientTop}let g=s&&!f&&!a?KC(s,l):Mn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+g.x,y:n.y*c.y-l.scrollTop*c.y+u.y+g.y}}function b3(t){return Array.from(t.getClientRects())}function S3(t){let e=Nn(t),n=hc(t),i=t.ownerDocument.body,r=Bi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=Bi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),s=-n.scrollLeft+bf(t),o=-n.scrollTop;return xn(i).direction==="rtl"&&(s+=Bi(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:s,y:o}}var qC=25;function x3(t,e){let n=It(t),i=Nn(t),r=n.visualViewport,a=i.clientWidth,s=i.clientHeight,o=0,l=0;if(r){a=r.width,s=r.height;let u=yf();(!u||u&&e==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}let c=bf(i);if(c<=0){let u=i.ownerDocument,f=u.body,g=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(i.clientWidth-f.clientWidth-p);y<=qC&&(a-=y)}else c<=qC&&(a+=c);return{width:a,height:s,x:o,y:l}}var E3=new Set(["absolute","fixed"]);function w3(t,e){let n=Ha(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,a=Dn(t)?ho(t):Mn(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=r*a.x,c=i*a.y;return{width:s,height:o,x:l,y:c}}function PC(t,e,n){let i;if(e==="viewport")i=x3(t,n);else if(e==="document")i=S3(Nn(t));else if(Sn(e))i=w3(e,n);else{let r=ZC(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return La(i)}function XC(t,e){let n=Ui(t);return n===e||!Sn(n)||Ba(n)?!1:xn(n).position==="fixed"||XC(n,e)}function C3(t,e){let n=e.get(t);if(n)return n;let i=fo(t,[],!1).filter(o=>Sn(o)&&za(o)!=="body"),r=null,a=xn(t).position==="fixed",s=a?Ui(t):t;for(;Sn(s)&&!Ba(s);){let o=xn(s),l=vf(s);!l&&o.position==="fixed"&&(r=null),(a?!l&&!r:!l&&o.position==="static"&&!!r&&E3.has(r.position)||po(s)&&!l&&XC(t,s))?i=i.filter(u=>u!==s):r=o,s=Ui(s)}return e.set(t,i),i}function A3(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,s=[...n==="clippingAncestors"?pc(e)?[]:C3(e,this._c):[].concat(n),i],o=s[0],l=s.reduce((c,u)=>{let f=PC(e,u,r);return c.top=Bi(f.top,c.top),c.right=Vr(f.right,c.right),c.bottom=Vr(f.bottom,c.bottom),c.left=Bi(f.left,c.left),c},PC(e,o,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function k3(t){let{width:e,height:n}=YC(t);return{width:e,height:n}}function T3(t,e,n){let i=Dn(e),r=Nn(e),a=n==="fixed",s=Ha(t,!0,a,e),o={scrollLeft:0,scrollTop:0},l=Mn(0);function c(){l.x=bf(r)}if(i||!i&&!a)if((za(e)!=="body"||po(r))&&(o=hc(e)),i){let p=Ha(e,!0,a,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else r&&c();a&&!i&&r&&c();let u=r&&!i&&!a?KC(r,o):Mn(0),f=s.left+o.scrollLeft-l.x-u.x,g=s.top+o.scrollTop-l.y-u.y;return{x:f,y:g,width:s.width,height:s.height}}function oy(t){return xn(t).position==="static"}function GC(t,e){if(!Dn(t)||xn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Nn(t)===n&&(n=n.ownerDocument.body),n}function WC(t,e){let n=It(t);if(pc(t))return n;if(!Dn(t)){let r=Ui(t);for(;r&&!Ba(r);){if(Sn(r)&&!oy(r))return r;r=Ui(r)}return n}let i=GC(t,e);for(;i&&IC(i)&&oy(i);)i=GC(i,e);return i&&Ba(i)&&oy(i)&&!vf(i)?n:i||FC(t)||n}var R3=async function(t){let e=this.getOffsetParent||WC,n=this.getDimensions,i=await n(t.floating);return{reference:T3(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function O3(t){return xn(t).direction==="rtl"}var M3={convertOffsetParentRelativeRectToViewportRelativeRect:_3,getDocumentElement:Nn,getClippingRect:A3,getOffsetParent:WC,getElementRects:R3,getClientRects:b3,getDimensions:k3,getScale:ho,isElement:Sn,isRTL:O3};function QC(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function N3(t,e){let n=null,i,r=Nn(t);function a(){var o;clearTimeout(i),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();let c=t.getBoundingClientRect(),{left:u,top:f,width:g,height:p}=c;if(o||e(),!g||!p)return;let y=fc(f),_=fc(r.clientWidth-(u+g)),b=fc(r.clientHeight-(f+p)),d=fc(u),m={rootMargin:-y+"px "+-_+"px "+-b+"px "+-d+"px",threshold:Bi(0,Vr(1,l))||1},v=!0;function S(w){let E=w[0].intersectionRatio;if(E!==l){if(!v)return s();E?s(!1,E):i=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!QC(c,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(S,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,m)}n.observe(t)}return s(!0),a}function Sf(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=ly(t),u=r||a?[...c?fo(c):[],...fo(e)]:[];u.forEach(d=>{r&&d.addEventListener("scroll",n,{passive:!0}),a&&d.addEventListener("resize",n)});let f=c&&o?N3(c,n):null,g=-1,p=null;s&&(p=new ResizeObserver(d=>{let[h]=d;h&&h.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var m;(m=p)==null||m.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,_=l?Ha(t):null;l&&b();function b(){let d=Ha(t);_&&!QC(_,d)&&n(),_=d,y=requestAnimationFrame(b)}return n(),()=>{var d;u.forEach(h=>{r&&h.removeEventListener("scroll",n),a&&h.removeEventListener("resize",n)}),f?.(),(d=p)==null||d.disconnect(),p=null,l&&cancelAnimationFrame(y)}}var xf=HC;var Ef=UC,wf=zC;var JC=BC,eA=LC;var Cf=(t,e,n)=>{let i=new Map,r={platform:M3,...n},a={...r.platform,_c:i};return DC(t,e,{...r,platform:a})};function D3(t){let e=t.getBoundingClientRect(),n=window.innerWidth,i=window.innerHeight;if(!(e.width>n*.8||e.height>i*.8))return t;let a=Math.max(e.left,0),s=Math.max(e.top,0),o=Math.min(e.right,n),l=Math.min(e.bottom,i),c=(a+o)/2,u=(s+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function tA(t,e,n){let i=t.getBoundingClientRect();i.width>window.innerWidth*.8||i.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let a=document.createElement("div");a.className="syntro-tooltip",a.setAttribute("role","tooltip"),a.innerHTML=nn(n.html);let s=a.querySelectorAll("[data-syntro-action]"),o=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};s.forEach(d=>d.addEventListener("click",o));let l=document.createElement("div");l.className="syntro-tooltip-arrow",a.appendChild(l),e.appendChild(a);let c=[xf(n.offsetPx??8),wf(),Ef({padding:8}),JC(),eA({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",f=Sf(t,a,async()=>{let d=D3(t),h=await Cf(d,a,{placement:u,middleware:c}),{x:m,y:v,strategy:S,middlewareData:w,placement:E}=h;if(Object.assign(a.style,{left:`${m}px`,top:`${v}px`,position:S}),w.arrow){let{x:C,y:O}=w.arrow,T=E.split("-")[0],I={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:C!=null?`${C}px`:"",top:O!=null?`${O}px`:"",right:"",bottom:"",[I[T]]:"-4px"});let Y={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${Y[T]||"0deg"})`}}),g=d=>{d.key==="Escape"&&b.destroy()};window.addEventListener("keydown",g);let p=[];if(n.blocking){Array.from(document.body.children).forEach(h=>{h!==e&&h.getAttribute("inert")===null&&(h.setAttribute("inert",""),p.push(h.id||h.tagName))});let d=Array.from(a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let h=d[0],m=d[d.length-1],v=S=>{S.key==="Tab"&&(S.shiftKey?document.activeElement===h&&(m.focus(),S.preventDefault()):document.activeElement===m&&(h.focus(),S.preventDefault()))};a.addEventListener("keydown",v),requestAnimationFrame(()=>h.focus())}}let _=(()=>{if(n.trigger==="hover"){let d=()=>{a.style.visibility="visible",a.style.opacity="1"},h=()=>{a.style.visibility="hidden",a.style.opacity="0"};return a.style.visibility="hidden",a.style.opacity="0",a.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",d),t.addEventListener("mouseleave",h),t.addEventListener("focus",d),t.addEventListener("blur",h),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",h),t.removeEventListener("focus",d),t.removeEventListener("blur",h)}}if(n.trigger==="click"){let d=()=>{a.style.visibility==="visible"?b.destroy():(a.style.visibility="visible",a.style.opacity="1")};return a.style.visibility="hidden",a.style.opacity="0",a.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",d),()=>t.removeEventListener("click",d)}return a.style.opacity="0",a.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{a.style.opacity="1"}),()=>{}})(),b={el:a,destroy(){f(),_(),window.removeEventListener("keydown",g),s.forEach(d=>d.removeEventListener("click",o)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),a.style.opacity="0",setTimeout(()=>a.remove(),200)}};return b}var nA=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=xC(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:!1,onClickOutside:!1,onEsc:!1});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{i.destroy()}}},iA=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=t.duration??2e3,r="syntro-pulse-effect";if(!document.querySelector("[data-syntro-pulse-styles]")){let s=document.createElement("style");s.setAttribute("data-syntro-pulse-styles",""),s.textContent=`
|
|
106
107
|
@keyframes syntro-pulse {
|
|
107
108
|
0%, 100% {
|
|
108
109
|
box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
|
|
@@ -111,10 +112,10 @@ Error generating stack: `+o.message+`
|
|
|
111
112
|
box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
.${
|
|
115
|
+
.${r} {
|
|
115
116
|
animation: syntro-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
116
117
|
}
|
|
117
|
-
`,document.head.appendChild(s)}n.classList.add(
|
|
118
|
+
`,document.head.appendChild(s)}n.classList.add(r);let a=setTimeout(()=>{n.classList.remove(r)},i);return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:pulse",anchorId:t.anchorId,duration:i}),{cleanup:()=>{clearTimeout(a),n.classList.remove(r)}}},rA=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let i=document.createElement("div");if(i.className="syntro-badge",i.textContent=t.content,i.setAttribute("data-syntro-badge",t.anchorId),!document.querySelector("[data-syntro-badge-styles]")){let s=document.createElement("style");s.setAttribute("data-syntro-badge-styles",""),s.textContent=`
|
|
118
119
|
.syntro-badge {
|
|
119
120
|
position: absolute;
|
|
120
121
|
padding: 2px 6px;
|
|
@@ -128,18 +129,18 @@ Error generating stack: `+o.message+`
|
|
|
128
129
|
z-index: 2147483646;
|
|
129
130
|
white-space: nowrap;
|
|
130
131
|
}
|
|
131
|
-
`,document.head.appendChild(s)}let
|
|
132
|
+
`,document.head.appendChild(s)}let r=t.position??"top-right",a=n.style.position;switch(getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(i),r){case"top-left":Object.assign(i.style,{top:"-8px",left:"-8px"});break;case"top-right":Object.assign(i.style,{top:"-8px",right:"-8px"});break;case"bottom-left":Object.assign(i.style,{bottom:"-8px",left:"-8px"});break;case"bottom-right":Object.assign(i.style,{bottom:"-8px",right:"-8px"});break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:badge",anchorId:t.anchorId,content:t.content,position:r}),{cleanup:()=>{i.remove(),a!==void 0&&(n.style.position=a)},updateFn:s=>{"content"in s&&typeof s.content=="string"&&(i.textContent=s.content)}}},aA=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let{content:i}=t,r="";if(i.title&&(r+=`<div class="syntro-tt-title">${nn(i.title)}</div>`),r+=`<div class="syntro-tt-body">${nn(i.body)}</div>`,i.ctaButtons&&i.ctaButtons.length>0){r+='<div class="syntro-tt-actions">';for(let s of i.ctaButtons){let o=s.primary??!1;r+=`
|
|
132
133
|
<button
|
|
133
|
-
class="syntro-tt-btn ${
|
|
134
|
-
data-syntro-action="${
|
|
134
|
+
class="syntro-tt-btn ${o?"syntro-tt-btn-primary":""}"
|
|
135
|
+
data-syntro-action="${nn(s.actionId)}"
|
|
135
136
|
>
|
|
136
|
-
${
|
|
137
|
+
${nn(s.label)}
|
|
137
138
|
</button>
|
|
138
|
-
`}
|
|
139
|
+
`}r+="</div>"}else i.cta&&(r+=`<div class="syntro-tt-actions">
|
|
139
140
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
140
|
-
${
|
|
141
|
+
${nn(i.cta.label)}
|
|
141
142
|
</button>
|
|
142
|
-
</div>`);let o=Ub(n,e.overlayRoot,{html:i,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:s=>{if(s==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let a=r.ctaButtons.find(l=>l.actionId===s);a&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:s,label:a.label})}}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},lm=[{kind:"overlays:highlight",executor:Wb},{kind:"overlays:pulse",executor:qb},{kind:"overlays:badge",executor:Kb},{kind:"overlays:tooltip",executor:Gb},{kind:"overlays:modal",executor:am}],QP={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, and visual overlays",executors:lm};var cm="syntro_active_tour",Wc=new Map;function JP(t){try{let e=localStorage.getItem(cm);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function um(t){try{localStorage.setItem(cm,JSON.stringify(t))}catch{}}function e2(){try{localStorage.removeItem(cm)}catch{}}function Wa(){return window.location.pathname}function t2(t){if(!t.route)return!0;let e=Wa();return t.route.includes("*")?new RegExp("^"+t.route.replace(/\*/g,".*")+"$").test(e):e===t.route}var dm=async(t,e)=>{let{tourId:n,steps:r,startStep:i,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${n}" has no steps`);if(Wc.has(n))return{cleanup:async()=>{let m=Wc.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let s=JP(n),a=!!s;if(!a&&!o)return{cleanup:()=>{}};s||(s={tourId:n,currentStepId:i||r[0].id,startedAt:Date.now()},um(s));let l=r.findIndex(m=>m.id===s.currentStepId);if(l===-1){let m=i||r[0].id;l=r.findIndex(y=>y.id===m),l===-1&&(l=0),s.currentStepId=r[l].id,um(s)}let u=r[l];if(!t2(u))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:u.id,expectedRoute:u.route,currentRoute:Wa()}),{cleanup:()=>{}};let c=!1,f=null,h=null,g=null,v=async()=>{h&&(h(),h=null),f&&f.isApplied()&&(await f.revert(),f=null)},_=async m=>{if(c)return;if(await v(),m==="end"){e2(),e.publishEvent("tour.completed",{tourId:n,totalSteps:r.length}),c=!0;return}let y=r.find(w=>w.id===m);if(!y){console.error(`[Tour] Step "${m}" not found`);return}if(s.currentStepId=m,um(s),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:u.id,nextStepId:m}),y.route&&y.route!==Wa()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:y.route});return}await x(y)},x=async m=>{if(!c){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:r.findIndex(y=>y.id===m.id),totalSteps:r.length});try{f=await e.applyAction(m.action)}catch(y){console.error(`[Tour] Failed to execute step "${m.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(y)});return}if(m.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",b=>{let k=b?.actionId;if(k&&m.onAction){let C=m.onAction[k];C&&_(C)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",b=>{let k=b?.actionId;if(k&&m.onAction){let C=m.onAction[k];C&&_(C)}}),w=h;h=()=>{w(),y()}}}};g=(()=>{let m=Wa(),y=()=>{let k=Wa();k!==m&&(m=k,e.publishEvent("tour.route_changed",{tourId:n,newRoute:k}))};window.addEventListener("popstate",y);let w=history.pushState.bind(history),b=history.replaceState.bind(history);return history.pushState=(...k)=>{w(...k),y()},history.replaceState=(...k)=>{b(...k),y()},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=b}})(),a?e.publishEvent("tour.resumed",{tourId:n,stepId:s.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:r.length,startStepId:s.currentStepId}),await x(u);let p=async()=>{c=!0,Wc.delete(n),await v(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:s.currentStepId})};return Wc.set(n,{cleanup:p}),{cleanup:p}};var qc=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:n}of tm)this.registerCore(e,n);for(let{kind:e,executor:n}of lm)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:tour",dm)}registerCore(e,n,r){this.executors.set(e,{kind:e,executor:n,schema:r,source:"core",isBuiltIn:!0})}register(e,n,r,i="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)throw new Error(`Cannot override built-in executor: ${e}`);console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e}`)}this.executors.set(e,{kind:e,executor:n,schema:r,source:i,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,r]of this.executors.entries())r.source===e&&this.executors.delete(n)}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 n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let r=e.kind;if(!r||typeof r!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let i=this.executors.get(r);if(!i)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(i.schema){let o=i.schema.safeParse(e);if(!o.success){for(let s of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:s.message,field:s.path.join(".")});return{valid:!1,errors:n,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)}},Ui=new qc;function n2(t){return Ui.get(t)}function fm(t){return Ui.has(t)}var r2=["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","navigation:scrollTo","navigation:navigate"],i2=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),Zb=5e4,Yb=50;function ei(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let r=t.kind;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!r2.includes(r))return e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:n};switch(!fm(r)&&r!=="core:mountWidget"&&e.push({code:"NO_EXECUTOR",message:`No executor registered for action kind: ${r}`,field:"kind"}),r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":Jr(t,e,n);break;case"overlays:badge":Jr(t,e,n),o2(t,e,n);break;case"overlays:tooltip":Jr(t,e,n),s2(t,e,n);break;case"overlays:modal":v2(t,e,n);break;case"content:insertHtml":Jr(t,e,n),a2(t,e,n);break;case"content:setText":Jr(t,e,n),l2(t,e,n);break;case"content:setAttr":Jr(t,e,n),u2(t,e,n);break;case"content:addClass":case"content:removeClass":Jr(t,e,n),c2(t,e,n);break;case"content:setStyle":Jr(t,e,n),d2(t,e,n);break;case"core:mountWidget":f2(t,e,n);break;case"core:wait":p2(t,e,n);break;case"core:sequence":h2(t,e,n);break;case"core:parallel":g2(t,e,n);break;case"core:tour":y2(t,e,n);break;case"navigation:navigate":m2(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function Jr(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function o2(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function s2(t,e,n){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 a2(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>Zb&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${Zb}`,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 l2(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function u2(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(i2.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 c2(t,e,n){!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)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function d2(t,e,n){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>Yb&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${Yb}`,field:"styles"});for(let[i,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${i}`,field:`styles.${i}`})}}function f2(t,e,n){(!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 p2(t,e,n){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 h2(t,e,n){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&&n.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 i=ei(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function g2(t,e,n){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&&n.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 i=ei(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function m2(t,e,n){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:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function v2(t,e,n){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 i=t.ctaButtons[r];(!i.label||typeof i.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!i.actionId||typeof i.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function y2(t,e,n){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 i=0;i<t.steps.length;i++){let o=t.steps[i];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${i} requires 'id' property`,field:`steps[${i}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${i}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${i} requires 'action' property`,field:`steps[${i}].action`});else{let s=ei(o.action);for(let a of s.errors)e.push({...a,field:`steps[${i}].action${a.field?`.${a.field}`:""}`});for(let a of s.warnings)n.push(a)}if(o.onAction)for(let[s,a]of Object.entries(o.onAction))a!=="end"&&!t.steps.some(l=>l.id===a)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${a}`,suggestion:`Make sure step "${a}" exists in the tour`})}}function pm(t){let e=[],n=[];if(!Array.isArray(t))return e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let r=0;r<t.length;r++){let i=ei(t[r]);for(let o of i.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of i.warnings)n.push({...o,suggestion:o.suggestion?`Action ${r}: ${o.suggestion}`:void 0})}return{valid:e.length===0,errors:e,warnings:n}}var _2=0;function hm(t){let{overlayRoot:e,eventBus:n,surfaces:r,anchorResolver:i,adaptiveId:o,executorRegistry:s=Ui}=t,a=new Map;function l(){return`action-${++_2}`}function u(d,p){n&&n.publish(d,p)}function c(){return{overlayRoot:e,resolveAnchor:i,generateId:l,publishEvent:u,adaptiveId:o,applyAction:h,subscribeEvent:n?(d,p)=>n.subscribe({names:[d]},m=>p(m.props)):void 0}}async function f(d,p){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let m=r.mount(d.slot,{type:"widget",widgetId:d.widget.widgetId,config:d.widget.props},{priority:d.widget.priority});return p.publishEvent("action.applied",{id:p.generateId(),kind:"core:mountWidget",slot:d.slot,widgetId:d.widget.widgetId}),{cleanup:()=>{m.unmount()},updateFn:y=>{if("widget"in y&&y.widget){let w=y.widget;w.props&&m.update({type:"widget",widgetId:d.widget.widgetId,config:w.props})}}}}async function h(d){let p=ei(d);if(!p.valid){let C=p.errors.map(I=>I.message).join("; ");throw new Error(`Action validation failed: ${C}`)}let m=l(),y=c(),w;if(d.kind==="core:mountWidget")w=await f(d,y);else{let C=s.get(d.kind);if(!C)throw new Error(`No executor for action kind: ${d.kind}`);w=await C(d,y)}let b={id:m,action:d,adaptiveId:o,appliedTs:Date.now(),state:"applied",cleanup:w.cleanup,updateFn:w.updateFn};return a.set(m,b),u("action.applied",{id:m,kind:d.kind,anchorId:"anchorId"in d?d.anchorId:void 0}),{id:m,action:d,async revert(){let C=a.get(m);if(!(!C||C.state!=="applied"))try{await C.cleanup(),C.state="reverted",u("action.reverted",{id:m,kind:d.kind})}catch(I){throw C.state="failed",u("action.failed",{id:m,kind:d.kind,error:String(I)}),I}finally{a.delete(m)}},isApplied(){return a.get(m)?.state==="applied"},async update(C){let I=a.get(m);if(!I||I.state!=="applied")throw new Error("Cannot update action that is not applied");if(I.updateFn)await I.updateFn(C);else throw new Error(`Action kind ${d.kind} does not support updates`)},getState(){return a.get(m)?.state??"reverted"}}}async function g(d){let p=pm(d);if(!p.valid){let k=p.errors.map(C=>C.message).join("; ");throw new Error(`Batch validation failed: ${k}`)}let m=l(),y=[],w=[];try{for(let k of d){let C=await h(k);y.push(C),w.push(C)}}catch(k){for(let C of w)try{await C.revert()}catch{}throw k}return{id:m,handles:y,async revertAll(){for(let k=y.length-1;k>=0;k--)try{await y[k].revert()}catch(C){console.error(`[ActionEngine] Error reverting action ${y[k].id}:`,C)}},isApplied(){return y.every(k=>k.isApplied())}}}function v(d){return ei(d)}function _(){return Array.from(a.values()).map(d=>({id:d.id,action:d.action,adaptiveId:d.adaptiveId,appliedTs:d.appliedTs,state:d.state}))}function x(){for(let d of a.values())if(d.state==="applied")try{d.cleanup()}catch(p){console.error("[ActionEngine] Error during cleanup:",p)}a.clear()}return{apply:h,applyBatch:g,validate:v,getActive:_,destroy:x}}function qa(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Kc(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}function Xb(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 n=document.createElement("template");n.innerHTML=t;let r=n.content,i=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"]),s=[];for(;i.nextNode();){let a=i.currentNode,l=a.tagName.toLowerCase();if(!o.has(l)){s.push(a);continue}for(let u of Array.from(a.attributes)){let c=u.name.toLowerCase(),f=u.value.trim().toLowerCase(),h=c.startsWith("on"),g=(c==="href"||c==="src")&&f.startsWith("javascript:");(h||g)&&a.removeAttribute(u.name)}}for(let a of s){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML=(r.firstChild,n.innerHTML)}var Qb={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"}},Ka={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:[]},Jb={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function gm(t,e,n){let r=Qb[e];Object.assign(t.style,r),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function mm(t,e,n){let r=n.placement==="auto"?"bottom":n.placement,i=[zc(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&i.push(jc()),n.shift!==!1&&i.push(Hc({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Bc(e,t,async()=>{let{x:s,y:a,strategy:l}=await Uc(e,t,{placement:r,middleware:i});Object.assign(t.style,{position:l,left:`${s}px`,top:`${a}px`})})}function vm(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function ym(t,e){return e==="none"||Ka[e].length===0?null:t.animate(Ka[e],Jb)}function _m(t,e){if(e==="none"||Ka[e].length===0)return Promise.resolve();let n=[...Ka[e]].reverse(),r=t.animate(n,Jb);return new Promise(i=>{r.onfinish=()=>i(),r.oncancel=()=>i()})}function wm(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function xm(t){switch(qa(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}}var w2=0;function Sm(t){let{overlayRoot:e,eventBus:n,anchorResolver:r,defaultAnimation:i="fade",widgetRegistry:o}=t,s=new Map,a=new Map,l=new Map;function u(){return`mount-${++w2}`}function c(y,w){n&&n.publish(y,w)}function f(y){let w=l.get(y);if(w){let b=x(y);for(let k of w)try{k(b)}catch(C){console.error("[Surfaces] State callback error:",C)}}}let h=new Map;function g(y,w,b){switch(w.type){case"html":y.innerHTML=Xb(w.content);return;case"widget":{if(o&&o.has(w.widgetId)){let k=o.mount(w.widgetId,y,w.config);return b&&h.set(b,k),()=>{k.unmount(),b&&h.delete(b)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function v(y,w,b){let k=u(),C=qa(y),I=b?.priority??0,A=b?.animation??i,H=b?.exclusive??!0,K=s.get(y);if(K&&H){if(K.options.priority>I)throw new Error(`Slot ${y} is occupied by higher priority content (${K.options.priority} > ${I})`);_(K)}let Y=wm(y,k);Y.style.zIndex=String(xm(y));let W;if(C==="static")gm(Y,y,b?.constraints),e.appendChild(Y);else if(C==="inline"){let B=Kc(y);if(!B)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let Z=r(B);if(!Z)throw new Error(`Anchor not found for inline slot: ${B}`);W=vm(Y,Z)}else if(C==="adjacent"){let B=Kc(y);if(!B)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let Z=r(B);if(!Z)throw new Error(`Anchor not found for adjacent slot: ${B}`);e.appendChild(Y),W=mm(Y,Z,b?.position??{placement:"bottom"})}let le=g(Y,w,k);ym(Y,A);let V={id:k,slot:y,content:w,options:{priority:I,exclusive:H,animation:A,position:b?.position??{placement:"auto"},constraints:b?.constraints??{},adaptiveId:b?.adaptiveId,autoUnmountOnRouteChange:b?.autoUnmountOnRouteChange??!0},container:Y,cleanup:()=>{W?.(),le?.()},mountedAt:Date.now()};return s.set(y,V),a.set(y,(a.get(y)??0)+1),c("surface.mounted",{slot:y,id:k,adaptiveId:b?.adaptiveId}),f(y),{id:k,update(B){let Z=s.get(y);if(!Z||Z.id!==k)throw new Error("Mount no longer active");let ut=h.get(k);if(ut){if(B.type==="widget"){ut.update(B.config),Z.content=B;return}ut.unmount(),h.delete(k)}Z.container.innerHTML="";let An=g(Z.container,B,k);if(Z.content=B,An){let He=Z.cleanup;Z.cleanup=()=>{He?.(),An()}}},setOptions(B){let Z=s.get(y);if(!Z||Z.id!==k)throw new Error("Mount no longer active");B.priority!==void 0&&(Z.options.priority=B.priority),B.animation!==void 0&&(Z.options.animation=B.animation),B.constraints&&C==="static"&&(B.constraints.maxWidth&&(Z.container.style.maxWidth=B.constraints.maxWidth),B.constraints.maxHeight&&(Z.container.style.maxHeight=B.constraints.maxHeight),B.constraints.minWidth&&(Z.container.style.minWidth=B.constraints.minWidth),B.constraints.minHeight&&(Z.container.style.minHeight=B.constraints.minHeight)),f(y)},async unmount(){let B=s.get(y);!B||B.id!==k||await _(B)},isMounted(){return s.get(y)?.id===k},getContainer(){let B=s.get(y);return B?.id===k?B.container:null}}}async function _(y){await _m(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),s.delete(y.slot),c("surface.unmounted",{slot:y.slot,id:y.id}),f(y.slot)}function x(y){let w=s.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:a.get(y)??0,currentMountId:w?.id}}function d(y,w){let b=l.get(y);return b||(b=new Set,l.set(y,b)),b.add(w),()=>{b?.delete(w),b?.size===0&&l.delete(y)}}function p(y,w){let b=s.get(y);return b?w!==void 0?w>=b.options.priority:!1:!0}function m(){for(let y of s.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}s.clear(),l.clear()}return{mount:v,getState:x,onStateChange:d,canMount:p,destroy:m}}var Gc=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0)}register(e,n,r="custom",i){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:n,source:r,metadata:i})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),!0):!1}unregisterBySource(e){for(let[n,r]of this.widgets.entries())r.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,r){let i=this.widgets.get(e);if(!i)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let s=i.widget.mount(n,r);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let l=this.mountedWidgets.get(o);l&&(l.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:l=>{if(i.widget.update)i.widget.update(n,l);else{let u=this.mountedWidgets.get(o);if(u){u.cleanup?.(),n.innerHTML="";let c=i.widget.mount(n,l);u.cleanup=c??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(n=>n.source===e)}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},bm=new Gc;function km(t){let{appId:e,runtime:n,isBuiltIn:r=!1}=t,i=`app:${e}:`,o=[],s=[],a=n.state.ns(`app:${e}`);return{appId:e,state:{get:u=>a.get(u),set:(u,c)=>a.set(u,c),remove:u=>a.remove(u)},telemetry:n.telemetry?{emit:(u,c)=>{n.events.publish(u,{...c,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(u,c,f)=>{let h=n.surfaces.mount(u,c,{...f,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(u,c)=>n.surfaces.canMount(u,c)},events:{subscribe:u=>n.events.subscribe(c=>{u(c)}),publish:(u,c)=>{n.events.publish(u,{...c,_appId:e})}},registerAction:u=>{n.executors.register(u.kind,u.executor,u.schema,e,r),o.push(u.kind)},registerWidget:u=>{n.widgets.register(u.id,u.component,e,u.metadata),s.push(u.id)}}}function Cm(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var Zc=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.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 n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"){console.warn(`[AppRegistry] App already active: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let r of n.manifest.dependencies){let i=this.apps.get(r);if(!i||i.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}n.state="activating";try{let r=n.manifest.metadata?.isBuiltIn===!0,i=km({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=n.manifest,s=[];if(o){if(o.actions)for(let a of o.actions)i.registerAction(a);if(o.widgets)for(let a of o.widgets)i.registerWidget(a);if(o.events)for(let a of o.events){let l=this.runtime.events.subscribe(u=>{if(a.names.includes(u.name)){let c={appId:e,state:i.state,telemetry:i.telemetry,surfaces:i.surfaces};try{a.handler(u,c)}catch(f){console.error(`[AppRegistry] Event handler error in ${e}:`,f)}}});s.push(l)}}n.cleanup=async()=>{for(let a of s)try{await a()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Cm(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,i]of this.apps)if(i.state==="active"&&i.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let n=this.apps.get(e);n&&(n.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 n of this.eventListeners)try{n(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Em=new Zc;var x2=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"]),S2={navigation:"nav"};function ek(t){return S2[t]??t}function tk(t){return x2.has(t)}function nk(t){if(tk(t))return null;let e=t.indexOf(":");return e===-1?null:ek(t.slice(0,e))}function rk(t){let e=t.indexOf(":");return e===-1?null:ek(t.slice(0,e))}function Am(t){let{cdnBase:e,registry:n,timeout:r=1e4,onLoadStart:i,onLoadEnd:o}=t,s=new Map,a=new Set;function l(v){return`${e}/apps/${v}/index.js`}async function u(v){if(n.has(v))return{appId:v,success:!0,manifest:n.get(v)?.manifest};if(s.has(v))return s.get(v);let _=(async()=>{i?.(v);try{let x=l(v);if(a.has(x)){let y=n.get(v);if(y)return o?.(v,!0),{appId:v,success:!0,manifest:y.manifest}}let d=new Promise((y,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${v}`)),r)}),p=c(x,v);await Promise.race([p,d]),a.add(x);let m=n.get(v);if(!m)throw new Error(`App ${v} did not register after loading`);return o?.(v,!0),{appId:v,success:!0,manifest:m.manifest}}catch(x){let d=x instanceof Error?x.message:String(x);return o?.(v,!1,d),{appId:v,success:!1,error:d}}finally{s.delete(v)}})();return s.set(v,_),_}async function c(v,_){if(typeof window<"u"){try{let x=await import(v);x.manifest?n.register(x.manifest):x.default?.manifest?n.register(x.default.manifest):x.default&&n.register(x.default);return}catch{}return new Promise((x,d)=>{let p=document.createElement("script");p.src=v,p.async=!0,p.onload=()=>{n.get(_)?x():d(new Error(`App ${_} did not self-register`))},p.onerror=()=>{d(new Error(`Failed to load app script: ${v}`))},document.head.appendChild(p)})}throw new Error("Dynamic app loading not supported in SSR")}function f(v){let _=new Set;if(v.apps)for(let x of v.apps)_.add(x);if(v.actions)for(let x of v.actions){let d=nk(x.kind);if(d&&_.add(d),x.kind==="core:mountWidget"){let p=x.widget?.widgetId;if(p){let m=rk(p);m&&_.add(m)}}}return Array.from(_)}async function h(v){let _=f(v);return _.length===0?[]:await Promise.all(_.map(d=>u(d)))}async function g(v){return Promise.all(v.map(_=>u(_)))}return{loadApp:u,loadAppsForConfig:h,preloadApps:g,getRequiredApps:f,getAppUrl:l}}var Ga=null;function ok(){if(Ga&&document.body.contains(Ga))return Ga;let t=document.getElementById("syntro-overlays");return t||(t=document.createElement("div"),t.id="syntro-overlays",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(t)),Ga=t,b2(),Ga}var ik=!1;function b2(){if(ik)return;let t=`
|
|
143
|
+
</div>`);let a=tA(n,e.overlayRoot,{html:r,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:s=>{if(s==="cta"&&i.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:i.cta.label});else if(i.ctaButtons){let o=i.ctaButtons.find(l=>l.actionId===s);o&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:s,label:o.label})}}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{a.destroy()}}},cy=[{kind:"overlays:highlight",executor:nA},{kind:"overlays:pulse",executor:iA},{kind:"overlays:badge",executor:rA},{kind:"overlays:tooltip",executor:aA},{kind:"overlays:modal",executor:ry}],L3={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, and visual overlays",executors:cy};var dy="syntro_active_tour",Af=new Map;function z3(t){try{let e=localStorage.getItem(dy);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function uy(t){try{localStorage.setItem(dy,JSON.stringify(t))}catch{}}function B3(){try{localStorage.removeItem(dy)}catch{}}function gc(){return window.location.pathname}function H3(t){if(!t.route)return!0;let e=gc();return t.route.includes("*")?new RegExp(`^${t.route.replace(/\*/g,".*")}$`).test(e):e===t.route}var fy=async(t,e)=>{let{tourId:n,steps:i,startStep:r,autoStart:a=!0}=t;if(i.length===0)throw new Error(`Tour "${n}" has no steps`);if(Af.has(n))return{cleanup:async()=>{let m=Af.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let s=z3(n),o=!!s;if(!o&&!a)return{cleanup:()=>{}};s||(s={tourId:n,currentStepId:r||i[0].id,startedAt:Date.now()},uy(s));let l=i.findIndex(m=>m.id===s.currentStepId);if(l===-1){let m=r||i[0].id;l=i.findIndex(v=>v.id===m),l===-1&&(l=0),s.currentStepId=i[l].id,uy(s)}let c=i[l];if(!H3(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:gc()}),{cleanup:()=>{}};let u=!1,f=null,g=null,p=null,y=async()=>{g&&(g(),g=null),f&&f.isApplied()&&(await f.revert(),f=null)},_=async m=>{if(u)return;if(await y(),m==="end"){B3(),e.publishEvent("tour.completed",{tourId:n,totalSteps:i.length}),u=!0;return}let v=i.find(S=>S.id===m);if(!v){console.error(`[Tour] Step "${m}" not found`);return}if(s.currentStepId=m,uy(s),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:m}),v.route&&v.route!==gc()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:v.route});return}await b(v)},b=async m=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:i.findIndex(v=>v.id===m.id),totalSteps:i.length});try{f=await e.applyAction(m.action)}catch(v){console.error(`[Tour] Failed to execute step "${m.id}":`,v),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(v)});return}if(m.onAction&&e.subscribeEvent){g=e.subscribeEvent("action.modal_cta_clicked",w=>{let E=w?.actionId;if(E&&m.onAction){let C=m.onAction[E];C&&_(C)}});let v=e.subscribeEvent("action.tooltip_cta_clicked",w=>{let E=w?.actionId;if(E&&m.onAction){let C=m.onAction[E];C&&_(C)}}),S=g;g=()=>{S(),v()}}}};p=(()=>{let m=gc(),v=()=>{let E=gc();E!==m&&(m=E,e.publishEvent("tour.route_changed",{tourId:n,newRoute:E}))};window.addEventListener("popstate",v);let S=history.pushState.bind(history),w=history.replaceState.bind(history);return history.pushState=(...E)=>{S(...E),queueMicrotask(v)},history.replaceState=(...E)=>{w(...E),queueMicrotask(v)},()=>{window.removeEventListener("popstate",v),history.pushState=S,history.replaceState=w}})(),o?e.publishEvent("tour.resumed",{tourId:n,stepId:s.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:i.length,startStepId:s.currentStepId}),await b(c);let h=async()=>{u=!0,Af.delete(n),await y(),p&&p(),e.publishEvent("tour.paused",{tourId:n,stepId:s.currentStepId})};return Af.set(n,{cleanup:h}),{cleanup:h}};var kf=class{constructor(){F(this,"executors",new Map);for(let{kind:e,executor:n}of iy)this.registerCore(e,n);for(let{kind:e,executor:n}of cy)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:tour",fy)}registerCore(e,n,i){this.executors.set(e,{kind:e,executor:n,schema:i,source:"core",isBuiltIn:!0})}register(e,n,i,r="custom",a=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)throw new Error(`Cannot override built-in executor: ${e}`);console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e}`)}this.executors.set(e,{kind:e,executor:n,schema:i,source:r,isBuiltIn:a})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.executors.entries())i.source===e&&this.executors.delete(n)}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 n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let{kind:i}=e;if(!i||typeof i!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let r=this.executors.get(i);if(!r)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(r.schema){let a=r.schema.safeParse(e);if(!a.success){for(let s of a.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:s.message,field:s.path.join(".")});return{valid:!1,errors:n,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)}},Ua=new kf;function U3(t){return Ua.get(t)}function py(t){return Ua.has(t)}var $3=["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","navigation:scrollTo","navigation:navigate"],V3=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),sA=5e4,oA=50;function jr(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let{kind:i}=t;if(!i||typeof i!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!$3.includes(i))return e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${i}`,field:"kind"}),{valid:!1,errors:e,warnings:n};switch(!py(i)&&i!=="core:mountWidget"&&e.push({code:"NO_EXECUTOR",message:`No executor registered for action kind: ${i}`,field:"kind"}),i){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":Fr(t,e,n);break;case"overlays:badge":Fr(t,e,n),I3(t,e,n);break;case"overlays:tooltip":Fr(t,e,n),F3(t,e,n);break;case"overlays:modal":J3(t,e,n);break;case"content:insertHtml":Fr(t,e,n),j3(t,e,n);break;case"content:setText":Fr(t,e,n),q3(t,e,n);break;case"content:setAttr":Fr(t,e,n),P3(t,e,n);break;case"content:addClass":case"content:removeClass":Fr(t,e,n),G3(t,e,n);break;case"content:setStyle":Fr(t,e,n),Y3(t,e,n);break;case"core:mountWidget":Z3(t,e,n);break;case"core:wait":K3(t,e,n);break;case"core:sequence":X3(t,e,n);break;case"core:parallel":W3(t,e,n);break;case"core:tour":e4(t,e,n);break;case"navigation:navigate":Q3(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function Fr(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function I3(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function F3(t,e,n){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 j3(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>sA&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${sA}`,field:"html"});let i=["before","after","prepend","append","replace"];(!t.position||!i.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${i.join(", ")}`,field:"position"})}function q3(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function P3(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(V3.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 G3(t,e,n){!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)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function Y3(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let i=Object.keys(t.styles).length;i>oA&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${i}). Maximum is ${oA}`,field:"styles"});for(let[r,a]of Object.entries(t.styles))typeof a=="string"&&a.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${r}`,field:`styles.${r}`})}}function Z3(t,e,n){(!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 K3(t,e,n){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 X3(t,e,n){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&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let i=0;i<t.actions.length;i++){let r=jr(t.actions[i]);for(let a of r.errors)e.push({...a,field:`actions[${i}]${a.field?`.${a.field}`:""}`});for(let a of r.warnings)n.push(a)}}function W3(t,e,n){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&&n.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 i=0;i<t.actions.length;i++){let r=jr(t.actions[i]);for(let a of r.errors)e.push({...a,field:`actions[${i}]${a.field?`.${a.field}`:""}`});for(let a of r.warnings)n.push(a)}}function Q3(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let i=t.url.trim().toLowerCase();i.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),i.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function J3(t,e,n){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 i=0;i<t.ctaButtons.length;i++){let r=t.ctaButtons[i];(!r.label||typeof r.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${i} requires 'label' property`,field:`ctaButtons[${i}].label`}),(!r.actionId||typeof r.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${i} requires 'actionId' property`,field:`ctaButtons[${i}].actionId`})}}function e4(t,e,n){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 i=new Set;for(let r=0;r<t.steps.length;r++){let a=t.steps[r];if(!a.id||typeof a.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${r} requires 'id' property`,field:`steps[${r}].id`}):(i.has(a.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${a.id}`,field:`steps[${r}].id`}),i.add(a.id)),!a.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${r} requires 'action' property`,field:`steps[${r}].action`});else{let s=jr(a.action);for(let o of s.errors)e.push({...o,field:`steps[${r}].action${o.field?`.${o.field}`:""}`});for(let o of s.warnings)n.push(o)}if(a.onAction)for(let[s,o]of Object.entries(a.onAction))o!=="end"&&!t.steps.some(l=>l.id===o)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${a.id}" references unknown target step: ${o}`,suggestion:`Make sure step "${o}" exists in the tour`})}}function hy(t){let e=[],n=[];if(!Array.isArray(t))return e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let i=0;i<t.length;i++){let r=jr(t[i]);for(let a of r.errors)e.push({...a,field:a.field?`[${i}].${a.field}`:`[${i}]`});for(let a of r.warnings)n.push({...a,suggestion:a.suggestion?`Action ${i}: ${a.suggestion}`:void 0})}return{valid:e.length===0,errors:e,warnings:n}}var t4=0;function gy(t){let{overlayRoot:e,eventBus:n,surfaces:i,anchorResolver:r,adaptiveId:a,executorRegistry:s=Ua}=t,o=new Map;function l(){return`action-${++t4}`}function c(d,h){n&&n.publish(d,h)}function u(){return{overlayRoot:e,resolveAnchor:r,generateId:l,publishEvent:c,adaptiveId:a,applyAction:g,subscribeEvent:n?(d,h)=>n.subscribe({names:[d]},m=>h(m.props)):void 0}}async function f(d,h){if(!i)throw new Error("Surfaces provider required for core:mountWidget actions");let m=i.mount(d.slot,{type:"widget",widgetId:d.widget.widgetId,config:d.widget.props},{priority:d.widget.priority});return h.publishEvent("action.applied",{id:h.generateId(),kind:"core:mountWidget",slot:d.slot,widgetId:d.widget.widgetId}),{cleanup:()=>{m.unmount()},updateFn:v=>{if("widget"in v&&v.widget){let S=v.widget;S.props&&m.update({type:"widget",widgetId:d.widget.widgetId,config:S.props})}}}}async function g(d){let h=jr(d);if(!h.valid){let C=h.errors.map(O=>O.message).join("; ");throw new Error(`Action validation failed: ${C}`)}let m=l(),v=u(),S;if(d.kind==="core:mountWidget")S=await f(d,v);else{let C=s.get(d.kind);if(!C)throw new Error(`No executor for action kind: ${d.kind}`);S=await C(d,v)}let w={id:m,action:d,adaptiveId:a,appliedTs:Date.now(),state:"applied",cleanup:S.cleanup,updateFn:S.updateFn};return o.set(m,w),c("action.applied",{id:m,kind:d.kind,anchorId:"anchorId"in d?d.anchorId:void 0}),{id:m,action:d,async revert(){let C=o.get(m);if(!(!C||C.state!=="applied"))try{await C.cleanup(),C.state="reverted",c("action.reverted",{id:m,kind:d.kind})}catch(O){throw C.state="failed",c("action.failed",{id:m,kind:d.kind,error:String(O)}),O}finally{o.delete(m)}},isApplied(){return o.get(m)?.state==="applied"},async update(C){let O=o.get(m);if(!O||O.state!=="applied")throw new Error("Cannot update action that is not applied");if(O.updateFn)await O.updateFn(C);else throw new Error(`Action kind ${d.kind} does not support updates`)},getState(){return o.get(m)?.state??"reverted"}}}async function p(d){let h=hy(d);if(!h.valid){let E=h.errors.map(C=>C.message).join("; ");throw new Error(`Batch validation failed: ${E}`)}let m=l(),v=[],S=[];try{for(let E of d){let C=await g(E);v.push(C),S.push(C)}}catch(E){for(let C of S)try{await C.revert()}catch{}throw E}return{id:m,handles:v,async revertAll(){for(let E=v.length-1;E>=0;E--)try{await v[E].revert()}catch(C){console.error(`[ActionEngine] Error reverting action ${v[E].id}:`,C)}},isApplied(){return v.every(E=>E.isApplied())}}}function y(d){return jr(d)}function _(){return Array.from(o.values()).map(d=>({id:d.id,action:d.action,adaptiveId:d.adaptiveId,appliedTs:d.appliedTs,state:d.state}))}function b(){for(let d of o.values())if(d.state==="applied")try{d.cleanup()}catch(h){console.error("[ActionEngine] Error during cleanup:",h)}o.clear()}return{apply:g,applyBatch:p,validate:y,getActive:_,destroy:b}}function lA(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let i=n.content,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,null),a=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),s=[];for(;r.nextNode();){let o=r.currentNode,l=o.tagName.toLowerCase();if(!a.has(l)){s.push(o);continue}for(let c of Array.from(o.attributes)){let u=c.name.toLowerCase(),f=c.value.trim().toLowerCase(),g=u.startsWith("on"),p=(u==="href"||u==="src")&&f.startsWith("javascript:");(g||p)&&o.removeAttribute(c.name)}}for(let o of s){for(;o.firstChild;)o.parentNode?.insertBefore(o.firstChild,o);o.remove()}return n.innerHTML=(i.firstChild,n.innerHTML)}function mc(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function Tf(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}var cA={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"}},vc={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:[]},uA={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function my(t,e,n){let i=cA[e];Object.assign(t.style,i),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function vy(t,e,n){let i=n.placement==="auto"?"bottom":n.placement,r=[xf(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&r.push(wf()),n.shift!==!1&&r.push(Ef({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",Sf(e,t,async()=>{let{x:s,y:o,strategy:l}=await Cf(e,t,{placement:i,middleware:r});Object.assign(t.style,{position:l,left:`${s}px`,top:`${o}px`})})}function yy(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function _y(t,e){return e==="none"||vc[e].length===0?null:t.animate(vc[e],uA)}function by(t,e){if(e==="none"||vc[e].length===0)return Promise.resolve();let n=[...vc[e]].reverse(),i=t.animate(n,uA);return new Promise(r=>{i.onfinish=()=>r(),i.oncancel=()=>r()})}function Sy(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function xy(t){switch(mc(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}}var n4=0;function Ey(t){let{overlayRoot:e,eventBus:n,anchorResolver:i,defaultAnimation:r="fade",widgetRegistry:a}=t,s=new Map,o=new Map,l=new Map;function c(){return`mount-${++n4}`}function u(v,S){n&&n.publish(v,S)}function f(v){let S=l.get(v);if(S){let w=b(v);for(let E of S)try{E(w)}catch(C){console.error("[Surfaces] State callback error:",C)}}}let g=new Map;function p(v,S,w){switch(S.type){case"html":v.innerHTML=lA(S.content);return;case"widget":{if(a&&a.has(S.widgetId)){let E=a.mount(S.widgetId,v,S.config);return w&&g.set(w,E),()=>{E.unmount(),w&&g.delete(w)}}console.warn(`[Surfaces] Widget not found: ${S.widgetId}`),v.innerHTML=`<div data-widget-id="${S.widgetId}" data-widget-missing="true">Widget: ${S.widgetId}</div>`;return}case"custom":return S.mount(v);case"react":v.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function y(v,S,w){let E=c(),C=mc(v),O=w?.priority??0,T=w?.animation??r,I=w?.exclusive??!0,Y=s.get(v);if(Y&&I){if(Y.options.priority>O)throw new Error(`Slot ${v} is occupied by higher priority content (${Y.options.priority} > ${O})`);_(Y)}let Q=Sy(v,E);Q.style.zIndex=String(xy(v));let P;if(C==="static")my(Q,v,w?.constraints),e.appendChild(Q);else if(C==="inline"){let $=Tf(v);if(!$)throw new Error(`Invalid inline slot: ${v}`);if(!i)throw new Error("Anchor resolver required for inline slots");let X=i($);if(!X)throw new Error(`Anchor not found for inline slot: ${$}`);P=yy(Q,X)}else if(C==="adjacent"){let $=Tf(v);if(!$)throw new Error(`Invalid adjacent slot: ${v}`);if(!i)throw new Error("Anchor resolver required for adjacent slots");let X=i($);if(!X)throw new Error(`Anchor not found for adjacent slot: ${$}`);e.appendChild(Q),P=vy(Q,X,w?.position??{placement:"bottom"})}let ge=p(Q,S,E);_y(Q,T);let U={id:E,slot:v,content:S,options:{priority:O,exclusive:I,animation:T,position:w?.position??{placement:"auto"},constraints:w?.constraints??{},adaptiveId:w?.adaptiveId,autoUnmountOnRouteChange:w?.autoUnmountOnRouteChange??!0},container:Q,cleanup:()=>{P?.(),ge?.()},mountedAt:Date.now()};return s.set(v,U),o.set(v,(o.get(v)??0)+1),u("surface.mounted",{slot:v,id:E,adaptiveId:w?.adaptiveId}),f(v),{id:E,update($){let X=s.get(v);if(!X||X.id!==E)throw new Error("Mount no longer active");let At=g.get(E);if(At){if($.type==="widget"){At.update($.config),X.content=$;return}At.unmount(),g.delete(E)}X.container.innerHTML="";let Jn=p(X.container,$,E);if(X.content=$,Jn){let lt=X.cleanup;X.cleanup=()=>{lt?.(),Jn()}}},setOptions($){let X=s.get(v);if(!X||X.id!==E)throw new Error("Mount no longer active");$.priority!==void 0&&(X.options.priority=$.priority),$.animation!==void 0&&(X.options.animation=$.animation),$.constraints&&C==="static"&&($.constraints.maxWidth&&(X.container.style.maxWidth=$.constraints.maxWidth),$.constraints.maxHeight&&(X.container.style.maxHeight=$.constraints.maxHeight),$.constraints.minWidth&&(X.container.style.minWidth=$.constraints.minWidth),$.constraints.minHeight&&(X.container.style.minHeight=$.constraints.minHeight)),f(v)},async unmount(){let $=s.get(v);!$||$.id!==E||await _($)},isMounted(){return s.get(v)?.id===E},getContainer(){let $=s.get(v);return $?.id===E?$.container:null}}}async function _(v){await by(v.container,v.options.animation),v.cleanup?.(),v.container.remove(),s.delete(v.slot),u("surface.unmounted",{slot:v.slot,id:v.id}),f(v.slot)}function b(v){let S=s.get(v);return{slot:v,occupied:!!S,currentPriority:S?.options.priority,currentAdaptiveId:S?.options.adaptiveId,mountCount:o.get(v)??0,currentMountId:S?.id}}function d(v,S){let w=l.get(v);return w||(w=new Set,l.set(v,w)),w.add(S),()=>{w?.delete(S),w?.size===0&&l.delete(v)}}function h(v,S){let w=s.get(v);return w?S!==void 0?S>=w.options.priority:!1:!0}function m(){for(let v of s.values())try{v.cleanup?.(),v.container.remove()}catch(S){console.error("[Surfaces] Error during cleanup:",S)}s.clear(),l.clear()}return{mount:y,getState:b,onStateChange:d,canMount:h,destroy:m}}var Rf=class{constructor(){F(this,"widgets",new Map);F(this,"mountedWidgets",new Map);F(this,"mountIdCounter",0)}register(e,n,i="custom",r){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:i,metadata:r})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),!0):!1}unregisterBySource(e){for(let[n,i]of this.widgets.entries())i.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,i){let r=this.widgets.get(e);if(!r)throw new Error(`Widget not found: ${e}`);let a=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",a),n.setAttribute("data-widget-id",e);let s=r.widget.mount(n,i);return this.mountedWidgets.set(a,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let l=this.mountedWidgets.get(a);l&&(l.cleanup?.(),this.mountedWidgets.delete(a),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:l=>{if(r.widget.update)r.widget.update(n,l);else{let c=this.mountedWidgets.get(a);if(c){c.cleanup?.(),n.innerHTML="";let u=r.widget.mount(n,l);c.cleanup=u??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(n=>n.source===e)}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},wy=new Rf;function Cy(t){let{appId:e,runtime:n,isBuiltIn:i=!1}=t,r=`app:${e}:`,a=[],s=[],o=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>o.get(c),set:(c,u)=>o.set(c,u),remove:c=>o.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,f)=>{let g=n.surfaces.mount(c,u,{...f,adaptiveId:e});return{unmount:()=>g.unmount(),update:p=>g.update(p)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,i),a.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),s.push(c.id)}}}function Ay(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var Of=class{constructor(){F(this,"apps",new Map);F(this,"eventListeners",new Set);F(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.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 n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"){console.warn(`[AppRegistry] App already active: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let i of n.manifest.dependencies){let r=this.apps.get(i);if(!r||r.state!=="active")throw new Error(`App ${e} depends on ${i}, which is not active`)}n.state="activating";try{let i=n.manifest.metadata?.isBuiltIn===!0,r=Cy({appId:e,runtime:this.runtime,isBuiltIn:i}),{runtime:a}=n.manifest,s=[];if(a){if(a.actions)for(let o of a.actions)r.registerAction(o);if(a.widgets)for(let o of a.widgets)r.registerWidget(o);if(a.events)for(let o of a.events){let l=this.runtime.events.subscribe(c=>{if(o.names.includes(c.name)){let u={appId:e,state:r.state,telemetry:r.telemetry,surfaces:r.surfaces};try{o.handler(c,u)}catch(f){console.error(`[AppRegistry] Event handler error in ${e}:`,f)}}});s.push(l)}}n.cleanup=async()=>{for(let o of s)try{await o()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Ay(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[i,r]of this.apps)if(r.state==="active"&&r.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${i} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(i){throw n.state="error",n.error=String(i),this.emit({type:"app:error",appId:e,error:String(i)}),i}}async unregister(e){let n=this.apps.get(e);n&&(n.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 n of this.eventListeners)try{n(e)}catch(i){console.error("[AppRegistry] Event listener error:",i)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},ky=new Of;var i4=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"]),r4={navigation:"nav"};function dA(t){return r4[t]??t}function fA(t){return i4.has(t)}function pA(t){if(fA(t))return null;let e=t.indexOf(":");return e===-1?null:dA(t.slice(0,e))}function hA(t){let e=t.indexOf(":");return e===-1?null:dA(t.slice(0,e))}function Ty(t){let{cdnBase:e,registry:n,timeout:i=1e4,onLoadStart:r,onLoadEnd:a}=t,s=new Map,o=new Set;function l(y){return`${e}/adaptives/${y}/index.js`}async function c(y){if(n.has(y))return{appId:y,success:!0,manifest:n.get(y)?.manifest};if(s.has(y))return s.get(y);let _=(async()=>{r?.(y);try{let b=l(y);if(o.has(b)){let v=n.get(y);if(v)return a?.(y,!0),{appId:y,success:!0,manifest:v.manifest}}let d=new Promise((v,S)=>{setTimeout(()=>S(new Error(`Timeout loading app: ${y}`)),i)}),h=u(b,y);await Promise.race([h,d]),o.add(b);let m=n.get(y);if(!m)throw new Error(`App ${y} did not register after loading`);return a?.(y,!0),{appId:y,success:!0,manifest:m.manifest}}catch(b){let d=b instanceof Error?b.message:String(b);return a?.(y,!1,d),{appId:y,success:!1,error:d}}finally{s.delete(y)}})();return s.set(y,_),_}async function u(y,_){if(typeof window<"u"){try{let b=await import(y);b.manifest?n.register(b.manifest):b.default?.manifest?n.register(b.default.manifest):b.default&&n.register(b.default);return}catch{}return new Promise((b,d)=>{let h=document.createElement("script");h.src=y,h.async=!0,h.onload=()=>{n.get(_)?b():d(new Error(`App ${_} did not self-register`))},h.onerror=()=>{d(new Error(`Failed to load app script: ${y}`))},document.head.appendChild(h)})}throw new Error("Dynamic app loading not supported in SSR")}function f(y){let _=new Set;if(y.apps)for(let b of y.apps)_.add(b);if(y.actions)for(let b of y.actions){let d=pA(b.kind);if(d&&_.add(d),b.kind==="core:mountWidget"){let h=b.widget?.widgetId;if(h){let m=hA(h);m&&_.add(m)}}}return Array.from(_)}async function g(y){let _=f(y);return _.length===0?[]:await Promise.all(_.map(d=>c(d)))}async function p(y){return Promise.all(y.map(_=>c(_)))}return{loadApp:c,loadAppsForConfig:g,preloadApps:p,getRequiredApps:f,getAppUrl:l}}var yc=null;function mA(){if(yc&&document.body.contains(yc))return yc;let t=document.getElementById("syntro-overlays");return t||(t=document.createElement("div"),t.id="syntro-overlays",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(t)),yc=t,a4(),yc}var gA=!1;function a4(){if(gA)return;let t=`
|
|
143
144
|
:root {
|
|
144
145
|
--syntro-surface: #111;
|
|
145
146
|
--syntro-fg: #fff;
|
|
@@ -396,48 +397,59 @@ Error generating stack: `+o.message+`
|
|
|
396
397
|
background: var(--syntro-accent, #4338ca);
|
|
397
398
|
filter: brightness(1.1);
|
|
398
399
|
}
|
|
399
|
-
`,e=document.createElement("style");e.setAttribute("data-syntro","base-overlay"),e.textContent=t,document.head.appendChild(e),ik=!0}var ak="2.0.0";function k2(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let r=n.replace(/\/$/,"")||"/";if(e.exclude){for(let i of e.exclude)if(sk(r,i))return!1}if(e.include&&e.include.length>0){for(let i of e.include)if(sk(r,i))return!0;return!1}return!0}function sk(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let r=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function C2(t,e){if(t.startsWith("[data-"))return document.querySelector(t);let n=e.get();if(n.anchors&&n.anchors.find(o=>o.anchorId===t)?.present){let o=document.querySelector(`[data-syntro-anchor="${t}"]`);if(o)return o}if(t.startsWith(".")||t.startsWith("#")||t.startsWith("["))return document.querySelector(t);let r=document.getElementById(t);return r||document.querySelector(`[data-syntro-anchor="${t}"]`)}function Tm(t={}){let{telemetry:e,sessionMetrics:n,routes:r,mode:i="production",namespace:o}=t,s=t.widgets??bm,a=t.executors??Ui,l=t.apps??Em,u=Wg({telemetry:e,routes:r}),c=t.events??Da(),f=Qg({namespace:o}),h=Jg({state:f,events:c,sessionMetrics:n}),g=ok(),v=p=>C2(p,u),_=Sm({overlayRoot:g,eventBus:c,anchorResolver:v,widgetRegistry:s}),x=hm({overlayRoot:g,eventBus:c,surfaces:_,anchorResolver:v,executorRegistry:a}),d={telemetry:e,context:u,events:c,state:f,sessionMetrics:n,actions:x,surfaces:_,widgets:s,executors:a,apps:l,version:ak,mode:i,async evaluate(p){return h.evaluate(p,u.get())},evaluateSync(p){return h.evaluateSync(p,u.get())},async filterTiles(p){let m=u.get().page.url,y=[];for(let w of p){let b=w.activation;if(!b){y.push(w);continue}if(!k2(m,b.routes))continue;if(!b.strategy){y.push(w);continue}(await this.evaluate(b.strategy)).value&&y.push(w)}return y},setRoutes(p){u.setRoutes(p)},destroy(){l.unbind().catch(p=>{console.error("[Runtime] Error unbinding apps registry:",p)}),u.destroy(),x.destroy(),_.destroy()}};return l.bind(d),d}var Rm="syn_";function Yc(t){if(!t.startsWith(Rm))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Rm.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(n),i=JSON.parse(r);if(i.v!==1)throw new Error(`Unsupported token version: ${i.v}`);return i}function Im(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Rm+n}var lk={growthbook:t=>ip({...t,autoInit:!0})};function uk(t,e){let n=lk[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(lk).join(", ")}`);return n(e)}var ck={posthog:t=>$f(t),noop:()=>Vf()};function dk(t,e){let n=ck[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(ck).join(", ")}`);return n(e)}var E2=["cdn.syntrologie.com","localhost","127.0.0.1"];function A2(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):E2.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var Pm=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!A2(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let r=await n.text();if(this.integrity){let l=await T2(r),u=this.integrity.replace("sha384-","");if(l!==u)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${u}, got ${l}`)}let i=JSON.parse(r),o=performance.now()-e,s=n.headers.get("cache-control"),a=n.headers.get("age");return{config:i,meta:{source:"cdn",fetchTimeMs:o,cached:s?.includes("public")??!1,cacheAge:a?parseInt(a,10):void 0}}}};async function T2(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",n),i=new Uint8Array(r);return btoa(String.fromCharCode(...i))}function fk(t){return new Pm(t)}var R2="syntro_exp",I2="syntro_var",Nm=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config"}async fetch(){let e=performance.now();if(typeof window<"u"){let i=new URLSearchParams(window.location.search),o=i.get(R2),s=i.get(I2);if(o&&s!==null&&this.client.setForcedVariations){let a=parseInt(s,10);isNaN(a)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${a}`),this.client.setForcedVariations({[o]:a}))}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="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:n,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}};function pk(t){return new Nm(t)}var P2="https://cdn.syntrologie.com/configs",hk={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return fk({baseUrl:t.baseUrl??P2,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return pk({featureKey:t.featureKey})}};function gk(t,e={}){let n=hk[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(hk).join(", ")}`);return n(e)}function ir(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{}}function N2(){if(typeof window>"u")return F("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("editor_token");return F("Syntro Bootstrap","isEditorMode check:",{url:window.location.href,search:window.location.search,hasEditorToken:e,allParams:Object.fromEntries(t.entries())}),e}function O2(){if(typeof window>"u")return F("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit");return F("Syntro Bootstrap","isAuditMode check:",{url:window.location.href,hasAuditFlag:e,auditSessionId:t.get("audit_session_id")??"none"}),e}var mk="syntro_segment_attributes";function L2(){if(typeof window>"u")return{};try{let t=localStorage.getItem(mk);if(t){let e=JSON.parse(t);return F("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){ft("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function M2(t){if(!(typeof window>"u"))try{localStorage.setItem(mk,JSON.stringify(t)),F("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){ft("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function F2(t){if(!t)return{};let e={};for(let[n,r]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=r===!0);return e}async function $2(t){dp(),F("Syntro Bootstrap","====== INIT ======"),F("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:t.token?.slice(0,15)+"...",hasCanvasOptions:!!t.canvas});let e=N2(),n=O2(),r=e?"editor":n?"audit":null;F("Syntro Bootstrap","SDK mode:",r??"normal");let i;if(t.token)if(t.token.startsWith("syn_"))F("Syntro Bootstrap","Token starts with syn_, decoding..."),i=Yc(t.token),dp(i.d);else if(r)F("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw Yl("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit mode!"),Yl("Syntro Bootstrap","Token received:",t.token),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)F("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw Yl("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit mode!"),new Error("Syntro token is required (unless in editor or audit mode)");let o=ir("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||ir("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,s=ir("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||ir("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,a=ir("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||ir("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,l=L2();F("Syntro Bootstrap","Phase 1: Using cached segment attributes:",l);let u,c=Da();console.log("[Syntro Bootstrap] EventBus created");let f=Kg(b=>{c.publishEvent(b)}),h=b=>{F("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let k=F2(b);if(F("Syntro Bootstrap","Segment flags from PostHog:",k),M2(k),u){let I={...v?.getAll?.()??{},...k};F("Syntro Bootstrap","Updating GrowthBook with attributes:",I),u.setAttributes?.(I)}},g;if(i?.t){let b=i.t==="noop"?"noop":"posthog";g=dk(b,{apiKey:i.t,apiHost:s,enableFeatureFlags:!0,onFeatureFlagsLoaded:h,onCapture:f}),console.log(`[Syntro Bootstrap] Telemetry client created (${b}) with EventBus wiring`)}let v;i?.e&&(u=uk("growthbook",{clientKey:i.e,apiHost:o,attributes:l,onExperimentViewed:g?.trackExperiment?(b,k,C)=>{g.trackExperiment(b,k,C)}:void 0})),t.enableSessionMetrics&&(v=jg({experiments:u,onMetricChange:(b,k)=>{F("Syntro Bootstrap",`Session metric changed: ${b} = ${k}`)}}),F("Syntro Bootstrap","SessionMetricTracker created"));let _="production";e?_="editor":n?_="audit":ir("NODE_ENV")==="development"&&(_="development");let x=Tm({telemetry:g,sessionMetrics:v,mode:_,events:c});F("Syntro Bootstrap","Runtime created:",{version:x.version,mode:x.mode,hasContext:!!x.context,hasEvents:!!x.events,hasState:!!x.state}),F("Syntro Bootstrap","Core app executors already registered");let d=t.cdnBase||ir("NEXT_PUBLIC_SYNTRO_CDN_BASE")||ir("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",p=Am({cdnBase:d,registry:x.apps,onLoadStart:b=>{F("Syntro Bootstrap",`Loading app from CDN: ${b}`)},onLoadEnd:(b,k,C)=>{k?F("Syntro Bootstrap",`App loaded successfully: ${b}`):ft("Syntro Bootstrap",`Failed to load app: ${b}`,C)}});if(typeof window<"u"&&(window.SynOS={appRegistry:x.apps,runtime:x,version:x.version},F("Syntro Bootstrap","Global SynOS object exposed")),u?.refreshFeatures)try{await u.refreshFeatures(),F("Syntro Bootstrap","GrowthBook features loaded")}catch(b){ft("Syntro Bootstrap","Failed to load GrowthBook features:",b)}let m;if(t.fetcher)m=t.fetcher;else if(i?.f){let b=gk(i.f,i.o??{});m=async()=>{let k=await b.fetch();return{...k.config,tiles:k.config.tiles??[]}}}else u&&(m=Uo({experiments:u}));let y=m?async()=>{let b=await m(),k=b,C=p.getRequiredApps(k);return F("Syntro Bootstrap","Config fetched, required apps:",C),C.length>0&&await p.loadAppsForConfig(k).then(async A=>{let H=A.filter(K=>!K.success);H.length>0&&ft("Syntro Bootstrap","Some apps failed to load:",H);for(let K of C)if(x.apps.has(K))try{await x.apps.activate(K)}catch(Y){ft("Syntro Bootstrap",`Failed to activate app: ${K}`,Y)}}),b}:void 0;return{canvas:await Dg({...t.canvas,fetcher:y,integrations:{experiments:u,telemetry:g},editorUrl:a,runtime:x}),runtime:x,experiments:u,telemetry:g,sessionMetrics:v,appLoader:p}}var vk={init:$2,encodeToken:Im,decodeToken:Yc};typeof window<"u"&&(window.Syntro=vk);export{Ka as ANIMATION_KEYFRAMES,mP as ActivationConfigZ,jI as AnchorStateZ,nP as AnchorVisibleConditionZ,Zc as AppRegistry,UI as AugmentationZ,HI as BoundingBoxZ,vn as CanvasEvents,Hg as CanvasRecipeZ,QS as ConditionZ,Ac as ContextManager,lP as CooldownActiveConditionZ,JS as DecisionStrategyZ,aP as DismissedConditionZ,ho as EVENT_SCHEMA_VERSION,Tc as EventBus,GI as EventFilterZ,rP as EventOccurredConditionZ,WS as EventSourceZ,qc as ExecutorRegistry,hP as ExternalStrategyZ,QI as FrequencyEntryZ,uP as FrequencyLimitConditionZ,$I as HighlightStepZ,pP as ModelStrategyZ,KI as NormalizedEventZ,DI as PageContextZ,VI as PageHistoryEntryZ,eP as PageUrlConditionZ,ak as RUNTIME_VERSION,tP as RouteConditionZ,gP as RouteFilterZ,dP as RuleStrategyZ,cP as RuleZ,WI as RuntimeContextZ,yp as RuntimeProvider,lr as SDK_SCHEMA_VERSION,Jc as SDK_VERSION,Qb as STATIC_SLOT_STYLES,fP as ScoreStrategyZ,HS as SelectorZ,BI as SessionContextZ,sP as SessionMetricConditionZ,Ec as SessionMetricTracker,fS as ShadowCanvasOverlay,mS as SmartCanvasApp,Lg as SmartCanvasController,$g as SmartCanvasElement,eL as SmartCanvasPortal,Ee as StandardEvents,iP as StateEqualsConditionZ,Rc as StateStore,XI as StoredValueZ,vk as Syntro,zs as TileCard,PO as TileWheel,FI as TooltipStepZ,oP as ViewportConditionZ,zI as ViewportContextZ,Gc as WidgetRegistry,Em as appRegistry,gm as applyStaticSlotStyles,Cm as cleanupAppContext,yP as contentRuntime,hm as createActionEngine,km as createAppContext,Am as createAppLoader,Uo as createCanvasConfigFetcher,Wg as createContextManager,Jg as createDecisionEngine,Da as createEventBus,ip as createGrowthBookClient,Vf as createNoopClient,jL as createOverlayRecipeFetcher,$f as createPostHogClient,Kg as createPostHogNormalizer,jg as createSessionMetricTracker,Dg as createSmartCanvas,pS as createSmartCanvasController,Tm as createSmartCanvasRuntime,Qg as createStateStore,wm as createSurfaceContainer,Sm as createSurfaces,Yc as decodeToken,Im as encodeToken,rb as evaluate,eb as evaluateCondition,tb as evaluateRule,Ic as evaluateRuleStrategy,Pc as evaluateScoreStrategy,ib as evaluateSync,Ui as executorRegistry,xR as getAntiFlickerSnippet,nk as getAppIdFromActionKind,rk as getAppIdFromWidgetId,n2 as getExecutor,Kc as getSlotAnchorId,qa as getSlotType,xm as getSlotZIndex,fm as hasExecutor,tk as isCoreActionKind,U2 as needsMigration,KS as normalizePostHogEvent,QP as overlaysRuntime,is as parseVersion,ym as playEnterAnimation,_m as playExitAnimation,SS as registerSmartCanvasElement,Mg as resolveConfigUri,mm as setupAdjacentPositioning,vm as setupInlinePositioning,GS as shouldNormalizeEvent,QE as useDecision,_p as usePageContext,Fn as useRuntime,Jl as useRuntimeContext,YE as useRuntimeEvents,XE as useRuntimeState,GE as useSessionContext,V_ as useShadowCanvasConfig,ZE as useViewportContext,ei as validateAction,pm as validateActions,DM as validateActivationConfig,FM as validateCondition,j2 as validateConfig,sM as validateEventFilter,xM as validateFrequencyEntry,oM as validateNormalizedEvent,VL as validateRecipe,YL as validateRuntimeContext,wM as validateStoredValue,$M as validateStrategy,bm as widgetRegistry};
|
|
400
|
+
`,e=document.createElement("style");e.setAttribute("data-syntro","base-overlay"),e.textContent=t,document.head.appendChild(e),gA=!0}var yA="2.0.0";function s4(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let i=n.replace(/\/$/,"")||"/";if(e.exclude){for(let r of e.exclude)if(vA(i,r))return!1}if(e.include&&e.include.length>0){for(let r of e.include)if(vA(i,r))return!0;return!1}return!0}function vA(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let i=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${i}$`).test(t)}function o4(t,e){if(t.startsWith("[data-"))return document.querySelector(t);let n=e.get();if(n.anchors&&n.anchors.find(a=>a.anchorId===t)?.present){let a=document.querySelector(`[data-syntro-anchor="${t}"]`);if(a)return a}if(t.startsWith(".")||t.startsWith("#")||t.startsWith("["))return document.querySelector(t);let i=document.getElementById(t);return i||document.querySelector(`[data-syntro-anchor="${t}"]`)}function Ry(t={}){let{telemetry:e,sessionMetrics:n,routes:i,mode:r="production",namespace:a}=t,s=t.widgets??wy,o=t.executors??Ua,l=t.apps??ky,c=Yv({telemetry:e,routes:i}),u=t.events??lc(),f=ey({namespace:a}),g=ty({state:f,events:u,sessionMetrics:n}),p=mA(),y=h=>o4(h,c),_=Ey({overlayRoot:p,eventBus:u,anchorResolver:y,widgetRegistry:s}),b=gy({overlayRoot:p,eventBus:u,surfaces:_,anchorResolver:y,executorRegistry:o}),d={telemetry:e,context:c,events:u,state:f,sessionMetrics:n,actions:b,surfaces:_,widgets:s,executors:o,apps:l,version:yA,mode:r,async evaluate(h){return g.evaluate(h,c.get())},evaluateSync(h){return g.evaluateSync(h,c.get())},async filterTiles(h){let m=c.get().page.url,v=[];for(let S of h){let w=S.activation;if(!w){v.push(S);continue}if(!s4(m,w.routes))continue;if(!w.strategy){v.push(S);continue}(await this.evaluate(w.strategy)).value&&v.push(S)}return v},setRoutes(h){c.setRoutes(h)},destroy(){l.unbind().catch(h=>{console.error("[Runtime] Error unbinding apps registry:",h)}),c.destroy(),b.destroy(),_.destroy()}};return l.bind(d),d}var _A={growthbook:t=>Uh({...t,autoInit:!0})};function bA(t,e){let n=_A[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(_A).join(", ")}`);return n(e)}var l4=["cdn.syntrologie.com","localhost","127.0.0.1"];function c4(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):l4.some(r=>e.hostname===r)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var Oy=class{constructor(e){F(this,"name","cdn");F(this,"url");F(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!c4(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let i=await n.text();if(this.integrity){let l=await u4(i),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let r=JSON.parse(i),a=performance.now()-e,s=n.headers.get("cache-control"),o=n.headers.get("age");return{config:r,meta:{source:"cdn",fetchTimeMs:a,cached:s?.includes("public")??!1,cacheAge:o?parseInt(o,10):void 0}}}};async function u4(t){let n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-384",n),r=new Uint8Array(i);return btoa(String.fromCharCode(...r))}function SA(t){return new Oy(t)}var d4="syntro_exp",f4="syntro_var",My=class{constructor(e){F(this,"name","experiments");F(this,"client");F(this,"featureKey");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config"}async fetch(){let e=performance.now();if(typeof window<"u"){let r=new URLSearchParams(window.location.search),a=r.get(d4),s=r.get(f4);if(a&&s!==null&&this.client.setForcedVariations){let o=parseInt(s,10);isNaN(o)||(console.log(`[SmartCanvas] Preview mode: forcing "${a}" to variation ${o}`),this.client.setForcedVariations({[a]:o}))}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let i=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:i,cached:!0}}}};function xA(t){return new My(t)}var p4="https://cdn.syntrologie.com/configs",EA={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return SA({baseUrl:t.baseUrl??p4,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return xA({featureKey:t.featureKey})}};function wA(t,e={}){let n=EA[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(EA).join(", ")}`);return n(e)}var CA={posthog:t=>vh(t),noop:()=>_h()};function AA(t,e){let n=CA[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(CA).join(", ")}`);return n(e)}var Ny="syn_";function Mf(t){if(!t.startsWith(Ny))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(Ny.length).replace(/-/g,"+").replace(/_/g,"/"),i=atob(n),r=JSON.parse(i);if(r.v!==1)throw new Error(`Unsupported token version: ${r.v}`);return r}function Dy(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return Ny+n}function $i(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{}}function h4(){if(typeof window>"u")return j("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=Jd(),n=!!(to()?.token&&t?.mode==="editor");return j("Syntro Bootstrap","isEditorMode:",n),n}function g4(){if(typeof window>"u")return j("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=Jd(),n=!!(to()?.token&&t?.mode==="audit");return j("Syntro Bootstrap","isAuditMode:",n),n}var kA="syntro_segment_attributes";function m4(){if(typeof window>"u")return{};try{let t=localStorage.getItem(kA);if(t){let e=JSON.parse(t);return j("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){Rt("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function v4(t){if(!(typeof window>"u"))try{localStorage.setItem(kA,JSON.stringify(t)),j("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){Rt("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function y4(t){if(!t)return{};let e={};for(let[n,i]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=i===!0);return e}async function _4(t){Yh(),j("Syntro Bootstrap","====== INIT ======"),j("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:`${t.token?.slice(0,15)}...`,hasCanvasOptions:!!t.canvas});let e=h4(),n=g4(),i=e?"editor":n?"audit":null;j("Syntro Bootstrap","SDK mode:",i??"normal");let r;if(t.token)if(t.token.startsWith("syn_"))j("Syntro Bootstrap","Token starts with syn_, decoding..."),r=Mf(t.token),Yh(r.d);else if(i)j("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${i} mode)`);else throw yu("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit mode!"),yu("Syntro Bootstrap","Token received:",t.token),new Error("Invalid Syntro token: must start with 'syn_'");else if(i)j("Syntro Bootstrap",`\u2713 No token, but ${i} mode - proceeding`);else throw yu("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit mode!"),new Error("Syntro token is required (unless in editor or audit mode)");let a=$i("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||$i("VITE_SYNTRO_EXPERIMENT_HOST")||r?.eh,s=$i("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||$i("VITE_SYNTRO_TELEMETRY_HOST")||r?.th,o=$i("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||$i("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,l=m4();j("Syntro Bootstrap","Phase 1: Using cached segment attributes:",l);let c,u=lc();console.log("[Syntro Bootstrap] EventBus created");let f=Kv(w=>{u.publishEvent(w)}),g=w=>{j("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let E=y4(w);if(j("Syntro Bootstrap","Segment flags from PostHog:",E),v4(E),c){let O={...y?.getAll?.()??{},...E};j("Syntro Bootstrap","Updating GrowthBook with attributes:",O),c.setAttributes?.(O)}},p;if(r?.t){let w=r.t==="noop"?"noop":"posthog";p=AA(w,{apiKey:r.t,apiHost:s,enableFeatureFlags:!0,onFeatureFlagsLoaded:g,onCapture:f}),console.log(`[Syntro Bootstrap] Telemetry client created (${w}) with EventBus wiring`)}let y;r?.e&&(c=bA("growthbook",{clientKey:r.e,apiHost:a,attributes:l,onExperimentViewed:p?.trackExperiment?(w,E,C)=>{p.trackExperiment(w,E,C)}:void 0})),t.enableSessionMetrics&&(y=Pv({experiments:c,onMetricChange:(w,E)=>{j("Syntro Bootstrap",`Session metric changed: ${w} = ${E}`)}}),j("Syntro Bootstrap","SessionMetricTracker created"));let _="production";e?_="editor":n?_="audit":$i("NODE_ENV")==="development"&&(_="development");let b=Ry({telemetry:p,sessionMetrics:y,mode:_,events:u});j("Syntro Bootstrap","Runtime created:",{version:b.version,mode:b.mode,hasContext:!!b.context,hasEvents:!!b.events,hasState:!!b.state}),j("Syntro Bootstrap","Core app executors already registered");let d=t.cdnBase||$i("NEXT_PUBLIC_SYNTRO_CDN_BASE")||$i("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntrologie.com",h=Ty({cdnBase:d,registry:b.apps,onLoadStart:w=>{j("Syntro Bootstrap",`Loading app from CDN: ${w}`)},onLoadEnd:(w,E,C)=>{E?j("Syntro Bootstrap",`App loaded successfully: ${w}`):Rt("Syntro Bootstrap",`Failed to load app: ${w}`,C)}});if(typeof window<"u"&&(window.SynOS={appRegistry:b.apps,runtime:b,version:b.version},j("Syntro Bootstrap","Global SynOS object exposed")),c?.refreshFeatures)try{await c.refreshFeatures(),j("Syntro Bootstrap","GrowthBook features loaded")}catch(w){Rt("Syntro Bootstrap","Failed to load GrowthBook features:",w)}let m;if(t.fetcher)m=t.fetcher;else if(r?.f){let w=wA(r.f,r.o??{});m=async()=>{let E=await w.fetch();return{...E.config,tiles:E.config.tiles??[]}}}else c&&(m=cs({experiments:c}));let v=m?async()=>{let w=await m(),E=w,C=h.getRequiredApps(E);return j("Syntro Bootstrap","Config fetched, required apps:",C),C.length>0&&await h.loadAppsForConfig(E).then(async T=>{let I=T.filter(Y=>!Y.success);I.length>0&&Rt("Syntro Bootstrap","Some apps failed to load:",I);for(let Y of C)if(b.apps.has(Y))try{await b.apps.activate(Y)}catch(Q){Rt("Syntro Bootstrap",`Failed to activate app: ${Y}`,Q)}}),w}:void 0;return{canvas:await Vv({...t.canvas,fetcher:v,integrations:{experiments:c,telemetry:p},editorUrl:o,runtime:b}),runtime:b,experiments:c,telemetry:p,sessionMetrics:y,appLoader:h}}var TA={init:_4,encodeToken:Dy,decodeToken:Mf};typeof window<"u"&&(window.Syntro=TA);export{vc as ANIMATION_KEYFRAMES,WD as ActivationConfigZ,wD as AnchorStateZ,HD as AnchorVisibleConditionZ,Of as AppRegistry,CD as AugmentationZ,ED as BoundingBoxZ,Fn as CanvasEvents,qv as CanvasRecipeZ,lC as ConditionZ,of as ContextManager,jD as CooldownActiveConditionZ,cC as DecisionStrategyZ,FD as DismissedConditionZ,ls as EVENT_SCHEMA_VERSION,lf as EventBus,RD as EventFilterZ,UD as EventOccurredConditionZ,tC as EventSourceZ,kf as ExecutorRegistry,KD as ExternalStrategyZ,DD as FrequencyEntryZ,qD as FrequencyLimitConditionZ,yD as HighlightStepZ,ZD as ModelStrategyZ,TD as NormalizedEventZ,_D as PageContextZ,bD as PageHistoryEntryZ,zD as PageUrlConditionZ,yA as RUNTIME_VERSION,BD as RouteConditionZ,XD as RouteFilterZ,GD as RuleStrategyZ,PD as RuleZ,AD as RuntimeContextZ,eg as RuntimeProvider,ji as SDK_SCHEMA_VERSION,Lf as SDK_VERSION,cA as STATIC_SLOT_STYLES,YD as ScoreStrategyZ,Qw as SelectorZ,SD as SessionContextZ,ID as SessionMetricConditionZ,sf as SessionMetricTracker,Qb as ShadowCanvasOverlay,nS as SmartCanvasApp,ig as SmartCanvasController,Hv as SmartCanvasElement,pz as SmartCanvasPortal,Ve as StandardEvents,$D as StateEqualsConditionZ,cf as StateStore,ND as StoredValueZ,TA as Syntro,tl as TileCard,IL as TileWheel,vD as TooltipStepZ,VD as ViewportConditionZ,xD as ViewportContextZ,Rf as WidgetRegistry,ky as appRegistry,my as applyStaticSlotStyles,Ay as cleanupAppContext,JD as contentRuntime,gy as createActionEngine,Cy as createAppContext,Ty as createAppLoader,cs as createCanvasConfigFetcher,Yv as createContextManager,ty as createDecisionEngine,lc as createEventBus,Uh as createGrowthBookClient,_h as createNoopClient,n6 as createOverlayRecipeFetcher,vh as createPostHogClient,Kv as createPostHogNormalizer,Pv as createSessionMetricTracker,Vv as createSmartCanvas,Jb as createSmartCanvasController,Ry as createSmartCanvasRuntime,ey as createStateStore,Sy as createSurfaceContainer,Ey as createSurfaces,Mf as decodeToken,Dy as encodeToken,pC as evaluate,uC as evaluateCondition,dC as evaluateRule,uf as evaluateRuleStrategy,df as evaluateScoreStrategy,hC as evaluateSync,Ua as executorRegistry,nN as getAntiFlickerSnippet,pA as getAppIdFromActionKind,hA as getAppIdFromWidgetId,U3 as getExecutor,Tf as getSlotAnchorId,mc as getSlotType,xy as getSlotZIndex,py as hasExecutor,fA as isCoreActionKind,A4 as needsMigration,iC as normalizePostHogEvent,L3 as overlaysRuntime,go as parseVersion,_y as playEnterAnimation,by as playExitAnimation,Dw as registerSmartCanvasElement,rg as resolveConfigUri,vy as setupAdjacentPositioning,yy as setupInlinePositioning,rC as shouldNormalizeEvent,v2 as useDecision,tg as usePageContext,oi as useRuntime,Su as useRuntimeContext,g2 as useRuntimeEvents,m2 as useRuntimeState,p2 as useSessionContext,$b as useShadowCanvasConfig,h2 as useViewportContext,jr as validateAction,hy as validateActions,W6 as validateActivationConfig,K6 as validateCondition,C4 as validateConfig,_6 as validateEventFilter,L6 as validateFrequencyEntry,y6 as validateNormalizedEvent,Qz as validateRecipe,c6 as validateRuntimeContext,D6 as validateStoredValue,X6 as validateStrategy,wy as widgetRegistry};
|
|
400
401
|
/*! Bundled license information:
|
|
401
402
|
|
|
402
|
-
react/cjs/react.production.
|
|
403
|
+
react/cjs/react.production.js:
|
|
403
404
|
(**
|
|
404
405
|
* @license React
|
|
405
|
-
* react.production.
|
|
406
|
+
* react.production.js
|
|
406
407
|
*
|
|
407
|
-
* Copyright (c)
|
|
408
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
408
409
|
*
|
|
409
410
|
* This source code is licensed under the MIT license found in the
|
|
410
411
|
* LICENSE file in the root directory of this source tree.
|
|
411
412
|
*)
|
|
412
413
|
|
|
413
|
-
react/cjs/react-jsx-runtime.production.
|
|
414
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
414
415
|
(**
|
|
415
416
|
* @license React
|
|
416
|
-
* react-jsx-runtime.production.
|
|
417
|
+
* react-jsx-runtime.production.js
|
|
417
418
|
*
|
|
418
|
-
* Copyright (c)
|
|
419
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
419
420
|
*
|
|
420
421
|
* This source code is licensed under the MIT license found in the
|
|
421
422
|
* LICENSE file in the root directory of this source tree.
|
|
422
423
|
*)
|
|
423
424
|
|
|
424
|
-
|
|
425
|
+
react-dom/cjs/react-dom.production.js:
|
|
425
426
|
(**
|
|
426
427
|
* @license React
|
|
427
|
-
*
|
|
428
|
+
* react-dom.production.js
|
|
428
429
|
*
|
|
429
|
-
* Copyright (c)
|
|
430
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
430
431
|
*
|
|
431
432
|
* This source code is licensed under the MIT license found in the
|
|
432
433
|
* LICENSE file in the root directory of this source tree.
|
|
433
434
|
*)
|
|
434
435
|
|
|
435
|
-
|
|
436
|
+
scheduler/cjs/scheduler.production.js:
|
|
436
437
|
(**
|
|
437
438
|
* @license React
|
|
438
|
-
*
|
|
439
|
+
* scheduler.production.js
|
|
439
440
|
*
|
|
440
|
-
* Copyright (c)
|
|
441
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the MIT license found in the
|
|
444
|
+
* LICENSE file in the root directory of this source tree.
|
|
445
|
+
*)
|
|
446
|
+
|
|
447
|
+
react-dom/cjs/react-dom-client.production.js:
|
|
448
|
+
(**
|
|
449
|
+
* @license React
|
|
450
|
+
* react-dom-client.production.js
|
|
451
|
+
*
|
|
452
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
441
453
|
*
|
|
442
454
|
* This source code is licensed under the MIT license found in the
|
|
443
455
|
* LICENSE file in the root directory of this source tree.
|