rivet-design 0.13.2 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/README.npm.md +5 -1
- package/dist/agent-variants/SessionStore.d.ts +22 -2
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +31 -0
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/VariantWorkspaceManager.d.ts +43 -0
- package/dist/agent-variants/VariantWorkspaceManager.d.ts.map +1 -0
- package/dist/agent-variants/VariantWorkspaceManager.js +216 -0
- package/dist/agent-variants/VariantWorkspaceManager.js.map +1 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +27 -2
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +370 -60
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +62 -1
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +10 -1
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/workItemBriefing.d.ts +26 -0
- package/dist/agent-variants/workItemBriefing.d.ts.map +1 -0
- package/dist/agent-variants/workItemBriefing.js +110 -0
- package/dist/agent-variants/workItemBriefing.js.map +1 -0
- package/dist/cli/client.d.ts +2 -0
- package/dist/cli/client.d.ts.map +1 -1
- package/dist/cli/client.js +1 -1
- package/dist/cli/client.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +36 -8
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +3 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/variants.d.ts.map +1 -1
- package/dist/cli/commands/variants.js +45 -8
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/hostWorkNextAction.d.ts +33 -26
- package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
- package/dist/cli/hostWorkNextAction.js +47 -24
- package/dist/cli/hostWorkNextAction.js.map +1 -1
- package/dist/hosts/workerDefaults.d.ts +62 -0
- package/dist/hosts/workerDefaults.d.ts.map +1 -0
- package/dist/hosts/workerDefaults.js +77 -0
- package/dist/hosts/workerDefaults.js.map +1 -0
- package/dist/install/codexGuidance.d.ts.map +1 -1
- package/dist/install/codexGuidance.js +5 -4
- package/dist/install/codexGuidance.js.map +1 -1
- package/dist/install/harnesses.d.ts.map +1 -1
- package/dist/install/harnesses.js +44 -16
- package/dist/install/harnesses.js.map +1 -1
- package/dist/install/mcpRegistration.d.ts +1 -1
- package/dist/install/mcpRegistration.d.ts.map +1 -1
- package/dist/install/mcpRegistration.js +23 -10
- package/dist/install/mcpRegistration.js.map +1 -1
- package/dist/routes/agentVariants.js +2 -2
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +8 -0
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +24 -0
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +8 -0
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +5 -2
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +39 -14
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +7 -2
- package/dist/services/WorktreeManager.js.map +1 -1
- package/dist/types/change-request-types.d.ts +3 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/cloneOrCopyDirSync.d.ts +14 -0
- package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -0
- package/dist/utils/cloneOrCopyDirSync.js +72 -0
- package/dist/utils/cloneOrCopyDirSync.js.map +1 -0
- package/dist/utils/skillWriter.d.ts +8 -0
- package/dist/utils/skillWriter.d.ts.map +1 -1
- package/dist/utils/skillWriter.js +35 -0
- package/dist/utils/skillWriter.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +2 -2
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +2 -2
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +8 -8
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/package.json +12 -9
- package/scripts/verify-node-version.cjs +52 -0
- package/src/ui/dist/assets/main-T3U4Gt16.js +419 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-BBHg643G.js +0 -419
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
var UI=Object.defineProperty;var fS=t=>{throw TypeError(t)};var BI=(t,e,n)=>e in t?UI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var xo=(t,e,n)=>BI(t,typeof e!="symbol"?e+"":e,n),rv=(t,e,n)=>e.has(t)||fS("Cannot "+n);var W=(t,e,n)=>(rv(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?fS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Re=(t,e,n,r)=>(rv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ot=(t,e,n)=>(rv(t,e,"access private method"),n);var kh=(t,e,n,r)=>({set _(s){Re(t,e,s,n)},get _(){return W(t,e,r)}});function WI(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Vm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sv={exports:{}},Lc={},iv={exports:{}},rt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var hS;function GI(){if(hS)return rt;hS=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function v(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function b(D,Z,te){this.props=D,this.context=Z,this.refs=_,this.updater=te||y}b.prototype.isReactComponent={},b.prototype.setState=function(D,Z){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,Z,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=b.prototype;function C(D,Z,te){this.props=D,this.context=Z,this.refs=_,this.updater=te||y}var P=C.prototype=new E;P.constructor=C,x(P,b.prototype),P.isPureReactComponent=!0;var T=Array.isArray,R=Object.prototype.hasOwnProperty,O={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function A(D,Z,te){var se,oe={},ue=null,he=null;if(Z!=null)for(se in Z.ref!==void 0&&(he=Z.ref),Z.key!==void 0&&(ue=""+Z.key),Z)R.call(Z,se)&&!I.hasOwnProperty(se)&&(oe[se]=Z[se]);var ie=arguments.length-2;if(ie===1)oe.children=te;else if(1<ie){for(var ae=Array(ie),me=0;me<ie;me++)ae[me]=arguments[me+2];oe.children=ae}if(D&&D.defaultProps)for(se in ie=D.defaultProps,ie)oe[se]===void 0&&(oe[se]=ie[se]);return{$$typeof:t,type:D,key:ue,ref:he,props:oe,_owner:O.current}}function N(D,Z){return{$$typeof:t,type:D.type,key:Z,ref:D.ref,props:D.props,_owner:D._owner}}function L(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function F(D){var Z={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(te){return Z[te]})}var V=/\/+/g;function G(D,Z){return typeof D=="object"&&D!==null&&D.key!=null?F(""+D.key):Z.toString(36)}function X(D,Z,te,se,oe){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var he=!1;if(D===null)he=!0;else switch(ue){case"string":case"number":he=!0;break;case"object":switch(D.$$typeof){case t:case e:he=!0}}if(he)return he=D,oe=oe(he),D=se===""?"."+G(he,0):se,T(oe)?(te="",D!=null&&(te=D.replace(V,"$&/")+"/"),X(oe,Z,te,"",function(me){return me})):oe!=null&&(L(oe)&&(oe=N(oe,te+(!oe.key||he&&he.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+D)),Z.push(oe)),1;if(he=0,se=se===""?".":se+":",T(D))for(var ie=0;ie<D.length;ie++){ue=D[ie];var ae=se+G(ue,ie);he+=X(ue,Z,te,ae,oe)}else if(ae=v(D),typeof ae=="function")for(D=ae.call(D),ie=0;!(ue=D.next()).done;)ue=ue.value,ae=se+G(ue,ie++),he+=X(ue,Z,te,ae,oe);else if(ue==="object")throw Z=String(D),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return he}function q(D,Z,te){if(D==null)return D;var se=[],oe=0;return X(D,se,"","",function(ue){return Z.call(te,ue,oe++)}),se}function B(D){if(D._status===-1){var Z=D._result;Z=Z(),Z.then(function(te){(D._status===0||D._status===-1)&&(D._status=1,D._result=te)},function(te){(D._status===0||D._status===-1)&&(D._status=2,D._result=te)}),D._status===-1&&(D._status=0,D._result=Z)}if(D._status===1)return D._result.default;throw D._result}var Y={current:null},$={transition:null},ee={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:$,ReactCurrentOwner:O};function H(){throw Error("act(...) is not supported in production builds of React.")}return rt.Children={map:q,forEach:function(D,Z,te){q(D,function(){Z.apply(this,arguments)},te)},count:function(D){var Z=0;return q(D,function(){Z++}),Z},toArray:function(D){return q(D,function(Z){return Z})||[]},only:function(D){if(!L(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},rt.Component=b,rt.Fragment=n,rt.Profiler=s,rt.PureComponent=C,rt.StrictMode=r,rt.Suspense=c,rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,rt.act=H,rt.cloneElement=function(D,Z,te){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var se=x({},D.props),oe=D.key,ue=D.ref,he=D._owner;if(Z!=null){if(Z.ref!==void 0&&(ue=Z.ref,he=O.current),Z.key!==void 0&&(oe=""+Z.key),D.type&&D.type.defaultProps)var ie=D.type.defaultProps;for(ae in Z)R.call(Z,ae)&&!I.hasOwnProperty(ae)&&(se[ae]=Z[ae]===void 0&&ie!==void 0?ie[ae]:Z[ae])}var ae=arguments.length-2;if(ae===1)se.children=te;else if(1<ae){ie=Array(ae);for(var me=0;me<ae;me++)ie[me]=arguments[me+2];se.children=ie}return{$$typeof:t,type:D.type,key:oe,ref:ue,props:se,_owner:he}},rt.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},rt.createElement=A,rt.createFactory=function(D){var Z=A.bind(null,D);return Z.type=D,Z},rt.createRef=function(){return{current:null}},rt.forwardRef=function(D){return{$$typeof:u,render:D}},rt.isValidElement=L,rt.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:B}},rt.memo=function(D,Z){return{$$typeof:f,type:D,compare:Z===void 0?null:Z}},rt.startTransition=function(D){var Z=$.transition;$.transition={};try{D()}finally{$.transition=Z}},rt.unstable_act=H,rt.useCallback=function(D,Z){return Y.current.useCallback(D,Z)},rt.useContext=function(D){return Y.current.useContext(D)},rt.useDebugValue=function(){},rt.useDeferredValue=function(D){return Y.current.useDeferredValue(D)},rt.useEffect=function(D,Z){return Y.current.useEffect(D,Z)},rt.useId=function(){return Y.current.useId()},rt.useImperativeHandle=function(D,Z,te){return Y.current.useImperativeHandle(D,Z,te)},rt.useInsertionEffect=function(D,Z){return Y.current.useInsertionEffect(D,Z)},rt.useLayoutEffect=function(D,Z){return Y.current.useLayoutEffect(D,Z)},rt.useMemo=function(D,Z){return Y.current.useMemo(D,Z)},rt.useReducer=function(D,Z,te){return Y.current.useReducer(D,Z,te)},rt.useRef=function(D){return Y.current.useRef(D)},rt.useState=function(D){return Y.current.useState(D)},rt.useSyncExternalStore=function(D,Z,te){return Y.current.useSyncExternalStore(D,Z,te)},rt.useTransition=function(){return Y.current.useTransition()},rt.version="18.3.1",rt}var pS;function z_(){return pS||(pS=1,iv.exports=GI()),iv.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var mS;function KI(){if(mS)return Lc;mS=1;var t=z_(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(u,c,f){var h,p={},v=null,y=null;f!==void 0&&(v=""+f),c.key!==void 0&&(v=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)r.call(c,h)&&!i.hasOwnProperty(h)&&(p[h]=c[h]);if(u&&u.defaultProps)for(h in c=u.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:e,type:u,key:v,ref:y,props:p,_owner:s.current}}return Lc.Fragment=n,Lc.jsx=a,Lc.jsxs=a,Lc}var gS;function qI(){return gS||(gS=1,sv.exports=KI()),sv.exports}var S=qI(),g=z_();const ve=Vm(g),U_=WI({__proto__:null,default:ve},[g]);var uf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Wa,Co,mu,BC,ZI=(BC=class extends uf{constructor(){super();Ue(this,Wa);Ue(this,Co);Ue(this,mu);Re(this,mu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Co)||this.setEventListener(W(this,mu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Co))==null||e.call(this),Re(this,Co,void 0))}setEventListener(e){var n;Re(this,mu,e),(n=W(this,Co))==null||n.call(this),Re(this,Co,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,Wa)!==e&&(Re(this,Wa,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,Wa)=="boolean"?W(this,Wa):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Wa=new WeakMap,Co=new WeakMap,mu=new WeakMap,BC),B_=new ZI,YI={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Po,H_,WC,XI=(WC=class{constructor(){Ue(this,Po,YI);Ue(this,H_,!1)}setTimeoutProvider(t){Re(this,Po,t)}setTimeout(t,e){return W(this,Po).setTimeout(t,e)}clearTimeout(t){W(this,Po).clearTimeout(t)}setInterval(t,e){return W(this,Po).setInterval(t,e)}clearInterval(t){W(this,Po).clearInterval(t)}},Po=new WeakMap,H_=new WeakMap,WC),$a=new XI;function QI(t){setTimeout(t,0)}var JI=typeof window>"u"||"Deno"in globalThis;function xr(){}function eN(t,e){return typeof t=="function"?t(e):t}function T1(t){return typeof t=="number"&&t>=0&&t!==1/0}function e8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function $o(t,e){return typeof t=="function"?t(e):t}function Fr(t,e){return typeof t=="function"?t(e):t}function vS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==W_(a,e.options))return!1}else if(!kd(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||i&&!i(e))}function yS(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Ed(e.options.mutationKey)!==Ed(i))return!1}else if(!kd(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function W_(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ed)(t)}function Ed(t){return JSON.stringify(t,(e,n)=>A1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function kd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>kd(t[n],e[n])):!1}var tN=Object.prototype.hasOwnProperty;function t8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=_S(t)&&_S(e);if(!r&&!(A1(t)&&A1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const p=r?h:a[h],v=t[p],y=e[p];if(v===y){c[p]=v,(r?h<i:tN.call(t,p))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){c[p]=y;continue}const x=t8(v,y,n+1);c[p]=x,x===v&&f++}return i===u&&f===i?t:c}function R1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function _S(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function A1(t){if(!xS(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!xS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function xS(t){return Object.prototype.toString.call(t)==="[object Object]"}function nN(t){return new Promise(e=>{$a.setTimeout(e,t)})}function M1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?t8(t,e):e}function rN(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function sN(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var G_=Symbol();function n8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===G_?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function r8(t,e){return typeof t=="function"?t(...e):!!t}function iN(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var Cd=(()=>{let t=()=>JI;return{isServer(){return t()},setIsServer(e){t=e}}})();function I1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var oN=QI;function aN(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=oN;const i=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var jn=aN(),gu,To,vu,GC,lN=(GC=class extends uf{constructor(){super();Ue(this,gu,!0);Ue(this,To);Ue(this,vu);Re(this,vu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,To)||this.setEventListener(W(this,vu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,To))==null||e.call(this),Re(this,To,void 0))}setEventListener(e){var n;Re(this,vu,e),(n=W(this,To))==null||n.call(this),Re(this,To,e(this.setOnline.bind(this)))}setOnline(e){W(this,gu)!==e&&(Re(this,gu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return W(this,gu)}},gu=new WeakMap,To=new WeakMap,vu=new WeakMap,GC),Fp=new lN;function uN(t){return Math.min(1e3*2**t,3e4)}function s8(t){return(t??"online")==="online"?Fp.isOnline():!0}var N1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function i8(t){let e=!1,n=0,r;const s=I1(),i=()=>s.status!=="pending",a=_=>{var b;if(!i()){const E=new N1(_);v(E),(b=t.onCancel)==null||b.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},f=()=>B_.isFocused()&&(t.networkMode==="always"||Fp.isOnline())&&t.canRun(),h=()=>s8(t.networkMode)&&t.canRun(),p=_=>{i()||(r==null||r(),s.resolve(_))},v=_=>{i()||(r==null||r(),s.reject(_))},y=()=>new Promise(_=>{var b;r=E=>{(i()||f())&&_(E)},(b=t.onPause)==null||b.call(t)}).then(()=>{var _;r=void 0,i()||(_=t.onContinue)==null||_.call(t)}),x=()=>{if(i())return;let _;const b=n===0?t.initialPromise:void 0;try{_=b??t.fn()}catch(E){_=Promise.reject(E)}Promise.resolve(_).then(p).catch(E=>{var O;if(i())return;const C=t.retry??(Cd.isServer()?0:3),P=t.retryDelay??uN,T=typeof P=="function"?P(n,E):P,R=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(e||!R){v(E);return}n++,(O=t.onFail)==null||O.call(t,n,E),nN(T).then(()=>f()?void 0:y()).then(()=>{e?v(E):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?x():y().then(x),s)}}var Ga,KC,o8=(KC=class{constructor(){Ue(this,Ga)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T1(this.gcTime)&&Re(this,Ga,$a.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Cd.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,Ga)!==void 0&&($a.clearTimeout(W(this,Ga)),Re(this,Ga,void 0))}},Ga=new WeakMap,KC);function cN(t){return{onFetch:(e,n)=>{var h,p,v,y,x;const r=e.options,s=(v=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let _=!1;const b=P=>{iN(P,()=>e.signal,()=>_=!0)},E=n8(e.options,e.fetchOptions),C=async(P,T,R)=>{if(_)return Promise.reject(e.signal.reason);if(T==null&&P.pages.length)return Promise.resolve(P);const I=(()=>{const F={client:e.client,queryKey:e.queryKey,pageParam:T,direction:R?"backward":"forward",meta:e.options.meta};return b(F),F})(),A=await E(I),{maxPages:N}=e.options,L=R?sN:rN;return{pages:L(P.pages,A,N),pageParams:L(P.pageParams,T,N)}};if(s&&i.length){const P=s==="backward",T=P?dN:wS,R={pages:i,pageParams:a},O=T(r,R);u=await C(R,O,P)}else{const P=t??i.length;do{const T=c===0?a[0]??r.initialPageParam:wS(r,u);if(c>0&&T==null)break;u=await C(u,T),c++}while(c<P)}return u};e.options.persister?e.fetchFn=()=>{var _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function wS(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function dN(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var yu,Ka,_u,is,qa,Pn,rf,Za,Dr,a8,Ri,qC,fN=(qC=class extends o8{constructor(e){super();Ue(this,Dr);Ue(this,yu);Ue(this,Ka);Ue(this,_u);Ue(this,is);Ue(this,qa);Ue(this,Pn);Ue(this,rf);Ue(this,Za);Re(this,Za,!1),Re(this,rf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Re(this,qa,e.client),Re(this,is,W(this,qa).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Re(this,Ka,SS(this.options)),this.state=e.state??W(this,Ka),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,yu)}get promise(){var e;return(e=W(this,Pn))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,rf),...e},e!=null&&e._type&&Re(this,yu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=SS(this.options);n.data!==void 0&&(this.setState(bS(n.data,n.dataUpdatedAt)),Re(this,Ka,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,is).remove(this)}setData(e,n){const r=M1(this.state.data,e,this.options);return ot(this,Dr,Ri).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ot(this,Dr,Ri).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Pn))==null?void 0:r.promise;return(s=W(this,Pn))==null||s.cancel(e),n?n.then(xr).catch(xr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,Ka)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Fr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===G_||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>$o(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!e8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=W(this,Pn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=W(this,Pn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,is).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(W(this,Pn)&&(W(this,Za)||ot(this,Dr,a8).call(this)?W(this,Pn).cancel({revert:!0}):W(this,Pn).cancelRetry()),this.scheduleGc()),W(this,is).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,Dr,Ri).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,p,v,y,x,_,b,E,C,P;if(this.state.fetchStatus!=="idle"&&((f=W(this,Pn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Pn))return W(this,Pn).continueRetry(),W(this,Pn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(R=>R.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Re(this,Za,!0),r.signal)})},i=()=>{const T=n8(this.options,n),O=(()=>{const I={client:W(this,qa),queryKey:this.queryKey,meta:this.meta};return s(I),I})();return Re(this,Za,!1),this.options.persister?this.options.persister(T,O,this):T(O)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,qa),state:this.state,fetchFn:i};return s(T),T})(),c=W(this,yu)==="infinite"?cN(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),Re(this,_u,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ot(this,Dr,Ri).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Re(this,Pn,i8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof N1&&T.revert&&this.setState({...W(this,_u),fetchStatus:"idle"}),r.abort()},onFail:(T,R)=>{ot(this,Dr,Ri).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{ot(this,Dr,Ri).call(this,{type:"pause"})},onContinue:()=>{ot(this,Dr,Ri).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await W(this,Pn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(v=W(this,is).config).onSuccess)==null||y.call(v,T,this),(_=(x=W(this,is).config).onSettled)==null||_.call(x,T,this.state.error,this),T}catch(T){if(T instanceof N1){if(T.silent)return W(this,Pn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw ot(this,Dr,Ri).call(this,{type:"error",error:T}),(E=(b=W(this,is).config).onError)==null||E.call(b,T,this),(P=(C=W(this,is).config).onSettled)==null||P.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},yu=new WeakMap,Ka=new WeakMap,_u=new WeakMap,is=new WeakMap,qa=new WeakMap,Pn=new WeakMap,rf=new WeakMap,Za=new WeakMap,Dr=new WeakSet,a8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ri=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...l8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...bS(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Re(this,_u,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),jn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,is).notify({query:this,type:"updated",action:e})})},qC);function l8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:s8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bS(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function SS(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var vr,ut,sf,rr,Ya,xu,Fi,Ro,of,wu,bu,Xa,Qa,Ao,Su,pt,Jc,O1,L1,D1,F1,j1,V1,$1,u8,ZC,hN=(ZC=class extends uf{constructor(e,n){super();Ue(this,pt);Ue(this,vr);Ue(this,ut);Ue(this,sf);Ue(this,rr);Ue(this,Ya);Ue(this,xu);Ue(this,Fi);Ue(this,Ro);Ue(this,of);Ue(this,wu);Ue(this,bu);Ue(this,Xa);Ue(this,Qa);Ue(this,Ao);Ue(this,Su,new Set);this.options=n,Re(this,vr,e),Re(this,Ro,null),Re(this,Fi,I1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,ut).addObserver(this),ES(W(this,ut),this.options)?ot(this,pt,Jc).call(this):this.updateResult(),ot(this,pt,F1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return H1(W(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return H1(W(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,pt,j1).call(this),ot(this,pt,V1).call(this),W(this,ut).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,ut);if(this.options=W(this,vr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fr(this.options.enabled,W(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ot(this,pt,$1).call(this),W(this,ut).setOptions(this.options),n._defaulted&&!R1(this.options,n)&&W(this,vr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,ut),observer:this});const s=this.hasListeners();s&&kS(W(this,ut),r,this.options,n)&&ot(this,pt,Jc).call(this),this.updateResult(),s&&(W(this,ut)!==r||Fr(this.options.enabled,W(this,ut))!==Fr(n.enabled,W(this,ut))||$o(this.options.staleTime,W(this,ut))!==$o(n.staleTime,W(this,ut)))&&ot(this,pt,O1).call(this);const i=ot(this,pt,L1).call(this);s&&(W(this,ut)!==r||Fr(this.options.enabled,W(this,ut))!==Fr(n.enabled,W(this,ut))||i!==W(this,Ao))&&ot(this,pt,D1).call(this,i)}getOptimisticResult(e){const n=W(this,vr).getQueryCache().build(W(this,vr),e),r=this.createResult(n,e);return mN(this,r)&&(Re(this,rr,r),Re(this,xu,this.options),Re(this,Ya,W(this,ut).state)),r}getCurrentResult(){return W(this,rr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,Fi).status==="pending"&&W(this,Fi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){W(this,Su).add(e)}getCurrentQuery(){return W(this,ut)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,vr).defaultQueryOptions(e),r=W(this,vr).getQueryCache().build(W(this,vr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ot(this,pt,Jc).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,rr)))}createResult(e,n){var N;const r=W(this,ut),s=this.options,i=W(this,rr),a=W(this,Ya),u=W(this,xu),f=e!==r?e.state:W(this,sf),{state:h}=e;let p={...h},v=!1,y;if(n._optimisticResults){const L=this.hasListeners(),F=!L&&ES(e,n),V=L&&kS(e,r,n,s);(F||V)&&(p={...p,...l8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:_,status:b}=p;y=p.data;let E=!1;if(n.placeholderData!==void 0&&y===void 0&&b==="pending"){let L;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(L=i.data,E=!0):L=typeof n.placeholderData=="function"?n.placeholderData((N=W(this,bu))==null?void 0:N.state.data,W(this,bu)):n.placeholderData,L!==void 0&&(b="success",y=M1(i==null?void 0:i.data,L,n),v=!0)}if(n.select&&y!==void 0&&!E)if(i&&y===(a==null?void 0:a.data)&&n.select===W(this,of))y=W(this,wu);else try{Re(this,of,n.select),y=n.select(y),y=M1(i==null?void 0:i.data,y,n),Re(this,wu,y),Re(this,Ro,null)}catch(L){Re(this,Ro,L)}W(this,Ro)&&(x=W(this,Ro),y=W(this,wu),_=Date.now(),b="error");const C=p.fetchStatus==="fetching",P=b==="pending",T=b==="error",R=P&&C,O=y!==void 0,A={status:b,fetchStatus:p.fetchStatus,isPending:P,isSuccess:b==="success",isError:T,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!P,isLoadingError:T&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:T&&O,isStale:K_(e,n),refetch:this.refetch,promise:W(this,Fi),isEnabled:Fr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=A.data!==void 0,F=A.status==="error"&&!L,V=q=>{F?q.reject(A.error):L&&q.resolve(A.data)},G=()=>{const q=Re(this,Fi,A.promise=I1());V(q)},X=W(this,Fi);switch(X.status){case"pending":e.queryHash===r.queryHash&&V(X);break;case"fulfilled":(F||A.data!==X.value)&&G();break;case"rejected":(!F||A.error!==X.reason)&&G();break}}return A}updateResult(){const e=W(this,rr),n=this.createResult(W(this,ut),this.options);if(Re(this,Ya,W(this,ut).state),Re(this,xu,this.options),W(this,Ya).data!==void 0&&Re(this,bu,W(this,ut)),R1(n,e))return;Re(this,rr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!W(this,Su).size)return!0;const a=new Set(i??W(this,Su));return this.options.throwOnError&&a.add("error"),Object.keys(W(this,rr)).some(u=>{const c=u;return W(this,rr)[c]!==e[c]&&a.has(c)})};ot(this,pt,u8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,pt,F1).call(this)}},vr=new WeakMap,ut=new WeakMap,sf=new WeakMap,rr=new WeakMap,Ya=new WeakMap,xu=new WeakMap,Fi=new WeakMap,Ro=new WeakMap,of=new WeakMap,wu=new WeakMap,bu=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,Ao=new WeakMap,Su=new WeakMap,pt=new WeakSet,Jc=function(e){ot(this,pt,$1).call(this);let n=W(this,ut).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(xr)),n},O1=function(){ot(this,pt,j1).call(this);const e=$o(this.options.staleTime,W(this,ut));if(Cd.isServer()||W(this,rr).isStale||!T1(e))return;const r=e8(W(this,rr).dataUpdatedAt,e)+1;Re(this,Xa,$a.setTimeout(()=>{W(this,rr).isStale||this.updateResult()},r))},L1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,ut)):this.options.refetchInterval)??!1},D1=function(e){ot(this,pt,V1).call(this),Re(this,Ao,e),!(Cd.isServer()||Fr(this.options.enabled,W(this,ut))===!1||!T1(W(this,Ao))||W(this,Ao)===0)&&Re(this,Qa,$a.setInterval(()=>{(this.options.refetchIntervalInBackground||B_.isFocused())&&ot(this,pt,Jc).call(this)},W(this,Ao)))},F1=function(){ot(this,pt,O1).call(this),ot(this,pt,D1).call(this,ot(this,pt,L1).call(this))},j1=function(){W(this,Xa)!==void 0&&($a.clearTimeout(W(this,Xa)),Re(this,Xa,void 0))},V1=function(){W(this,Qa)!==void 0&&($a.clearInterval(W(this,Qa)),Re(this,Qa,void 0))},$1=function(){const e=W(this,vr).getQueryCache().build(W(this,vr),this.options);if(e===W(this,ut))return;const n=W(this,ut);Re(this,ut,e),Re(this,sf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},u8=function(e){jn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(W(this,rr))}),W(this,vr).getQueryCache().notify({query:W(this,ut),type:"observerResultsUpdated"})})},ZC);function pN(t,e){return Fr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Fr(e.retryOnMount,t)===!1)}function ES(t,e){return pN(t,e)||t.state.data!==void 0&&H1(t,e,e.refetchOnMount)}function H1(t,e,n){if(Fr(e.enabled,t)!==!1&&$o(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&K_(t,e)}return!1}function kS(t,e,n,r){return(t!==e||Fr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&K_(t,n)}function K_(t,e){return Fr(e.enabled,t)!==!1&&t.isStaleByTime($o(e.staleTime,t))}function mN(t,e){return!R1(t.getCurrentResult(),e)}var af,qs,qn,Ja,Zs,So,YC,gN=(YC=class extends o8{constructor(e){super();Ue(this,Zs);Ue(this,af);Ue(this,qs);Ue(this,qn);Ue(this,Ja);Re(this,af,e.client),this.mutationId=e.mutationId,Re(this,qn,e.mutationCache),Re(this,qs,[]),this.state=e.state||vN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,qs).includes(e)||(W(this,qs).push(e),this.clearGcTimeout(),W(this,qn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Re(this,qs,W(this,qs).filter(n=>n!==e)),this.scheduleGc(),W(this,qn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,qs).length||(this.state.status==="pending"?this.scheduleGc():W(this,qn).remove(this))}continue(){var e;return((e=W(this,Ja))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,f,h,p,v,y,x,_,b,E,C,P,T,R,O,I;const n=()=>{ot(this,Zs,So).call(this,{type:"continue"})},r={client:W(this,af),meta:this.options.meta,mutationKey:this.options.mutationKey};Re(this,Ja,i8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,N)=>{ot(this,Zs,So).call(this,{type:"failed",failureCount:A,error:N})},onPause:()=>{ot(this,Zs,So).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,qn).canRun(this)}));const s=this.state.status==="pending",i=!W(this,Ja).canStart();try{if(s)n();else{ot(this,Zs,So).call(this,{type:"pending",variables:e,isPaused:i}),W(this,qn).config.onMutate&&await W(this,qn).config.onMutate(e,this,r);const N=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));N!==this.state.context&&ot(this,Zs,So).call(this,{type:"pending",context:N,variables:e,isPaused:i})}const A=await W(this,Ja).start();return await((f=(c=W(this,qn).config).onSuccess)==null?void 0:f.call(c,A,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,e,this.state.context,r)),await((y=(v=W(this,qn).config).onSettled)==null?void 0:y.call(v,A,null,this.state.variables,this.state.context,this,r)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,A,null,e,this.state.context,r)),ot(this,Zs,So).call(this,{type:"success",data:A}),A}catch(A){try{await((E=(b=W(this,qn).config).onError)==null?void 0:E.call(b,A,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,A,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((R=(T=W(this,qn).config).onSettled)==null?void 0:R.call(T,void 0,A,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((I=(O=this.options).onSettled)==null?void 0:I.call(O,void 0,A,e,this.state.context,r))}catch(N){Promise.reject(N)}throw ot(this,Zs,So).call(this,{type:"error",error:A}),A}finally{W(this,qn).runNext(this)}}},af=new WeakMap,qs=new WeakMap,qn=new WeakMap,Ja=new WeakMap,Zs=new WeakSet,So=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),jn.batch(()=>{W(this,qs).forEach(r=>{r.onMutationUpdate(e)}),W(this,qn).notify({mutation:this,type:"updated",action:e})})},YC);function vN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ji,Cs,lf,XC,yN=(XC=class extends uf{constructor(e={}){super();Ue(this,ji);Ue(this,Cs);Ue(this,lf);this.config=e,Re(this,ji,new Set),Re(this,Cs,new Map),Re(this,lf,0)}build(e,n,r){const s=new gN({client:e,mutationCache:this,mutationId:++kh(this,lf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,ji).add(e);const n=Ch(e);if(typeof n=="string"){const r=W(this,Cs).get(n);r?r.push(e):W(this,Cs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,ji).delete(e)){const n=Ch(e);if(typeof n=="string"){const r=W(this,Cs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,Cs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ch(e);if(typeof n=="string"){const r=W(this,Cs).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Ch(e);if(typeof n=="string"){const s=(r=W(this,Cs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jn.batch(()=>{W(this,ji).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,ji).clear(),W(this,Cs).clear()})}getAll(){return Array.from(W(this,ji))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>yS(n,r))}findAll(e={}){return this.getAll().filter(n=>yS(e,n))}notify(e){jn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return jn.batch(()=>Promise.all(e.map(n=>n.continue().catch(xr))))}},ji=new WeakMap,Cs=new WeakMap,lf=new WeakMap,XC);function Ch(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Ys,QC,_N=(QC=class extends uf{constructor(e={}){super();Ue(this,Ys);this.config=e,Re(this,Ys,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??W_(s,n);let a=this.get(i);return a||(a=new fN({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){W(this,Ys).has(e.queryHash)||(W(this,Ys).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=W(this,Ys).get(e.queryHash);n&&(e.destroy(),n===e&&W(this,Ys).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,Ys).get(e)}getAll(){return[...W(this,Ys).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>vS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>vS(e,r)):n}notify(e){jn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){jn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ys=new WeakMap,QC),Qt,Mo,Io,Eu,ku,No,Cu,Pu,JC,xN=(JC=class{constructor(t={}){Ue(this,Qt);Ue(this,Mo);Ue(this,Io);Ue(this,Eu);Ue(this,ku);Ue(this,No);Ue(this,Cu);Ue(this,Pu);Re(this,Qt,t.queryCache||new _N),Re(this,Mo,t.mutationCache||new yN),Re(this,Io,t.defaultOptions||{}),Re(this,Eu,new Map),Re(this,ku,new Map),Re(this,No,0)}mount(){kh(this,No)._++,W(this,No)===1&&(Re(this,Cu,B_.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Qt).onFocus())})),Re(this,Pu,Fp.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Qt).onOnline())})))}unmount(){var t,e;kh(this,No)._--,W(this,No)===0&&((t=W(this,Cu))==null||t.call(this),Re(this,Cu,void 0),(e=W(this,Pu))==null||e.call(this),Re(this,Pu,void 0))}isFetching(t){return W(this,Qt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Mo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Qt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,Qt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime($o(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,Qt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=W(this,Qt).get(r.queryHash),i=s==null?void 0:s.state.data,a=eN(e,i);if(a!==void 0)return W(this,Qt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return jn.batch(()=>W(this,Qt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Qt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,Qt);jn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,Qt);return jn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=jn.batch(()=>W(this,Qt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(xr).catch(xr)}invalidateQueries(t,e={}){return jn.batch(()=>(W(this,Qt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=jn.batch(()=>W(this,Qt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(xr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(xr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Qt).build(this,e);return n.isStaleByTime($o(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xr).catch(xr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xr).catch(xr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Fp.isOnline()?W(this,Mo).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Qt)}getMutationCache(){return W(this,Mo)}getDefaultOptions(){return W(this,Io)}setDefaultOptions(t){Re(this,Io,t)}setQueryDefaults(t,e){W(this,Eu).set(Ed(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,Eu).values()],n={};return e.forEach(r=>{kd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,ku).set(Ed(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,ku).values()],n={};return e.forEach(r=>{kd(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Io).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=W_(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===G_&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Io).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,Qt).clear(),W(this,Mo).clear()}},Qt=new WeakMap,Mo=new WeakMap,Io=new WeakMap,Eu=new WeakMap,ku=new WeakMap,No=new WeakMap,Cu=new WeakMap,Pu=new WeakMap,JC),c8=g.createContext(void 0),d8=t=>{const e=g.useContext(c8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},wN=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(c8.Provider,{value:t,children:e})),f8=g.createContext(!1),bN=()=>g.useContext(f8);f8.Provider;function SN(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var EN=g.createContext(SN()),kN=()=>g.useContext(EN),CN=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?r8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},PN=t=>{g.useEffect(()=>{t.clearReset()},[t])},TN=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||r8(n,[t.error,r])),RN=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},AN=(t,e)=>t.isLoading&&t.isFetching&&!e,MN=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,CS=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function IN(t,e,n){var y,x,_,b;const r=bN(),s=kN(),i=d8(),a=i.defaultQueryOptions(t);(x=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||x.call(y,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,RN(a),CN(a,s,u),PN(s);const f=!i.getQueryCache().get(a.queryHash),[h]=g.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),v=!r&&c;if(g.useSyncExternalStore(g.useCallback(E=>{const C=v?h.subscribe(jn.batchCalls(E)):xr;return h.updateResult(),C},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),g.useEffect(()=>{h.setOptions(a)},[a,h]),MN(a,p))throw CS(a,h,s);if(TN({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((b=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||b.call(_,a,p),a.experimental_prefetchInRender&&!Cd.isServer()&&AN(p,r)){const E=f?CS(a,h,s):u==null?void 0:u.promise;E==null||E.catch(xr).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function z1(t,e){return IN(t,hN)}var ne=typeof window<"u"?window:void 0,_n=typeof globalThis<"u"?globalThis:ne;typeof self>"u"&&(_n.self=_n),typeof File>"u"&&(_n.File=function(){});var ir=_n==null?void 0:_n.navigator,Ee=_n==null?void 0:_n.document,on=_n==null?void 0:_n.location,q_=_n==null?void 0:_n.fetch,U1=_n!=null&&_n.XMLHttpRequest&&"withCredentials"in new _n.XMLHttpRequest?_n.XMLHttpRequest:void 0,PS=_n==null?void 0:_n.AbortController,NN=_n==null?void 0:_n.CompressionStream,yr=ir==null?void 0:ir.userAgent,$e=ne??{};function h8(){return!(!ne||ne.navigator.onLine===!1)}var TS="1.400.1",Vt={DEBUG:!1,LIB_VERSION:TS,LIB_NAME:"web",JS_SDK_VERSION:TS};function RS(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(f){return void n(f)}u.done?e(c):Promise.resolve(c).then(r,s)}function en(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){RS(i,r,s,a,u,"next",c)}function u(c){RS(i,r,s,a,u,"throw",c)}a(void 0)}))}}function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fe.apply(null,arguments)}function p8(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 AS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function MS(t){return typeof t=="string"||t}function IS(t){return typeof t=="string"?t:void 0}var Dc,Ni=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),NS=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),ON=["$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"],LN=["token"],m8="NativeGzipValidationError",B1=t=>t.length>=2&&t[0]===31&&t[1]===139,OS=(t,e)=>t===NS.GZipJS||e===NS.GZipJS||e==="gzip",LS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Ph=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=m8,e},DN=(function(){var t=en((function*(e,n){18>e.size&&Ph("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());B1(r)&&r[2]===8||Ph("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(Dc)return Dc;Dc=[];for(var h=0;256>h;h++){for(var p=h,v=0;8>v;v++)p=1&p?3988292384^p>>>1:p>>>1;Dc[h]=p>>>0}return Dc})(),c=4294967295,f=0;a.length>f;f++)c=u[255&(c^a[f])]^c>>>8;return(4294967295^c)>>>0})(n)&&Ph("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Ph("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function W1(){return W1=en((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var f=en((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return f.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield DN(c,r),c}catch(f){if(n!=null&&n.rethrow)throw f;return e&&console.error("Failed to gzip compress data",f),null}})),W1.apply(this,arguments)}var FN=["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"],DS=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return FN.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Be(t,e){return t.indexOf(e)!==-1}var $m=function(t){return t.trim()},G1=function(t){return t.replace(/^\$/,"")};function g8(t){var e,n=[];return(e=JSON.stringify(t,(function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}})))!==null&&e!==void 0?e:"null"}var v8=Object.prototype,y8=v8.hasOwnProperty,Hm=v8.toString,et=Array.isArray||function(t){return Hm.call(t)==="[object Array]"},Ps=t=>typeof t=="function",Ot=t=>t===Object(t)&&!et(t),Oo=t=>{if(Ot(t)){for(var e in t)if(y8.call(t,e))return!1;return!0}return!1},xe=t=>t===void 0,_t=t=>Hm.call(t)=="[object String]",K1=t=>_t(t)&&t.trim().length===0,lr=t=>t===null,Ye=t=>xe(t)||lr(t),$n=t=>Hm.call(t)=="[object Number]"&&t==t,Ai=t=>$n(t)&&t>0,si=t=>Hm.call(t)==="[object Boolean]",jN=t=>t instanceof FormData,VN=t=>Be(ON,t),$N=t=>Be(LN,t);function _8(t){return t===null||typeof t!="object"}function jp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Z_(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var HN=[!0,"true",1,"1","yes"],ov=t=>Be(HN,t),zN=[!1,"false",0,"0","no"];function ti(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),$n(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(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: "+s),ti(s||n,e,n,r))}class UN{constructor(e){this.Pe={},this.Oe=e.Oe,this.Fe=ti(e.bucketSize,0,100,e.Ae),this.$e=ti(e.refillRate,0,this.Fe,e.Ae),this.Ne=ti(e.refillInterval,0,864e5,e.Ae)}De(e,n){var r=Math.floor((n-e.lastAccess)/this.Ne);r>0&&(e.tokens=Math.min(e.tokens+r*this.$e,this.Fe),e.lastAccess=e.lastAccess+r*this.Ne)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.Pe[s];return i?this.De(i,r):this.Pe[s]=i={tokens:this.Fe,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.Oe)==null||n.call(this,e)),i.tokens===0)}stop(){this.Pe={}}}var Ur="Mobile",Vp="iOS",zi="Android",Tu="Tablet",x8=zi+" "+Tu,w8="iPad",b8="Apple",S8=b8+" Watch",ld="Safari",Ru="BlackBerry",E8="Samsung",k8=E8+"Browser",C8=E8+" Internet",el="Chrome",BN=el+" OS",P8=el+" "+Vp,Y_="Internet Explorer",T8=Y_+" "+Ur,X_="Opera",WN=X_+" Mini",Q_="Edge",R8="Microsoft "+Q_,ou="Firefox",A8=ou+" "+Vp,Pd="Nintendo",Td="PlayStation",au="Xbox",M8=zi+" "+Ur,I8=Ur+" "+ld,ed="Windows",q1=ed+" Phone",FS="Nokia",Z1="Ouya",N8="Generic",GN=N8+" "+Ur.toLowerCase(),O8=N8+" "+Tu.toLowerCase(),Y1="Konqueror",L8="Oculus Browser",$p="Vivaldi",D8="Yandex",Hp="Whale",X1="DuckDuckGo",F8="Pale Moon",zp="Waterfox",ud="Brave",j8="Google Search App",jt="(\\d+(\\.\\d+)?)",av=new RegExp("Version/"+jt),KN=new RegExp(au,"i"),qN=new RegExp(Td+" \\w+","i"),ZN=new RegExp(Pd+" \\w+","i"),J_=new RegExp(Ru+"|PlayBook|BB10","i"),YN={"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"},V8=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?ud:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Be(t,"GSA/")?j8:Be(t," OPR/")&&Be(t,"Mini")?WN:Be(t," OPR/")?X_:J_.test(t)?Ru:Be(t,"IE"+Ur)||Be(t,"WPDesktop")?T8:Be(t,"OculusBrowser")?L8:Be(t,k8)?C8:Be(t,Q_)||Be(t,"Edg/")?R8:Be(t,$p+"/")?$p:Be(t,"YaBrowser/")?D8:Be(t,Hp+"/")?Hp:Be(t,X1+"/")||Be(t,"Ddg/")?X1:Be(t,"FBIOS")?"Facebook "+Ur:Be(t,"UCWEB")||Be(t,"UCBrowser")?"UC Browser":Be(t,"CriOS")?P8:Be(t,"CrMo")||Be(t,el)?el:Be(t,zi)&&Be(t,ld)?M8:Be(t,"FxiOS")?A8:Be(t.toLowerCase(),Y1.toLowerCase())?Y1:Be(t,ud+"/")?ud:((i,a)=>a&&Be(a,b8)||(function(u){return Be(u,ld)&&!Be(u,el)&&!Be(u,zi)})(i))(t,e)?Be(t,Ur)?I8:ld:Be(t,"PaleMoon/")?F8:Be(t,zp+"/")?zp:Be(t,ou)?ou:Be(t,"MSIE")||Be(t,"Trident/")?Y_:Be(t,"Gecko")?ou:"")},XN={[T8]:[new RegExp("rv:"+jt)],[R8]:[new RegExp(Q_+"?\\/"+jt)],[el]:[new RegExp("("+el+"|CrMo)\\/"+jt)],[P8]:[new RegExp("CriOS\\/"+jt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+jt)],[ld]:[av],[I8]:[av],[X_]:[new RegExp("(Opera|OPR)\\/"+jt)],[ou]:[new RegExp(ou+"\\/"+jt)],[A8]:[new RegExp("FxiOS\\/"+jt)],[Y1]:[new RegExp("Konqueror[:/]?"+jt,"i")],[Ru]:[new RegExp(Ru+" "+jt),av],[M8]:[new RegExp("android\\s"+jt,"i")],[C8]:[new RegExp(k8+"\\/"+jt)],[L8]:[new RegExp("OculusBrowser\\/"+jt)],[$p]:[new RegExp($p+"\\/"+jt)],[D8]:[new RegExp("YaBrowser\\/"+jt)],[Hp]:[new RegExp(Hp+"\\/"+jt)],[ud]:[new RegExp(ud+"\\/"+jt)],[X1]:[new RegExp("(DuckDuckGo|Ddg)\\/"+jt)],[F8]:[new RegExp("PaleMoon\\/"+jt)],[zp]:[new RegExp(zp+"\\/"+jt)],[j8]:[new RegExp("GSA\\/"+jt)],[Y_]:[new RegExp("(rv:|MSIE )"+jt)],Mozilla:[new RegExp("rv:"+jt)]},QN=function(t,e,n,r){var s=V8(t,e,n,r),i=XN[s];if(xe(i))return null;for(var a=0;i.length>a;a++){var u=t.match(i[a]);if(u)return parseFloat(u[u.length-2])}return null},jS=[[new RegExp(au+"; "+au+" (.*?)[);]","i"),t=>[au,t&&t[1]||""]],[new RegExp(Pd,"i"),[Pd,""]],[new RegExp(Td,"i"),[Td,""]],[J_,[Ru,""]],[new RegExp(ed,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[q1,""];if(new RegExp(Ur).test(e)&&!/IEMobile\b/.test(e))return[ed+" "+Ur,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=YN[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[ed,r]}return[ed,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Vp,[t[3],t[4],t[5]||"0"].join(".")]:[Vp,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=xe(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+zi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+zi+")","i"),t=>t&&t[2]?[zi,[t[2],t[3],t[4]||"0"].join(".")]:[zi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[BN,""]],[/Linux|debian/i,["Linux",""]]],VS=function(t){return ZN.test(t)?Pd:qN.test(t)?Td:KN.test(t)?au:new RegExp(Z1,"i").test(t)?Z1:new RegExp("("+q1+"|WPDesktop)","i").test(t)?q1:/iPad/.test(t)?w8:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?S8:J_.test(t)?Ru:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(FS,"i").test(t)?FS:/(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(Ur).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)?zi:x8:new RegExp("(pda|"+Ur+")","i").test(t)?GN:new RegExp(Tu,"i").test(t)&&!new RegExp(Tu+" pc","i").test(t)?O8:""},JN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function $S(t,e){return typeof(n=t)=="string"&&JN.test(n)?t:e();var n}function Uo(t){return t&&t.split("#")[0]}function op(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var eO=t=>t instanceof Error,$8={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},tO=$8.info;function H8(t){if(si(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(et(t))return{arrayValue:{values:t.map((e=>H8(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Up(t){var e=[];for(var n in t){var r=t[n];lr(r)||xe(r)||e.push({key:n,value:H8(r)})}return e}function nO(t,e){var n=$8[t.level||"info"]||tO,r=n.text,s=n.number,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Ye(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Ye(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=fe({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:Up(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),xe(t.trace_flags)||(c.flags=t.trace_flags),c}function z8(t,e,n){return fe({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function U8(t,e,n,r){return{resourceLogs:[{resource:{attributes:Up(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let rO=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Se=e,this.Ae=n,this.qe=r,this.je=s,this.Be=i,this.He=a,this.Ue=null,this.ze=0,this.We=0,this.Ve=0,this.Ze=0,this.Ge=!1,this.Qe=e.maxBufferSize,this.Je=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.Ke=e.flushIntervalMs,this.Ye=e.maxBatchRecordsPerPost,this.Xe=e.rateCapWindowMs,this.et=e.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.Ve=0,this.Ze=0,this.Ge=!1,this.ze=0,this.We=0,this.Ye=this.Se.maxBatchRecordsPerPost}onReconnect(){this.We=0,this.rt()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.it(t);if(e!==null)if(e.body){if(this.nt()){var n={record:nO(e,this.qe())};this.je((()=>this.st(n)))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=et(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ae.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.Ae.error("Error in beforeSend function for log:",a),null}return r}nt(){if(this.et===void 0)return!0;var t=Date.now(),e=t-this.Ve;return this.Xe>e&&e>=0||(this.Ve=t,this.Ze=0,this.Ge=!1),this.et>this.Ze?(this.Ze++,!0):(this.Ge||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ge=!0),!1)}flush(){var t=this;return en((function*(){if(!t._instance.isDisabled)return t.Ue||(t.Ue=t.ot().finally((()=>{t.Ue=null}))),t.Ue}))()}ot(){var t=this;return en((function*(){var e;t.tt();var n=(e=t._instance.getPersistedProperty(Ni.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,a;t.ze=0;var u=Math.min(n.length,t.Ye),c=n.slice(0,u),f=U8(c.map((p=>p.record)),t.ut(),(i=t.He)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.ht(f);if(h.kind==="too-large"&&c.length>1)t.Ye=Math.max(1,Math.floor(c.length/2)),t.Ae.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.Ye);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Se.maxBatchRecordsPerPost>t.Ye&&(t.Ye=Math.min(t.Se.maxBatchRecordsPerPost,t.Ye+1)),yield t.dt(c.length),n=(a=t._instance.getPersistedProperty(Ni.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}dt(t){var e=this;return en((function*(){var n,r=Math.max(0,t-e.ze),s=(n=e._instance.getPersistedProperty(Ni.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ni.LogsQueue,s.slice(r)),yield e.Be()}))()}ut(){return z8(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Ni.LogsQueue))!==null&&e!==void 0?e:[];this.Je>n.length||(n.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ni.LogsQueue,n),this.Qe>n.length?this.ct():this.rt()}}ct(t){t===void 0&&(t=this.Ke),this.vt||(this.vt=op((()=>{this.vt=void 0,this.rt()}),t))}ft(){var t=Math.min(Math.max(0,this.We-1),6);return this.Ke*Math.pow(2,t)}yt(){var t=this._instance.getPersistedProperty(Ni.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return en((function*(){e.tt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>op(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return en((function*(){var n=!1,r=e.flush(),s=new Promise((i=>op((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.We=0}),(t=>{this.We++,this.Ae.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var lv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function HS(t){return String(t)+"000000"}function zS(t,e,n,r){var s="";return r&&(s=Object.keys(r).sort().map((i=>JSON.stringify(i)+":"+JSON.stringify(r[i]))).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+s}let sO=class{constructor(t,e,n){this._instance=t,this.Se=e,this.Ae=n,this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}count(t,e,n){e===void 0&&(e=1),this.kt({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.kt({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.kt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.Ue,n=(function(){var s=en((function*(){e&&(yield e.catch((()=>{}))),yield t.St()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.Ue===r&&(this.Ue=null)}));return this.Ue=r,r}drainWindow(){if(this.bt.size===0)return null;var t=this.bt;return this.bt=new Map,this._t=!1,this.wt=new Map,this.xt=new Set,this.Ct(t)}reset(){this.tt(),this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}kt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.it(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ae.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n=this.wt.get(e.name);n===void 0?this.wt.set(e.name,e.type):n===e.type||this.xt.has(e.name)||(this.xt.add(e.name),this.Ae.warn("Metric name '"+e.name+"' is already used as a "+n+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name."));var r=zS(e.type,e.name,e.unit,e.attributes),s=this.bt.get(r);if(!s){if(this.bt.size>=this.Se.maxSeriesPerFlush)return void(this._t||(this._t=!0,this.Ae.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")));s={name:e.name,type:e.type,unit:e.unit,attributes:e.attributes?fe({},e.attributes):void 0,windowStartMs:Date.now()},this.bt.set(r,s)}this.Tt(s,e.value),this.ct()}else this.Ae.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ae.warn("Dropping metric with empty name")}}Tt(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(lv.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(var a=0;i.length>a;a++)if(i[a]>=s)return a;return i.length})(e,lv)]+=1}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=et(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ae.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.Ae.error("Error in beforeSend function for metric:",a),null}return r}ct(){this.vt||(this.vt=op((()=>{this.vt=void 0,this.flush().catch((()=>{}))}),this.Se.flushIntervalMs))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}St(){var t=this;return en((function*(){if(t.bt.size!==0){var e=t.bt;t.bt=new Map,t._t=!1,t.wt=new Map,t.xt=new Set;var n=yield t._instance.It(t.Ct(e));switch(n.kind){case"ok":return;case"retry-later":return t.Mt(e),void t.ct();case"too-large":return void t.Ae.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ae.error("Failed to send metrics batch:",n.error)}}}))()}Ct(t){return(function(s,i,a,u){return{resourceMetrics:[{resource:{attributes:Up(i)},scopeMetrics:[{scope:{name:a,version:u},metrics:s}]}]}})(this.Et(t),(e=this.Se,n=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),fe({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":n,"telemetry.sdk.version":r})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,n,r}Et(t){var e=HS(Date.now()),n=new Map;for(var r of t.values()){var s,i=zS(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=fe({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var u=Up((s=r.attributes)!==null&&s!==void 0?s:{}),c=HS(r.windowStartMs);if(r.type==="count"){var f,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(f=r.total)!==null&&f!==void 0?f:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,v={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:u,startTimeUnixNano:c,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:lv})}return Array.from(n.values())}Mt(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.bt.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var u=0;a.hist.bucketCounts.length>u;u++)a.hist.bucketCounts[u]+=i.hist.bucketCounts[u]}else a.hist=i.hist}else this.bt.set(s,i)}}};var Th,US,uv;function iO(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return uv&&n.length===US||(US=n.length,uv=n.reduce(((r,s)=>{Th||(Th={});var i=Th[s];if(i)r[i[0]]=i[1];else for(var a=t(s),u=a.length-1;u>=0;u--){var c=a[u],f=c==null?void 0:c.filename,h=e[s];if(f&&h){r[f]=h,Th[s]=[f,h];break}}return r}),{})),uv}}class oO{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"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return en((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&et(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,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),fe({},e,{cause:r,stack:s})}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 en((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var u=[a];return e.cause!=null&&u.push(...this.convertToExceptionList(e.cause,fe({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:iO(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var u=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,u)}};return fe({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Au="?";function Q1(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Au:n,in_app:!0};return xe(r)||(i.lineno=r),xe(s)||(i.colno=s),i}var B8=(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]:Au,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},aO=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,lO=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,uO=/\((\S*)(?::(\d+))(?::(\d+))\)/,cO=(t,e)=>{var n=aO.exec(t);if(n)return Q1(e,n[1],Au,+n[2],+n[3]);var r=lO.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=uO.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=B8(r[1]||Au,r[2]);return Q1(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},dO=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,fO=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hO=(t,e)=>{var n=dO.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=fO.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Au,a=B8(i,s);return Q1(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},BS=/\(error: (.*)\)/;class pO{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=_t(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 jp(e,"DOMException")}isDOMError(e){return jp(e,"DOMError")}}class mO{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 String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class gO{constructor(){}match(e){return jp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var vO=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class yO{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],a=s[1];return{type:i??"Error",value:a??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(vO);return s&&(n=s[1],r=s[2]),[n,r]}}var _O=["fatal","error","warning","log","info","debug"];function W8(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 s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class xO{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{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 Z_(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: "+W8(e)}isSeverityLevel(e){return _t(e)&&!K1(e)&&_O.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(eO(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class wO{match(e){return Z_(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+W8(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class bO{match(e){return _8(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}}}class SO{match(e){return jp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Z_(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return _8(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var Bp="$message",Wp="$timestamp",EO=new Set([Bp,Wp]),cv={enabled:!0,max_bytes:32768};function Gp(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:cv.enabled,max_bytes:CO(t.max_bytes,cv.max_bytes)}:fe({},cv)}class kO{constructor(e){this.Rt=[],this.Pt=0,this.Se=Gp(e)}setConfig(e){this.Se=Gp(e),this.Ot()}add(e){var n=(function(s){var i;try{i=g8(s)}catch{return}try{var a=JSON.parse(i);if(!Ot(a))return;var u=a,c=u[Bp],f=u[Wp];return!_t(c)||c.trim().length===0||!_t(f)&&!$n(f)?void 0:{step:u,json:i}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),a=0,u=0;i.length>u;u++)i[u]==="%"?(a+=1,u+=2):a+=1;return a})(n.json);r>this.Se.max_bytes||(this.Rt.push({step:n.step,bytes:r}),this.Pt+=r,this.Ot())}}getAttachable(){return this.Rt.map((e=>e.step))}clear(){this.Rt=[],this.Pt=0}size(){return this.Rt.length}Ot(){for(;this.Pt>this.Se.max_bytes&&this.Rt.length>0;){var e=this.Rt.shift();e&&(this.Pt-=e.bytes)}}}function CO(t,e){if(!$n(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var G8=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(ne&&(Vt.DEBUG||$e.POSTHOG_DEBUG||n)&&!xe(ne.console)&&ne.console){for(var i=("__rrweb_original__"in ne.console[s])?ne.console[s].__rrweb_original__:ne.console[s],a=arguments.length,u=new Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];i(t,...u)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>G8(t+" "+s,i)};return r},_e=G8("[PostHog.js]"),Dt=_e.createLogger,PO=Dt("[ExternalScriptsLoader]"),dv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return PO.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Ee==null?void 0:Ee.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var c=r[a];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(f=>{c.__posthog_loading_callback_fired=!0,n(void 0,f)})),c.onerror=f=>n(f),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var u=()=>{if(!Ee)return n("document not found");var c=Ee.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=e,c.onload=p=>{c.__posthog_loading_callback_fired=!0,n(void 0,p)},c.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(c=t.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Ee.head.appendChild(c);else{var f,h=Ee.querySelectorAll("body > script");h.length>0?(f=h[0].parentNode)==null||f.insertBefore(c,h[0]):Ee.body.appendChild(c)}};Ee!=null&&Ee.body?u():Ee==null||Ee.addEventListener("DOMContentLoaded",u)};$e.__PosthogExtensions__=$e.__PosthogExtensions__||{},$e.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}r=t.requestRouter.endpointFor("assets",s)}dv(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");dv(t,a,n)}},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);dv(t,r,n)};var K8="$people_distinct_id",Kp="$device_id",fv="$device_model",td="__alias",nd="__timers",J1="$autocapture_disabled_server_side",ey="$heatmaps_enabled_server_side",ty="$exception_capture_enabled_server_side",ny="$error_tracking_suppression_rules",ry="$error_tracking_capture_extension_exceptions",sy="$web_vitals_enabled_server_side",e2="$dead_clicks_enabled_server_side",t2="$product_tours_enabled_server_side",iy="$web_vitals_allowed_metrics",Ha="$session_recording_remote_config",q8="$replay_sample_rate",Z8="$replay_override_sampling",Y8="$replay_override_linked_flag",X8="$replay_override_url_trigger",Q8="$replay_override_event_trigger",Jl="$sesid",n2="$session_is_sampled",ja="$enabled_feature_flags",ap="$active_feature_flags",rd="$early_access_features",oy="$feature_flag_details",lp="$feature_flag_payloads",ay="$feature_flag_request_id",Mi="$override_feature_flags",Zl="$override_feature_flag_payloads",Na="$stored_person_properties",Oa="$stored_group_properties",ly="$surveys",qp="$surveys_loaded_at",uy="$surveys_activated",sd="ph_product_tours",cd="$flag_call_reported",cy="$flag_call_reported_session_id",dy="$feature_flag_errors",Rd="$feature_flag_evaluated_at",Ss="$user_state",fy="$client_session_props",hy="$capture_rate_limit",py="$initial_campaign_params",my="$initial_referrer_info",Zp="$initial_person_info",Yp="$epp",J8="__POSTHOG_TOOLBAR__",Rh="$posthog_cookieless",e6="$sdk_debug_extensions_init_method",t6="$sdk_debug_extensions_init_time_ms",n6="$sdk_debug_recording_script_not_loaded",r2="PostHog loadExternalDependency extension not found.",La="on_reject",Vi="always",Vl="anonymous",$l="identified",gy="identified_only",Xp="visibilitychange",Qp="beforeunload",Yl="$pageview",hv="$pageleave",pv="$identify",WS="$groupidentify";function Ah(t,e){et(t)&&t.forEach(e)}function bt(t,e){if(!Ye(t))if(et(t))t.forEach(e);else if(jN(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)y8.call(t,n)&&e(t[n],n)}var Rt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function up(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 GS=function(t){try{return t()}catch{return}},TO=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){_e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_e.critical(s)}}},s2=function(t){var e={};return bt(t,(function(n,r){(_t(n)&&n.length>0||$n(n))&&(e[r]=n)})),e},RO=["herokuapp.com","vercel.app","netlify.app"];function AO(t){var e=t==null?void 0:t.hostname;if(!_t(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of RO)if(n===r)return!1;return!0}function $t(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function r6(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return $n(t)&&isFinite(t)&&Math.floor(t)===t});class Jp{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new Jp(i)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),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 Jp(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class MO{constructor(){this.S=0,this.C=0,this.I=new IO}generate(){var e=this.generateOrAbort();if(xe(e)){this.S=0;var n=this.generateOrAbort();if(xe(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Jp.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var KS,s6=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};ne&&!xe(ne.crypto)&&crypto.getRandomValues&&(s6=t=>crypto.getRandomValues(t));class IO{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(s6(this.R),this.O=0),this.R[this.O++]}}var Li=()=>NO().toString(),NO=()=>(KS||(KS=new MO)).generate(),Fc="",OO=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qs={N:()=>!!Ee,D(t){_e.error("cookieStore error: "+t)},A(t){if(Ee){try{for(var e=t+"=",n=Ee.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},F(t){var e;try{e=JSON.parse(Qs.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Ee)return!1;try{var i="",a="",u=(function(h,p){if(p){var v=(function(x,_){if(_===void 0&&(_=Ee),Fc)return Fc;if(!_||["localhost","127.0.0.1"].includes(x))return"";for(var b=x.split("."),E=Math.min(b.length,8),C="dmn_chk_"+Li();!Fc&&E--;){var P=b.slice(E).join("."),T=C+"=1;domain=."+P+";path=/";_.cookie=T+";max-age=3",_.cookie.includes(C)&&(_.cookie=T+";max-age=0",Fc=P)}return Fc})(h);if(!v){var y=(x=>{var _=x.match(OO);return _?_[0]:""})(h);y!==v&&_e.info("Warning: cookie subdomain discovery mismatch",y,v),v=y}return v?"; domain=."+v:""}return""})(Ee.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var f=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return f.length>3686.4&&_e.warn("cookieStore warning: large cookie, len="+f.length),Ee.cookie=f,!0}catch{return!1}},P(t,e){if(Ee!=null&&Ee.cookie)try{Qs.q(t,"",-1,e)}catch{return}}},mv=null,wt={N(){if(!lr(mv))return mv;var t=!0;if(xe(ne))t=!1;else try{var e="__mplssupport__";wt.q(e,"xyz"),wt.A(e)!=='"xyz"'&&(t=!1),wt.P(e)}catch{t=!1}return t||_e.error("localStorage unsupported; falling back to cookie store"),mv=t,t},D(t){_e.error("localStorage error: "+t)},A(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){wt.D(e)}return null},F(t){try{return JSON.parse(wt.A(t))||{}}catch{}return null},q(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){wt.D(n)}return!1},P(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){wt.D(e)}}},LO=[Kp,"distinct_id",Jl,n2,Yp,Zp,Ss],Mh={},DO={N:()=>!0,D(t){_e.error("memoryStorage error: "+t)},A:t=>Mh[t]||null,F:t=>Mh[t]||null,q:(t,e)=>(Mh[t]=e,!0),P(t){delete Mh[t]}},wa=null,Fn={N(){if(!lr(wa))return wa;if(wa=!0,xe(ne))wa=!1;else try{var t="__support__";Fn.q(t,"xyz"),Fn.A(t)!=='"xyz"'&&(wa=!1),Fn.P(t)}catch{wa=!1}return wa},D(t){_e.error("sessionStorage error: ",t)},A(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){Fn.D(e)}return null},F(t){try{return JSON.parse(Fn.A(t))||null}catch{}return null},q(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Fn.D(n)}return!1},P(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){Fn.D(e)}}};class FO{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.At()?0:this.$t}isOptedOut(){return this.Se.cookieless_mode===Vi||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===La}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Nt.q(this.Dt,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Nt.P(this.Dt,this.Se.cross_subdomain_cookie)}get Dt(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get $t(){var e=this.Nt.A(this.Dt);return ov(e)?1:Be(zN,e)?0:-1}get Nt(){var e=this.Se.opt_out_capturing_persistence_type,n=e==="localStorage"?wt:Qs;if(!this.qt||this.qt!==n){this.qt=n;var r=e==="localStorage"?Qs:wt;r.A(this.Dt)&&(this.qt.A(this.Dt)||this.optInOut(ov(r.A(this.Dt))),r.P(this.Dt,this.Se.cross_subdomain_cookie))}return this.qt}At(){return!!this.Se.respect_dnt&&[ir==null?void 0:ir.doNotTrack,ir==null?void 0:ir.msDoNotTrack,$e.doNotTrack].some((e=>ov(e)))}}function i6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Ps(r))return e;try{var s=r(e);return _t(s)&&s?s:e}catch(i){return _e.error("Error in get_current_url, falling back to window.location.href",i),e}}var jO=1,VO=3,$O=11;function qS(t){return t instanceof Element&&(t.id===J8||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Bo(t){return!!t&&t.nodeType===jO}function $r(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function o6(t){return!!t&&t.nodeType===VO}function a6(t){return!!t&&t.nodeType===$O&&Bo(t.host)}var l6=1e3;function i2(t){return t?$m(t).split(/\s+/):[]}function ZS(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return xe(i)?void 0:i6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function em(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 i2(e)}function u6(t){return Ye(t)?null:$m(t).split(/(\s+)/).filter((e=>dd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ad(t){var e="";return yy(t)&&!h6(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;o6(n)&&n.textContent&&(e+=(r=u6(n.textContent))!==null&&r!==void 0?r:"")})),$m(e)}function gv(t){return xe(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var o2=["a","button","form","input","select","textarea","label"];function vy(t,e){if(xe(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var f=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!f&&f.call(u,c)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function c6(t){var e=t.parentNode;return!(!e||!Bo(e))&&e}var HO=[".ph-no-autocapture","[data-ph-no-autocapture]"],d6=["next","previous","prev",">","<"],zO=[...d6,"+","-","−","–"],YS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,XS=[".ph-no-rageclick",".ph-no-capture"],UO=["","text","search","email","password","url","tel","number"];function QS(t,e){if(!ne||a2(t))return!1;var n,r,s,i,a;if(si(e)?(n=!!e&&XS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:XS,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),n===!1||s&&(function(c){return!(!c||!Bo(c))&&(!!$r(c,"textarea")||($r(c,"input")?Be(UO,(c.getAttribute("type")||"").toLowerCase()):(function(f){if(f.isContentEditable)return!0;var h=f.getAttribute==null?void 0:f.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=f6(t,!1).targetElementList;return!(function(c,f){if(c===!1||xe(c))return!1;var h;if(c===!0)h=d6;else{if(!et(c))return!1;if(c.length>10)return _e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map((p=>p.toLowerCase()))}return f.some((p=>{var v=p.safeText,y=p.ariaLabel;return h.some((x=>YS(v,x)||YS(y,x)))}))})(r,u.map((c=>{var f;return{safeText:Ad(c).toLowerCase(),ariaLabel:((f=c.getAttribute("aria-label"))==null?void 0:f.toLowerCase().trim())||""}})))&&!vy(u,n)}var a2=t=>!t||$r(t,"html")||!Bo(t),f6=(t,e)=>{if(!ne||a2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!$r(s,"body");)if(a6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=c6(s);if(!i)break;if(e||o2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=ne.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function yy(t){for(var e=new Set,n=0,r=t;r.parentNode&&!$r(r,"body");r=r.parentNode){if(n++>=l6||e.has(r))return!1;e.add(r);var s=em(r);if(Be(s,"ph-sensitive")||Be(s,"ph-no-capture"))return!1}if(Be(em(t),"ph-include"))return!0;var i=t.type||"";if(_t(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!_t(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function h6(t){return!!($r(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||$r(t,"select")||$r(t,"textarea")||t.getAttribute("contenteditable")==="true")}var p6="(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})",BO=new RegExp("^(?:"+p6+")$"),WO=new RegExp(p6),m6="\\d{3}-?\\d{2}-?\\d{4}",GO=new RegExp("^("+m6+")$"),KO=new RegExp("("+m6+")");function dd(t,e){return e===void 0&&(e=!0),!(Ye(t)||_t(t)&&(t=$m(t),(e?BO:WO).test((t||"").replace(/[- ]/g,""))||(e?GO:KO).test(t)))}function JS(t){var e=Ad(t);return dd(e=(e+" "+g6(t)).trim())?e:""}function g6(t){var e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Ad(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+g6(n)).trim())}catch(i){_e.error("[AutoCapture]",i)}})),e}function eE(t){return t.replace(/"|\\"/g,'\\"')}function qO(t){var e=t.attr__class;return e?et(e)?e:i2(e):void 0}var Ih=Dt("[Dead Clicks]"),ZO=()=>!0,YO=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(e2)),r=t.instance.config.capture_dead_clicks;return si(r)?r:!!Ot(r)||n};class tE{get lazyLoadedDeadClicksAutocapture(){return this.jt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[e2]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bt((()=>{this.Ht()})):this.stop()}Bt(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Ih.error("failed to load script",s):e()}))}Ht(){var e;if(Ee){if(!this.jt&&(e=$e.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ot(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.jt=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.jt.start(Ee),Ih.info("starting...")}}else Ih.error("`document` not found. Cannot start.")}stop(){this.jt&&(this.jt.stop(),this.jt=void 0,Ih.info("stopping..."))}}var vv=Dt("[SegmentIntegration]"),v6="posthog-js";function y6(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,u=a===void 0?["error"]:a,c=n.sendExceptionsToPostHog,f=c===void 0||c;return h=>{var p,v,y,x,_;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var b=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=b,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,C=((p=h.exception)==null?void 0:p.values)||[],P=C.map((R=>fe({},R,{stacktrace:R.stacktrace?fe({},R.stacktrace,{type:"raw",frames:(R.stacktrace.frames||[]).map((O=>fe({},O,{platform:"web:javascript"})))}):void 0}))),T={$exception_message:((v=C[0])==null?void 0:v.value)||h.message,$exception_type:(y=C[0])==null?void 0:y.type,$exception_level:h.level,$exception_list:P,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((x=C[0])==null?void 0:x.value)||h.message,$sentry_exception_type:(_=C[0])==null?void 0:_.type,$sentry_tags:h.tags};return r&&s&&(T.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),f&&((E=t.exceptions)==null||E.sendExceptionEvent(T)),h}}class XO{constructor(e,n,r,s,i,a){this.name=v6,this.setupOnce=function(u){u(y6(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class nE{constructor(e){this.Ut=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(_e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.zt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Wt()}Wt(){var e;this.Vt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Ut)}destroy(){var e;(e=this.Vt)==null||e.call(this),this.Vt=void 0}doPageView(e,n){var r,s=this.Zt(e,n);return this.zt={pathname:(r=ne==null?void 0:ne.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.Zt(e,(n=this.zt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.zt)==null?void 0:e.pageViewId}}Zt(e,n){var r=this.zt;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,u=i.lastScrollY,c=i.maxScrollY,f=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(xe(a)||xe(u)||xe(c)||xe(f)||xe(h)||xe(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),f=Math.ceil(f),h=Math.ceil(h),p=Math.ceil(p);var v=a>1?ti(u/a,0,1,_e):1,y=a>1?ti(c/a,0,1,_e):1,x=f>1?ti(h/f,0,1,_e):1,_=f>1?ti(p/f,0,1,_e):1;s=Rt(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Nh=["flags","surveys"],QO={[K8]:{exposure:"hidden"},[td]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[nd]:{exposure:"hidden"},[J1]:{exposure:"event"},[ey]:{exposure:"hidden"},[ty]:{exposure:"event"},[ny]:{exposure:"hidden"},[ry]:{exposure:"event"},[sy]:{exposure:"event"},[e2]:{exposure:"event"},[t2]:{exposure:"hidden"},[iy]:{exposure:"event"},[Ha]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Jl]:{exposure:"hidden"},[n2]:{exposure:"event"},[q8]:{exposure:"event",shouldSkipFromEventProperties:t=>lr(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[ja]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Ot(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[ap]:{exposure:"event",storageGroup:"flags"},[rd]:{exposure:"hidden"},[oy]:{exposure:"hidden",storageGroup:"flags"},[lp]:{exposure:"event",storageGroup:"flags"},[ay]:{exposure:"event",storageGroup:"flags",volatile:!0},[Mi]:{exposure:"event"},[Zl]:{exposure:"hidden"},[Na]:{exposure:"hidden"},[Oa]:{exposure:"hidden"},[ly]:{exposure:"hidden",storageGroup:"surveys"},[qp]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[uy]:{exposure:"event"},[sd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[cd]:{exposure:"hidden"},[cy]:{exposure:"hidden"},[dy]:{exposure:"hidden"},[Rd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ss]:{exposure:"hidden"},[fy]:{exposure:"hidden"},[hy]:{exposure:"hidden"},[py]:{exposure:"hidden"},[my]:{exposure:"hidden"},[Zp]:{exposure:"hidden"},[Yp]:{exposure:"hidden"},[Z8]:{exposure:"event"},[Y8]:{exposure:"event"},[X8]:{exposure:"event"},[Q8]:{exposure:"event"},[e6]:{exposure:"event"},[t6]:{exposure:"event"},[n6]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},JO=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ba=t=>{var e=QO[t];if(e)return e;for(var n of JO){var r=n[1];if(t.indexOf(n[0])===0)return r}},Md=t=>{var e=Ee==null?void 0:Ee.createElement("a");return xe(e)?null:(e.href=t,e)},Mu=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!et(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{_e.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Id=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),a=i[1],u=i[0],c=(a||"").split("&"),f=[],h=0;c.length>h;h++){var p=c[h].split("=");et(p)&&(e.includes(p[0])?f.push(p[0]+"="+n):f.push(c[h]))}var v=u;return a!=null&&(v+="?"+f.join("&")),s!=null&&(v+="#"+s),v},tm=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},_6=(t,e)=>t>=e&&h8(),x6=(t,e,n,r)=>{if(t===0){if(h8()){var s=e+1;return s===n&&r(),s}return e}return 0},Oh="https?://(.*)",Iu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],eL=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Iu],Nd="<masked>",tL=["li_fat_id"];function w6(t,e,n){if(!Ee)return{};var r,s=e?[...Iu,...n||[]]:[],i=b6(Id(Ee.URL,s,Nd),t),a=(r={},bt(tL,(function(u){var c=Qs.A(u);r[u]=c||null})),r);return Rt(a,i)}function b6(t,e){var n=eL.concat(e||[]),r={};return bt(n,(function(s){var i=Mu(t,s);r[s]=i||null})),r}function S6(t){var e=(function(i){return i?i.search(Oh+"google.([^/?]*)")===0?"google":i.search(Oh+"bing.com")===0?"bing":i.search(Oh+"yahoo.com")===0?"yahoo":i.search(Oh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!lr(e)){r.$search_engine=e;var s=Ee?Mu(Ee.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function rE(){return navigator.language||navigator.userLanguage}var nm="$direct";function E6(){return(Ee==null?void 0:Ee.referrer)||nm}function k6(t,e,n){n===void 0&&(n=!1);var r=t?[...Iu,...e||[]]:[],s=n?Uo(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:E6().substring(0,1e3),u:i?Id(i,r,Nd):void 0}}function C6(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?Uo(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==nm?nm:(n=Md(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=Md(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=b6(i);Rt(a,c)}if(r){var f=S6(r);Rt(a,f)}return a}function P6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function nL(){try{return new Date().getTimezoneOffset()}catch{return}}var rL={flags:Rd,surveys:qp},sL=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Hl="main";class yv{constructor(e,n,r){if(r===void 0&&(r=!0),this.Gt={},this.Qt=!1,this.Jt=!1,this.Se=e,this.Kt=r,this.props={},this.Yt=!1,this.Xt=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.Nt=this.er(e),this.Jt=this.tr(e),this.load(),e.debug&&_e.info("Persistence loaded",e.persistence,fe({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();$t(ne,"beforeunload",s,{capture:!1}),$t(ne,"pagehide",s,{capture:!1})}}rr(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return $n(n)&&n>0?n:0}isDisabled(){return!!this.ir}er(e){sL.indexOf(e.persistence.toLowerCase())===-1&&(_e.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,u){a===void 0&&(a=[]),u===void 0&&(u=!1);var c=[...LO,...a];return fe({},wt,{F(f){try{var h={};try{h=Qs.F(f)||{}}catch{}var p,v=JSON.parse(wt.A(f)||"{}");if(u){var y={};for(var x in h){var _=h[x];lr(_)||_===""||(y[x]=_)}p=Rt(v,y)}else p=Rt(h,v);return wt.q(f,p),p}catch{}return null},q(f,h,p,v,y,x){var _=wt.q(f,h,void 0,void 0,x);try{var b={};c.forEach((E=>{h[E]&&(b[E]=h[E])})),Object.keys(b).length&&Qs.q(f,b,p,v,y,x)}catch(E){wt.D(E)}return _},P(f,h){try{ne==null||ne.localStorage.removeItem(f),Qs.P(f,h)}catch(p){wt.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&wt.N()?(n=wt,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Fn.N()?n=Fn:i==="memory"?n=DO:i==="cookie"?n=Qs:r.N()?(n=r,s=!0):n=Qs,this.Qt=s,n}nr(e){return this.Xt+"__"+e}tr(e){return this.Qt&&!!e.split_storage}sr(e){var n=e??this.Se.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Rd];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return bt(this.props,((n,r)=>{var s=ba(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===ja?()=>this.sr():()=>!1))return;s.transformToEventProperties&&Rt(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.ir){var e=this.Nt.F(this.Xt);e&&(this.props=Rt({},e)),this.Jt&&this.ar()}}ar(){for(var e of Nh){var n=wt.F(this.nr(e));if(n&&!Oo(n)){var r=this.lr(e);r.persisted=!0,this.ur(e)||(r.fingerprint=this.hr(n,e)),this.dr(e,n)||Rt(this.props,n)}}}ur(e){return Object.keys(this.props).some((n=>{var r;return((r=ba(n))==null?void 0:r.storageGroup)===e}))}dr(e,n){var r=rL[e];if(!r)return!1;var s=n[r],i=this.props[r];return $n(s)&&$n(i)&&i>s}refreshKey(e){var n;if(!this.ir){var r=this.Jt?(n=ba(e))==null?void 0:n.storageGroup:void 0,s=r?wt.F(this.nr(r)):this.Nt.F(this.Xt);if(s&&e in s)this.cr(e,s[e]);else{if(r){var i=this.Nt.F(this.Xt);if(i&&e in i)return void this.cr(e,i[e])}this.vr(e)}}}save(){if(!this.ir){var e=this.rr();e>0?xe(this.pr)&&(this.pr=setTimeout((()=>{this.pr=void 0,this.gr()}),e)):this.gr()}}flush(){xe(this.pr)||(clearTimeout(this.pr),this.pr=void 0,this.gr())}gr(){this.ir||(this.Jt?this.mr():this.yr(this.Nt,this.Xt,this.props,Hl))}mr(){var e=this.br(),n=e.main,r=e.groups;for(var s of(this.yr(this.Nt,this.Xt,n,Hl),Nh)){var i,a=r[s];(!Oo(a)||(i=this.Gt[s])!=null&&i.persisted)&&this.yr(wt,this.nr(s),a,s)}}br(){var e={},n={};for(var r of Nh)n[r]={};return bt(this.props,((s,i)=>{var a,u=(a=ba(i))==null?void 0:a.storageGroup;u?n[u][i]=s:e[i]=s})),{main:e,groups:n}}hr(e,n){if(n===Hl)return JSON.stringify(e)+"|"+this._r+"|"+this.wr+"|"+this.kr;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=ba(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}yr(e,n,r,s){var i=this.lr(s);if(s===Hl||i.dirty||xe(i.fingerprint)){var a;try{if((a=this.hr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this._r,this.wr,this.kr,this.Se.debug)?(i.dirty=!1,s!==Hl&&(i.persisted=!0),xe(a)||(i.fingerprint=a)):this.Se.debug&&_e.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(xe(this.pr)||(clearTimeout(this.pr),this.pr=void 0),this.Nt.P(this.Xt,!1),this.Nt.P(this.Xt,!0),!r&&this.Kt)for(var s of Nh)wt.P(this.nr(s));r?delete this.Gt[Hl]:this.Gt={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Ot(e)){xe(n)&&(n="None"),this._r=xe(r)?this.Sr:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.cr(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Ot(e)){this._r=xe(n)?this.Sr:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.cr(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.vr(e),this.save())}update_campaign_params(){if(!this.Yt){var e=w6(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);Oo(s2(e))||this.register(e),this.Yt=!0}}update_search_keyword(){var e;this.register((e=Ee==null?void 0:Ee.referrer)?S6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:E6(),$referring_domain:Ee!=null&&Ee.referrer&&((e=Md(Ee.referrer))==null?void 0:e.host)||nm},void 0)}set_initial_person_info(){this.props[py]||this.props[my]||this.register_once({[Zp]:k6(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};bt([my,py],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+G1(u)]=a}))}));var n=this.props[Zp];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=C6(s,i),u={};return bt(a,(function(c,f){u["$initial_"+G1(f)]=c})),u})(n,this.Se.disable_capture_url_hashes);Rt(e,r)}return e}safe_merge(e){return bt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Sr=this._r=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((c,f)=>{if(c.length!==f.length)return!1;var h=[...c].sort(),p=[...f].sort();return h.every(((v,y)=>v===p[y]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.er(e):this.Nt,a=this.tr(e);if(s||a!==this.Jt){var u=this.props;this.clear(),this.Nt=i,this.Jt=a,this.props=u,this.save()}}set_disabled(e){this.ir=e,this.ir?this.remove():this.save()}set_cross_subdomain(e){e!==this.wr&&(this.wr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.kr&&(this.kr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[nd]||{};r[e]=n,this.cr(nd,r),this.save()}remove_event_timer(e){var n=this.props[nd]||{},r=n[e];return xe(r)||(delete n[e],this.cr(nd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.cr(e,n),this.save()}cr(e,n){var r;this.props[e]=n,(r=ba(e))!=null&&r.volatile||this.Cr(e)}vr(e){delete this.props[e],this.Cr(e)}Cr(e){var n,r=(n=ba(e))==null?void 0:n.storageGroup;r&&(this.lr(r).dirty=!0)}lr(e){return this.Gt[e]||(this.Gt[e]={})}}var jc={Activation:"events",Cancellation:"cancelEvents"},_v={Popover:"popover",API:"api",Widget:"widget"},$i={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},xv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},_y={Popover:"popover",Inline:"inline"},iL={SHOWN:"product tour shown"},sE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},iE=Dt("[RateLimiter]");class oL{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{iE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void iE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,u=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(hy))!==null&&n!==void 0?n:{tokens:i,last:u};c.tokens+=(u-c.last)/1e3*a,c.last=u,c.tokens>i&&(c.tokens=i);var f=1>c.tokens;return f||e||(c.tokens=Math.max(0,c.tokens-1)),!f||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(s=this.instance.persistence)==null||s.set_property(hy,c),{isRateLimited:f,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Vc=Dt("[RemoteConfig]");class T6{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=$e._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Tr(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Ir(e){this._instance._send_request({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 Vc.info("Using preloaded remote config",this.remoteConfig),this.Mr(this.remoteConfig),void this.Er();if(this._instance.Rr())return void Vc.warn("Remote config is disabled. Falling back to local config.");this.Tr((e=>{if(!e)return Vc.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ir((n=>{this.Mr(n),this.Er()}));this.Mr(e),this.Er()}))}catch(e){Vc.error("Error loading remote config",e)}}stop(){this.Pr&&(clearInterval(this.Pr),this.Pr=void 0)}refresh(){!this._instance.Rr()&&Ee&&Ee.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Er(){var e;if(!this.Pr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.Pr=setInterval((()=>{this.refresh()}),n))}}Mr(e){var n;e||Vc.error("Failed to fetch remote config from PostHog."),this._instance.Mr(e??{}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var sr={GZipJS:"gzip-js",Base64:"base64"},cs=Uint8Array,br=Uint16Array,Nu=Uint32Array,l2=new cs([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]),u2=new cs([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]),oE=new cs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),R6=function(t,e){for(var n=new br(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Nu(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},A6=R6(l2,2),xy=A6[1];A6[0][28]=258,xy[258]=28;for(var aE=R6(u2,0)[1],M6=new br(32768),Lt=0;32768>Lt;++Lt){var zl=(43690&Lt)>>>1|(21845&Lt)<<1;M6[Lt]=((65280&(zl=(61680&(zl=(52428&zl)>>>2|(13107&zl)<<2))>>>4|(3855&zl)<<4))>>>8|(255&zl)<<8)>>>1}var fd=function(t,e,n){for(var r=t.length,s=0,i=new br(e);r>s;++s)++i[t[s]-1];var a,u=new br(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new br(r),s=0;r>s;++s)a[s]=M6[u[t[s]-1]++]>>>15-t[s];return a},ul=new cs(288);for(Lt=0;144>Lt;++Lt)ul[Lt]=8;for(Lt=144;256>Lt;++Lt)ul[Lt]=9;for(Lt=256;280>Lt;++Lt)ul[Lt]=7;for(Lt=280;288>Lt;++Lt)ul[Lt]=8;var rm=new cs(32);for(Lt=0;32>Lt;++Lt)rm[Lt]=5;var aL=fd(ul,9),lL=fd(rm,5),I6=function(t){return(t/8>>0)+(7&t&&1)},N6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof br?br:t instanceof Nu?Nu:cs)(n-e);return r.set(t.subarray(e,n)),r},Si=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},$c=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},wv=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new cs(0),0];if(s==1){var a=new cs(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(R,O){return R.f-O.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=s-1;)u=n[n[p].f>n[f].f?f++:p++],c=n[f!=h&&n[p].f>n[f].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var v=i[0].s;for(r=1;s>r;++r)i[r].s>v&&(v=i[r].s);var y=new br(v+1),x=wy(n[h-1],y,0);if(x>e){r=0;var _=0,b=x-e,E=1<<b;for(i.sort((function(R,O){return y[O.s]-y[R.s]||R.f-O.f}));s>r;++r){var C=i[r].s;if(e>=y[C])break;_+=E-(1<<x-y[C]),y[C]=e}for(_>>>=b;_>0;){var P=i[r].s;e>y[P]?_-=1<<e-y[P]++-1:++r}for(;r>=0&&_;--r){var T=i[r].s;y[T]==e&&(--y[T],++_)}x=e}return[new cs(y),x]},wy=function(t,e,n){return t.s==-1?Math.max(wy(t.l,e,n+1),wy(t.r,e,n+1)):e[t.s]=n},lE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new br(++e),r=0,s=t[0],i=1,a=function(c){n[r++]=c},u=1;e>=u;++u)if(t[u]==s&&u!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[u]}return[n.subarray(0,r),e]},Hc=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},by=function(t,e,n){var r=n.length,s=I6(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},uE=function(t,e,n,r,s,i,a,u,c,f,h){Si(e,h++,n),++s[256];for(var p=wv(s,15),v=p[0],y=p[1],x=wv(i,15),_=x[0],b=x[1],E=lE(v),C=E[0],P=E[1],T=lE(_),R=T[0],O=T[1],I=new br(19),A=0;C.length>A;++A)I[31&C[A]]++;for(A=0;R.length>A;++A)I[31&R[A]]++;for(var N=wv(I,7),L=N[0],F=N[1],V=19;V>4&&!L[oE[V-1]];--V);var G,X,q,B,Y=f+5<<3,$=Hc(s,ul)+Hc(i,rm)+a,ee=Hc(s,v)+Hc(i,_)+a+14+3*V+Hc(I,L)+(2*I[16]+3*I[17]+7*I[18]);if($>=Y&&ee>=Y)return by(e,h,t.subarray(c,c+f));if(Si(e,h,1+($>ee)),h+=2,$>ee){G=fd(v,y),X=v,q=fd(_,b),B=_;var H=fd(L,F);for(Si(e,h,P-257),Si(e,h+5,O-1),Si(e,h+10,V-4),h+=14,A=0;V>A;++A)Si(e,h+3*A,L[oE[A]]);h+=3*V;for(var D=[C,R],Z=0;2>Z;++Z){var te=D[Z];for(A=0;te.length>A;++A)Si(e,h,H[se=31&te[A]]),h+=L[se],se>15&&(Si(e,h,te[A]>>>5&127),h+=te[A]>>>12)}}else G=aL,X=ul,q=lL,B=rm;for(A=0;u>A;++A)if(r[A]>255){var se;$c(e,h,G[257+(se=r[A]>>>18&31)]),h+=X[se+257],se>7&&(Si(e,h,r[A]>>>23&31),h+=l2[se]);var oe=31&r[A];$c(e,h,q[oe]),h+=B[oe],oe>3&&($c(e,h,r[A]>>>5&8191),h+=u2[oe])}else $c(e,h,G[r[A]]),h+=X[r[A]];return $c(e,h,G[256]),h+X[256]},uL=new Nu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),cL=(function(){for(var t=new Nu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),bv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function dL(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(v){for(var y=p,x=0;v.length>x;++x)y=cL[255&y^v[x]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,f=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,v,y,x,_,b){var E=p.length,C=new cs(x+E+5*(1+Math.floor(E/7e3))+_),P=C.subarray(x,C.length-_),T=0;if(!v||8>E)for(var R=0;E>=R;R+=65535){var O=R+65535;E>O?T=by(P,T,p.subarray(R,O)):(P[R]=!0,T=by(P,T,p.subarray(R,E)))}else{for(var I=uL[v-1],A=I>>>13,N=8191&I,L=(1<<y)-1,F=new br(32768),V=new br(L+1),G=Math.ceil(y/3),X=2*G,q=function(vt){return(p[vt]^p[vt+1]<<G^p[vt+2]<<X)&L},B=new Nu(25e3),Y=new br(288),$=new br(32),ee=0,H=0,D=(R=0,0),Z=0,te=0;E>R;++R){var se=q(R),oe=32767&R,ue=V[se];if(F[oe]=ue,V[se]=oe,R>=Z){var he=E-R;if((ee>7e3||D>24576)&&he>423){T=uE(p,P,0,B,Y,$,H,D,te,R-te,T),D=ee=H=0,te=R;for(var ie=0;286>ie;++ie)Y[ie]=0;for(ie=0;30>ie;++ie)$[ie]=0}var ae=2,me=0,Se=N,Ae=oe-ue&32767;if(he>2&&se==q(R-Ae))for(var Ke=Math.min(A,he)-1,it=Math.min(32767,R),Oe=Math.min(258,he);it>=Ae&&--Se&&oe!=ue;){if(p[R+ae]==p[R+ae-Ae]){for(var at=0;Oe>at&&p[R+at]==p[R+at-Ae];++at);if(at>ae){if(ae=at,me=Ae,at>Ke)break;var Mt=Math.min(Ae,at-2),mt=0;for(ie=0;Mt>ie;++ie){var Fe=R-Ae+ie+32768&32767,Qe=Fe-F[Fe]+32768&32767;Qe>mt&&(mt=Qe,ue=Fe)}}}Ae+=(oe=ue)-(ue=F[oe])+32768&32767}if(me){B[D++]=268435456|xy[ae]<<18|aE[me];var lt=31&xy[ae],Je=31&aE[me];H+=l2[lt]+u2[Je],++Y[257+lt],++$[Je],Z=R+ae,++ee}else B[D++]=p[R],++Y[p[R]]}}T=uE(p,P,!0,B,Y,$,H,D,te,R-te,T)}return N6(C,0,x+I6(T)+_)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,u,c)),h=f.length;return(function(p,v){var y=v.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>v.level?4:v.level==9?2:0,p[9]=3,v.mtime!=0&&bv(p,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){p[3]=8;for(var x=0;y.length>=x;++x)p[x+10]=y.charCodeAt(x)}})(f,e),bv(f,h-8,n.d()),bv(f,h-4,r),f}var fL=!!U1||!!q_,O6="text/plain",cp=!1,Sy=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var u=a.split("&").filter((c=>c.split("=")[0]!==e)).join("&");return i+(u?"?"+u:"")+(r?"#"+r:"")},c2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=fe({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,v=h.split("="),y=v[0],x=n&&(p=u[y])!==null&&p!==void 0?p:v[1];return delete u[y],y+"="+x})))!==null&&r!==void 0?r:[],f=(function(h,p){var v,y;p===void 0&&(p="&");var x=[];return bt(h,(function(_,b){xe(_)||xe(b)||b==="undefined"||(v=encodeURIComponent((E=>E instanceof File)(_)?_.name:_.toString()),y=encodeURIComponent(b),x[x.length]=y+"="+v)})),x.join(p)})(u);return f&&c.push(f),i+"?"+c.join("&")},eu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return g8(t)}},Sv=t=>{if(t.Lt)return t.Lt;var e=t.data,n=t.compression;if(e){if(n===sr.GZipJS){var r=dL((function(u,c){var f=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new cs(u.length+(u.length>>>1)),p=0,v=function(b){h[p++]=b},y=0;f>y;++y){if(p+5>h.length){var x=new cs(p+8+(f-y<<1));x.set(h),h=x}var _=u.charCodeAt(y);128>_?v(_):2048>_?(v(192|_>>>6),v(128|63&_)):_>55295&&57344>_?(v(240|(_=65536+(1047552&_)|1023&u.charCodeAt(++y))>>>18),v(128|_>>>12&63),v(128|_>>>6&63),v(128|63&_)):(v(224|_>>>12),v(128|_>>>6&63),v(128|63&_))}return N6(h,0,p)})(eu(e)),{mtime:0});return{contentType:O6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===sr.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,f)=>String.fromCharCode(parseInt(f,16)))))})(eu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:eu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=eu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},L6=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:c2(t.url,{compression:sr.Base64}),encodedBody:Sv(fe({},t,{compression:sr.Base64,Lt:void 0}))}:{url:Sy(t.url,"compression"),encodedBody:Sv(fe({},t,{compression:void 0,Lt:void 0}))};try{e=Sv(t)}catch(s){if(OS(t.compression,Mu(t.url,"compression")))return _e.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&OS(t.compression,Mu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?B1(new Uint8Array(n)):ArrayBuffer.isView(n)&&B1(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(cp=!0,r()):{url:t.url,encodedBody:e}},D6=t=>{try{return L6(t)}catch(e){return _e.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},hL=(function(){var t=en((function*(e){var n=eu(e.data),r=yield(function(i,a,u){return W1.apply(this,arguments)})(n,Vt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return fe({},e,{Lt:{contentType:O6,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),pL=/Failed to fetch|NetworkError|Load failed/i,F6=t=>{var e,n=D6(t);if(n){var r=n.url,s=n.encodedBody,i=s??{},a=i.contentType,u=i.body,c=i.estimatedSize,f=new Headers;bt(t.headers,(function(y,x){f.append(x,y)})),a&&f.append("Content-Type",a);var h=null,p=!1;if(PS){var v=new PS;h={signal:v.signal,timeout:setTimeout((()=>{var y,x;p=!0,v.abort((y=t.timeout,(x=new Error("PostHog request timed out"+(y?" after "+y+"ms":""))).name="AbortError",x))}),t.timeout)}}q_(r,fe({method:(t==null?void 0:t.method)||"GET",headers:f,keepalive:t.method==="POST"&&!t.Ft&&52428.8>(c||0),body:u,signal:(e=h)==null?void 0:e.signal},t.fetchOptions)).then((y=>y.text().then((x=>{var _={statusCode:y.status,text:x};if(y.status===200)try{_.json=JSON.parse(x)}catch(b){_e.error(b)}t.callback==null||t.callback(_)})))).catch((y=>{p&&(y==null?void 0:y.name)==="AbortError"||(x=>(x==null?void 0:x.name)==="TypeError"&&pL.test((x==null?void 0:x.message)||""))(y)?_e.warn(y):_e.error(y),t.callback==null||t.callback({statusCode:0,error:y})})).finally((()=>h?clearTimeout(h.timeout):null))}},Ey=t=>{try{var e=L6(t),n=e.url,r=e.encodedBody,s=r??{},i=s.body,a=s.estimatedSize;if(!i)return;var u=i instanceof Blob?i:new Blob([i],{type:s.contentType});if(ir.sendBeacon(n,u))return;if(et(t.data)&&t.data.length>1&&(a??0)>16384){var c=Math.ceil(t.data.length/2);return Ey(fe({},t,{data:t.data.slice(0,c)})),void Ey(fe({},t,{data:t.data.slice(c)}))}_e.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),F6(fe({},t,{Ft:!0}))}catch(f){_e.warn("Beacon send failed",f)}},mL=["/e/","/s/"],cE=(t,e)=>{var n=(s=>{var i=(a=>{var u=Md(a),c=(u==null?void 0:u.pathname)||a.split(/[?#]/)[0];return c?c[0]==="/"?c:"/"+c:"/"})(s);return mL.some((a=>((u,c)=>u.slice(u.length-c.length)===c)(i,a)))})(t),r=n?Sy(t,"ver"):t;return c2(e===sr.GZipJS?Sy(r,"compression"):r,fe({_:new Date().getTime().toString()},n?{}:{ver:Vt.JS_SDK_VERSION},e===sr.GZipJS?{}:{compression:e}))},dp=[];q_&&dp.push({transport:"fetch",method:F6}),U1&&dp.push({transport:"XHR",method(t){var e=D6(t);if(e){var n=new U1,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;bt(t.headers,(function(u,c){n.setRequestHeader(c,u)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(u)}},n.send(a)}}}),ir!=null&&ir.sendBeacon&&dp.push({transport:"sendBeacon",method:Ey});var ky=3e3;class gL{constructor(e,n){this.Or=!0,this.Lr=[],this.Fr=ti((n==null?void 0:n.flush_interval_ms)||ky,250,5e3,_e.createLogger("flush interval"),ky),this.Ar=e}enqueue(e){this.Lr.push(e),this.$r||this.Nr()}unload(){this.Dr();var e=this.Lr.length>0?this.qr():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.jr(fe({},r,{transport:"sendBeacon"}))}))}enable(){this.Or=!1,this.Nr()}Nr(){var e=this;this.Or||(this.$r=setTimeout((()=>{if(this.Dr(),this.Lr.length>0){var n=this.qr(),r=function(){var i=n[s],a=new Date().getTime();i.data&&et(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.jr(i)};for(var s in n)r()}}),this.Fr))}jr(e){try{this.Ar(e)}catch(n){_e.error(n)}}Dr(){clearTimeout(this.$r),this.$r=void 0}qr(){var e={};return bt(this.Lr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;xe(e[i])&&(e[i]=fe({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Lr=[],e}}var vL=["retriesPerformedSoFar"];class yL{constructor(e){this.Br=!1,this.Hr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.Ur=!0,!xe(ne)&&"onLine"in ne.navigator&&(this.Ur=ne.navigator.onLine,this.zr=()=>{this.Ur=!0,this.Wr()},this.Vr=()=>{this.Ur=!1},$t(ne,"online",this.zr),$t(ne,"offline",this.Vr))}get length(){return this.Lr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=p8(e,vL);Ai(n)&&(r.url=c2(r.url,{retry_count:n})),this._instance._send_request(fe({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.st(fe({retriesPerformedSoFar:n},r));s.statusCode===0&&_e.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}st(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,f=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(f+h*(f-c))})(n),s=Date.now()+r;this.Lr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),_e.warn(i),this.Br||(this.Br=!0,this.Zr())}Zr(){if(this.Gr&&clearTimeout(this.Gr),this.Lr.length===0)return this.Br=!1,void(this.Gr=void 0);this.Gr=setTimeout((()=>{this.Ur&&this.Lr.length>0&&this.Wr(),this.Zr()}),this.Hr)}Wr(){var e=Date.now(),n=[],r=this.Lr.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Lr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Gr&&(clearTimeout(this.Gr),this.Gr=void 0),this.Br=!1,xe(ne)||(this.zr&&(ne.removeEventListener("online",this.zr),this.zr=void 0),this.Vr&&(ne.removeEventListener("offline",this.Vr),this.Vr=void 0)),this.Lr)){var n=e.requestOptions;try{this._instance._send_request(fe({},n,{transport:"sendBeacon"}))}catch(r){_e.error(r)}}this.Lr=[]}}class _L{constructor(e){this.Qr=()=>{var n,r,s,i;this.Jr||(this.Jr={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,f=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.Jr.lastScrollY=Math.ceil(u),this.Jr.maxScrollY=Math.max(u,(n=this.Jr.maxScrollY)!==null&&n!==void 0?n:0),this.Jr.maxScrollHeight=Math.max(c,(r=this.Jr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Jr.lastContentY=f,this.Jr.maxContentY=Math.max(f,(s=this.Jr.maxContentY)!==null&&s!==void 0?s:0),this.Jr.maxContentHeight=Math.max(h,(i=this.Jr.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get Kr(){return this._instance.config.scroll_root_selector}getContext(){return this.Jr}resetContext(){var e=this.Jr;return setTimeout(this.Qr,0),e}startMeasuringScrollPosition(){$t(ne,"scroll",this.Qr,{capture:!0}),$t(ne,"scrollend",this.Qr,{capture:!0}),$t(ne,"resize",this.Qr)}scrollElement(){if(!this.Kr)return ne==null?void 0:ne.document.documentElement;var e=et(this.Kr)?this.Kr:[this.Kr];for(var n of e){var r=ne==null?void 0:ne.document.querySelector(n);if(r)return r}}Yr(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.Kr){var r=this.scrollElement();return r&&r[n]||0}return ne?e==="y"?ne.scrollY||ne.pageYOffset||ne.document.documentElement.scrollTop||0:ne.scrollX||ne.pageXOffset||ne.document.documentElement.scrollLeft||0:0}scrollY(){return this.Yr("y")}scrollX(){return this.Yr("x")}}var xL=t=>k6(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class dE{constructor(e,n,r,s){this.Xr=i=>{var a=this.ei();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.ti(this._instance)};this.ri.register({[fy]:u})}},this._instance=e,this.ii=n,this.ri=r,this.ti=s||xL,this.ii.onSessionId(this.Xr)}ei(){return this.ri.props[fy]}getSetOnceProps(){var e,n=(e=this.ei())==null?void 0:e.props;return n?"r"in n?C6(n,this._instance.config.disable_capture_url_hashes):{$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 bt(s2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+G1(r)]=n})),e}}class d2{constructor(){this.ni={}}on(e,n){return this.ni[e]||(this.ni[e]=[]),this.ni[e].push(n),()=>{this.ni[e]=this.ni[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.ni[e]||[])r(n);for(var s of this.ni["*"]||[])s(e,n)}}var zc=Dt("[SessionId]");class fE{on(e,n){return this.si.on(e,n)}constructor(e,n,r){var s;if(this.oi=null,this.ai=[],this.li=void 0,this.ui=!1,this.si=new d2,this.hi=(f,h)=>!(!Ai(f)||!Ai(h))&&Math.abs(f-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Vi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.ri=e.persistence,this.di=void 0,this.ci=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=n||Li,this.fi=r||Li;var i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*ti(this.Se.session_idle_timeout_seconds||1800,60,36e3,zc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+i+"_window_id",this.mi="ph_"+i+"_primary_window_exists",this.yi()){var a=Fn.F(this.gi),u=Fn.F(this.mi);a&&!u?this.di=a:Fn.P(this.gi),Fn.q(this.mi,!0)}if((s=this.Se.bootstrap)!=null&&s.sessionID)try{var c=(f=>{var h=this.Se.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.bi(this.Se.bootstrap.sessionID,new Date().getTime(),c)}catch(f){zc.error("Invalid sessionID in bootstrap",f)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return xe(this.ai)&&(this.ai=[]),this.ai.push(e),this.ci&&e(this.ci,this.di),()=>{this.ai=this.ai.filter((n=>n!==e))}}yi(){return this.Se.persistence!=="memory"&&!this.ri.ir&&Fn.N()}xi(e){e!==this.di&&(this.di=e,this.yi()&&Fn.q(this.gi,e))}ki(){return this.di?this.di:this.yi()?Fn.F(this.gi):null}Si(e){var n=this.oi;return!lr(n)&&!lr(e)&&5e3>Math.abs(e-n)}bi(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.ci||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.ci=e,i&&!s||i&&this.Si(n)||(this.oi=n,this.ri.register({[Jl]:[n,e,r]}))}Ci(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Ai(n)&&n>0}Ti(){this.Ci()?this.ri.refreshKey(Jl):(this.ri.flush(),this.ri.load())}Ii(){var e;if(!lr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.oi){this.Ti();var n=this.Mi();n[1]===this.ci&&n[2]===this._sessionStartTimestamp&&(this.oi=this._sessionActivityTimestamp,this.ri.register({[Jl]:[this._sessionActivityTimestamp,(e=this.ci)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.ri.flush())}}Ei(){var e=this.Mi()[0],n=Ai(e)?e:0,r=Ai(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Ri(e){return this.Ti(),this.hi(e,this.Ei())}Mi(){var e=this.ri.props[Jl];return et(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.oi=null,clearTimeout(this.Pi),this.Pi=void 0,this.bi(null,null,null)}destroy(){this.ui=!0,this.Ii(),clearTimeout(this.Pi),this.Pi=void 0,this.li&&ne&&(ne.removeEventListener(Qp,this.li,{capture:!1}),this.li=void 0),this.ai=[]}wi(){this.li=()=>{this.Ii(),this.yi()&&Fn.P(this.mi)},$t(ne,Qp,this.li,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Se.cookieless_mode===Vi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Mi(),i=s[1],a=s[2],u=this.Ei(),c=this.ki(),f=Ai(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,v=!i,y=i,x=!v&&!e&&this.hi(r,u);if(x){(x=this.Ri(r))||zc.info("cross-tab refresh kept the session alive",{sessionId:i});var _=this.Mi();i=_[1],a=_[2]}v||x||f?(i=this.vi(),c=this.fi(),zc.info("new session ID generated",{sessionId:i,windowId:c,changeReason:{noSessionId:v,activityTimeout:x,sessionPastMaximumLength:f}}),a=r,h=!0):(c||(c=this.fi(),h=!0),(p=i!==y)&&(zc.info("adopted cross-tab session id",{sessionId:i,windowId:c}),h=!0));var b=Ai(u)&&e&&!f?u:r,E=Ai(a)?a:new Date().getTime();this.xi(c),this.bi(i,b,E),e||this.pi();var C={noSessionId:v,activityTimeout:x,sessionPastMaximumLength:f,crossTabAdoption:p};return h&&this.ai.forEach((P=>P(i,c,C))),{sessionId:i,windowId:c,sessionStartTimestamp:E,changeReason:h?C:void 0,lastActivityTimestamp:u}}pi(){this.ui||(clearTimeout(this.Pi),this.Pi=setTimeout((()=>{if(!this.ui)if(this.Ri(new Date().getTime())){var e=this.ci;this.resetSessionId(),this.si.emit("forcedIdleReset",{idleSessionId:e})}else this.pi()}),1.1*this.sessionTimeoutMs))}}var j6=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&DS(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>DS(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function V6(){return(V6=en((function*(){var t=ir==null?void 0:ir.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return _t(n)&&n.length>0?n:void 0}catch(r){return void _e.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var sm=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 hE(t,e,n){return eu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var $6={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=>sm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!sm(n,r))))),icontains:(t,e)=>e.map(Lh).some((n=>t.map(Lh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Lh).every((n=>t.map(Lh).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},Lh=t=>t.toLowerCase();function H6(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(xe(s)||lr(s))return!1;var i=[String(s)],a=$6[r.operator];return!!a&&a(r.values,i)}))}var Cy="custom",pE="i.posthog.com",wL=/^\/static\//;class bL{constructor(e){this.Oi={},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("."+pE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Oi[this.apiHost]||(this.Oi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Cy),this.Oi[this.apiHost]}Li(e){if(wL.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}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(e==="assets"){var r=this.Li(n);if(r)return""+r+n}if(this.region===Cy)return this.apiHost+n;var s=pE+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function z6(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var yt=Dt("[Surveys]"),U6="seenSurvey_",B6=t=>{try{var e=(n=>((r,s)=>""+U6+(function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id})(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){yt.error("Failed to persist survey seen state",n)}},SL=[_v.Popover,_v.Widget,_v.API],EL={ignoreConditions:!1,ignoreDelay:!1,displayType:_y.Popover},kL=Dt("[PostHog ExternalIntegrations]"),CL={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class PL{constructor(e){this._instance=e}Bt(e,n){var r;(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return kL.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],f=r[1];!f||(i=$e.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.Bt(CL[c],(()=>{var h;(h=$e.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!f&&(a=$e.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=$e.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[c])==null||u.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var hd={},Ev=0,im=()=>{},mE='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Uc="Surveys module not available",gE="sanitize_properties is deprecated. Use before_send instead",W6="Invalid value for property_denylist config: ",Xl="posthog",G6=!fL&&(yr==null?void 0:yr.indexOf("MSIE"))===-1&&(yr==null?void 0:yr.indexOf("Mozilla"))===-1,vE=t=>{var e;return fe({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:AO(Ee==null?void 0:Ee.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:im,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,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:on&&_t(on==null?void 0:on.search)&&on.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(ne==null||(e=ne.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_feature_flags_dedup_per_session:!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){_e.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:gy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:ky},error_tracking:{},_onCapture:im},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:zO,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},TL=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],yE=t=>{var e={};for(var n of TL){var r=n[0],s=n[1];xe(t[r])||(e[s]=t[r])}var i=Rt({},e,t),a=t.__preview_external_dependency_versioned_paths;return xe(a)||(xe(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),_t(a)&&xe(t.asset_host)&&(i.asset_host=a)),et(t.property_blacklist)&&(xe(t.property_denylist)?i.property_denylist=t.property_blacklist:et(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:_e.error(W6+t.property_denylist)),i};class RL{constructor(){this.__forceAllowLocalhost=!1}get Fi(){return this.__forceAllowLocalhost}set Fi(e){_e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class os{Ai(e,n){if(e){var r=this.$i.indexOf(e);r!==-1&&this.$i.splice(r,1)}return this.$i.push(n),n.initialize==null||n.initialize(),n}Ni(){return this.config.cookieless_mode===Vi||this.config.cookieless_mode===La&&this.consent.isRejected()}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(){var e;this.webPerformance=new RL,this.Di=!1,this.version=Vt.LIB_VERSION,this.qi=new d2,this.$i=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=vE(),this.SentryIntegration=XO,this.sentryIntegration=r=>(function(s,i){var a=y6(s,i);return{name:v6,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ji=!1,this.Bi=null,this.Hi=null,this.Ui=null,this.scrollManager=new _L(this),this.pageViewManager=new nE(this),this.rateLimiter=new oL(this),this.requestRouter=new bL(this),this.consent=new FO(this),this.externalIntegrations=new PL(this);var n=(e=os.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>_e.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==Xl){var s,i=(s=hd[r])!==null&&s!==void 0?s:new os;return i._init(e,n,r),hd[r]=i,hd[Xl][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=_t(e)?e.trim():"";if(!a)return _e.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.zi(n.debug),this.Wi=n,this.Vi=[],n.person_profiles?this.Hi=n.person_profiles:n.process_person&&(this.Hi=n.process_person);var u=vE(n.defaults),c=yE(n),f=Rt({},u,c,{name:r,token:a});Ot(u.rageclick)&&Ot(c.rageclick)&&(f.rageclick=Rt({},u.rageclick,c.rageclick)),Ot(u.session_recording)&&Ot(c.session_recording)&&(f.session_recording=Rt({},u.session_recording,c.session_recording)),this.set_config(f),this.config.on_xhr_error&&_e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:sr.GZipJS;var h=this.Zi();this.persistence=new yv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new yv(fe({},this.config,{persistence:"sessionStorage"}),h,!1);var p=fe({},this.persistence.props),v=fe({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Gi=new gL((T=>this.Qi(T)),this.config.request_queue_config),this.Ji=new yL(this),this.__request_queue=[];var y=this.Ni();if(y||(this.sessionManager=new fE(this),this.sessionPropsManager=new dE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(_e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ki(y)}),0)):(_e.info("Initializing extensions synchronously"),this.Ki(y)),Vt.DEBUG=Vt.DEBUG||this.config.debug,Vt.DEBUG&&_e.info("Starting in debug mode",{this:this,config:n,thisC:fe({},this.config),p,s:v}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=fe({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,_=this.get_distinct_id(),b=this.persistence.get_property(Ss);if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&b===Vl)this.identify(x);else if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&b===$l)_e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var E=this.config.get_device_id(Li()),C=n.bootstrap.isIdentifiedID?E:x;this.persistence.set_property(Ss,n.bootstrap.isIdentifiedID?$l:Vl),this.register({distinct_id:x,$device_id:C})}}if(y)this.register_once({distinct_id:Rh,$device_id:null},"");else if(!this.get_distinct_id()){var P=this.config.get_device_id(Li());this.register_once({distinct_id:P,$device_id:P},""),this.persistence.set_property(Ss,Vl)}return $t(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(T,R){var O=T.config.segment;if(!O)return R();(function(I,A){var N=I.config.segment;if(!N)return A();var L=V=>{var G=()=>V.anonymousId()||Li();I.config.get_device_id=G,V.id()&&(I.register({distinct_id:V.id(),$device_id:G()}),I.persistence.set_property(Ss,$l)),A()},F=N.user();"then"in F&&Ps(F.then)?F.then(L):L(F)})(T,(()=>{O.register((I=>{typeof Promise<"u"&&Promise.resolve||vv.warn("This browser does not have Promise support, and can not use the segment integration");var A=(N,L)=>{if(!L)return N;N.event.userId||N.event.anonymousId===I.get_distinct_id()||(vv.info("No userId set, resetting PostHog"),I.reset()),N.event.userId&&N.event.userId!==I.get_distinct_id()&&(vv.info("UserId set, identifying with PostHog"),I.identify(N.event.userId));var F=I.calculateEventProperties(L,N.event.properties);return N.event.properties=Object.assign({},F,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>A(N,N.event.event),page:N=>A(N,Yl),identify:N=>A(N,pv),screen:N=>A(N,"$screen")}})(T)).then((()=>{R()}))}))})(this,(()=>this.Yi())):this.Yi(),Ps(this.config._onCapture)&&this.config._onCapture!==im&&(_e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(T=>this.config._onCapture(T.event,T)))),this.config.ip&&_e.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.config.disableDeviceModel||(function(){return V6.apply(this,arguments)})().then((T=>{T&&this.register({[fv]:T})})).catch(im),this}Ki(e){var n,r,s,i,a,u,c,f,h=performance.now(),p=fe({},os.__defaultExtensionClasses,this.config.__extensionClasses),v=[];p.featureFlags&&this.$i.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.$i.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.$i.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.$i.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.$i.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.$i.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.$i.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.$i.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.$i.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.$i.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.$i.push(this.conversations=(u=this.conversations)!==null&&u!==void 0?u:new p.conversations(this)),p.productTours&&this.$i.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.$i.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.$i.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.$i.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.$i.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,YO)),p.toolbar&&this.$i.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.$i.push(this.experiments=(f=this.experiments)!==null&&f!==void 0?f:new p.experiments(this)),this.$i.forEach((y=>{y.initialize&&v.push((()=>{y.initialize==null||y.initialize()}))})),v.push((()=>{if(this.Xi){var y=this.Xi;this.Xi=void 0,this.Mr(y)}})),this.en(v,h)}en(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.en(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){_e.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[e6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[t6]:s}),this.config.__preview_deferred_init_extensions&&_e.info("PostHog extensions initialized ("+s+"ms)")}Mr(e){var n;if(!Ee||!Ee.body)return _e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Mr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Xi=e),this.tn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Be(e.supportedCompression,sr.GZipJS)?sr.GZipJS:Be(e.supportedCompression,sr.Base64)?sr.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Hi?this.Hi:gy}),this.$i.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(e)))}Yi(){try{this.config.loaded(this)}catch(r){_e.critical("`loaded` function failed",r)}if(this.rn(),this.config.internal_or_test_user_hostname&&on!=null&&on.hostname){var e=on.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.nn()}),1),this.sn=new T6(this),this.sn.load()}rn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Gi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Ah(this.__request_queue,(e=>this.Qi(e))),this.__request_queue=[],this.rn()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.an()&&this.capture(hv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Gi)==null||s.unload(),(i=this.Ji)==null||i.unload()):this.an()&&this.capture(hv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?G6?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=fe({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(xe(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=fe({},n);a.timeout=a.timeout||6e4;var u=(r=a.transport)!==null&&r!==void 0?r:"fetch";u==="sendBeacon"&&xe(a.compression)&&a.data&&(a.compression=sr.Base64),a.url=cE(a.url,a.compression);var c=dp.filter((h=>!a.disableTransport||!h.transport||!a.disableTransport.includes(h.transport))),f=(s=(i=(function(h,p){for(var v=0;h.length>v;v++)if(h[v].transport===u)return h[v]})(c))==null?void 0:i.method)!==null&&s!==void 0?s:c[0].method;if(!f)throw new Error("No available transport method");u!=="sendBeacon"&&a.data&&a.compression===sr.GZipJS&&NN&&typeof Promise<"u"&&!cp?hL(a).then((h=>{f(h)})).catch((h=>{if(LS(h))return cp=!0,void f(fe({},a,{compression:void 0,url:cE(n.url,void 0)}));(p=>{if(!p||typeof p!="object")return!1;var v="name"in p?String(p.name):"";return LS(p)||v===m8})(h)&&(cp=!0),f(a)})):f(a)})(fe({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Qi(e){this.Ji?this.Ji.retriableRequest(e):this._send_request(e)}_execute_array(e){Ev++;try{var n,r=[],s=[],i=[];Ah(e,(u=>{if(u)if(et(n=u[0]))i.push(u);else if(Ps(u))try{u.call(this)}catch(c){_e.error("Error executing queued PostHog call",u,c)}else et(u)&&n==="alias"?r.push(u):et(u)&&n.indexOf("capture")!==-1&&Ps(this[n])?i.push(u):s.push(u)}));var a=function(u,c){Ah(u,(function(f){try{if(et(f[0])){var h=c;bt(f,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[f[0]].apply(c,f.slice(1))}catch(p){_e.error("Error executing queued PostHog call",f,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Ev--}}push(e){if(Ev>0&&et(e)&&_t(e[0])){var n=os.prototype[e[0]];Ps(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,u,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gi){if(this.is_capturing())if(!xe(e)&&_t(e)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!_t(n==null?void 0:n.$current_url)&&(_e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.ln||_e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 p=new Date,v=(r==null?void 0:r.timestamp)||p,y=$S(r==null?void 0:r.uuid,Li),x={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},v,y)};e===Yl&&this.config.__preview_capture_bot_pageviews&&f&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),r!=null&&r.$set&&(x.$set=r==null?void 0:r.$set);var _=r==null?void 0:r.$unset;_&&(x.$unset=_);var b,E,C,P=this.un(r==null?void 0:r.$set_once,e!==WS,e===pv);if(P&&(x.$set_once=P),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,u=L=>_t(L)?L.slice(0,i):L,c=new Set,x=(function L(F,V){return F!==Object(F)?u?u(F):F:c.has(F)?void 0:(c.add(F),et(F)?(G=[],Ah(F,(X=>{G.push(L(X))}))):(G={},bt(F,((X,q)=>{c.has(X)||(G[q]=L(X))}))),G);var G})(a)),x.timestamp=v,xe(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),e===$i.DISMISSED||e===$i.SENT){var T=n==null?void 0:n[xv.SURVEY_ID],R=n==null?void 0:n[xv.SURVEY_ITERATION];B6({id:T,current_iteration:R}),x.$set=fe({},x.$set,{[(b={id:T,current_iteration:R},E=e===$i.SENT?"responded":"dismissed",C="$survey_"+E+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(C="$survey_"+E+"/"+b.id+"/"+b.current_iteration),C)]:!0})}else e===$i.SHOWN&&(x.$set=fe({},x.$set,{[xv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===iL.SHOWN){var O=n==null?void 0:n[sE.TOUR_TYPE];O&&(x.$set=fe({},x.$set,{[sE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var I=fe({},x.properties.$set,x.$set);if(Oo(I)||this.setPersonPropertiesForFlags(I),!Ye(this.config.before_send)){var A=this.it(x);if(!A)return;(x=A).uuid=$S(x.uuid,Li)}this.qi.emit("eventCaptured",x);var N={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:x,compression:"best-available",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Qi(N):this.Gi.enqueue(N),x}_e.critical("This capture call is ignored due to client rate limiting.")}}else _e.error("No event name provided to posthog.capture")}else _e.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),u=fe({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Ni()&&(u.$cookieless_mode=!0),e==="$snapshot"){var c=fe({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!_t(u.distinct_id)&&!$n(u.distinct_id)||K1(u.distinct_id))&&_e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var f,h=(function(E,C,P,T){var R,O,I,A;if(T===void 0&&(T=!1),!yr)return{};var N,L,F,V,G,X,q,B,Y,$=E?[...Iu,...C||[]]:[],ee=(function(te){for(var se=0;jS.length>se;se++){var oe=jS[se],ue=oe[1],he=oe[0].exec(te),ie=he&&(Ps(ue)?ue(he,te):ue);if(ie)return ie}return["",""]})(yr),H=(N=typeof navigator<"u"?navigator:void 0)!=null&&N.brave?{brave:!0}:{},D={detectGoogleSearchApp:P},Z=Rt(s2({$os:ee[0],$os_version:ee[1],$browser:V8(yr,navigator.vendor,H,D),$device:VS(yr),$device_type:(F=yr,V={userAgentDataPlatform:(R=navigator)==null||(R=R.userAgentData)==null?void 0:R.platform,maxTouchPoints:(O=navigator)==null?void 0:O.maxTouchPoints,screenWidth:ne==null||(I=ne.screen)==null?void 0:I.width,screenHeight:ne==null||(A=ne.screen)==null?void 0:A.height,devicePixelRatio:ne==null?void 0:ne.devicePixelRatio},Y=VS(F),Y===w8||Y===x8||Y==="Kobo"||Y==="Kindle Fire"||Y===O8?Tu:Y===Pd||Y===au||Y===Td||Y===Z1?"Console":Y===S8?"Wearable":Y?Ur:(V==null?void 0:V.userAgentDataPlatform)==="Android"&&((G=V==null?void 0:V.maxTouchPoints)!==null&&G!==void 0?G:0)>0?600>Math.min((X=V==null?void 0:V.screenWidth)!==null&&X!==void 0?X:0,(q=V==null?void 0:V.screenHeight)!==null&&q!==void 0?q:0)/((B=V==null?void 0:V.devicePixelRatio)!==null&&B!==void 0?B:1)?Ur:Tu:"Desktop"),$timezone:P6(),$timezone_offset:nL()}),{$current_url:Id(T?Uo(on==null?void 0:on.href):on==null?void 0:on.href,$,Nd),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:yr.length>1e3?yr.substring(0,997)+"...":yr,$browser_version:QN(yr,navigator.vendor,H,D),$browser_language:rE(),$browser_language_prefix:(L=rE(),typeof L=="string"?L.split("-")[0]:void 0),$screen_height:ne==null?void 0:ne.screen.height,$screen_width:ne==null?void 0:ne.screen.width,$viewport_height:ne==null?void 0:ne.innerHeight,$viewport_width:ne==null?void 0:ne.innerWidth,$lib:Vt.LIB_NAME,$lib_version:Vt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Vt.SDK_DIST_CHANNEL&&(Z.$sdk_dist_channel=Vt.SDK_DIST_CHANNEL),Z})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime()),v=p.windowId;u.$session_id=p.sessionId,u.$window_id=v}this.sessionPropsManager&&Rt(u,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&Rt(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(y=this.Ji)==null?void 0:y.length}catch(E){u.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===Cy&&(u.$lib_custom_api_host=this.config.api_host),f=e!==Yl||i?e!==hv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=Rt(u,f),e===Yl&&Ee&&(u.title=Ee.title),!xe(a)){var x=r.getTime()-a;u.$duration=parseFloat((x/1e3).toFixed(3))}yr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=Rt({},h,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),et(this.config.property_denylist)?bt(this.config.property_denylist,(function(E){delete u[E]})):_e.error(W6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(_e.error(gE),u=_(u,e));var b=this.hn();return u.$process_person_profile=b,b&&!i&&this.dn("_calculate_event_properties"),u}un(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.hn()||this.Di&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=Rt({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(_e.error(gE),u=c(u,"$set_once")),n&&(this.Di=!0),Oo(u)?void 0:u}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.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)}cn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(e,n)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.qi.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Uc}),()=>{})}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?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Uc})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Uc})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=EL),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Uc}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Uc})}vn(e){return!e||K1(e)?(_e.critical("Unique user id has not been set in posthog.identify"),!1):e===Rh?(_e.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(_e.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.'),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return _e.uninitializedWarning("posthog.identify");if($n(e)&&(e=e.toString(),_e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.vn(e)&&this.dn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Kp)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(td)&&(this.unregister(td),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Ss)||Vl)===Vl;e!==s&&a?(this.persistence.set_property(Ss,$l),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(pv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Ui=hE(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(cd))}}setPersonProperties(e,n){if((e||n)&&this.dn("posthog.setPersonProperties")){var r=hE(this.get_distinct_id(),e,n);this.Ui!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Ui=r):_e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(et(e)?e:[e]).filter((s=>_t(s)&&s.length>0));r.length!==0&&this.dn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ui=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:fe({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(WS,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else _e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.dn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,a,u,c,f,h,p;if(_e.info("reset"),!this.__loaded)return _e.uninitializedWarning("posthog.reset");var v,y=this.get_property(Kp),x=this.get_property(fv),_=this.get_property(Ha);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),xe(_)||(v=this.persistence)==null||v.register({[Ha]:_}),(s=this.surveys)==null||s.reset(),(i=this.sn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(u=this.conversations)==null||u.reset(),(c=this.logs)==null||c.reset(),(f=this.metrics)==null||f.reset(),(h=this.persistence)==null||h.set_property(Ss,Vl),(p=this.sessionManager)==null||p.resetSessionId(),this.Ui=null,this.config.cookieless_mode===Vi)this.register_once({distinct_id:Rh,$device_id:null},"");else{var b=this.config.get_device_id(Li());this.register_once({distinct_id:b,$device_id:e?b:y},""),e||xe(x)||this.register({[fv]:x})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return en((function*(){var r,s,i,a,u;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(i=n.Gi)==null||i.unload(),(a=n.Ji)==null||a.unload(),(u=n.featureFlags)==null||u.destroy()):_e.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.fn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.pn()}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 n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,n){return e===this.get_property(K8)?(_e.critical("Attempting to create alias for existing People user - aborting."),-2):this.dn("posthog.alias")?(xe(n)&&(n=this.get_distinct_id()),e!==n?(this.cn(td,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(_e.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=fe({},this.config);if(Ot(e)){var r,s,i,a,u,c,f,h,p,v,y;Rt(this.config,yE(e));var x=this.Zi();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new yv(fe({},this.config,{persistence:"sessionStorage"}),x,!1);var _=this.zi(this.config.debug);si(_)&&(this.config.debug=_),si(this.config.debug)&&(this.config.debug?(Vt.DEBUG=!0,wt.N()&&wt.q("ph_debug",!0),_e.info("set_config",{config:e,oldConfig:n,newConfig:fe({},this.config)})):(Vt.DEBUG=!1,wt.N()&&wt.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(u=this.tracingHeaders)==null||u.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(v=this.surveys)==null||v.loadIfEnabled(),this.gn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){Vt.LIB_NAME=e,Vt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,u=e===!0,c={sampling:u||!(e==null||!e.sampling),linked_flag:u||!(e==null||!e.linked_flag),url_trigger:u||!(e==null||!e.url_trigger),event_trigger:u||!(e==null||!e.event_trigger)};Object.values(c).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),c.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),c.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),c.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),c.event_trigger&&((a=this.sessionRecording)==null||a.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){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(fe({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:os.mn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}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:Xl;return n!==Xl&&(n=Xl+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Ss))===$l||((n=this.sessionPersistence)==null?void 0:n.get_property(Ss))===$l}hn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===gy&&!this._isIdentified()&&Oo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[td])&&((n=this.persistence)==null||(n=n.props)==null||!n[Yp]))}an(){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.hn()||this.dn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.dn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}dn(e){return this.config.person_profiles==="never"?(_e.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.cn(Yp,!0),!0)}Zi(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==La)}gn(){var e,n,r,s,i=this.Zi();return((e=this.persistence)==null?void 0:e.ir)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.ir)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Vi){if(this.Ni()){var r,s,i,a,u;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new fE(this),this.pageViewManager=new nE(this),this.persistence&&(this.sessionPropsManager=new dE(this,this.sessionManager,this.persistence));var c,f=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=os.__defaultExtensionClasses)==null?void 0:u.sessionRecording;f&&(this.sessionRecording=this.Ai(this.sessionRecording,new f(this)),this.tn&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.tn)))}var h,p;this.consent.optInOut(!0),this.gn(),this.rn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==La&&((h=this.surveys)==null||h.loadIfEnabled()),(xe(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((p=e==null?void 0:e.captureEventName)!==null&&p!==void 0?p:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.nn()}else _e.warn(mE)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Vi?(this.config.cookieless_mode===La&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gn(),this.config.cookieless_mode===La&&(this.register({distinct_id:Rh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.nn(),this.rn())):_e.warn(mE)}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===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Vi||(this.config.cookieless_mode===La?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gn()}_is_bot(){return ir?j6(ir,this.config.custom_blocked_useragents):void 0}nn(){Ee&&(Ee.visibilityState==="visible"?this.ji||(this.ji=!0,this.capture(Yl,{title:Ee.title},{send_instantly:!0}),this.Bi&&(Ee.removeEventListener(Xp,this.Bi),this.Bi=null)):this.Bi||(this.Bi=this.nn.bind(this),$t(Ee,Xp,this.Bi)))}debug(e){e===!1?(ne==null||ne.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ne==null||ne.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}))}Rr(){var e,n,r,s,i,a,u=this.Wi||{};return"advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(_e.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",s=_e,i=(n="advanced_disable_flags")in(e=u)&&!Ye(e[n]),a=r in e&&!Ye(e[r]),i?e[n]:!!a&&(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]))}it(e){var n;if(Ye(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter($N),s=et(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Ye(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return VN(e.event)?_e.warn(u+". This can cause unexpected behavior."):_e.info(u),null}i.properties&&!Oo(i.properties)||_e.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&Ye(i.properties[c]))return _e.warn("Event '"+e.event+"' had its '"+c+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.zt)==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)})}zi(e){var n=si(e)&&!e,r=wt.N()&&wt.A("ph_debug")==="true";return!n&&(!!r||e)}}os.__defaultExtensionClasses={},os.mn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=TO(t.prototype[e[n]])})(os,["identify"]);class _E{constructor(e){this.disabled=e===!1;var n=Ot(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){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}}var kv="$copy_autocapture",Cv=Dt("[AutoCapture]");function Pv(t,e){return e.length>t?e.slice(0,t)+"...":e}function AL(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Bo(e));return e}function ML(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,f=e.disableCaptureUrlHashes;if(!Bo(t))return{props:{}};for(var h=[t],p=new Set([t]),v=t;v.parentNode&&!$r(v,"body")&&l6>h.length;)if(a6(v.parentNode)){var y=v.parentNode.host;if(p.has(y))break;p.add(y),h.push(y),v=y}else{if(!Bo(v.parentNode)||p.has(v.parentNode))break;p.add(v.parentNode),h.push(v.parentNode),v=v.parentNode}var x,_,b=[],E={},C=!1,P=!1;if(bt(h,(A=>{var N=yy(A);if($r(A,"a")){var L=A.getAttribute("href");C=!!(N&&L&&dd(L))&&(f?Uo(L):L)}Be(em(A),"ph-no-capture")&&(P=!0),b.push((function(V,G,X,q,B){B===void 0&&(B=!1);var Y=V.tagName.toLowerCase(),$={tag_name:Y};o2.indexOf(Y)>-1&&!X&&($.$el_text=Y.toLowerCase()==="a"||Y.toLowerCase()==="button"?Pv(1024,JS(V)):Pv(1024,Ad(V)));var ee=em(V);ee.length>0&&($.classes=ee.filter((function(te){return te!==""}))),bt(V.attributes,(function(te){var se;if((!h6(V)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(q==null||!q.includes(te.name))&&!G&&dd(te.value)&&(!_t(se=te.name)||se.substring(0,10)!=="_ngcontent"&&se.substring(0,7)!=="_nghost")){var oe=te.value;te.name==="class"&&(oe=i2(oe).join(" ")),$["attr__"+te.name]=Pv(1024,te.name==="href"&&B?Uo(oe):oe)}}));for(var H=1,D=1,Z=V;Z=AL(Z);)H++,Z.tagName===V.tagName&&D++;return $.nth_child=H,$.nth_of_type=D,$})(A,i,a,u,f));var F=(function(V){if(!yy(V))return{};var G={};return bt(V.attributes,(function(X){if(X.name&&X.name.indexOf("data-ph-capture-attribute")===0){var q=X.name.replace("data-ph-capture-attribute-",""),B=X.value;q&&B&&dd(B)&&(G[q]=B)}})),G})(A);Rt(E,F)})),P)return{props:{},explicitNoCapture:P};if(a||(b[0].$el_text=$r(t,"a")||$r(t,"button")?JS(t):Ad(t)),C){var T,R;b[0].attr__href=C;var O=(T=Md(C))==null?void 0:T.host,I=ne==null||(R=ne.location)==null?void 0:R.host;O&&I&&O!==I&&(x=C)}return{props:Rt({$event_type:s.type,$ce_version:1},c?{}:{$elements:b},{$elements_chain:(_=b,(function(A){return A.map((N=>{var L,F,V="";if(N.tag_name&&(V+=N.tag_name),N.attr_class)for(var G of(N.attr_class.sort(),N.attr_class))V+="."+G.replace(/"/g,"");var X=fe({},N.text?{text:N.text}:{},{"nth-child":(L=N.nth_child)!==null&&L!==void 0?L:0,"nth-of-type":(F=N.nth_of_type)!==null&&F!==void 0?F:0},N.href?{href:N.href}:{},N.attr_id?{attr_id:N.attr_id}:{},N.attributes),q={};return up(X).sort(((B,Y)=>B[0].localeCompare(Y[0]))).forEach((B=>{var Y=B[1];return q[eE(B[0].toString())]=eE(Y.toString())})),(V+=":")+up(q).map((B=>B[0]+'="'+B[1]+'"')).join("")})).join(";")})((function(A){return A.map((N=>{var L,F,V={text:(L=N.$el_text)==null?void 0:L.slice(0,400),tag_name:N.tag_name,href:(F=N.attr__href)==null?void 0:F.slice(0,2048),attr_class:qO(N),attr_id:N.attr__id,nth_child:N.nth_child,nth_of_type:N.nth_of_type,attributes:{}};return up(N).filter((G=>G[0].indexOf("attr__")===0)).forEach((G=>V.attributes[G[0]]=G[1])),V}))})(_)))},(n=b[0])!=null&&n.$el_text?{$el_text:(r=b[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},E)}}var Bc=Dt("[ExceptionAutocapture]"),xE=()=>{},IL=Dt("[TracingHeaders]"),Sa=Dt("[Web Vitals]"),wE=9e5,bE="disabled",SE="lazy_loading",Wc="awaiting_config",Dh="missing_config";Dt("[SessionRecording]"),Dt("[SessionRecording]");var Py="[SessionRecording]",Ei=Dt(Py),NL=Dt("[Heatmaps]");function EE(t){return Ot(t)&&"clientX"in t&&"clientY"in t&&$n(t.clientX)&&$n(t.clientY)}var Tv=Dt("[Product Tours]"),Rv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(t2))},OL=["$set_once","$set"],zs=Dt("[SiteApps]"),kE="Error while initializing PostHog app with config id ";function Ul(t,e,n){if(Ye(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}}class LL{constructor(e){this.yn=new d2,this.bn=(n,r)=>this._n(n,r)&&this.wn(n,r)&&this.xn(n,r)&&this.kn(n,r),this._n=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.Sn=new Set,this.Cn=new Set}init(){var e,n;xe((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!xe((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.Cn)==null||u.add(a),(c=a.steps)==null||c.forEach((f=>{var h;(h=this.Sn)==null||h.add((f==null?void 0:f.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var u;(u=a.steps)==null||u.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Sn.has(e)||this.Sn.has(n==null?void 0:n.event))&&this.Cn&&((r=this.Cn)==null?void 0:r.size)>0&&this.Cn.forEach((s=>{this.Tn(n,s)&&this.yn.emit("actionCaptured",s.name)}))}In(e){this.onAction("actionCaptured",(n=>e(n)))}Tn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.bn(e,r))return!0;return!1}onAction(e,n){return this.yn.on(e,n)}wn(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Ul(s,n.url,n.url_matching||"contains"))return!1}return!0}xn(e,n){return!!this.Mn(e,n)&&!!this.En(e,n)&&!!this.Rn(e,n)}Mn(e,n){var r;if(n==null||!n.href)return!0;var s=this.Pn(e);if(s.length>0)return s.some((u=>Ul(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&Ul((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}En(e,n){var r;if(n==null||!n.text)return!0;var s=this.Pn(e);if(s.length>0)return s.some((f=>Ul(f.text,n.text,n.text_matching||"exact")||Ul(f.$el_text,n.text,n.text_matching||"exact")));var i,a,u,c=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(f){for(var h,p=[],v=/(?::|")text="(.*?)"/g;!Ye(h=v.exec(f));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((f=>Ul(f,a,u))))}Rn(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Pn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}kn(e,n){return n==null||!n.properties||n.properties.length===0||H6(n.properties.reduce(((r,s)=>{var i=et(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class DL{constructor(e){this.On=[],this._instance=e,this.Ln=new Map,this.Fn=new Map,this.An=new Map}$n(e,n){return!!e&&H6(e.propertyFilters,n==null?void 0:n.properties)}Nn(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((a=>{if(a!=null&&a.name){var u=r.get(a.name)||[];u.push(s.id),r.set(a.name,u)}}))})),r}Dn(e,n,r){var s=(r===jc.Activation?this.Ln:this.Fn).get(e),i=[];return this.qn((a=>{i=a.filter((u=>s==null?void 0:s.includes(u.id)))})),i.filter((a=>{var u,c=(u=a.conditions)==null||(u=u[r])==null||(u=u.values)==null?void 0:u.find((f=>f.name===e));return this.$n(c,n)}))}register(e){var n;xe((n=this._instance)==null?void 0:n._addCaptureHook)||(this.jn(e),this.Bn(e))}Bn(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.Hn==null&&(this.Hn=new LL(this._instance),this.Hn.init(),this.Hn.In((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,u,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((u=this.Hn)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((f=>{if(f&&f.name){var h=this.An.get(f.name);h&&h.push(r.id),this.An.set(f.name,h||[r.id])}})))})))}jn(e){var n,r=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.events)&&((u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)>0})),s=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((u=i.conditions)==null||(u=u.cancelEvents)==null||(u=u.values)==null?void 0:u.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.Ln=this.Nn(e,jc.Activation),this.Fn=this.Nn(e,jc.Cancellation))}onEvent(e,n){var r,s,i=this.Un(),a=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var u=this.zn(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.Wn([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.Vn(a)}if(this.Fn.has(e)){var c=this.Dn(e,n,jc.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.Wn(c.map((h=>h.id))),c.forEach((h=>this.Zn(h.id))))}if(this.Ln.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Ln.get(e)});var f=this.Dn(e,n,jc.Activation);this.Gn(f.map((h=>h.id)))}}onAction(e){this.An.has(e)&&this.Gn(this.An.get(e)||[])}Gn(e){e.length!==0&&(this.On=[...new Set([...this.On,...e])],this.Un().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Vn(e){this.On=this.On.filter((r=>r!==e));var n=this.Qn();n.includes(e)||this.Jn([...n,e])}Wn(e){var n=new Set(e);this.On=this.On.filter((i=>!n.has(i)));var r=this.Qn(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&this.Jn(s)}Qn(){var e,n=this.Kn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}getActivatedIds(){return[...new Set([...this.Qn(),...this.On])].filter((e=>!this.Yn(e)))}reset(){this.On=[],this.Qn().length>0&&this.Jn([])}getEventToItemsMap(){return this.Ln}Xn(){return this.Hn}}class FL extends DL{constructor(e){super(e)}Kn(){return uy}es(){return $i.SHOWN}qn(e){var n;(n=this._instance)==null||n.getSurveys(e)}Zn(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Un(){return yt}Jn(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[uy]:e})}Yn(){return!1}zn(e,n){var r;this.qn((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return z6(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===$i.SHOWN?"consume":"ignore":e===$i.SHOWN?"persist":e===$i.DISMISSED||e===$i.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Av="SDK is not enabled or survey functionality is not yet loaded",CE="Disabled. Not loading surveys.",jL=ne!=null&&ne.location?tm(ne.location.hash,"__posthog")||tm(location.hash,"state"):null,PE="_postHogToolbarParams",TE=Dt("[Toolbar]"),un=Dt("[FeatureFlags]"),Ea=Dt("[FeatureFlags]",{debugEnabled:!0}),Mv=`" failed. Feature flags didn't load in time.`,RE=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},AE=t=>{var e={};for(var n of up(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},ki=Dt("[Error tracking]"),ME="Refusing to render web experiment since the viewer is a likely bot",VL={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>sm(e,t),not_regex:(t,e)=>!sm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Kn{get Se(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Kn.ts("retrieved web experiments from the server"),n.rs=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.rs&&(Kn.ts("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.rs)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);_t(u)&&i.variants[u]&&n.ns(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var f=i.variants[c];Kn.ss(f,n._instance)&&n.ns(i.name,c,f.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Kn.ts(ME);else if(!this.Se.disable_web_experiments){if(Ye(this.rs))return this.rs=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Kn.ts("applying feature flags",e),e.forEach((n=>{var r;if(this.rs&&(r=this.rs)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.rs)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.ns(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Kn.getWindowLocation();if(e!=null&&e.search){var n=Mu(e==null?void 0:e.search,"__experiment_id"),r=Mu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Kn.ts("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.os(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Se.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}os(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Kn.ts("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.ns(s[0].name,n,s[0].variants[n].transforms))}static ss(e,n){return!Ye(e.conditions)&&Kn.ls(e,n)&&Kn.us(e)}static ls(e,n){var r;if(Ye(e.conditions)||Ye((r=e.conditions)==null?void 0:r.url))return!0;var s=Kn.getWindowLocation();if(s){var i,a,u,c=i6(n,s.href);return(i=e.conditions)==null||!i.url||VL[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ne==null?void 0:ne.location}static us(e){var n;if(Ye(e.conditions)||Ye((n=e.conditions)==null?void 0:n.utm))return!0;var r=w6();if(r.utm_source){var s,i,a,u,c,f,h,p,v=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,y=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,x=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,_=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return v&&x&&_&&y}return!1}static ts(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];_e.info("[WebExperiments] "+e,r)}ns(e,n,r){this._is_bot()?Kn.ts(ME):n!=="control"?r.forEach((s=>{if(s.selector){var i;Kn.ts("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((u=>{var c=u;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):Kn.ts("Control variants leave the page unmodified.")}_is_bot(){return ir&&this._instance?j6(ir,this.Se.custom_blocked_useragents):void 0}}var rs=Dt("[Conversations]"),ka="Conversations not available yet.",IE="console",zm={featureFlags:class{constructor(t){this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=!1,this.bs=0,this._s=()=>{var e=this.ws();this.bs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],ne&&$t(ne,"online",this._s)}destroy(){ne==null||ne.removeEventListener("online",this._s)}get Se(){return this._instance.config}get ri(){return this._instance.persistence}xs(t){return this._instance.get_property(t)}ks(){var t,e;return(t=(e=this.ri)==null?void 0:e.sr(this.Se.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ss(){return!!this.ks()&&(this.ys||this.cs||(this.ys=!0,un.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Cs(){var t,e=(t=this.Se.evaluation_contexts)!==null&&t!==void 0?t:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.gs||(un.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.gs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||un.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Ts(){return this.Cs().length>0}Is(){var t=this.Se.flag_keys;if(!xe(t)){if(et(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||un.error("Invalid flag key found:",e,"Expected non-empty string"),n}));un.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},u=Object.keys(r).filter((f=>!!r[f])).reduce(((f,h)=>(f[h]=r[h]||!1,f)),{}),c=Object.keys(a).filter((f=>u[f])).reduce(((f,h)=>(a[h]&&(f[h]=a[h]),f)),{});this.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.xs(ja))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.xs(lp))!==null&&s!==void 0?s:{},u=fe({},i,t),c=fe({},a,e),f={};for(var h of Object.entries(u)){var p=h[0],v=h[1];f[p]={key:p,enabled:MS(v),variant:IS(v),reason:void 0,metadata:xe(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.receivedFeatureFlags({flags:f})}get hasLoadedFlags(){return this.ds}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.xs(oy),e=this.xs(Mi),n=this.xs(Zl);if(!n&&!e)return t||{};var r=Rt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],f=e==null?void 0:e[i],h=xe(f)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!f,p=xe(f)?c.variant:typeof f=="string"?f:void 0,v=n==null?void 0:n[i],y=fe({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(y.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(y.original_variant=c==null?void 0:c.variant),v&&(y.metadata=fe({},c==null?void 0:c.metadata,{payload:v,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=y}return this.hs||(un.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.hs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:MS(r),variant:IS(r),payload:AS(e[n])}}))}getFlagVariants(){var t=this.xs(ja),e=this.xs(Mi);if(!e)return t||{};for(var n=Rt({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.hs||(un.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.hs=!0),n}getFlagPayloads(){var t=this.xs(lp),e=this.xs(Zl);if(!e)return t||{};for(var n=Rt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.hs||(un.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.hs=!0),n}reloadFeatureFlags(){this.vs||this.Se.advanced_disable_feature_flags||this.ws()||this.Ms||(this._instance.qi.emit("featureFlagsReloading",!0),this.Ms=setTimeout((()=>{this.Es()}),5))}Rs(){clearTimeout(this.Ms),this.Ms=void 0}ensureFlagsLoaded(){this.ds||this.cs||this.Ms||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.vs=t}Es(t){var e;if(this.Rs(),!this._instance.Rr()&&!this.ws())if(this.cs)this.fs=!0;else{var n=this.Se.token,r=this.xs(Kp),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:fe({},((e=this.ri)==null?void 0:e.get_initial_props())||{},this.xs(Na)||{}),group_properties:this.xs(Oa),timezone:P6()};lr(r)||xe(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Se.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Ts()&&(s.evaluation_contexts=this.Cs());var i=this.Is();xe(i)||(s.flag_keys=i);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.cs=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.Se.disable_compression?void 0:sr.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:c=>{var f,h,p,v=!0;if(this.Ps(c.statusCode),c.statusCode===200&&(this.fs||(this.$anon_distinct_id=void 0),v=!1),this.cs=!1,!s.disable_flags||this.fs){this.ps=!v;var y=[];c.error?c.error instanceof Error?y.push(c.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):c.statusCode!==200&&y.push("api_error_"+c.statusCode),(f=c.json)!=null&&f.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var x,_=!((h=c.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));_&&y.push("quota_limited"),(p=this.ri)==null||p.register({[dy]:y}),_?un.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."):(s.disable_flags||this.receivedFeatureFlags((x=c.json)!==null&&x!==void 0?x:{},v,{partialResponse:a}),this.fs&&(this.fs=!1,this.Es()))}}})}}ws(){return _6(this.bs,3)}Ps(t){this.bs=x6(t,this.bs,3,(()=>un.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.ps)if(this.ds||this.getFlags()&&this.getFlags().length>0){if(!this.Ss()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else un.warn('getFeatureFlag for key "'+t+Mv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.ps)if(this.ds||this.getFlags()&&this.getFlags().length>0){if(!this.Ss()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),u=this.xs(ay)||void 0,c=this.xs(Rd)||void 0,f=this.xs(cd)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),v=this.xs(cy);p&&p!==v&&(f={},(h=this.ri)==null||h.register({[cd]:f,[cy]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in f)||!f[t].includes(a))){var y,x,_,b,E,C,P,T,R,O;et(f[t])?f[t].push(a):f[t]=[a],(y=this.ri)==null||y.register({[cd]:f});var I=this.getFeatureFlagDetails(t),A=[...(x=this.xs(dy))!==null&&x!==void 0?x:[]];xe(s)&&A.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:u,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((_=this.Se.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[t])||null,$feature_flag_bootstrapped_payload:((b=this.Se.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[t])||null,$used_bootstrap_value:!this.ps};xe(I==null||(E=I.metadata)==null?void 0:E.version)||(N.$feature_flag_version=I.metadata.version);var L,F=(C=I==null||(P=I.reason)==null?void 0:P.description)!==null&&C!==void 0?C:I==null||(T=I.reason)==null?void 0:T.code;F&&(N.$feature_flag_reason=F),I!=null&&(R=I.metadata)!=null&&R.id&&(N.$feature_flag_id=I.metadata.id),xe(I==null?void 0:I.original_variant)&&xe(I==null?void 0:I.original_enabled)||(N.$feature_flag_original_response=xe(I.original_variant)?I.original_enabled:I.original_variant),I!=null&&(O=I.metadata)!=null&&O.original_payload&&(N.$feature_flag_original_payload=I==null||(L=I.metadata)==null?void 0:L.original_payload),A.length&&(N.$feature_flag_error=A.join(",")),this._instance.capture("$feature_flag_called",N)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:AS(i)}}}else un.warn('getFeatureFlagResult for key "'+t+Mv)}getRemoteConfigPayload(t,e){var n=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Ts()&&(r.evaluation_contexts=this.Cs());var s=this.Is();xe(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Se.disable_compression?void 0:sr.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(i){var a,u=(a=i.json)==null?void 0:a.featureFlagPayloads;e((u==null?void 0:u[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.ps){if(this.ds||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,e);return xe(n)?void 0:!!n}un.warn('isFeatureEnabled for key "'+t+Mv)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.ri){this.ds=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,u,c,f,h,p){c===void 0&&(c={}),f===void 0&&(f={}),h===void 0&&(h={});var v=(A=>{var N=A.flags;return N?(A.featureFlags=Object.fromEntries(Object.keys(N).map((L=>{var F;return[L,(F=N[L].variant)!==null&&F!==void 0?F:N[L].enabled]}))),A.featureFlagPayloads=Object.fromEntries(Object.keys(N).filter((L=>N[L].enabled)).filter((L=>{var F;return(F=N[L].metadata)==null?void 0:F.payload})).map((L=>{var F;return[L,(F=N[L].metadata)==null?void 0:F.payload]})))):A.featureFlags&&un.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A})(a),y=v.flags,x=v.featureFlags,_=v.featureFlagPayloads;if(x){var b=a.requestId,E=a.evaluatedAt;if(et(x)){un.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var C={};if(x)for(var P=0;x.length>P;P++)C[x[P]]=!0;u&&u.register({[ap]:x,[ja]:C})}else{var T=x,R=_,O=y;if(p!=null&&p.partialResponse)T=fe({},c,T),R=fe({},f,R),O=fe({},h,O);else if(a.errorsWhileComputingFlags)if(y){var I=new Set(Object.keys(y).filter((A=>{var N;return!((N=y[A])!=null&&N.failed)})));T=fe({},c,Object.fromEntries(Object.entries(T).filter((A=>I.has(A[0]))))),R=fe({},f,Object.fromEntries(Object.entries(R||{}).filter((A=>I.has(A[0]))))),O=fe({},h,Object.fromEntries(Object.entries(O||{}).filter((A=>I.has(A[0])))))}else T=fe({},c,T),R=fe({},f,R),O=fe({},h,O);u&&u.register(fe({[ap]:Object.keys(AE(T)),[ja]:T||{},[lp]:R||{},[oy]:O||{}},b?{[ay]:b}:{},E?{[Rd]:E}:{}))}}})(t,this.ri,r,s,i,n),e||(this.ys=!1),this.Os(e)}}override(t,e){e===void 0&&(e=!1),un.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ri)return un.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.ri.unregister(Mi),this.ri.unregister(Zl),this.Os(),Ea.info("All overrides cleared");if(et(t)){var e=RE(t);return this.ri.register({[Mi]:e}),this.Os(),Ea.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.hs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ri.unregister(Mi),Ea.info("Flag overrides cleared");else if(r.flags){if(et(r.flags)){var s=RE(r.flags);this.ri.register({[Mi]:s})}else this.ri.register({[Mi]:r.flags});Ea.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ri.unregister(Zl),Ea.info("Payload overrides cleared")):r.payloads&&(this.ri.register({[Zl]:r.payloads}),Ea.info("Payload overrides set",{payloads:r.payloads}))),void this.Os()}if(t&&typeof t=="object")return this.ri.register({[Mi]:t}),this.Os(),Ea.info("Flag overrides set",{flags:t});un.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ds){var e=this.Ls(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){un.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.xs(rd)||[]).find((c=>c.flagKey===t)),i={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var u=fe({},this.getFlagVariants(),{[t]:e});(r=this.ri)==null||r.register({[ap]:Object.keys(AE(u)),[ja]:u}),this.Os()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.xs(rd),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+s),method:"GET",callback:i=>{var a,u;if(i.json){var c=i.json.earlyAccessFeatures;return(a=this.ri)==null||a.unregister(rd),(u=this.ri)==null||u.register({[rd]:c}),t(c)}}})}Ls(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,r)=>(n[r]=e[r],n)),{})}}Os(t){var e=this.Ls(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){un.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.xs(Na)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this._instance.register({[Na]:fe({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=fe({},this.xs(Na)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[Na]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Na),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.xs(Oa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=fe({},n[r],t[r]),delete t[r]})),this._instance.register({[Oa]:fe({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.xs(Oa)||{};this._instance.register({[Oa]:fe({},e,{[t]:{}})})}else this._instance.unregister(Oa)}reset(){this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.$anon_distinct_id=void 0,this.Rs(),this.hs=!1,this.bs=0}}},$L={sessionRecording:class{get Se(){return this._instance.config}get ri(){return this._instance.persistence}get started(){var t;return!((t=this.Fs)==null||!t.isStarted)}get status(){var t,e;return this.As===Wc||this.As===Dh?this.As:(t=(e=this.Fs)==null?void 0:e.status)!==null&&t!==void 0?t:this.As}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.As=bE,this.$s=void 0,this._instance=t,!this._instance.sessionManager)throw Ei.error("started without valid sessionManager"),new Error(Py+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===Vi)throw new Error(Py+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ns(){var t,e=!((t=this._instance.get_property(Ha))==null||!t.enabled),n=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.Ns||(e=this.Fs)==null||!e.isStarted){var n=!xe(Object.assign)&&!xe(Array.from);this.Ns&&n?(this.Ds(t),Ei.info("starting")):(this.As=bE,this.stopRecording())}}Ds(t){var e,n,r;this.Ns&&(this.As!==Wc&&this.As!==Dh&&(this.As=SE),$e!=null&&(e=$e.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=$e.__PosthogExtensions__)!=null&&n.initSessionRecording?this.qs(t):(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.js,(s=>{if(s)return Ei.error("could not load recorder",s);this.qs(t)})))}stopRecording(){var t,e;(t=this.$s)==null||t.call(this),this.$s=void 0,(e=this.Fs)==null||e.stop()}Bs(){var t,e;(t=this.$s)==null||t.call(this),this.$s=void 0,(e=this.Fs)==null||e.discard()}Hs(){var t,e;(t=this.ri)==null||t.unregister(n2),(e=this.ri)==null||e.unregister(q8)}Us(t,e){if(Ye(t))return null;var n,r=$n(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ei.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}zs(t){if(this.ri){var e,n,r=this.ri,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.Us((i=this.Se.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.Us(a==null?void 0:a.sampleRate,"remote config sampleRate"),f=u??c;Ye(f)&&this.Hs();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[Ha]:fe({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:fe({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:f,minimumDurationMilliseconds:xe(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.$s)==null||e.call(this),this.$s=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.zs(t),void this.Bs()):(this.zs(t),void this.startIfEnabledOrStop()):(this.As===Wc&&(this.As=Dh,Ei.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.Fs)!=null&&n.log?this.Fs.log(t,e):Ei.warn("log called before recorder was ready")}get js(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(Ha);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Ws(){var t,e,n=this._instance.get_property(Ha);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Ei.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}qs(t){var e,n;if((e=$e.__PosthogExtensions__)==null||!e.initSessionRecording)return Ei.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[n6]:!0});if(this.Fs||(this.Fs=(n=$e.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.Fs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ws())return this.As===Dh||this.As===Wc?void 0:(this.As=Wc,Ei.info("persisted remote config is stale, requesting fresh config before starting"),void new T6(this._instance).load());this.As=SE,this.Fs.start(t)}onRRwebEmit(t){var e;(e=this.Fs)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Fs||(e=this.ri)==null||e.register({[Y8]:!0}),(t=this.Fs)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Fs||(e=this.ri)==null||e.register({[Z8]:!0}),(t=this.Fs)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Fs||(n=this.ri)==null||n.register({[t==="url"?X8:Q8]:!0}),(e=this.Fs)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Fs)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Fs)==null||!n.tryAddCustomEvent(t,e))}}},HL={autocapture:class{constructor(t){this.Vs=!1,this.Zs=null,this.Gs=!1,this.instance=t,this.rageclicks=new _E(t.config.rageclick),this.Qs=null}initialize(){this.startIfEnabled()}get Se(){var t,e,n=Ot(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}Js(){if(this.isBrowserSupported()){if(ne&&Ee){var t=n=>{n=n||(ne==null?void 0:ne.event);try{this.Ks(n)}catch(r){Cv.error("Failed to capture event",r)}};if($t(Ee,"submit",t,{capture:!0}),$t(Ee,"change",t,{capture:!0}),$t(Ee,"click",t,{capture:!0}),this.Se.capture_copied_text){var e=n=>{n=n||(ne==null?void 0:ne.event);try{this.Ks(n,kv)}catch(r){Cv.error("Failed to capture copy/cut event",r)}};$t(Ee,"copy",e,{capture:!0}),$t(Ee,"cut",e,{capture:!0})}}}else Cv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Vs&&(this.Js(),this.Vs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Gs=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[J1]:!!t.autocapture_opt_out}),this.Zs=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Qs=t}getElementSelectors(t){var e,n=[];return(e=this.Qs)==null||e.forEach((r=>{var s=Ee==null?void 0:Ee.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[J1];if(lr(this.Zs)&&!si(n)&&!this.instance.Rr())return!1;var r=(e=this.Zs)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!r}Ks(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=gv(t);o6(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&QS(r,this.instance.config.rageclick)&&this.Ks(t,"$rageclick");var s=e===kv;if(r&&(function(p,v,y,x,_,b){var E,C,P,T,R,O;if(y===void 0&&(y=void 0),!ne||a2(p)||(E=y)!=null&&E.url_allowlist&&!ZS(y.url_allowlist,b)||(C=y)!=null&&C.url_ignorelist&&ZS(y.url_ignorelist,b))return!1;if((P=y)!=null&&P.dom_event_allowlist){var I=y.dom_event_allowlist;if(I&&!I.some((G=>v.type===G)))return!1}var A=f6(p,x),N=A.parentIsUsefulElement,L=A.targetElementList;if(!(function(G,X){var q=X==null?void 0:X.element_allowlist;if(xe(q))return!0;var B,Y=function(ee){if(q.some((H=>ee.tagName.toLowerCase()===H)))return{v:!0}};for(var $ of G)if(B=Y($))return B.v;return!1})(L,y)||!vy(L,(T=y)==null?void 0:T.css_selector_allowlist)||vy(L,(R=(O=y)==null?void 0:O.css_selector_ignorelist)!==null&&R!==void 0?R:HO))return!1;try{var F=ne.getComputedStyle(p);if(F&&F.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}var V=p.tagName.toLowerCase();switch(V){case"html":return!1;case"form":return(_||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(v.type)>=0;default:return N?(_||["click"]).indexOf(v.type)>=0:(_||["click"]).indexOf(v.type)>=0&&(o2.indexOf(V)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Se,s,s?["copy","cut"]:void 0,this.instance)){var i=ML(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Gs,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),e===kv){var c,f=u6(ne==null||(c=ne.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!f)return!1;a.$selected_content=f,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Ps(Ee==null?void 0:Ee.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ys=(ne==null||(e=ne.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(_e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Xs&&this.Xs(),this.Xs=void 0,_e.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.eo("pushState"),this.eo("replaceState"),this.ro())}eo(t){var e;if(ne&&((e=ne.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return xE;var a={next:r[s]},u=i((function(){for(var c=arguments.length,f=new Array(c),h=0;c>h;h++)f[h]=arguments[h];return a.next.apply(this,f)}));return Ps(u)&&(u.prototype=u.prototype||{},Object.defineProperties(u,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=u,()=>{if(r[s]!==u)for(var c=r[s];Ps(c)&&c.__posthog_layer__;){var f=c.__posthog_layer__;if(f.next===u)return void(f.next=a.next);c=f.next}else r[s]=a.next}}catch{return xE}})(ne.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.io(t)}))}}io(t){try{var e,n=ne==null||(e=ne.location)==null?void 0:e.pathname;if(!n)return;n!==this.Ys&&this.isEnabled&&this._instance.capture(Yl,{navigation_type:t}),this.Ys=n}catch(r){_e.error("Error capturing "+t+" pageview",r)}}ro(){if(!this.Xs){var t=()=>{this.io("popstate")};$t(ne,"popstate",t),this.Xs=()=>{ne&&ne.removeEventListener("popstate",t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(t){var e;this.no=!1,this.Vs=!1,this.so=null,this.instance=t,this.no=!((e=this.instance.persistence)==null||!e.props[ey]),this.rageclicks=new _E(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ot(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(t=this.Se.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Ye(this.Se.capture_heatmaps)?Ye(this.Se.enable_heatmaps)?this.no:this.Se.enable_heatmaps:this.Se.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Vs)return;NL.info("starting..."),this.oo(),this.ke()}else{var t;clearInterval((t=this.so)!==null&&t!==void 0?t:void 0),this.ao(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ey]:e}),this.no=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}lo(t){this.fe(t.originalEvent,"deadclick")}ke(){this.so&&clearInterval(this.so),this.so=(Ee==null?void 0:Ee.visibilityState)==="visible"?setInterval(this.Wr.bind(this),this.flushIntervalMilliseconds):null}oo(){ne&&Ee&&(this.uo=this.Wr.bind(this),$t(ne,Qp,this.uo),this.ho=t=>this.fe(t||(ne==null?void 0:ne.event)),$t(Ee,"click",this.ho,{capture:!0}),this.do=t=>this.co(t||(ne==null?void 0:ne.event)),$t(Ee,"mousemove",this.do,{capture:!0}),this.vo=new tE(this.instance,ZO,this.lo.bind(this)),this.vo.startIfEnabledOrStop(),this.fo=this.ke.bind(this),$t(Ee,Xp,this.fo),this.Vs=!0)}ao(){var t;ne&&Ee&&(this.uo&&ne.removeEventListener(Qp,this.uo),this.ho&&Ee.removeEventListener("click",this.ho,{capture:!0}),this.do&&Ee.removeEventListener("mousemove",this.do,{capture:!0}),this.fo&&Ee.removeEventListener(Xp,this.fo),clearTimeout(this.po),(t=this.vo)==null||t.stop(),this.Vs=!1)}mo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,u,c){for(var f=a;f&&Bo(f)&&!$r(f,"body");){if(f===c)return!1;var h=void 0;try{var p,v,y;h=(p=(v=(y=f.ownerDocument)==null?void 0:y.defaultView)!==null&&v!==void 0?v:ne)==null?void 0:p.getComputedStyle(f).position}catch{return!1}if(Be(u,h))return!0;f=c6(f)}return!1})(gv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}fe(t,e){var n;if(e===void 0&&(e="click"),!qS(t.target)&&EE(t)){var r=this.mo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&QS(gv(t),this.instance.config.rageclick)&&this.kt(fe({},r,{type:"rageclick"})),this.kt(r)}}co(t){!qS(t.target)&&EE(t)&&(clearTimeout(this.po),this.po=setTimeout((()=>{this.kt(this.mo(t,"mousemove"))}),500))}kt(t){if(ne){var e=this.Se.disable_capture_url_hashes?Uo(ne.location.href):ne.location.href,n=this.Se.custom_personal_data_properties,r=this.Se.mask_personal_data_properties?[...Iu,...n||[]]:[],s=Id(e,r,Nd);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}Wr(){this.R&&!Oo(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:tE,webVitalsAutocapture:class{constructor(t){var e;this.no=!1,this.Vs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.yo=()=>{clearTimeout(this.bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>fe({},n,{["$web_vitals_"+r.name+"_event"]:fe({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._o=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.wo();if(!xe(s))if(Ye(n==null?void 0:n.name)||Ye(n==null?void 0:n.value))Sa.error("Invalid metric received",n);else if(!this.xo||this.xo>n.value){this.R.url!==s&&(this.yo(),this.bo=setTimeout(this.yo,this.flushToCaptureTimeoutMs)),xe(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=xe(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=fe({},n,{$current_url:s,timestamp:Date.now()});xe(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.yo()}else Sa.error("Ignoring metric with value >= "+this.xo,n)},this.ko=()=>{if(!this.Vs){var n,r,s,i,a=$e.__PosthogExtensions__;if(!xe(a)&&!xe(a.postHogWebVitalsCallbacks)){var u=a.postHogWebVitalsCallbacks;n=u.onLCP,r=u.onCLS,s=u.onFCP,i=u.onINP}n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this._o.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this._o.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this._o.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._o.bind(this)),this.Vs=!0):Sa.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.no=!((e=this._instance.persistence)==null||!e.props[sy]),this.startIfEnabled()}get So(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Ot(this.So)?(t=this.So)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Ye(n)?((e=this._instance.persistence)==null?void 0:e.props[iy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ot(this.So)?this.So.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ot(this.So)?this.So.web_vitals_attribution:void 0;return t!=null&&t}get xo(){var t=Ot(this.So)&&$n(this.So.__web_vitals_max_value)?this.So.__web_vitals_max_value:wE;return t>0&&6e4>=t?wE:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Sa.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ot(this.So)?this.So.web_vitals:si(this.So)?this.So:void 0;return si(e)?e:this.no}startIfEnabled(){this.isEnabled&&!this.Vs&&(Sa.info("enabled, starting..."),this.Bt(this.ko))}onRemoteConfig(t){if("capturePerformance"in t){var e=Ot(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=Ot(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[sy]:e}),this._instance.persistence.register({[iy]:n})),this.no=e,this.startIfEnabled()}}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Sa.error("failed to load script",r):t()}))}wo(){var t=ne?this._instance.config.disable_capture_url_hashes?Uo(ne.location.href):ne.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Iu,...e||[]]:[];return Id(t,n,Nd)}Sa.error("Could not determine current URL")}}},zL={exceptionObserver:class{constructor(t){var e,n,r,s,i,a;this.ko=()=>{var u;if(ne&&this.isEnabled&&(u=$e.__PosthogExtensions__)!=null&&u.errorWrappingFunctions){var c=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,f=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,h=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Co&&this.Se.capture_unhandled_errors&&(this.Co=c(this.captureException.bind(this))),!this.To&&this.Se.capture_unhandled_rejections&&(this.To=f(this.captureException.bind(this))),!this.Io&&this.Se.capture_console_errors&&(this.Io=h(this.captureException.bind(this)))}catch(p){Bc.error("failed to start",p),this.Mo()}}},this._instance=t,this.Eo=!((e=this._instance.persistence)==null||!e.props[ty]),this.Ro=new UN(fe({},((n=this._instance.config.error_tracking)===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}),{refillInterval:1e4,Ae:Bc})),this.Se=this.Po(),this.startIfEnabledOrStop()}Po(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ot(t)?e=fe({},e,t):(xe(t)?this.Eo:t)&&(e=fe({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Bc.info("enabled"),this.Mo(),this.Bt(this.ko)):this.Mo()}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Bc.error("failed to load script",r);t()}))}Mo(){var t,e,n;(t=this.Co)==null||t.call(this),this.Co=void 0,(e=this.To)==null||e.call(this),this.To=void 0,(n=this.Io)==null||n.call(this),this.Io=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Eo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ty]:this.Eo}),this.Se=this.Po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Po()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Ro.consumeRateLimit(s)?Bc.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.Oo=[],this.Lo=new oO([new pO,new SO,new gO,new mO,new wO,new xO,new yO,new bO],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;s>a;a++)i[a-1]=arguments[a];return function(u,c){c===void 0&&(c=0);for(var f=[],h=u.split(`
|
|
18
|
+
`),p=c;h.length>p;p++){var v=h[p];if(1024>=v.length){var y=BS.test(v)?v.replace(BS,"$1"):v;if(!y.match(/\S*Error: /)){for(var x of i){var _=x(y,r);if(_){f.push(_);break}}if(f.length>=50)break}}}return(function(b){if(!b.length)return[];var E=Array.from(b);return E.reverse(),E.slice(0,50).map((C=>{return fe({},C,{filename:C.filename||(P=E,P[P.length-1]||{}).filename,function:C.function||Au});var P}))})(f)}})("web:javascript",cO,hO)),this._instance=t,this.Oo=(e=(n=this._instance.persistence)==null?void 0:n.get_property(ny))!==null&&e!==void 0?e:[],this.Fo=Gp(this.Ao()),this.$o=new kO(this.Fo)}onConfigChange(){this.Fo=Gp(this.Ao()),this.$o.setConfig(this.Fo)}onRemoteConfig(t){var e,n,r;if("errorTracking"in t){var s=(e=(n=t.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],i=(r=t.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Oo=s,this._instance.persistence&&this._instance.persistence.register({[ny]:this.Oo,[ry]:i})}}get No(){var t,e=!!this._instance.get_property(ry),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Lo.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Fo.enabled)try{if(!_t(t)||t.trim().length===0)return void ki.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((u,c)=>EO.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.Do(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&ki.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.$o.add(fe({[Bp]:t,[Wp]:new Date().toISOString()},r))}catch(i){ki.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.qo(e)){if(this.jo(e))return this.Bo("Exception dropped: matched a suppression rule"),void ki.info("Skipping exception capture because a suppression rule matched");if(!this.No&&this.Ho(e))return this.Bo("Exception dropped: thrown by a browser extension"),void ki.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Uo(e))return this.Bo("Exception dropped: thrown by the PostHog SDK"),void ki.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Fo.enabled&&Ye(t.$exception_steps)?this.zo(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",ln:!0});return r&&this.$o.clear(),r}catch(s){return ki.error("Failed to capture exception event. Dropping this exception.",s),void this.$o.clear()}}catch(s){return void ki.error("Failed to process exception event. Ignoring this exception.",s)}}zo(t){try{var e=this.$o.getAttachable();return e.length===0?t:fe({},t,{$exception_steps:e})}catch(n){return ki.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}Bo(t){this.Fo.enabled&&this.$o.add({[Bp]:t,[Wp]:new Date().toISOString()})}Do(t){return Ot(t)?fe({},t):{}}Ao(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}jo(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return _t(s)&&s.length>0&&n.$exception_types.push(s),_t(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Oo.some((n=>{var r=n.values.map((s=>{var i,a=$6[s.operator],u=et(s.value)?s.value:[s.value],c=(i=e[s.key])!==null&&i!==void 0?i:[];return u.length>0&&a(u,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Ho(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Uo(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],a=i[i.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}qo(t){return!Ye(t)&&et(t)}}},UL=fe({productTours:class{get ri(){return this._instance.persistence}constructor(t){this.Wo=null,this.Vo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if("productTours"in t){var e,n;if(this.ri&&this.ri.register({[t2]:!!t.productTours}),!Rv(this._instance))return!this.Wo&&Ye((e=this.ri)==null?void 0:e.props[sd])||Tv.info("product tours disabled; stopping and clearing cached tours"),(n=this.Wo)==null||n.stop(),this.Wo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Wo&&Rv(this._instance)&&this.Bt((()=>this.Zo()))}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Tv.error("Could not load product tours script",r):t()}))}Zo(){var t;!this.Wo&&(t=$e.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Wo=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!et(this.Vo)||e){var n=this.ri;if(n){var r=n.props[sd];if(et(r)&&!e)return this.Vo=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{if(Rv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return Tv.error(a),void t([],{isLoaded:!1,error:a})}var u=et(s.json.product_tours)?s.json.product_tours:[];this.Vo=u,n&&n.register({[sd]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Vo,{isLoaded:!0})}getActiveProductTours(t){Ye(this.Wo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Wo.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Wo)==null||e.showTourById(t)}previewTour(t){this.Wo?this.Wo.previewTour(t):this.Bt((()=>{var e;this.Zo(),(e=this.Wo)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.Wo)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Wo)==null||t.nextStep()}previousStep(){var t;(t=this.Wo)==null||t.previousStep()}clearCache(){var t;this.Vo=null,(t=this.ri)==null||t.unregister(sd)}resetTour(t){var e;(e=this.Wo)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Wo)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Wo)==null||e.cancelPendingTour(t)}}},zm),BL={siteApps:class{constructor(t){this.Go=0,this._instance=t,this.Qo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Jo(t,e){if(e){var n=this.globalsForEvent(e);this.Qo.push(n),this.Qo.length>1e3&&(this.Qo=this.Qo.slice(10))}}get siteAppLoaders(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Jo.bind(this));this.Ko=()=>{t(),this.Qo=[],this.Ko=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var v=p[0];c[v]={id:f[v],type:v,properties:p[1]}}var y=t.$set_once,x=t.$set;return{event:fe({},p8(t,OL),{properties:fe({},t.properties,x?{$set:fe({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},y?{$set_once:fe({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Yo(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(zs.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(zs.error("prepare_external_dependency_script returned null"),null):t}Xo(){var t,e,n,r,s,i,a,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var c=Ee==null?void 0:Ee.defaultView,f=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!f)return()=>{};if(this.Go++,this.ea)return this.ta();var h=[],p=this,v=new WeakSet,y=(b,E,C)=>{if(b!=null&&b[E]){var P=b[E];b[E]=C(P),h.push((()=>{b[E]=P}))}},x=b=>{if(v.has(b))return b;var E=p.Yo(b);return E&&v.add(E),E},_=b=>b.map((E=>typeof E=="string"?E:x(E))).filter((E=>!lr(E)));return y(f,"appendChild",(b=>function(E){var C=x(E);return C?b.call(this,C):E})),y(f,"insertBefore",(b=>function(E,C){var P=x(E);return P?b.call(this,P,C):E})),y(f,"replaceChild",(b=>function(E,C){var P=x(E);return P?b.call(this,P,C):C})),[(e=c.Element)==null?void 0:e.prototype,(n=c.Document)==null?void 0:n.prototype,(r=c.DocumentFragment)==null?void 0:r.prototype].forEach((b=>{y(b,"append",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"prepend",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))}))})),[(s=c.Element)==null?void 0:s.prototype,(i=c.CharacterData)==null?void 0:i.prototype,(a=c.DocumentType)==null?void 0:a.prototype].forEach((b=>{y(b,"before",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"after",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"replaceWith",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];var R=_(P);return P.length&&!R.length?void 0:E.apply(this,R)}))})),y((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(b=>function(E,C){var P=x(C);return P?b.call(this,E,P):null})),this.ea=()=>{h.forEach((b=>b())),this.ea=void 0},this.ta()}ta(){var t=!1;return()=>{var e;t||(t=!0,this.Go--,this.Go===0&&((e=this.ea)==null||e.call(this)))}}ra(t,e){e===void 0&&(e=!0);var n=this.Xo();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this.Qo.length&&(zs.info("Processing "+this.Qo.length+" events for site app with id "+t.id),this.Qo.forEach((u=>this.ra((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.Ko)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,zs.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.ra((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){zs.error(kE+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){zs.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}ia(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}na(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.ra((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){zs.error("Error while processing event "+t.event+" for site app "+i.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ia(),void this._instance.on("eventCaptured",(u=>this.na(u)))):void zs.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Ko)==null||n.call(this),(r=t.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(){var u,c=a.id,f=a.url;$e["__$$ph_site_app_"+c]=s._instance,(u=$e.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,f,(h=>{if(h)return zs.error(kE+c,h)}))};for(var a of t.siteApps)i()}else zs.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},WL={tracingHeaders:class{constructor(t){this.sa=void 0,this.oa=void 0,this.aa=void 0,this.ko=()=>{var e,n,r=this.la();r?(xe(this.sa)&&(this.sa=(e=$e.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),xe(this.oa)&&(this.oa=(n=$e.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Mo()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return IL.error("failed to load script",r);t()}))}ua(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}la(){var t=this.ua();return et(t)?(et(this.aa)?this.aa.splice(0,this.aa.length,...t):this.aa=[...t],t.length>0?this.aa:void 0):(et(this.aa)&&this.aa.splice(0),this.aa=t||void 0,this.aa)}Mo(){var t,e;(t=this.sa)==null||t.call(this),(e=this.oa)==null||e.call(this),this.sa=void 0,this.oa=void 0}startIfEnabledOrStop(){this.la()?this.Bt(this.ko):this.Mo()}}},GL=fe({surveys:class{get Se(){return this._instance.config}constructor(t){this.ha=void 0,this._surveyManager=null,this.da=!1,this.ca=[],this.va=null,this.fa=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Se.disable_surveys){var e=t.surveys;if(Ye(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=et(e);this.ha=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.ha),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(U6)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.da)yt.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)yt.info(CE);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){if(!xe(this.ha)||this.Se.advanced_enable_surveys){var e=this.ha||this.Se.advanced_enable_surveys;this.da=!0;try{var n=t.generateSurveys;if(n)return void this.pa(n,e);var r=t.loadExternalDependency;if(!r)return void this.ga(r2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.ga("Could not load surveys script",s):this.pa(t.generateSurveys,e)}))}catch(s){throw this.ga("Error initializing surveys",s),s}finally{this.da=!1}}}else yt.error("PostHog Extensions not found.")}}pa(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new FL(this._instance),yt.info("Surveys loaded successfully"),this.ma({isLoaded:!0})}ga(t,e){yt.error(t,e),this.ma({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ca.push(t),this._surveyManager&&this.ma({isLoaded:!0}),()=>{this.ca=this.ca.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Se.disable_surveys)return yt.info(CE),t([]);var n,r=this._instance.get_property(ly);if(r&&!e)return t(r,{isLoaded:!0}),void(this.ya()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.va?this.va.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.va=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:s=>{var i;this.va=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;yt.error(u),this.fa=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.fa=null;var f,h=s.json.surveys||[],p=h.filter((y=>(function(x){return!(!x.start_date||x.end_date)})(y)&&(z6(y)||(function(x){var _;return!((_=x.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(y))));p.length>0&&((f=this._surveyEventReceiver)==null||f.register(p)),(i=this._instance.persistence)==null||i.register({[ly]:h,[qp]:Date.now()});var v={isLoaded:!0};t(h,v),n==null||n({surveys:h,context:v})}}))}ya(){return this.ba()&&!this.va&&!this._a()}ba(){var t=this._instance.get_property(qp);return $n(t)&&Date.now()-t>3e5}_a(){return $n(this.fa)&&3e5>Date.now()-this.fa}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};B6(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ma(t){for(var e of this.ca)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){yt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Ye(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}wa(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}xa(t){if(Ye(this._surveyManager))return{eligible:!1,reason:Av};var e=typeof t=="string"?this.wa(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Ye(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:Av};var e=this.xa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Ye(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Av})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((u=>u.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.xa(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Ye(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this.wa(t):t;if(s!=null&&s.id)if(SL.includes(s.type)){var i=Ee==null?void 0:Ee.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,i,n),yt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);yt.warn("Survey element not found")}else yt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else yt.warn("Survey not found")}}displaySurvey(t,e){var n;if(Ye(this._surveyManager))yt.warn("init was not called");else{var r=this.wa(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=fe({},r,{appearance:fe({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==_y.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void yt.warn("Survey is not eligible to be displayed: ",i.disabledReason)}e.displayType!==_y.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){Ye(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},zm),KL={toolbar:class{constructor(t){this.instance=t}ka(t){$e.ph_toolbar_state=t}Sa(){var t;return(t=$e.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),r6(this.instance.config)||!ne||!Ee)return!1;t=t??ne.location,n=n??ne.history;try{if(!e){try{ne.localStorage.setItem("test","test"),ne.localStorage.removeItem("test")}catch{return!1}e=ne==null?void 0:ne.localStorage}var r,s=jL||tm(t.hash,"__posthog")||tm(t.hash,"state"),i=s?GS((()=>JSON.parse(atob(decodeURIComponent(s)))))||GS((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(PE)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ca(t){var e=$e.ph_load_toolbar||$e.ph_load_editor;!Ye(e)&&Ps(e)?e(t,this.instance):TE.warn("No toolbar load function found")}loadToolbar(t){var e=!(Ee==null||!Ee.getElementById(J8));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=fe({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(PE,JSON.stringify(fe({},r,{source:void 0}))),this.Sa()===2)this.Ca(r);else if(this.Sa()===0){var s;this.ka(1),(s=$e.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return TE.error("[Toolbar] Failed to load",i),void this.ka(0);this.ka(2),this.Ca(r)})),$t(ne,"turbolinks:load",(()=>{this.ka(0),this.loadToolbar(r)}))}return!0}Ta(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},qL=fe({experiments:Kn},zm),ZL={conversations:class{constructor(t){this.Ia=void 0,this._conversationsManager=null,this.Ma=!1,this.Ea=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;Ye(e)||(si(e)?this.Ia=e:(this.Ia=e.enabled,this.Ea=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ma||this._instance.config.disable_conversations||r6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!xe(this.Ia)&&this.Ia)if(this.Ea&&this.Ea.token){this.Ma=!0;try{var e=t.initConversations;if(e)return this.Ra(e),void(this.Ma=!1);var n=t.loadExternalDependency;if(!n)return void this.Pa(r2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.Pa("Could not load conversations script",r):this.Ra(t.initConversations),this.Ma=!1}))}catch(r){this.Pa("Error initializing conversations",r),this.Ma=!1}}else rs.error("Conversations enabled but missing token in remote config.")}}Ra(t){if(this.Ea)try{this._conversationsManager=t(this.Ea,this._instance),rs.info("Conversations loaded successfully")}catch(e){this.Pa("Error completing conversations initialization",e)}else rs.error("Cannot complete initialization: remote config is null")}Pa(t,e){rs.error(t,e),this._conversationsManager=null,this.Ma=!1}show(){this._conversationsManager?this._conversationsManager.show():rs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ia===!0&&!lr(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return en((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(rs.warn(ka),null)}))()}getMessages(t,e){var n=this;return en((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(rs.warn(ka),null)}))()}markAsRead(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(rs.warn(ka),null)}))()}getTickets(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(rs.warn(ka),null)}))()}requestRestoreLink(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(rs.warn(ka),null)}))()}restoreFromToken(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(rs.warn(ka),null)}))()}restoreFromUrlToken(){var t=this;return en((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(rs.warn(ka),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}fn(){var t;(t=this._conversationsManager)==null||t.setIdentity()}pn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},YL={logs:class{constructor(t){var e;this.Oa=!1,this.La=!1,this.Ae=Dt("[logs]"),this.Lr=[],this.Fa=[],this.bs=0,this.Aa=()=>{var n,r;this.bs=0,(n=this.$a)==null||n.onReconnect(),(r=this.Na)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Oa=!0),ne&&$t(ne,"online",this.Aa)}Da(t,e,n,r){var s,i=(function(a,u){var c,f,h,p,v,y,x,_=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,b=(f=a==null?void 0:a.maxBufferSize)!==null&&f!==void 0?f:100,E=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,C=xe(E)?Math.max(b,2048):Math.max(b,E),P=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(v=P==null?void 0:P["service.name"])!==null&&v!==void 0?v:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(y=P==null?void 0:P["service.version"])!==null&&y!==void 0?y:a==null?void 0:a.serviceVersion,environment:(x=P==null?void 0:P["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:P,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:_,maxBufferSize:b,maxQueueSize:C,maxBatchRecordsPerPost:100,rateCapWindowMs:_,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new rO(this.qa(t,e),i,this.Ae,(()=>this.ja()),(a=>a()),void 0,r),i]}Ba(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.$a||this.Ha!==e){var n;(n=this.$a)==null||n.reset(),this.Ha=e;var r=this.Da((()=>this.Lr),(s=>{this.Lr=s}));this.$a=r[0],this.Ua=r[1]}return this.$a}za(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Na||this.Wa!==e){var n;(n=this.Na)==null||n.reset(),this.Wa=e;var r=this.Da((()=>this.Fa),(s=>{this.Fa=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},IE);this.Na=r[0],this.Va=r[1]}return this.Na}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,n=(e=t.logs)==null?void 0:e.captureConsoleLogs;!Ye(n)&&n&&(this.Oa=!0,this.loadIfEnabled())}reset(){var t,e;this.Lr=[],(t=this.$a)==null||t.reset(),this.Fa=[],(e=this.Na)==null||e.reset(),this.bs=0}captureLog(t){this.Ba().captureLog(t)}le(t){this.za().captureLog(t)}get logger(){return this.Za||(this.Za={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Za}flushLogs(t){t?this.Ga(t):(this.$a&&this.$a.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))),this.Na&&this.Na.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.Oa&&!this.La){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.Ae.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.La=!0)})):this.Ae.error(r2)}else this.Ae.error("PostHog Extensions not found.")}}qa(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Ni.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Ni.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},ht:r=>this.ht(r),getLibraryId:()=>Vt.LIB_NAME,getLibraryVersion:()=>Vt.LIB_VERSION}}ht(t){return new Promise((e=>{if(_6(this.bs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Qa(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.Ja(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var u;r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}Ja(t){(t!==0||this._instance.__loaded)&&(this.bs=x6(t,this.bs,3,(()=>this.Ae.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Ga(t){this.Lr.length>0&&this.Ka(t,this.Lr,this.Ua,Vt.LIB_NAME,(e=>{this.Lr=e})),this.Fa.length>0&&this.Ka(t,this.Fa,this.Va,IE,(e=>{this.Fa=e}))}Ka(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=U8(i,z8(n,Vt.LIB_NAME,Vt.LIB_VERSION),r,Vt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Qa(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Qa(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ja(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,Ye(s)||(e.sessionStartTimestamp=s),Ye(i)||(e.lastActivityTimestamp=i)}if($e!=null&&(t=$e.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Uo($e.location.href):$e.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},XL={metrics:class{constructor(t){this.Ae=Dt("[metrics]"),this._instance=t}initialize(){}Ba(){var t,e,n,r,s,i,a,u,c,f=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.$a&&this.Ha===f||((e=this.$a)==null||e.reset(),this.Ha=f,this.$a=new sO(this.qa(),{serviceName:(r=(c=(n=f)==null?void 0:n.resourceAttributes)==null?void 0:c["service.name"])!==null&&r!==void 0?r:n==null?void 0:n.serviceName,serviceVersion:(s=c==null?void 0:c["service.version"])!==null&&s!==void 0?s:n==null?void 0:n.serviceVersion,environment:(i=c==null?void 0:c["deployment.environment"])!==null&&i!==void 0?i:n==null?void 0:n.environment,resourceAttributes:c,beforeSend:n==null?void 0:n.beforeSend,flushIntervalMs:(a=n==null?void 0:n.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(u=n==null?void 0:n.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3},this.Ae)),this.$a}count(t,e,n){e===void 0&&(e=1),this.Ba().count(t,e,n)}gauge(t,e,n){this.Ba().gauge(t,e,n)}histogram(t,e,n){this.Ba().histogram(t,e,n)}flush(t){if(!this.$a)return Promise.resolve();if(t){var e=this.$a.drainWindow();return e&&this.It(e,t),Promise.resolve()}return this.$a.flush().catch((n=>this.Ae.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.$a)==null||t.reset()}qa(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},It:n=>e.It(n),getLibraryId:()=>Vt.LIB_NAME,getLibraryVersion:()=>Vt.LIB_VERSION}}It(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(fe({method:"POST",url:this.Ya(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var u=a.statusCode;if(u>=200&&300>u)s({kind:"ok"});else if(u===413)s({kind:"too-large"});else if(u!==0&&u!==429&&500>u)s({kind:"fatal",error:new Error("metrics request failed with status "+u)});else{var c;s({kind:"retry-later",error:(c=a.error)!==null&&c!==void 0?c:new Error("metrics request failed with status "+u)})}}}))}))}Ya(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},QL=fe({},zm,$L,HL,zL,UL,BL,GL,WL,KL,qL,ZL,YL,XL);os.__defaultExtensionClasses=fe({},QL);var Te=(function(){Vt.SDK_DIST_CHANNEL="npm";var t=hd[Xl]=new os;return(function(){function e(){e.done||(e.done=!0,G6=!1,bt(hd,(function(n){n._dom_loaded()})))}Ee!=null&&Ee.addEventListener?Ee.readyState==="complete"?e():$t(Ee,"DOMContentLoaded",e,{capture:!1}):ne&&_e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),K6;function JL(t){K6=t}function Ty(){return K6}var f2=g.createContext({get client(){return Ty()},bootstrap:void 0});function q6(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,a=r;i<a.length;i++){var u=a[i];if(!s.includes(u)||!q6(t[u],e[u],n))return!1}return!0}function eD(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=g.useRef(null),c=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var f=Ty();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),f},[s,i,JSON.stringify(a)]);return g.useEffect(function(){if(!(s||!i)){var f=Ty(),h=u.current;h?(i!==h.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!q6(a,h.options)&&f.set_config(a),u.current={apiKey:i,options:a??{}}):(f.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),f.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ve.createElement(f2.Provider,{value:{client:c,bootstrap:(e=a==null?void 0:a.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Iv=function(t){return typeof t=="function"},tD=function(){var t=g.useContext(f2).client;return t},Ry=function(t,e){return Ry=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Ry(t,e)};function nD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ry(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var rD={componentStack:null,exceptionEvent:null,error:null},sD={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},iD=(function(t){nD(e,t);function e(n){var r=t.call(this,n)||this;return r.state=rD,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Iv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,u=a.captureException(n,i),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Iv(r)?r():r;var a=Iv(s)?ve.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ve.isValidElement(a)?a:(console.warn(sD.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},e.contextType=f2,e})(ve.Component);JL(Te);var Fh={},Nv={exports:{}},gr={},Ov={exports:{}},Lv={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var NE;function oD(){return NE||(NE=1,(function(t){function e($,ee){var H=$.length;$.push(ee);e:for(;0<H;){var D=H-1>>>1,Z=$[D];if(0<s(Z,ee))$[D]=ee,$[H]=Z,H=D;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var ee=$[0],H=$.pop();if(H!==ee){$[0]=H;e:for(var D=0,Z=$.length,te=Z>>>1;D<te;){var se=2*(D+1)-1,oe=$[se],ue=se+1,he=$[ue];if(0>s(oe,H))ue<Z&&0>s(he,oe)?($[D]=he,$[ue]=H,D=ue):($[D]=oe,$[se]=H,D=se);else if(ue<Z&&0>s(he,H))$[D]=he,$[ue]=H,D=ue;else break e}}return ee}function s($,ee){var H=$.sortIndex-ee.sortIndex;return H!==0?H:$.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,p=null,v=3,y=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P($){for(var ee=n(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=$)r(f),ee.sortIndex=ee.expirationTime,e(c,ee);else break;ee=n(f)}}function T($){if(_=!1,P($),!x)if(n(c)!==null)x=!0,B(R);else{var ee=n(f);ee!==null&&Y(T,ee.startTime-$)}}function R($,ee){x=!1,_&&(_=!1,E(A),A=-1),y=!0;var H=v;try{for(P(ee),p=n(c);p!==null&&(!(p.expirationTime>ee)||$&&!F());){var D=p.callback;if(typeof D=="function"){p.callback=null,v=p.priorityLevel;var Z=D(p.expirationTime<=ee);ee=t.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(c)&&r(c),P(ee)}else r(c);p=n(c)}if(p!==null)var te=!0;else{var se=n(f);se!==null&&Y(T,se.startTime-ee),te=!1}return te}finally{p=null,v=H,y=!1}}var O=!1,I=null,A=-1,N=5,L=-1;function F(){return!(t.unstable_now()-L<N)}function V(){if(I!==null){var $=t.unstable_now();L=$;var ee=!0;try{ee=I(!0,$)}finally{ee?G():(O=!1,I=null)}}else O=!1}var G;if(typeof C=="function")G=function(){C(V)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,q=X.port2;X.port1.onmessage=V,G=function(){q.postMessage(null)}}else G=function(){b(V,0)};function B($){I=$,O||(O=!0,G())}function Y($,ee){A=b(function(){$(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){x||y||(x=!0,B(R))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function($){switch(v){case 1:case 2:case 3:var ee=3;break;default:ee=v}var H=v;v=ee;try{return $()}finally{v=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,ee){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=v;v=$;try{return ee()}finally{v=H}},t.unstable_scheduleCallback=function($,ee,H){var D=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?D+H:D):H=D,$){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=H+Z,$={id:h++,callback:ee,priorityLevel:$,startTime:H,expirationTime:Z,sortIndex:-1},H>D?($.sortIndex=H,e(f,$),n(c)===null&&$===n(f)&&(_?(E(A),A=-1):_=!0,Y(T,H-D))):($.sortIndex=Z,e(c,$),x||y||(x=!0,B(R))),$},t.unstable_shouldYield=F,t.unstable_wrapCallback=function($){var ee=v;return function(){var H=v;v=ee;try{return $.apply(this,arguments)}finally{v=H}}}})(Lv)),Lv}var OE;function aD(){return OE||(OE=1,Ov.exports=oD()),Ov.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var LE;function lD(){if(LE)return gr;LE=1;var t=z_(),e=aD();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function v(o){return c.call(p,o)?!0:c.call(h,o)?!1:f.test(o)?p[o]=!0:(h[o]=!0,!1)}function y(o,l,d,m){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,d,m){if(l===null||typeof l>"u"||y(o,l,d,m))return!0;if(m)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function _(o,l,d,m,w,k,M){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=d,this.propertyName=o,this.type=l,this.sanitizeURL=k,this.removeEmptyString=M}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){b[o]=new _(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];b[l]=new _(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){b[o]=new _(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){b[o]=new _(o,2,!1,o,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(o){b[o]=new _(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){b[o]=new _(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){b[o]=new _(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){b[o]=new _(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){b[o]=new _(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function C(o){return o[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(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){b[o]=new _(o,1,!1,o.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){b[o]=new _(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,d,m){var w=b.hasOwnProperty(l)?b[l]:null;(w!==null?w.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,d,w,m)&&(d=null),m||w===null?v(l)&&(d===null?o.removeAttribute(l):o.setAttribute(l,""+d)):w.mustUseProperty?o[w.propertyName]=d===null?w.type===3?!1:"":d:(l=w.attributeName,m=w.attributeNamespace,d===null?o.removeAttribute(l):(w=w.type,d=w===3||w===4&&d===!0?"":""+d,m?o.setAttributeNS(m,l,d):o.setAttribute(l,d))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),O=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),F=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),$=Symbol.iterator;function ee(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,D;function Z(o){if(D===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
|
|
35
|
+
`+D+o}var te=!1;function se(o,l){if(!o||te)return"";te=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(re){var m=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){m=re}o.call(l.prototype)}else{try{throw Error()}catch(re){m=re}o()}}catch(re){if(re&&m&&typeof re.stack=="string"){for(var w=re.stack.split(`
|
|
36
|
+
`),k=m.stack.split(`
|
|
37
|
+
`),M=w.length-1,j=k.length-1;1<=M&&0<=j&&w[M]!==k[j];)j--;for(;1<=M&&0<=j;M--,j--)if(w[M]!==k[j]){if(M!==1||j!==1)do if(M--,j--,0>j||w[M]!==k[j]){var U=`
|
|
38
|
+
`+w[M].replace(" at new "," at ");return o.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",o.displayName)),U}while(1<=M&&0<=j);break}}}finally{te=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Z(o):""}function oe(o){switch(o.tag){case 5:return Z(o.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return o=se(o.type,!1),o;case 11:return o=se(o.type.render,!1),o;case 1:return o=se(o.type,!0),o;default:return""}}function ue(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case I:return"Fragment";case O:return"Portal";case N:return"Profiler";case A:return"StrictMode";case G:return"Suspense";case X:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case F:return(o.displayName||"Context")+".Consumer";case L:return(o._context.displayName||"Context")+".Provider";case V:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case q:return l=o.displayName||null,l!==null?l:ue(o.type)||"Memo";case B:l=o._payload,o=o._init;try{return ue(o(l))}catch{}}return null}function he(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(l);case 8:return l===A?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ie(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ae(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function me(o){var l=ae(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),m=""+o[l];if(!o.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var w=d.get,k=d.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(M){m=""+M,k.call(this,M)}}),Object.defineProperty(o,l,{enumerable:d.enumerable}),{getValue:function(){return m},setValue:function(M){m=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Se(o){o._valueTracker||(o._valueTracker=me(o))}function Ae(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),m="";return o&&(m=ae(o)?o.checked?"true":"false":o.value),o=m,o!==d?(l.setValue(o),!0):!1}function Ke(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function it(o,l){var d=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function Oe(o,l){var d=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;d=ie(l.value!=null?l.value:d),o._wrapperState={initialChecked:m,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function at(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function Mt(o,l){at(o,l);var d=ie(l.value),m=l.type;if(d!=null)m==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(m==="submit"||m==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Fe(o,l.type,d):l.hasOwnProperty("defaultValue")&&Fe(o,l.type,ie(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function mt(o,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var m=l.type;if(!(m!=="submit"&&m!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,d||l===o.value||(o.value=l),o.defaultValue=l}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function Fe(o,l,d){(l!=="number"||Ke(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Qe=Array.isArray;function lt(o,l,d,m){if(o=o.options,l){l={};for(var w=0;w<d.length;w++)l["$"+d[w]]=!0;for(d=0;d<o.length;d++)w=l.hasOwnProperty("$"+o[d].value),o[d].selected!==w&&(o[d].selected=w),w&&m&&(o[d].defaultSelected=!0)}else{for(d=""+ie(d),l=null,w=0;w<o.length;w++){if(o[w].value===d){o[w].selected=!0,m&&(o[w].defaultSelected=!0);return}l!==null||o[w].disabled||(l=o[w])}l!==null&&(l.selected=!0)}}function Je(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function vt(o,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(Qe(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}o._wrapperState={initialValue:ie(d)}}function xn(o,l){var d=ie(l.value),m=ie(l.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),l.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),m!=null&&(o.defaultValue=""+m)}function zt(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function Rn(o){switch(o){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 Xn(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?Rn(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Rr,Qn=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,m,w){MSApp.execUnsafeLocalFunction(function(){return o(l,d,m,w)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Rr=Rr||document.createElement("div"),Rr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Rr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function wn(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var Ms={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},Is=["Webkit","ms","Moz","O"];Object.keys(Ms).forEach(function(o){Is.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Ms[l]=Ms[o]})});function An(o,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||Ms.hasOwnProperty(o)&&Ms[o]?(""+l).trim():l+"px"}function di(o,l){o=o.style;for(var d in l)if(l.hasOwnProperty(d)){var m=d.indexOf("--")===0,w=An(d,l[d],m);d==="float"&&(d="cssFloat"),m?o.setProperty(d,w):o[d]=w}}var fi=H({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 hs(o,l){if(l){if(fi[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Ns(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 cr=null;function Mn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ia=null,qr=null,Ar=null;function hi(o){if(o=xc(o)){if(typeof ia!="function")throw Error(n(280));var l=o.stateNode;l&&(l=$f(l),ia(o.stateNode,o.type,l))}}function qe(o){qr?Ar?Ar.push(o):Ar=[o]:qr=o}function Pt(){if(qr){var o=qr,l=Ar;if(Ar=qr=null,hi(o),l)for(o=0;o<l.length;o++)hi(l[o])}}function nn(o,l){return o(l)}function bn(){}var Os=!1;function Ut(o,l,d){if(Os)return o(l,d);Os=!0;try{return nn(o,l,d)}finally{Os=!1,(qr!==null||Ar!==null)&&(bn(),Pt())}}function rn(o,l){var d=o.stateNode;if(d===null)return null;var m=$f(d);if(m===null)return null;d=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var ps=!1;if(u)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){ps=!0}}),window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{ps=!1}function Jn(o,l,d,m,w,k,M,j,U){var re=Array.prototype.slice.call(arguments,3);try{l.apply(d,re)}catch(de){this.onError(de)}}var Ls=!1,er=null,oa=!1,Xu=null,Qu={onError:function(o){Ls=!0,er=o}};function E0(o,l,d,m,w,k,M,j,U){Ls=!1,er=null,Jn.apply(Qu,arguments)}function k0(o,l,d,m,w,k,M,j,U){if(E0.apply(this,arguments),Ls){if(Ls){var re=er;Ls=!1,er=null}else throw Error(n(198));oa||(oa=!0,Xu=re)}}function pi(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function xf(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function ml(o){if(pi(o)!==o)throw Error(n(188))}function Ju(o){var l=o.alternate;if(!l){if(l=pi(o),l===null)throw Error(n(188));return l!==o?null:o}for(var d=o,m=l;;){var w=d.return;if(w===null)break;var k=w.alternate;if(k===null){if(m=w.return,m!==null){d=m;continue}break}if(w.child===k.child){for(k=w.child;k;){if(k===d)return ml(w),o;if(k===m)return ml(w),l;k=k.sibling}throw Error(n(188))}if(d.return!==m.return)d=w,m=k;else{for(var M=!1,j=w.child;j;){if(j===d){M=!0,d=w,m=k;break}if(j===m){M=!0,m=w,d=k;break}j=j.sibling}if(!M){for(j=k.child;j;){if(j===d){M=!0,d=k,m=w;break}if(j===m){M=!0,m=k,d=w;break}j=j.sibling}if(!M)throw Error(n(189))}}if(d.alternate!==m)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:l}function ec(o){return o=Ju(o),o!==null?wf(o):null}function wf(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=wf(o);if(l!==null)return l;o=o.sibling}return null}var tc=e.unstable_scheduleCallback,Qi=e.unstable_cancelCallback,bf=e.unstable_shouldYield,nc=e.unstable_requestPaint,Bt=e.unstable_now,Sf=e.unstable_getCurrentPriorityLevel,Ji=e.unstable_ImmediatePriority,gl=e.unstable_UserBlockingPriority,aa=e.unstable_NormalPriority,Ef=e.unstable_LowPriority,rc=e.unstable_IdlePriority,la=null,z=null;function le(o){if(z&&typeof z.onCommitFiberRoot=="function")try{z.onCommitFiberRoot(la,o,void 0,(o.current.flags&128)===128)}catch{}}var we=Math.clz32?Math.clz32:Ce,ge=Math.log,be=Math.LN2;function Ce(o){return o>>>=0,o===0?32:31-(ge(o)/be|0)|0}var We=64,ke=4194304;function hn(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function In(o,l){var d=o.pendingLanes;if(d===0)return 0;var m=0,w=o.suspendedLanes,k=o.pingedLanes,M=d&268435455;if(M!==0){var j=M&~w;j!==0?m=hn(j):(k&=M,k!==0&&(m=hn(k)))}else M=d&~w,M!==0?m=hn(M):k!==0&&(m=hn(k));if(m===0)return 0;if(l!==0&&l!==m&&(l&w)===0&&(w=m&-m,k=l&-l,w>=k||w===16&&(k&4194240)!==0))return l;if((m&4)!==0&&(m|=d&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=m;0<l;)d=31-we(l),w=1<<d,m|=o[d],l&=~w;return m}function Ds(o,l){switch(o){case 1:case 2:case 4:return l+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 l+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 Fs(o,l){for(var d=o.suspendedLanes,m=o.pingedLanes,w=o.expirationTimes,k=o.pendingLanes;0<k;){var M=31-we(k),j=1<<M,U=w[M];U===-1?((j&d)===0||(j&m)!==0)&&(w[M]=Ds(j,l)):U<=l&&(o.expiredLanes|=j),k&=~j}}function Zr(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Sn(){var o=We;return We<<=1,(We&4194240)===0&&(We=64),o}function Yr(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Mr(o,l,d){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-we(l),o[l]=d}function cM(o,l){var d=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var m=o.eventTimes;for(o=o.expirationTimes;0<d;){var w=31-we(d),k=1<<w;l[w]=0,m[w]=-1,o[w]=-1,d&=~k}}function C0(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var m=31-we(d),w=1<<m;w&l|o[m]&l&&(o[m]|=l),d&=~w}}var gt=0;function Bx(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Wx,P0,Gx,Kx,qx,T0=!1,kf=[],eo=null,to=null,no=null,sc=new Map,ic=new Map,ro=[],dM="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 Zx(o,l){switch(o){case"focusin":case"focusout":eo=null;break;case"dragenter":case"dragleave":to=null;break;case"mouseover":case"mouseout":no=null;break;case"pointerover":case"pointerout":sc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ic.delete(l.pointerId)}}function oc(o,l,d,m,w,k){return o===null||o.nativeEvent!==k?(o={blockedOn:l,domEventName:d,eventSystemFlags:m,nativeEvent:k,targetContainers:[w]},l!==null&&(l=xc(l),l!==null&&P0(l)),o):(o.eventSystemFlags|=m,l=o.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),o)}function fM(o,l,d,m,w){switch(l){case"focusin":return eo=oc(eo,o,l,d,m,w),!0;case"dragenter":return to=oc(to,o,l,d,m,w),!0;case"mouseover":return no=oc(no,o,l,d,m,w),!0;case"pointerover":var k=w.pointerId;return sc.set(k,oc(sc.get(k)||null,o,l,d,m,w)),!0;case"gotpointercapture":return k=w.pointerId,ic.set(k,oc(ic.get(k)||null,o,l,d,m,w)),!0}return!1}function Yx(o){var l=ua(o.target);if(l!==null){var d=pi(l);if(d!==null){if(l=d.tag,l===13){if(l=xf(d),l!==null){o.blockedOn=l,qx(o.priority,function(){Gx(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Cf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=A0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var m=new d.constructor(d.type,d);cr=m,d.target.dispatchEvent(m),cr=null}else return l=xc(d),l!==null&&P0(l),o.blockedOn=d,!1;l.shift()}return!0}function Xx(o,l,d){Cf(o)&&d.delete(l)}function hM(){T0=!1,eo!==null&&Cf(eo)&&(eo=null),to!==null&&Cf(to)&&(to=null),no!==null&&Cf(no)&&(no=null),sc.forEach(Xx),ic.forEach(Xx)}function ac(o,l){o.blockedOn===l&&(o.blockedOn=null,T0||(T0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,hM)))}function lc(o){function l(w){return ac(w,o)}if(0<kf.length){ac(kf[0],o);for(var d=1;d<kf.length;d++){var m=kf[d];m.blockedOn===o&&(m.blockedOn=null)}}for(eo!==null&&ac(eo,o),to!==null&&ac(to,o),no!==null&&ac(no,o),sc.forEach(l),ic.forEach(l),d=0;d<ro.length;d++)m=ro[d],m.blockedOn===o&&(m.blockedOn=null);for(;0<ro.length&&(d=ro[0],d.blockedOn===null);)Yx(d),d.blockedOn===null&&ro.shift()}var vl=T.ReactCurrentBatchConfig,Pf=!0;function pM(o,l,d,m){var w=gt,k=vl.transition;vl.transition=null;try{gt=1,R0(o,l,d,m)}finally{gt=w,vl.transition=k}}function mM(o,l,d,m){var w=gt,k=vl.transition;vl.transition=null;try{gt=4,R0(o,l,d,m)}finally{gt=w,vl.transition=k}}function R0(o,l,d,m){if(Pf){var w=A0(o,l,d,m);if(w===null)K0(o,l,m,Tf,d),Zx(o,m);else if(fM(w,o,l,d,m))m.stopPropagation();else if(Zx(o,m),l&4&&-1<dM.indexOf(o)){for(;w!==null;){var k=xc(w);if(k!==null&&Wx(k),k=A0(o,l,d,m),k===null&&K0(o,l,m,Tf,d),k===w)break;w=k}w!==null&&m.stopPropagation()}else K0(o,l,m,null,d)}}var Tf=null;function A0(o,l,d,m){if(Tf=null,o=Mn(m),o=ua(o),o!==null)if(l=pi(o),l===null)o=null;else if(d=l.tag,d===13){if(o=xf(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Tf=o,null}function Qx(o){switch(o){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(Sf()){case Ji:return 1;case gl:return 4;case aa:case Ef:return 16;case rc:return 536870912;default:return 16}default:return 16}}var so=null,M0=null,Rf=null;function Jx(){if(Rf)return Rf;var o,l=M0,d=l.length,m,w="value"in so?so.value:so.textContent,k=w.length;for(o=0;o<d&&l[o]===w[o];o++);var M=d-o;for(m=1;m<=M&&l[d-m]===w[k-m];m++);return Rf=w.slice(o,1<m?1-m:void 0)}function Af(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Mf(){return!0}function ew(){return!1}function Ir(o){function l(d,m,w,k,M){this._reactName=d,this._targetInst=w,this.type=m,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var j in o)o.hasOwnProperty(j)&&(d=o[j],this[j]=d?d(k):k[j]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Mf:ew,this.isPropagationStopped=ew,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Mf)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Mf)},persist:function(){},isPersistent:Mf}),l}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},I0=Ir(yl),uc=H({},yl,{view:0,detail:0}),gM=Ir(uc),N0,O0,cc,If=H({},uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:D0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==cc&&(cc&&o.type==="mousemove"?(N0=o.screenX-cc.screenX,O0=o.screenY-cc.screenY):O0=N0=0,cc=o),N0)},movementY:function(o){return"movementY"in o?o.movementY:O0}}),tw=Ir(If),vM=H({},If,{dataTransfer:0}),yM=Ir(vM),_M=H({},uc,{relatedTarget:0}),L0=Ir(_M),xM=H({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),wM=Ir(xM),bM=H({},yl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),SM=Ir(bM),EM=H({},yl,{data:0}),nw=Ir(EM),kM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},PM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=PM[o])?!!l[o]:!1}function D0(){return TM}var RM=H({},uc,{key:function(o){if(o.key){var l=kM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Af(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?CM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:D0,charCode:function(o){return o.type==="keypress"?Af(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Af(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),AM=Ir(RM),MM=H({},If,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rw=Ir(MM),IM=H({},uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:D0}),NM=Ir(IM),OM=H({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),LM=Ir(OM),DM=H({},If,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),FM=Ir(DM),jM=[9,13,27,32],F0=u&&"CompositionEvent"in window,dc=null;u&&"documentMode"in document&&(dc=document.documentMode);var VM=u&&"TextEvent"in window&&!dc,sw=u&&(!F0||dc&&8<dc&&11>=dc),iw=" ",ow=!1;function aw(o,l){switch(o){case"keyup":return jM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var _l=!1;function $M(o,l){switch(o){case"compositionend":return lw(l);case"keypress":return l.which!==32?null:(ow=!0,iw);case"textInput":return o=l.data,o===iw&&ow?null:o;default:return null}}function HM(o,l){if(_l)return o==="compositionend"||!F0&&aw(o,l)?(o=Jx(),Rf=M0=so=null,_l=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return sw&&l.locale!=="ko"?null:l.data;default:return null}}var zM={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 uw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!zM[o.type]:l==="textarea"}function cw(o,l,d,m){qe(m),l=Ff(l,"onChange"),0<l.length&&(d=new I0("onChange","change",null,d,m),o.push({event:d,listeners:l}))}var fc=null,hc=null;function UM(o){Tw(o,0)}function Nf(o){var l=El(o);if(Ae(l))return o}function BM(o,l){if(o==="change")return l}var dw=!1;if(u){var j0;if(u){var V0="oninput"in document;if(!V0){var fw=document.createElement("div");fw.setAttribute("oninput","return;"),V0=typeof fw.oninput=="function"}j0=V0}else j0=!1;dw=j0&&(!document.documentMode||9<document.documentMode)}function hw(){fc&&(fc.detachEvent("onpropertychange",pw),hc=fc=null)}function pw(o){if(o.propertyName==="value"&&Nf(hc)){var l=[];cw(l,hc,o,Mn(o)),Ut(UM,l)}}function WM(o,l,d){o==="focusin"?(hw(),fc=l,hc=d,fc.attachEvent("onpropertychange",pw)):o==="focusout"&&hw()}function GM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Nf(hc)}function KM(o,l){if(o==="click")return Nf(l)}function qM(o,l){if(o==="input"||o==="change")return Nf(l)}function ZM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ms=typeof Object.is=="function"?Object.is:ZM;function pc(o,l){if(ms(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),m=Object.keys(l);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var w=d[m];if(!c.call(l,w)||!ms(o[w],l[w]))return!1}return!0}function mw(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function gw(o,l){var d=mw(o);o=0;for(var m;d;){if(d.nodeType===3){if(m=o+d.textContent.length,o<=l&&m>=l)return{node:d,offset:l-o};o=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=mw(d)}}function vw(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?vw(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function yw(){for(var o=window,l=Ke();l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Ke(o.document)}return l}function $0(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function YM(o){var l=yw(),d=o.focusedElem,m=o.selectionRange;if(l!==d&&d&&d.ownerDocument&&vw(d.ownerDocument.documentElement,d)){if(m!==null&&$0(d)){if(l=m.start,o=m.end,o===void 0&&(o=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(o,d.value.length);else if(o=(l=d.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=d.textContent.length,k=Math.min(m.start,w);m=m.end===void 0?k:Math.min(m.end,w),!o.extend&&k>m&&(w=m,m=k,k=w),w=gw(d,k);var M=gw(d,m);w&&M&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==M.node||o.focusOffset!==M.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),k>m?(o.addRange(l),o.extend(M.node,M.offset)):(l.setEnd(M.node,M.offset),o.addRange(l)))}}for(l=[],o=d;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)o=l[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var XM=u&&"documentMode"in document&&11>=document.documentMode,xl=null,H0=null,mc=null,z0=!1;function _w(o,l,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;z0||xl==null||xl!==Ke(m)||(m=xl,"selectionStart"in m&&$0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),mc&&pc(mc,m)||(mc=m,m=Ff(H0,"onSelect"),0<m.length&&(l=new I0("onSelect","select",null,l,d),o.push({event:l,listeners:m}),l.target=xl)))}function Of(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var wl={animationend:Of("Animation","AnimationEnd"),animationiteration:Of("Animation","AnimationIteration"),animationstart:Of("Animation","AnimationStart"),transitionend:Of("Transition","TransitionEnd")},U0={},xw={};u&&(xw=document.createElement("div").style,"AnimationEvent"in window||(delete wl.animationend.animation,delete wl.animationiteration.animation,delete wl.animationstart.animation),"TransitionEvent"in window||delete wl.transitionend.transition);function Lf(o){if(U0[o])return U0[o];if(!wl[o])return o;var l=wl[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in xw)return U0[o]=l[d];return o}var ww=Lf("animationend"),bw=Lf("animationiteration"),Sw=Lf("animationstart"),Ew=Lf("transitionend"),kw=new Map,Cw="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 io(o,l){kw.set(o,l),i(l,[o])}for(var B0=0;B0<Cw.length;B0++){var W0=Cw[B0],QM=W0.toLowerCase(),JM=W0[0].toUpperCase()+W0.slice(1);io(QM,"on"+JM)}io(ww,"onAnimationEnd"),io(bw,"onAnimationIteration"),io(Sw,"onAnimationStart"),io("dblclick","onDoubleClick"),io("focusin","onFocus"),io("focusout","onBlur"),io(Ew,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eI=new Set("cancel close invalid load scroll toggle".split(" ").concat(gc));function Pw(o,l,d){var m=o.type||"unknown-event";o.currentTarget=d,k0(m,l,void 0,o),o.currentTarget=null}function Tw(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var m=o[d],w=m.event;m=m.listeners;e:{var k=void 0;if(l)for(var M=m.length-1;0<=M;M--){var j=m[M],U=j.instance,re=j.currentTarget;if(j=j.listener,U!==k&&w.isPropagationStopped())break e;Pw(w,j,re),k=U}else for(M=0;M<m.length;M++){if(j=m[M],U=j.instance,re=j.currentTarget,j=j.listener,U!==k&&w.isPropagationStopped())break e;Pw(w,j,re),k=U}}}if(oa)throw o=Xu,oa=!1,Xu=null,o}function It(o,l){var d=l[J0];d===void 0&&(d=l[J0]=new Set);var m=o+"__bubble";d.has(m)||(Rw(l,o,2,!1),d.add(m))}function G0(o,l,d){var m=0;l&&(m|=4),Rw(d,o,m,l)}var Df="_reactListening"+Math.random().toString(36).slice(2);function vc(o){if(!o[Df]){o[Df]=!0,r.forEach(function(d){d!=="selectionchange"&&(eI.has(d)||G0(d,!1,o),G0(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Df]||(l[Df]=!0,G0("selectionchange",!1,l))}}function Rw(o,l,d,m){switch(Qx(l)){case 1:var w=pM;break;case 4:w=mM;break;default:w=R0}d=w.bind(null,l,d,o),w=void 0,!ps||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),m?w!==void 0?o.addEventListener(l,d,{capture:!0,passive:w}):o.addEventListener(l,d,!0):w!==void 0?o.addEventListener(l,d,{passive:w}):o.addEventListener(l,d,!1)}function K0(o,l,d,m,w){var k=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var M=m.tag;if(M===3||M===4){var j=m.stateNode.containerInfo;if(j===w||j.nodeType===8&&j.parentNode===w)break;if(M===4)for(M=m.return;M!==null;){var U=M.tag;if((U===3||U===4)&&(U=M.stateNode.containerInfo,U===w||U.nodeType===8&&U.parentNode===w))return;M=M.return}for(;j!==null;){if(M=ua(j),M===null)return;if(U=M.tag,U===5||U===6){m=k=M;continue e}j=j.parentNode}}m=m.return}Ut(function(){var re=k,de=Mn(d),pe=[];e:{var ce=kw.get(o);if(ce!==void 0){var Pe=I0,Le=o;switch(o){case"keypress":if(Af(d)===0)break e;case"keydown":case"keyup":Pe=AM;break;case"focusin":Le="focus",Pe=L0;break;case"focusout":Le="blur",Pe=L0;break;case"beforeblur":case"afterblur":Pe=L0;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=tw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=yM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=NM;break;case ww:case bw:case Sw:Pe=wM;break;case Ew:Pe=LM;break;case"scroll":Pe=gM;break;case"wheel":Pe=FM;break;case"copy":case"cut":case"paste":Pe=SM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=rw}var je=(l&4)!==0,sn=!je&&o==="scroll",Q=je?ce!==null?ce+"Capture":null:ce;je=[];for(var K=re,J;K!==null;){J=K;var ye=J.stateNode;if(J.tag===5&&ye!==null&&(J=ye,Q!==null&&(ye=rn(K,Q),ye!=null&&je.push(yc(K,ye,J)))),sn)break;K=K.return}0<je.length&&(ce=new Pe(ce,Le,null,d,de),pe.push({event:ce,listeners:je}))}}if((l&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",Pe=o==="mouseout"||o==="pointerout",ce&&d!==cr&&(Le=d.relatedTarget||d.fromElement)&&(ua(Le)||Le[mi]))break e;if((Pe||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,Pe?(Le=d.relatedTarget||d.toElement,Pe=re,Le=Le?ua(Le):null,Le!==null&&(sn=pi(Le),Le!==sn||Le.tag!==5&&Le.tag!==6)&&(Le=null)):(Pe=null,Le=re),Pe!==Le)){if(je=tw,ye="onMouseLeave",Q="onMouseEnter",K="mouse",(o==="pointerout"||o==="pointerover")&&(je=rw,ye="onPointerLeave",Q="onPointerEnter",K="pointer"),sn=Pe==null?ce:El(Pe),J=Le==null?ce:El(Le),ce=new je(ye,K+"leave",Pe,d,de),ce.target=sn,ce.relatedTarget=J,ye=null,ua(de)===re&&(je=new je(Q,K+"enter",Le,d,de),je.target=J,je.relatedTarget=sn,ye=je),sn=ye,Pe&&Le)t:{for(je=Pe,Q=Le,K=0,J=je;J;J=bl(J))K++;for(J=0,ye=Q;ye;ye=bl(ye))J++;for(;0<K-J;)je=bl(je),K--;for(;0<J-K;)Q=bl(Q),J--;for(;K--;){if(je===Q||Q!==null&&je===Q.alternate)break t;je=bl(je),Q=bl(Q)}je=null}else je=null;Pe!==null&&Aw(pe,ce,Pe,je,!1),Le!==null&&sn!==null&&Aw(pe,sn,Le,je,!0)}}e:{if(ce=re?El(re):window,Pe=ce.nodeName&&ce.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&ce.type==="file")var Ve=BM;else if(uw(ce))if(dw)Ve=qM;else{Ve=GM;var He=WM}else(Pe=ce.nodeName)&&Pe.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ve=KM);if(Ve&&(Ve=Ve(o,re))){cw(pe,Ve,d,de);break e}He&&He(o,ce,re),o==="focusout"&&(He=ce._wrapperState)&&He.controlled&&ce.type==="number"&&Fe(ce,"number",ce.value)}switch(He=re?El(re):window,o){case"focusin":(uw(He)||He.contentEditable==="true")&&(xl=He,H0=re,mc=null);break;case"focusout":mc=H0=xl=null;break;case"mousedown":z0=!0;break;case"contextmenu":case"mouseup":case"dragend":z0=!1,_w(pe,d,de);break;case"selectionchange":if(XM)break;case"keydown":case"keyup":_w(pe,d,de)}var ze;if(F0)e:{switch(o){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else _l?aw(o,d)&&(Ge="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Ge="onCompositionStart");Ge&&(sw&&d.locale!=="ko"&&(_l||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&_l&&(ze=Jx()):(so=de,M0="value"in so?so.value:so.textContent,_l=!0)),He=Ff(re,Ge),0<He.length&&(Ge=new nw(Ge,o,null,d,de),pe.push({event:Ge,listeners:He}),ze?Ge.data=ze:(ze=lw(d),ze!==null&&(Ge.data=ze)))),(ze=VM?$M(o,d):HM(o,d))&&(re=Ff(re,"onBeforeInput"),0<re.length&&(de=new nw("onBeforeInput","beforeinput",null,d,de),pe.push({event:de,listeners:re}),de.data=ze))}Tw(pe,l)})}function yc(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Ff(o,l){for(var d=l+"Capture",m=[];o!==null;){var w=o,k=w.stateNode;w.tag===5&&k!==null&&(w=k,k=rn(o,d),k!=null&&m.unshift(yc(o,k,w)),k=rn(o,l),k!=null&&m.push(yc(o,k,w))),o=o.return}return m}function bl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Aw(o,l,d,m,w){for(var k=l._reactName,M=[];d!==null&&d!==m;){var j=d,U=j.alternate,re=j.stateNode;if(U!==null&&U===m)break;j.tag===5&&re!==null&&(j=re,w?(U=rn(d,k),U!=null&&M.unshift(yc(d,U,j))):w||(U=rn(d,k),U!=null&&M.push(yc(d,U,j)))),d=d.return}M.length!==0&&o.push({event:l,listeners:M})}var tI=/\r\n?/g,nI=/\u0000|\uFFFD/g;function Mw(o){return(typeof o=="string"?o:""+o).replace(tI,`
|
|
39
|
+
`).replace(nI,"")}function jf(o,l,d){if(l=Mw(l),Mw(o)!==l&&d)throw Error(n(425))}function Vf(){}var q0=null,Z0=null;function Y0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var X0=typeof setTimeout=="function"?setTimeout:void 0,rI=typeof clearTimeout=="function"?clearTimeout:void 0,Iw=typeof Promise=="function"?Promise:void 0,sI=typeof queueMicrotask=="function"?queueMicrotask:typeof Iw<"u"?function(o){return Iw.resolve(null).then(o).catch(iI)}:X0;function iI(o){setTimeout(function(){throw o})}function Q0(o,l){var d=l,m=0;do{var w=d.nextSibling;if(o.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(m===0){o.removeChild(w),lc(l);return}m--}else d!=="$"&&d!=="$?"&&d!=="$!"||m++;d=w}while(d);lc(l)}function oo(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function Nw(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return o;l--}else d==="/$"&&l++}o=o.previousSibling}return null}var Sl=Math.random().toString(36).slice(2),js="__reactFiber$"+Sl,_c="__reactProps$"+Sl,mi="__reactContainer$"+Sl,J0="__reactEvents$"+Sl,oI="__reactListeners$"+Sl,aI="__reactHandles$"+Sl;function ua(o){var l=o[js];if(l)return l;for(var d=o.parentNode;d;){if(l=d[mi]||d[js]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=Nw(o);o!==null;){if(d=o[js])return d;o=Nw(o)}return l}o=d,d=o.parentNode}return null}function xc(o){return o=o[js]||o[mi],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function El(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function $f(o){return o[_c]||null}var eg=[],kl=-1;function ao(o){return{current:o}}function Nt(o){0>kl||(o.current=eg[kl],eg[kl]=null,kl--)}function Tt(o,l){kl++,eg[kl]=o.current,o.current=l}var lo={},Un=ao(lo),dr=ao(!1),ca=lo;function Cl(o,l){var d=o.type.contextTypes;if(!d)return lo;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var w={},k;for(k in d)w[k]=l[k];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function fr(o){return o=o.childContextTypes,o!=null}function Hf(){Nt(dr),Nt(Un)}function Ow(o,l,d){if(Un.current!==lo)throw Error(n(168));Tt(Un,l),Tt(dr,d)}function Lw(o,l,d){var m=o.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var w in m)if(!(w in l))throw Error(n(108,he(o)||"Unknown",w));return H({},d,m)}function zf(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||lo,ca=Un.current,Tt(Un,o),Tt(dr,dr.current),!0}function Dw(o,l,d){var m=o.stateNode;if(!m)throw Error(n(169));d?(o=Lw(o,l,ca),m.__reactInternalMemoizedMergedChildContext=o,Nt(dr),Nt(Un),Tt(Un,o)):Nt(dr),Tt(dr,d)}var gi=null,Uf=!1,tg=!1;function Fw(o){gi===null?gi=[o]:gi.push(o)}function lI(o){Uf=!0,Fw(o)}function uo(){if(!tg&&gi!==null){tg=!0;var o=0,l=gt;try{var d=gi;for(gt=1;o<d.length;o++){var m=d[o];do m=m(!0);while(m!==null)}gi=null,Uf=!1}catch(w){throw gi!==null&&(gi=gi.slice(o+1)),tc(Ji,uo),w}finally{gt=l,tg=!1}}return null}var Pl=[],Tl=0,Bf=null,Wf=0,Xr=[],Qr=0,da=null,vi=1,yi="";function fa(o,l){Pl[Tl++]=Wf,Pl[Tl++]=Bf,Bf=o,Wf=l}function jw(o,l,d){Xr[Qr++]=vi,Xr[Qr++]=yi,Xr[Qr++]=da,da=o;var m=vi;o=yi;var w=32-we(m)-1;m&=~(1<<w),d+=1;var k=32-we(l)+w;if(30<k){var M=w-w%5;k=(m&(1<<M)-1).toString(32),m>>=M,w-=M,vi=1<<32-we(l)+w|d<<w|m,yi=k+o}else vi=1<<k|d<<w|m,yi=o}function ng(o){o.return!==null&&(fa(o,1),jw(o,1,0))}function rg(o){for(;o===Bf;)Bf=Pl[--Tl],Pl[Tl]=null,Wf=Pl[--Tl],Pl[Tl]=null;for(;o===da;)da=Xr[--Qr],Xr[Qr]=null,yi=Xr[--Qr],Xr[Qr]=null,vi=Xr[--Qr],Xr[Qr]=null}var Nr=null,Or=null,Ft=!1,gs=null;function Vw(o,l){var d=ns(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=o,l=o.deletions,l===null?(o.deletions=[d],o.flags|=16):l.push(d)}function $w(o,l){switch(o.tag){case 5:var d=o.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Nr=o,Or=oo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Nr=o,Or=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=da!==null?{id:vi,overflow:yi}:null,o.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=ns(18,null,null,0),d.stateNode=l,d.return=o,o.child=d,Nr=o,Or=null,!0):!1;default:return!1}}function sg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function ig(o){if(Ft){var l=Or;if(l){var d=l;if(!$w(o,l)){if(sg(o))throw Error(n(418));l=oo(d.nextSibling);var m=Nr;l&&$w(o,l)?Vw(m,d):(o.flags=o.flags&-4097|2,Ft=!1,Nr=o)}}else{if(sg(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ft=!1,Nr=o}}}function Hw(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Nr=o}function Gf(o){if(o!==Nr)return!1;if(!Ft)return Hw(o),Ft=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!Y0(o.type,o.memoizedProps)),l&&(l=Or)){if(sg(o))throw zw(),Error(n(418));for(;l;)Vw(o,l),l=oo(l.nextSibling)}if(Hw(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(l===0){Or=oo(o.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}o=o.nextSibling}Or=null}}else Or=Nr?oo(o.stateNode.nextSibling):null;return!0}function zw(){for(var o=Or;o;)o=oo(o.nextSibling)}function Rl(){Or=Nr=null,Ft=!1}function og(o){gs===null?gs=[o]:gs.push(o)}var uI=T.ReactCurrentBatchConfig;function wc(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var m=d.stateNode}if(!m)throw Error(n(147,o));var w=m,k=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(M){var j=w.refs;M===null?delete j[k]:j[k]=M},l._stringRef=k,l)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Kf(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Uw(o){var l=o._init;return l(o._payload)}function Bw(o){function l(Q,K){if(o){var J=Q.deletions;J===null?(Q.deletions=[K],Q.flags|=16):J.push(K)}}function d(Q,K){if(!o)return null;for(;K!==null;)l(Q,K),K=K.sibling;return null}function m(Q,K){for(Q=new Map;K!==null;)K.key!==null?Q.set(K.key,K):Q.set(K.index,K),K=K.sibling;return Q}function w(Q,K){return Q=yo(Q,K),Q.index=0,Q.sibling=null,Q}function k(Q,K,J){return Q.index=J,o?(J=Q.alternate,J!==null?(J=J.index,J<K?(Q.flags|=2,K):J):(Q.flags|=2,K)):(Q.flags|=1048576,K)}function M(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function j(Q,K,J,ye){return K===null||K.tag!==6?(K=Xg(J,Q.mode,ye),K.return=Q,K):(K=w(K,J),K.return=Q,K)}function U(Q,K,J,ye){var Ve=J.type;return Ve===I?de(Q,K,J.props.children,ye,J.key):K!==null&&(K.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Uw(Ve)===K.type)?(ye=w(K,J.props),ye.ref=wc(Q,K,J),ye.return=Q,ye):(ye=vh(J.type,J.key,J.props,null,Q.mode,ye),ye.ref=wc(Q,K,J),ye.return=Q,ye)}function re(Q,K,J,ye){return K===null||K.tag!==4||K.stateNode.containerInfo!==J.containerInfo||K.stateNode.implementation!==J.implementation?(K=Qg(J,Q.mode,ye),K.return=Q,K):(K=w(K,J.children||[]),K.return=Q,K)}function de(Q,K,J,ye,Ve){return K===null||K.tag!==7?(K=xa(J,Q.mode,ye,Ve),K.return=Q,K):(K=w(K,J),K.return=Q,K)}function pe(Q,K,J){if(typeof K=="string"&&K!==""||typeof K=="number")return K=Xg(""+K,Q.mode,J),K.return=Q,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case R:return J=vh(K.type,K.key,K.props,null,Q.mode,J),J.ref=wc(Q,null,K),J.return=Q,J;case O:return K=Qg(K,Q.mode,J),K.return=Q,K;case B:var ye=K._init;return pe(Q,ye(K._payload),J)}if(Qe(K)||ee(K))return K=xa(K,Q.mode,J,null),K.return=Q,K;Kf(Q,K)}return null}function ce(Q,K,J,ye){var Ve=K!==null?K.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Ve!==null?null:j(Q,K,""+J,ye);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return J.key===Ve?U(Q,K,J,ye):null;case O:return J.key===Ve?re(Q,K,J,ye):null;case B:return Ve=J._init,ce(Q,K,Ve(J._payload),ye)}if(Qe(J)||ee(J))return Ve!==null?null:de(Q,K,J,ye,null);Kf(Q,J)}return null}function Pe(Q,K,J,ye,Ve){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Q=Q.get(J)||null,j(K,Q,""+ye,Ve);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case R:return Q=Q.get(ye.key===null?J:ye.key)||null,U(K,Q,ye,Ve);case O:return Q=Q.get(ye.key===null?J:ye.key)||null,re(K,Q,ye,Ve);case B:var He=ye._init;return Pe(Q,K,J,He(ye._payload),Ve)}if(Qe(ye)||ee(ye))return Q=Q.get(J)||null,de(K,Q,ye,Ve,null);Kf(K,ye)}return null}function Le(Q,K,J,ye){for(var Ve=null,He=null,ze=K,Ge=K=0,Cn=null;ze!==null&&Ge<J.length;Ge++){ze.index>Ge?(Cn=ze,ze=null):Cn=ze.sibling;var ft=ce(Q,ze,J[Ge],ye);if(ft===null){ze===null&&(ze=Cn);break}o&&ze&&ft.alternate===null&&l(Q,ze),K=k(ft,K,Ge),He===null?Ve=ft:He.sibling=ft,He=ft,ze=Cn}if(Ge===J.length)return d(Q,ze),Ft&&fa(Q,Ge),Ve;if(ze===null){for(;Ge<J.length;Ge++)ze=pe(Q,J[Ge],ye),ze!==null&&(K=k(ze,K,Ge),He===null?Ve=ze:He.sibling=ze,He=ze);return Ft&&fa(Q,Ge),Ve}for(ze=m(Q,ze);Ge<J.length;Ge++)Cn=Pe(ze,Q,Ge,J[Ge],ye),Cn!==null&&(o&&Cn.alternate!==null&&ze.delete(Cn.key===null?Ge:Cn.key),K=k(Cn,K,Ge),He===null?Ve=Cn:He.sibling=Cn,He=Cn);return o&&ze.forEach(function(_o){return l(Q,_o)}),Ft&&fa(Q,Ge),Ve}function je(Q,K,J,ye){var Ve=ee(J);if(typeof Ve!="function")throw Error(n(150));if(J=Ve.call(J),J==null)throw Error(n(151));for(var He=Ve=null,ze=K,Ge=K=0,Cn=null,ft=J.next();ze!==null&&!ft.done;Ge++,ft=J.next()){ze.index>Ge?(Cn=ze,ze=null):Cn=ze.sibling;var _o=ce(Q,ze,ft.value,ye);if(_o===null){ze===null&&(ze=Cn);break}o&&ze&&_o.alternate===null&&l(Q,ze),K=k(_o,K,Ge),He===null?Ve=_o:He.sibling=_o,He=_o,ze=Cn}if(ft.done)return d(Q,ze),Ft&&fa(Q,Ge),Ve;if(ze===null){for(;!ft.done;Ge++,ft=J.next())ft=pe(Q,ft.value,ye),ft!==null&&(K=k(ft,K,Ge),He===null?Ve=ft:He.sibling=ft,He=ft);return Ft&&fa(Q,Ge),Ve}for(ze=m(Q,ze);!ft.done;Ge++,ft=J.next())ft=Pe(ze,Q,Ge,ft.value,ye),ft!==null&&(o&&ft.alternate!==null&&ze.delete(ft.key===null?Ge:ft.key),K=k(ft,K,Ge),He===null?Ve=ft:He.sibling=ft,He=ft);return o&&ze.forEach(function(zI){return l(Q,zI)}),Ft&&fa(Q,Ge),Ve}function sn(Q,K,J,ye){if(typeof J=="object"&&J!==null&&J.type===I&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case R:e:{for(var Ve=J.key,He=K;He!==null;){if(He.key===Ve){if(Ve=J.type,Ve===I){if(He.tag===7){d(Q,He.sibling),K=w(He,J.props.children),K.return=Q,Q=K;break e}}else if(He.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Uw(Ve)===He.type){d(Q,He.sibling),K=w(He,J.props),K.ref=wc(Q,He,J),K.return=Q,Q=K;break e}d(Q,He);break}else l(Q,He);He=He.sibling}J.type===I?(K=xa(J.props.children,Q.mode,ye,J.key),K.return=Q,Q=K):(ye=vh(J.type,J.key,J.props,null,Q.mode,ye),ye.ref=wc(Q,K,J),ye.return=Q,Q=ye)}return M(Q);case O:e:{for(He=J.key;K!==null;){if(K.key===He)if(K.tag===4&&K.stateNode.containerInfo===J.containerInfo&&K.stateNode.implementation===J.implementation){d(Q,K.sibling),K=w(K,J.children||[]),K.return=Q,Q=K;break e}else{d(Q,K);break}else l(Q,K);K=K.sibling}K=Qg(J,Q.mode,ye),K.return=Q,Q=K}return M(Q);case B:return He=J._init,sn(Q,K,He(J._payload),ye)}if(Qe(J))return Le(Q,K,J,ye);if(ee(J))return je(Q,K,J,ye);Kf(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,K!==null&&K.tag===6?(d(Q,K.sibling),K=w(K,J),K.return=Q,Q=K):(d(Q,K),K=Xg(J,Q.mode,ye),K.return=Q,Q=K),M(Q)):d(Q,K)}return sn}var Al=Bw(!0),Ww=Bw(!1),qf=ao(null),Zf=null,Ml=null,ag=null;function lg(){ag=Ml=Zf=null}function ug(o){var l=qf.current;Nt(qf),o._currentValue=l}function cg(o,l,d){for(;o!==null;){var m=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),o===d)break;o=o.return}}function Il(o,l){Zf=o,ag=Ml=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(hr=!0),o.firstContext=null)}function Jr(o){var l=o._currentValue;if(ag!==o)if(o={context:o,memoizedValue:l,next:null},Ml===null){if(Zf===null)throw Error(n(308));Ml=o,Zf.dependencies={lanes:0,firstContext:o}}else Ml=Ml.next=o;return l}var ha=null;function dg(o){ha===null?ha=[o]:ha.push(o)}function Gw(o,l,d,m){var w=l.interleaved;return w===null?(d.next=d,dg(l)):(d.next=w.next,w.next=d),l.interleaved=d,_i(o,m)}function _i(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}var co=!1;function fg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kw(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function xi(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function fo(o,l,d){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(dt&2)!==0){var w=m.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),m.pending=l,_i(o,d)}return w=m.interleaved,w===null?(l.next=l,dg(m)):(l.next=w.next,w.next=l),m.interleaved=l,_i(o,d)}function Yf(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var m=l.lanes;m&=o.pendingLanes,d|=m,l.lanes=d,C0(o,d)}}function qw(o,l){var d=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var w=null,k=null;if(d=d.firstBaseUpdate,d!==null){do{var M={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};k===null?w=k=M:k=k.next=M,d=d.next}while(d!==null);k===null?w=k=l:k=k.next=l}else w=k=l;d={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:k,shared:m.shared,effects:m.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function Xf(o,l,d,m){var w=o.updateQueue;co=!1;var k=w.firstBaseUpdate,M=w.lastBaseUpdate,j=w.shared.pending;if(j!==null){w.shared.pending=null;var U=j,re=U.next;U.next=null,M===null?k=re:M.next=re,M=U;var de=o.alternate;de!==null&&(de=de.updateQueue,j=de.lastBaseUpdate,j!==M&&(j===null?de.firstBaseUpdate=re:j.next=re,de.lastBaseUpdate=U))}if(k!==null){var pe=w.baseState;M=0,de=re=U=null,j=k;do{var ce=j.lane,Pe=j.eventTime;if((m&ce)===ce){de!==null&&(de=de.next={eventTime:Pe,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var Le=o,je=j;switch(ce=l,Pe=d,je.tag){case 1:if(Le=je.payload,typeof Le=="function"){pe=Le.call(Pe,pe,ce);break e}pe=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=je.payload,ce=typeof Le=="function"?Le.call(Pe,pe,ce):Le,ce==null)break e;pe=H({},pe,ce);break e;case 2:co=!0}}j.callback!==null&&j.lane!==0&&(o.flags|=64,ce=w.effects,ce===null?w.effects=[j]:ce.push(j))}else Pe={eventTime:Pe,lane:ce,tag:j.tag,payload:j.payload,callback:j.callback,next:null},de===null?(re=de=Pe,U=pe):de=de.next=Pe,M|=ce;if(j=j.next,j===null){if(j=w.shared.pending,j===null)break;ce=j,j=ce.next,ce.next=null,w.lastBaseUpdate=ce,w.shared.pending=null}}while(!0);if(de===null&&(U=pe),w.baseState=U,w.firstBaseUpdate=re,w.lastBaseUpdate=de,l=w.shared.interleaved,l!==null){w=l;do M|=w.lane,w=w.next;while(w!==l)}else k===null&&(w.shared.lanes=0);ga|=M,o.lanes=M,o.memoizedState=pe}}function Zw(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var m=o[l],w=m.callback;if(w!==null){if(m.callback=null,m=d,typeof w!="function")throw Error(n(191,w));w.call(m)}}}var bc={},Vs=ao(bc),Sc=ao(bc),Ec=ao(bc);function pa(o){if(o===bc)throw Error(n(174));return o}function hg(o,l){switch(Tt(Ec,l),Tt(Sc,o),Tt(Vs,bc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Xn(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Xn(l,o)}Nt(Vs),Tt(Vs,l)}function Nl(){Nt(Vs),Nt(Sc),Nt(Ec)}function Yw(o){pa(Ec.current);var l=pa(Vs.current),d=Xn(l,o.type);l!==d&&(Tt(Sc,o),Tt(Vs,d))}function pg(o){Sc.current===o&&(Nt(Vs),Nt(Sc))}var Wt=ao(0);function Qf(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var mg=[];function gg(){for(var o=0;o<mg.length;o++)mg[o]._workInProgressVersionPrimary=null;mg.length=0}var Jf=T.ReactCurrentDispatcher,vg=T.ReactCurrentBatchConfig,ma=0,Gt=null,pn=null,En=null,eh=!1,kc=!1,Cc=0,cI=0;function Bn(){throw Error(n(321))}function yg(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!ms(o[d],l[d]))return!1;return!0}function _g(o,l,d,m,w,k){if(ma=k,Gt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Jf.current=o===null||o.memoizedState===null?pI:mI,o=d(m,w),kc){k=0;do{if(kc=!1,Cc=0,25<=k)throw Error(n(301));k+=1,En=pn=null,l.updateQueue=null,Jf.current=gI,o=d(m,w)}while(kc)}if(Jf.current=rh,l=pn!==null&&pn.next!==null,ma=0,En=pn=Gt=null,eh=!1,l)throw Error(n(300));return o}function xg(){var o=Cc!==0;return Cc=0,o}function $s(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?Gt.memoizedState=En=o:En=En.next=o,En}function es(){if(pn===null){var o=Gt.alternate;o=o!==null?o.memoizedState:null}else o=pn.next;var l=En===null?Gt.memoizedState:En.next;if(l!==null)En=l,pn=o;else{if(o===null)throw Error(n(310));pn=o,o={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},En===null?Gt.memoizedState=En=o:En=En.next=o}return En}function Pc(o,l){return typeof l=="function"?l(o):l}function wg(o){var l=es(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var m=pn,w=m.baseQueue,k=d.pending;if(k!==null){if(w!==null){var M=w.next;w.next=k.next,k.next=M}m.baseQueue=w=k,d.pending=null}if(w!==null){k=w.next,m=m.baseState;var j=M=null,U=null,re=k;do{var de=re.lane;if((ma&de)===de)U!==null&&(U=U.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),m=re.hasEagerState?re.eagerState:o(m,re.action);else{var pe={lane:de,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};U===null?(j=U=pe,M=m):U=U.next=pe,Gt.lanes|=de,ga|=de}re=re.next}while(re!==null&&re!==k);U===null?M=m:U.next=j,ms(m,l.memoizedState)||(hr=!0),l.memoizedState=m,l.baseState=M,l.baseQueue=U,d.lastRenderedState=m}if(o=d.interleaved,o!==null){w=o;do k=w.lane,Gt.lanes|=k,ga|=k,w=w.next;while(w!==o)}else w===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function bg(o){var l=es(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var m=d.dispatch,w=d.pending,k=l.memoizedState;if(w!==null){d.pending=null;var M=w=w.next;do k=o(k,M.action),M=M.next;while(M!==w);ms(k,l.memoizedState)||(hr=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),d.lastRenderedState=k}return[k,m]}function Xw(){}function Qw(o,l){var d=Gt,m=es(),w=l(),k=!ms(m.memoizedState,w);if(k&&(m.memoizedState=w,hr=!0),m=m.queue,Sg(tb.bind(null,d,m,o),[o]),m.getSnapshot!==l||k||En!==null&&En.memoizedState.tag&1){if(d.flags|=2048,Tc(9,eb.bind(null,d,m,w,l),void 0,null),kn===null)throw Error(n(349));(ma&30)!==0||Jw(d,l,w)}return w}function Jw(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Gt.updateQueue,l===null?(l={lastEffect:null,stores:null},Gt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function eb(o,l,d,m){l.value=d,l.getSnapshot=m,nb(l)&&rb(o)}function tb(o,l,d){return d(function(){nb(l)&&rb(o)})}function nb(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!ms(o,d)}catch{return!0}}function rb(o){var l=_i(o,1);l!==null&&xs(l,o,1,-1)}function sb(o){var l=$s();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pc,lastRenderedState:o},l.queue=o,o=o.dispatch=hI.bind(null,Gt,o),[l.memoizedState,o]}function Tc(o,l,d,m){return o={tag:o,create:l,destroy:d,deps:m,next:null},l=Gt.updateQueue,l===null?(l={lastEffect:null,stores:null},Gt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(m=d.next,d.next=o,o.next=m,l.lastEffect=o)),o}function ib(){return es().memoizedState}function th(o,l,d,m){var w=$s();Gt.flags|=o,w.memoizedState=Tc(1|l,d,void 0,m===void 0?null:m)}function nh(o,l,d,m){var w=es();m=m===void 0?null:m;var k=void 0;if(pn!==null){var M=pn.memoizedState;if(k=M.destroy,m!==null&&yg(m,M.deps)){w.memoizedState=Tc(l,d,k,m);return}}Gt.flags|=o,w.memoizedState=Tc(1|l,d,k,m)}function ob(o,l){return th(8390656,8,o,l)}function Sg(o,l){return nh(2048,8,o,l)}function ab(o,l){return nh(4,2,o,l)}function lb(o,l){return nh(4,4,o,l)}function ub(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function cb(o,l,d){return d=d!=null?d.concat([o]):null,nh(4,4,ub.bind(null,l,o),d)}function Eg(){}function db(o,l){var d=es();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&yg(l,m[1])?m[0]:(d.memoizedState=[o,l],o)}function fb(o,l){var d=es();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&yg(l,m[1])?m[0]:(o=o(),d.memoizedState=[o,l],o)}function hb(o,l,d){return(ma&21)===0?(o.baseState&&(o.baseState=!1,hr=!0),o.memoizedState=d):(ms(d,l)||(d=Sn(),Gt.lanes|=d,ga|=d,o.baseState=!0),l)}function dI(o,l){var d=gt;gt=d!==0&&4>d?d:4,o(!0);var m=vg.transition;vg.transition={};try{o(!1),l()}finally{gt=d,vg.transition=m}}function pb(){return es().memoizedState}function fI(o,l,d){var m=go(o);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},mb(o))gb(l,d);else if(d=Gw(o,l,d,m),d!==null){var w=nr();xs(d,o,m,w),vb(d,l,m)}}function hI(o,l,d){var m=go(o),w={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(mb(o))gb(l,w);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var M=l.lastRenderedState,j=k(M,d);if(w.hasEagerState=!0,w.eagerState=j,ms(j,M)){var U=l.interleaved;U===null?(w.next=w,dg(l)):(w.next=U.next,U.next=w),l.interleaved=w;return}}catch{}finally{}d=Gw(o,l,w,m),d!==null&&(w=nr(),xs(d,o,m,w),vb(d,l,m))}}function mb(o){var l=o.alternate;return o===Gt||l!==null&&l===Gt}function gb(o,l){kc=eh=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function vb(o,l,d){if((d&4194240)!==0){var m=l.lanes;m&=o.pendingLanes,d|=m,l.lanes=d,C0(o,d)}}var rh={readContext:Jr,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useInsertionEffect:Bn,useLayoutEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useMutableSource:Bn,useSyncExternalStore:Bn,useId:Bn,unstable_isNewReconciler:!1},pI={readContext:Jr,useCallback:function(o,l){return $s().memoizedState=[o,l===void 0?null:l],o},useContext:Jr,useEffect:ob,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,th(4194308,4,ub.bind(null,l,o),d)},useLayoutEffect:function(o,l){return th(4194308,4,o,l)},useInsertionEffect:function(o,l){return th(4,2,o,l)},useMemo:function(o,l){var d=$s();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var m=$s();return l=d!==void 0?d(l):l,m.memoizedState=m.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},m.queue=o,o=o.dispatch=fI.bind(null,Gt,o),[m.memoizedState,o]},useRef:function(o){var l=$s();return o={current:o},l.memoizedState=o},useState:sb,useDebugValue:Eg,useDeferredValue:function(o){return $s().memoizedState=o},useTransition:function(){var o=sb(!1),l=o[0];return o=dI.bind(null,o[1]),$s().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,d){var m=Gt,w=$s();if(Ft){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),kn===null)throw Error(n(349));(ma&30)!==0||Jw(m,l,d)}w.memoizedState=d;var k={value:d,getSnapshot:l};return w.queue=k,ob(tb.bind(null,m,k,o),[o]),m.flags|=2048,Tc(9,eb.bind(null,m,k,d,l),void 0,null),d},useId:function(){var o=$s(),l=kn.identifierPrefix;if(Ft){var d=yi,m=vi;d=(m&~(1<<32-we(m)-1)).toString(32)+d,l=":"+l+"R"+d,d=Cc++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=cI++,l=":"+l+"r"+d.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},mI={readContext:Jr,useCallback:db,useContext:Jr,useEffect:Sg,useImperativeHandle:cb,useInsertionEffect:ab,useLayoutEffect:lb,useMemo:fb,useReducer:wg,useRef:ib,useState:function(){return wg(Pc)},useDebugValue:Eg,useDeferredValue:function(o){var l=es();return hb(l,pn.memoizedState,o)},useTransition:function(){var o=wg(Pc)[0],l=es().memoizedState;return[o,l]},useMutableSource:Xw,useSyncExternalStore:Qw,useId:pb,unstable_isNewReconciler:!1},gI={readContext:Jr,useCallback:db,useContext:Jr,useEffect:Sg,useImperativeHandle:cb,useInsertionEffect:ab,useLayoutEffect:lb,useMemo:fb,useReducer:bg,useRef:ib,useState:function(){return bg(Pc)},useDebugValue:Eg,useDeferredValue:function(o){var l=es();return pn===null?l.memoizedState=o:hb(l,pn.memoizedState,o)},useTransition:function(){var o=bg(Pc)[0],l=es().memoizedState;return[o,l]},useMutableSource:Xw,useSyncExternalStore:Qw,useId:pb,unstable_isNewReconciler:!1};function vs(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}function kg(o,l,d,m){l=o.memoizedState,d=d(m,l),d=d==null?l:H({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var sh={isMounted:function(o){return(o=o._reactInternals)?pi(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var m=nr(),w=go(o),k=xi(m,w);k.payload=l,d!=null&&(k.callback=d),l=fo(o,k,w),l!==null&&(xs(l,o,w,m),Yf(l,o,w))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var m=nr(),w=go(o),k=xi(m,w);k.tag=1,k.payload=l,d!=null&&(k.callback=d),l=fo(o,k,w),l!==null&&(xs(l,o,w,m),Yf(l,o,w))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=nr(),m=go(o),w=xi(d,m);w.tag=2,l!=null&&(w.callback=l),l=fo(o,w,m),l!==null&&(xs(l,o,m,d),Yf(l,o,m))}};function yb(o,l,d,m,w,k,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,k,M):l.prototype&&l.prototype.isPureReactComponent?!pc(d,m)||!pc(w,k):!0}function _b(o,l,d){var m=!1,w=lo,k=l.contextType;return typeof k=="object"&&k!==null?k=Jr(k):(w=fr(l)?ca:Un.current,m=l.contextTypes,k=(m=m!=null)?Cl(o,w):lo),l=new l(d,k),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=sh,o.stateNode=l,l._reactInternals=o,m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=w,o.__reactInternalMemoizedMaskedChildContext=k),l}function xb(o,l,d,m){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,m),l.state!==o&&sh.enqueueReplaceState(l,l.state,null)}function Cg(o,l,d,m){var w=o.stateNode;w.props=d,w.state=o.memoizedState,w.refs={},fg(o);var k=l.contextType;typeof k=="object"&&k!==null?w.context=Jr(k):(k=fr(l)?ca:Un.current,w.context=Cl(o,k)),w.state=o.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(kg(o,l,k,d),w.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(l=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),l!==w.state&&sh.enqueueReplaceState(w,w.state,null),Xf(o,d,w,m),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308)}function Ol(o,l){try{var d="",m=l;do d+=oe(m),m=m.return;while(m);var w=d}catch(k){w=`
|
|
40
|
+
Error generating stack: `+k.message+`
|
|
41
|
+
`+k.stack}return{value:o,source:l,stack:w,digest:null}}function Pg(o,l,d){return{value:o,source:null,stack:d??null,digest:l??null}}function Tg(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var vI=typeof WeakMap=="function"?WeakMap:Map;function wb(o,l,d){d=xi(-1,d),d.tag=3,d.payload={element:null};var m=l.value;return d.callback=function(){dh||(dh=!0,Ug=m),Tg(o,l)},d}function bb(o,l,d){d=xi(-1,d),d.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;d.payload=function(){return m(w)},d.callback=function(){Tg(o,l)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(d.callback=function(){Tg(o,l),typeof m!="function"&&(po===null?po=new Set([this]):po.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})}),d}function Sb(o,l,d){var m=o.pingCache;if(m===null){m=o.pingCache=new vI;var w=new Set;m.set(l,w)}else w=m.get(l),w===void 0&&(w=new Set,m.set(l,w));w.has(d)||(w.add(d),o=MI.bind(null,o,l,d),l.then(o,o))}function Eb(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function kb(o,l,d,m,w){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=xi(-1,1),l.tag=2,fo(d,l,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=w,o)}var yI=T.ReactCurrentOwner,hr=!1;function tr(o,l,d,m){l.child=o===null?Ww(l,null,d,m):Al(l,o.child,d,m)}function Cb(o,l,d,m,w){d=d.render;var k=l.ref;return Il(l,w),m=_g(o,l,d,m,k,w),d=xg(),o!==null&&!hr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,wi(o,l,w)):(Ft&&d&&ng(l),l.flags|=1,tr(o,l,m,w),l.child)}function Pb(o,l,d,m,w){if(o===null){var k=d.type;return typeof k=="function"&&!Yg(k)&&k.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=k,Tb(o,l,k,m,w)):(o=vh(d.type,null,m,l,l.mode,w),o.ref=l.ref,o.return=l,l.child=o)}if(k=o.child,(o.lanes&w)===0){var M=k.memoizedProps;if(d=d.compare,d=d!==null?d:pc,d(M,m)&&o.ref===l.ref)return wi(o,l,w)}return l.flags|=1,o=yo(k,m),o.ref=l.ref,o.return=l,l.child=o}function Tb(o,l,d,m,w){if(o!==null){var k=o.memoizedProps;if(pc(k,m)&&o.ref===l.ref)if(hr=!1,l.pendingProps=m=k,(o.lanes&w)!==0)(o.flags&131072)!==0&&(hr=!0);else return l.lanes=o.lanes,wi(o,l,w)}return Rg(o,l,d,m,w)}function Rb(o,l,d){var m=l.pendingProps,w=m.children,k=o!==null?o.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Dl,Lr),Lr|=d;else{if((d&1073741824)===0)return o=k!==null?k.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Tt(Dl,Lr),Lr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=k!==null?k.baseLanes:d,Tt(Dl,Lr),Lr|=m}else k!==null?(m=k.baseLanes|d,l.memoizedState=null):m=d,Tt(Dl,Lr),Lr|=m;return tr(o,l,w,d),l.child}function Ab(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Rg(o,l,d,m,w){var k=fr(d)?ca:Un.current;return k=Cl(l,k),Il(l,w),d=_g(o,l,d,m,k,w),m=xg(),o!==null&&!hr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,wi(o,l,w)):(Ft&&m&&ng(l),l.flags|=1,tr(o,l,d,w),l.child)}function Mb(o,l,d,m,w){if(fr(d)){var k=!0;zf(l)}else k=!1;if(Il(l,w),l.stateNode===null)oh(o,l),_b(l,d,m),Cg(l,d,m,w),m=!0;else if(o===null){var M=l.stateNode,j=l.memoizedProps;M.props=j;var U=M.context,re=d.contextType;typeof re=="object"&&re!==null?re=Jr(re):(re=fr(d)?ca:Un.current,re=Cl(l,re));var de=d.getDerivedStateFromProps,pe=typeof de=="function"||typeof M.getSnapshotBeforeUpdate=="function";pe||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(j!==m||U!==re)&&xb(l,M,m,re),co=!1;var ce=l.memoizedState;M.state=ce,Xf(l,m,M,w),U=l.memoizedState,j!==m||ce!==U||dr.current||co?(typeof de=="function"&&(kg(l,d,de,m),U=l.memoizedState),(j=co||yb(l,d,j,m,ce,U,re))?(pe||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(l.flags|=4194308)):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=U),M.props=m,M.state=U,M.context=re,m=j):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{M=l.stateNode,Kw(o,l),j=l.memoizedProps,re=l.type===l.elementType?j:vs(l.type,j),M.props=re,pe=l.pendingProps,ce=M.context,U=d.contextType,typeof U=="object"&&U!==null?U=Jr(U):(U=fr(d)?ca:Un.current,U=Cl(l,U));var Pe=d.getDerivedStateFromProps;(de=typeof Pe=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(j!==pe||ce!==U)&&xb(l,M,m,U),co=!1,ce=l.memoizedState,M.state=ce,Xf(l,m,M,w);var Le=l.memoizedState;j!==pe||ce!==Le||dr.current||co?(typeof Pe=="function"&&(kg(l,d,Pe,m),Le=l.memoizedState),(re=co||yb(l,d,re,m,ce,Le,U)||!1)?(de||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(m,Le,U),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(m,Le,U)),typeof M.componentDidUpdate=="function"&&(l.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof M.componentDidUpdate!="function"||j===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||j===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=Le),M.props=m,M.state=Le,M.context=U,m=re):(typeof M.componentDidUpdate!="function"||j===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||j===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),m=!1)}return Ag(o,l,d,m,k,w)}function Ag(o,l,d,m,w,k){Ab(o,l);var M=(l.flags&128)!==0;if(!m&&!M)return w&&Dw(l,d,!1),wi(o,l,k);m=l.stateNode,yI.current=l;var j=M&&typeof d.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,o!==null&&M?(l.child=Al(l,o.child,null,k),l.child=Al(l,null,j,k)):tr(o,l,j,k),l.memoizedState=m.state,w&&Dw(l,d,!0),l.child}function Ib(o){var l=o.stateNode;l.pendingContext?Ow(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Ow(o,l.context,!1),hg(o,l.containerInfo)}function Nb(o,l,d,m,w){return Rl(),og(w),l.flags|=256,tr(o,l,d,m),l.child}var Mg={dehydrated:null,treeContext:null,retryLane:0};function Ig(o){return{baseLanes:o,cachePool:null,transitions:null}}function Ob(o,l,d){var m=l.pendingProps,w=Wt.current,k=!1,M=(l.flags&128)!==0,j;if((j=M)||(j=o!==null&&o.memoizedState===null?!1:(w&2)!==0),j?(k=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(w|=1),Tt(Wt,w&1),o===null)return ig(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(M=m.children,o=m.fallback,k?(m=l.mode,k=l.child,M={mode:"hidden",children:M},(m&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=M):k=yh(M,m,0,null),o=xa(o,m,d,null),k.return=l,o.return=l,k.sibling=o,l.child=k,l.child.memoizedState=Ig(d),l.memoizedState=Mg,o):Ng(l,M));if(w=o.memoizedState,w!==null&&(j=w.dehydrated,j!==null))return _I(o,l,M,m,j,w,d);if(k){k=m.fallback,M=l.mode,w=o.child,j=w.sibling;var U={mode:"hidden",children:m.children};return(M&1)===0&&l.child!==w?(m=l.child,m.childLanes=0,m.pendingProps=U,l.deletions=null):(m=yo(w,U),m.subtreeFlags=w.subtreeFlags&14680064),j!==null?k=yo(j,k):(k=xa(k,M,d,null),k.flags|=2),k.return=l,m.return=l,m.sibling=k,l.child=m,m=k,k=l.child,M=o.child.memoizedState,M=M===null?Ig(d):{baseLanes:M.baseLanes|d,cachePool:null,transitions:M.transitions},k.memoizedState=M,k.childLanes=o.childLanes&~d,l.memoizedState=Mg,m}return k=o.child,o=k.sibling,m=yo(k,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=d),m.return=l,m.sibling=null,o!==null&&(d=l.deletions,d===null?(l.deletions=[o],l.flags|=16):d.push(o)),l.child=m,l.memoizedState=null,m}function Ng(o,l){return l=yh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function ih(o,l,d,m){return m!==null&&og(m),Al(l,o.child,null,d),o=Ng(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function _I(o,l,d,m,w,k,M){if(d)return l.flags&256?(l.flags&=-257,m=Pg(Error(n(422))),ih(o,l,M,m)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(k=m.fallback,w=l.mode,m=yh({mode:"visible",children:m.children},w,0,null),k=xa(k,w,M,null),k.flags|=2,m.return=l,k.return=l,m.sibling=k,l.child=m,(l.mode&1)!==0&&Al(l,o.child,null,M),l.child.memoizedState=Ig(M),l.memoizedState=Mg,k);if((l.mode&1)===0)return ih(o,l,M,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var j=m.dgst;return m=j,k=Error(n(419)),m=Pg(k,m,void 0),ih(o,l,M,m)}if(j=(M&o.childLanes)!==0,hr||j){if(m=kn,m!==null){switch(M&-M){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|M))!==0?0:w,w!==0&&w!==k.retryLane&&(k.retryLane=w,_i(o,w),xs(m,o,w,-1))}return Zg(),m=Pg(Error(n(421))),ih(o,l,M,m)}return w.data==="$?"?(l.flags|=128,l.child=o.child,l=II.bind(null,o),w._reactRetry=l,null):(o=k.treeContext,Or=oo(w.nextSibling),Nr=l,Ft=!0,gs=null,o!==null&&(Xr[Qr++]=vi,Xr[Qr++]=yi,Xr[Qr++]=da,vi=o.id,yi=o.overflow,da=l),l=Ng(l,m.children),l.flags|=4096,l)}function Lb(o,l,d){o.lanes|=l;var m=o.alternate;m!==null&&(m.lanes|=l),cg(o.return,l,d)}function Og(o,l,d,m,w){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:w}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=d,k.tailMode=w)}function Db(o,l,d){var m=l.pendingProps,w=m.revealOrder,k=m.tail;if(tr(o,l,m.children,d),m=Wt.current,(m&2)!==0)m=m&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Lb(o,d,l);else if(o.tag===19)Lb(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}if(Tt(Wt,m),(l.mode&1)===0)l.memoizedState=null;else switch(w){case"forwards":for(d=l.child,w=null;d!==null;)o=d.alternate,o!==null&&Qf(o)===null&&(w=d),d=d.sibling;d=w,d===null?(w=l.child,l.child=null):(w=d.sibling,d.sibling=null),Og(l,!1,w,d,k);break;case"backwards":for(d=null,w=l.child,l.child=null;w!==null;){if(o=w.alternate,o!==null&&Qf(o)===null){l.child=w;break}o=w.sibling,w.sibling=d,d=w,w=o}Og(l,!0,d,null,k);break;case"together":Og(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function oh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function wi(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),ga|=l.lanes,(d&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,d=yo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=yo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function xI(o,l,d){switch(l.tag){case 3:Ib(l),Rl();break;case 5:Yw(l);break;case 1:fr(l.type)&&zf(l);break;case 4:hg(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,w=l.memoizedProps.value;Tt(qf,m._currentValue),m._currentValue=w;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(Tt(Wt,Wt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?Ob(o,l,d):(Tt(Wt,Wt.current&1),o=wi(o,l,d),o!==null?o.sibling:null);Tt(Wt,Wt.current&1);break;case 19:if(m=(d&l.childLanes)!==0,(o.flags&128)!==0){if(m)return Db(o,l,d);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Tt(Wt,Wt.current),m)break;return null;case 22:case 23:return l.lanes=0,Rb(o,l,d)}return wi(o,l,d)}var Fb,Lg,jb,Vb;Fb=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Lg=function(){},jb=function(o,l,d,m){var w=o.memoizedProps;if(w!==m){o=l.stateNode,pa(Vs.current);var k=null;switch(d){case"input":w=it(o,w),m=it(o,m),k=[];break;case"select":w=H({},w,{value:void 0}),m=H({},m,{value:void 0}),k=[];break;case"textarea":w=Je(o,w),m=Je(o,m),k=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(o.onclick=Vf)}hs(d,m);var M;d=null;for(re in w)if(!m.hasOwnProperty(re)&&w.hasOwnProperty(re)&&w[re]!=null)if(re==="style"){var j=w[re];for(M in j)j.hasOwnProperty(M)&&(d||(d={}),d[M]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?k||(k=[]):(k=k||[]).push(re,null));for(re in m){var U=m[re];if(j=w!=null?w[re]:void 0,m.hasOwnProperty(re)&&U!==j&&(U!=null||j!=null))if(re==="style")if(j){for(M in j)!j.hasOwnProperty(M)||U&&U.hasOwnProperty(M)||(d||(d={}),d[M]="");for(M in U)U.hasOwnProperty(M)&&j[M]!==U[M]&&(d||(d={}),d[M]=U[M])}else d||(k||(k=[]),k.push(re,d)),d=U;else re==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,j=j?j.__html:void 0,U!=null&&j!==U&&(k=k||[]).push(re,U)):re==="children"?typeof U!="string"&&typeof U!="number"||(k=k||[]).push(re,""+U):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(U!=null&&re==="onScroll"&&It("scroll",o),k||j===U||(k=[])):(k=k||[]).push(re,U))}d&&(k=k||[]).push("style",d);var re=k;(l.updateQueue=re)&&(l.flags|=4)}},Vb=function(o,l,d,m){d!==m&&(l.flags|=4)};function Rc(o,l){if(!Ft)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function Wn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,m=0;if(l)for(var w=o.child;w!==null;)d|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)d|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=m,o.childLanes=d,l}function wI(o,l,d){var m=l.pendingProps;switch(rg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(l),null;case 1:return fr(l.type)&&Hf(),Wn(l),null;case 3:return m=l.stateNode,Nl(),Nt(dr),Nt(Un),gg(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(Gf(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,gs!==null&&(Gg(gs),gs=null))),Lg(o,l),Wn(l),null;case 5:pg(l);var w=pa(Ec.current);if(d=l.type,o!==null&&l.stateNode!=null)jb(o,l,d,m,w),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(n(166));return Wn(l),null}if(o=pa(Vs.current),Gf(l)){m=l.stateNode,d=l.type;var k=l.memoizedProps;switch(m[js]=l,m[_c]=k,o=(l.mode&1)!==0,d){case"dialog":It("cancel",m),It("close",m);break;case"iframe":case"object":case"embed":It("load",m);break;case"video":case"audio":for(w=0;w<gc.length;w++)It(gc[w],m);break;case"source":It("error",m);break;case"img":case"image":case"link":It("error",m),It("load",m);break;case"details":It("toggle",m);break;case"input":Oe(m,k),It("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!k.multiple},It("invalid",m);break;case"textarea":vt(m,k),It("invalid",m)}hs(d,k),w=null;for(var M in k)if(k.hasOwnProperty(M)){var j=k[M];M==="children"?typeof j=="string"?m.textContent!==j&&(k.suppressHydrationWarning!==!0&&jf(m.textContent,j,o),w=["children",j]):typeof j=="number"&&m.textContent!==""+j&&(k.suppressHydrationWarning!==!0&&jf(m.textContent,j,o),w=["children",""+j]):s.hasOwnProperty(M)&&j!=null&&M==="onScroll"&&It("scroll",m)}switch(d){case"input":Se(m),mt(m,k,!0);break;case"textarea":Se(m),zt(m);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(m.onclick=Vf)}m=w,l.updateQueue=m,m!==null&&(l.flags|=4)}else{M=w.nodeType===9?w:w.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Rn(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=M.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof m.is=="string"?o=M.createElement(d,{is:m.is}):(o=M.createElement(d),d==="select"&&(M=o,m.multiple?M.multiple=!0:m.size&&(M.size=m.size))):o=M.createElementNS(o,d),o[js]=l,o[_c]=m,Fb(o,l,!1,!1),l.stateNode=o;e:{switch(M=Ns(d,m),d){case"dialog":It("cancel",o),It("close",o),w=m;break;case"iframe":case"object":case"embed":It("load",o),w=m;break;case"video":case"audio":for(w=0;w<gc.length;w++)It(gc[w],o);w=m;break;case"source":It("error",o),w=m;break;case"img":case"image":case"link":It("error",o),It("load",o),w=m;break;case"details":It("toggle",o),w=m;break;case"input":Oe(o,m),w=it(o,m),It("invalid",o);break;case"option":w=m;break;case"select":o._wrapperState={wasMultiple:!!m.multiple},w=H({},m,{value:void 0}),It("invalid",o);break;case"textarea":vt(o,m),w=Je(o,m),It("invalid",o);break;default:w=m}hs(d,w),j=w;for(k in j)if(j.hasOwnProperty(k)){var U=j[k];k==="style"?di(o,U):k==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Qn(o,U)):k==="children"?typeof U=="string"?(d!=="textarea"||U!=="")&&wn(o,U):typeof U=="number"&&wn(o,""+U):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?U!=null&&k==="onScroll"&&It("scroll",o):U!=null&&P(o,k,U,M))}switch(d){case"input":Se(o),mt(o,m,!1);break;case"textarea":Se(o),zt(o);break;case"option":m.value!=null&&o.setAttribute("value",""+ie(m.value));break;case"select":o.multiple=!!m.multiple,k=m.value,k!=null?lt(o,!!m.multiple,k,!1):m.defaultValue!=null&<(o,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(o.onclick=Vf)}switch(d){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Wn(l),null;case 6:if(o&&l.stateNode!=null)Vb(o,l,o.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(n(166));if(d=pa(Ec.current),pa(Vs.current),Gf(l)){if(m=l.stateNode,d=l.memoizedProps,m[js]=l,(k=m.nodeValue!==d)&&(o=Nr,o!==null))switch(o.tag){case 3:jf(m.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&jf(m.nodeValue,d,(o.mode&1)!==0)}k&&(l.flags|=4)}else m=(d.nodeType===9?d:d.ownerDocument).createTextNode(m),m[js]=l,l.stateNode=m}return Wn(l),null;case 13:if(Nt(Wt),m=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ft&&Or!==null&&(l.mode&1)!==0&&(l.flags&128)===0)zw(),Rl(),l.flags|=98560,k=!1;else if(k=Gf(l),m!==null&&m.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[js]=l}else Rl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Wn(l),k=!1}else gs!==null&&(Gg(gs),gs=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(m=m!==null,m!==(o!==null&&o.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Wt.current&1)!==0?mn===0&&(mn=3):Zg())),l.updateQueue!==null&&(l.flags|=4),Wn(l),null);case 4:return Nl(),Lg(o,l),o===null&&vc(l.stateNode.containerInfo),Wn(l),null;case 10:return ug(l.type._context),Wn(l),null;case 17:return fr(l.type)&&Hf(),Wn(l),null;case 19:if(Nt(Wt),k=l.memoizedState,k===null)return Wn(l),null;if(m=(l.flags&128)!==0,M=k.rendering,M===null)if(m)Rc(k,!1);else{if(mn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(M=Qf(o),M!==null){for(l.flags|=128,Rc(k,!1),m=M.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=d,d=l.child;d!==null;)k=d,o=m,k.flags&=14680066,M=k.alternate,M===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=M.childLanes,k.lanes=M.lanes,k.child=M.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=M.memoizedProps,k.memoizedState=M.memoizedState,k.updateQueue=M.updateQueue,k.type=M.type,o=M.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Tt(Wt,Wt.current&1|2),l.child}o=o.sibling}k.tail!==null&&Bt()>Fl&&(l.flags|=128,m=!0,Rc(k,!1),l.lanes=4194304)}else{if(!m)if(o=Qf(M),o!==null){if(l.flags|=128,m=!0,d=o.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Rc(k,!0),k.tail===null&&k.tailMode==="hidden"&&!M.alternate&&!Ft)return Wn(l),null}else 2*Bt()-k.renderingStartTime>Fl&&d!==1073741824&&(l.flags|=128,m=!0,Rc(k,!1),l.lanes=4194304);k.isBackwards?(M.sibling=l.child,l.child=M):(d=k.last,d!==null?d.sibling=M:l.child=M,k.last=M)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=Bt(),l.sibling=null,d=Wt.current,Tt(Wt,m?d&1|2:d&1),l):(Wn(l),null);case 22:case 23:return qg(),m=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(Lr&1073741824)!==0&&(Wn(l),l.subtreeFlags&6&&(l.flags|=8192)):Wn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function bI(o,l){switch(rg(l),l.tag){case 1:return fr(l.type)&&Hf(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Nl(),Nt(dr),Nt(Un),gg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return pg(l),null;case 13:if(Nt(Wt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Rl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Nt(Wt),null;case 4:return Nl(),null;case 10:return ug(l.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var ah=!1,Gn=!1,SI=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function Ll(o,l){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){Xt(o,l,m)}else d.current=null}function Dg(o,l,d){try{d()}catch(m){Xt(o,l,m)}}var $b=!1;function EI(o,l){if(q0=Pf,o=yw(),$0(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var w=m.anchorOffset,k=m.focusNode;m=m.focusOffset;try{d.nodeType,k.nodeType}catch{d=null;break e}var M=0,j=-1,U=-1,re=0,de=0,pe=o,ce=null;t:for(;;){for(var Pe;pe!==d||w!==0&&pe.nodeType!==3||(j=M+w),pe!==k||m!==0&&pe.nodeType!==3||(U=M+m),pe.nodeType===3&&(M+=pe.nodeValue.length),(Pe=pe.firstChild)!==null;)ce=pe,pe=Pe;for(;;){if(pe===o)break t;if(ce===d&&++re===w&&(j=M),ce===k&&++de===m&&(U=M),(Pe=pe.nextSibling)!==null)break;pe=ce,ce=pe.parentNode}pe=Pe}d=j===-1||U===-1?null:{start:j,end:U}}else d=null}d=d||{start:0,end:0}}else d=null;for(Z0={focusedElem:o,selectionRange:d},Pf=!1,Ie=l;Ie!==null;)if(l=Ie,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ie=o;else for(;Ie!==null;){l=Ie;try{var Le=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var je=Le.memoizedProps,sn=Le.memoizedState,Q=l.stateNode,K=Q.getSnapshotBeforeUpdate(l.elementType===l.type?je:vs(l.type,je),sn);Q.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var J=l.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ye){Xt(l,l.return,ye)}if(o=l.sibling,o!==null){o.return=l.return,Ie=o;break}Ie=l.return}return Le=$b,$b=!1,Le}function Ac(o,l,d){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&o)===o){var k=w.destroy;w.destroy=void 0,k!==void 0&&Dg(l,d,k)}w=w.next}while(w!==m)}}function lh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var m=d.create;d.destroy=m()}d=d.next}while(d!==l)}}function Fg(o){var l=o.ref;if(l!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof l=="function"?l(o):l.current=o}}function Hb(o){var l=o.alternate;l!==null&&(o.alternate=null,Hb(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[js],delete l[_c],delete l[J0],delete l[oI],delete l[aI])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function zb(o){return o.tag===5||o.tag===3||o.tag===4}function Ub(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||zb(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function jg(o,l,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(o,l):d.insertBefore(o,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(o,d)):(l=d,l.appendChild(o)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Vf));else if(m!==4&&(o=o.child,o!==null))for(jg(o,l,d),o=o.sibling;o!==null;)jg(o,l,d),o=o.sibling}function Vg(o,l,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(m!==4&&(o=o.child,o!==null))for(Vg(o,l,d),o=o.sibling;o!==null;)Vg(o,l,d),o=o.sibling}var Nn=null,ys=!1;function ho(o,l,d){for(d=d.child;d!==null;)Bb(o,l,d),d=d.sibling}function Bb(o,l,d){if(z&&typeof z.onCommitFiberUnmount=="function")try{z.onCommitFiberUnmount(la,d)}catch{}switch(d.tag){case 5:Gn||Ll(d,l);case 6:var m=Nn,w=ys;Nn=null,ho(o,l,d),Nn=m,ys=w,Nn!==null&&(ys?(o=Nn,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):Nn.removeChild(d.stateNode));break;case 18:Nn!==null&&(ys?(o=Nn,d=d.stateNode,o.nodeType===8?Q0(o.parentNode,d):o.nodeType===1&&Q0(o,d),lc(o)):Q0(Nn,d.stateNode));break;case 4:m=Nn,w=ys,Nn=d.stateNode.containerInfo,ys=!0,ho(o,l,d),Nn=m,ys=w;break;case 0:case 11:case 14:case 15:if(!Gn&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var k=w,M=k.destroy;k=k.tag,M!==void 0&&((k&2)!==0||(k&4)!==0)&&Dg(d,l,M),w=w.next}while(w!==m)}ho(o,l,d);break;case 1:if(!Gn&&(Ll(d,l),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(j){Xt(d,l,j)}ho(o,l,d);break;case 21:ho(o,l,d);break;case 22:d.mode&1?(Gn=(m=Gn)||d.memoizedState!==null,ho(o,l,d),Gn=m):ho(o,l,d);break;default:ho(o,l,d)}}function Wb(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new SI),l.forEach(function(m){var w=NI.bind(null,o,m);d.has(m)||(d.add(m),m.then(w,w))})}}function _s(o,l){var d=l.deletions;if(d!==null)for(var m=0;m<d.length;m++){var w=d[m];try{var k=o,M=l,j=M;e:for(;j!==null;){switch(j.tag){case 5:Nn=j.stateNode,ys=!1;break e;case 3:Nn=j.stateNode.containerInfo,ys=!0;break e;case 4:Nn=j.stateNode.containerInfo,ys=!0;break e}j=j.return}if(Nn===null)throw Error(n(160));Bb(k,M,w),Nn=null,ys=!1;var U=w.alternate;U!==null&&(U.return=null),w.return=null}catch(re){Xt(w,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)Gb(l,o),l=l.sibling}function Gb(o,l){var d=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(_s(l,o),Hs(o),m&4){try{Ac(3,o,o.return),lh(3,o)}catch(je){Xt(o,o.return,je)}try{Ac(5,o,o.return)}catch(je){Xt(o,o.return,je)}}break;case 1:_s(l,o),Hs(o),m&512&&d!==null&&Ll(d,d.return);break;case 5:if(_s(l,o),Hs(o),m&512&&d!==null&&Ll(d,d.return),o.flags&32){var w=o.stateNode;try{wn(w,"")}catch(je){Xt(o,o.return,je)}}if(m&4&&(w=o.stateNode,w!=null)){var k=o.memoizedProps,M=d!==null?d.memoizedProps:k,j=o.type,U=o.updateQueue;if(o.updateQueue=null,U!==null)try{j==="input"&&k.type==="radio"&&k.name!=null&&at(w,k),Ns(j,M);var re=Ns(j,k);for(M=0;M<U.length;M+=2){var de=U[M],pe=U[M+1];de==="style"?di(w,pe):de==="dangerouslySetInnerHTML"?Qn(w,pe):de==="children"?wn(w,pe):P(w,de,pe,re)}switch(j){case"input":Mt(w,k);break;case"textarea":xn(w,k);break;case"select":var ce=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!k.multiple;var Pe=k.value;Pe!=null?lt(w,!!k.multiple,Pe,!1):ce!==!!k.multiple&&(k.defaultValue!=null?lt(w,!!k.multiple,k.defaultValue,!0):lt(w,!!k.multiple,k.multiple?[]:"",!1))}w[_c]=k}catch(je){Xt(o,o.return,je)}}break;case 6:if(_s(l,o),Hs(o),m&4){if(o.stateNode===null)throw Error(n(162));w=o.stateNode,k=o.memoizedProps;try{w.nodeValue=k}catch(je){Xt(o,o.return,je)}}break;case 3:if(_s(l,o),Hs(o),m&4&&d!==null&&d.memoizedState.isDehydrated)try{lc(l.containerInfo)}catch(je){Xt(o,o.return,je)}break;case 4:_s(l,o),Hs(o);break;case 13:_s(l,o),Hs(o),w=o.child,w.flags&8192&&(k=w.memoizedState!==null,w.stateNode.isHidden=k,!k||w.alternate!==null&&w.alternate.memoizedState!==null||(zg=Bt())),m&4&&Wb(o);break;case 22:if(de=d!==null&&d.memoizedState!==null,o.mode&1?(Gn=(re=Gn)||de,_s(l,o),Gn=re):_s(l,o),Hs(o),m&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!de&&(o.mode&1)!==0)for(Ie=o,de=o.child;de!==null;){for(pe=Ie=de;Ie!==null;){switch(ce=Ie,Pe=ce.child,ce.tag){case 0:case 11:case 14:case 15:Ac(4,ce,ce.return);break;case 1:Ll(ce,ce.return);var Le=ce.stateNode;if(typeof Le.componentWillUnmount=="function"){m=ce,d=ce.return;try{l=m,Le.props=l.memoizedProps,Le.state=l.memoizedState,Le.componentWillUnmount()}catch(je){Xt(m,d,je)}}break;case 5:Ll(ce,ce.return);break;case 22:if(ce.memoizedState!==null){Zb(pe);continue}}Pe!==null?(Pe.return=ce,Ie=Pe):Zb(pe)}de=de.sibling}e:for(de=null,pe=o;;){if(pe.tag===5){if(de===null){de=pe;try{w=pe.stateNode,re?(k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(j=pe.stateNode,U=pe.memoizedProps.style,M=U!=null&&U.hasOwnProperty("display")?U.display:null,j.style.display=An("display",M))}catch(je){Xt(o,o.return,je)}}}else if(pe.tag===6){if(de===null)try{pe.stateNode.nodeValue=re?"":pe.memoizedProps}catch(je){Xt(o,o.return,je)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===o)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===o)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===o)break e;de===pe&&(de=null),pe=pe.return}de===pe&&(de=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:_s(l,o),Hs(o),m&4&&Wb(o);break;case 21:break;default:_s(l,o),Hs(o)}}function Hs(o){var l=o.flags;if(l&2){try{e:{for(var d=o.return;d!==null;){if(zb(d)){var m=d;break e}d=d.return}throw Error(n(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(wn(w,""),m.flags&=-33);var k=Ub(o);Vg(o,k,w);break;case 3:case 4:var M=m.stateNode.containerInfo,j=Ub(o);jg(o,j,M);break;default:throw Error(n(161))}}catch(U){Xt(o,o.return,U)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function kI(o,l,d){Ie=o,Kb(o)}function Kb(o,l,d){for(var m=(o.mode&1)!==0;Ie!==null;){var w=Ie,k=w.child;if(w.tag===22&&m){var M=w.memoizedState!==null||ah;if(!M){var j=w.alternate,U=j!==null&&j.memoizedState!==null||Gn;j=ah;var re=Gn;if(ah=M,(Gn=U)&&!re)for(Ie=w;Ie!==null;)M=Ie,U=M.child,M.tag===22&&M.memoizedState!==null?Yb(w):U!==null?(U.return=M,Ie=U):Yb(w);for(;k!==null;)Ie=k,Kb(k),k=k.sibling;Ie=w,ah=j,Gn=re}qb(o)}else(w.subtreeFlags&8772)!==0&&k!==null?(k.return=w,Ie=k):qb(o)}}function qb(o){for(;Ie!==null;){var l=Ie;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Gn||lh(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!Gn)if(d===null)m.componentDidMount();else{var w=l.elementType===l.type?d.memoizedProps:vs(l.type,d.memoizedProps);m.componentDidUpdate(w,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&Zw(l,k,m);break;case 3:var M=l.updateQueue;if(M!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}Zw(l,M,d)}break;case 5:var j=l.stateNode;if(d===null&&l.flags&4){d=j;var U=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&d.focus();break;case"img":U.src&&(d.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var de=re.memoizedState;if(de!==null){var pe=de.dehydrated;pe!==null&&lc(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gn||l.flags&512&&Fg(l)}catch(ce){Xt(l,l.return,ce)}}if(l===o){Ie=null;break}if(d=l.sibling,d!==null){d.return=l.return,Ie=d;break}Ie=l.return}}function Zb(o){for(;Ie!==null;){var l=Ie;if(l===o){Ie=null;break}var d=l.sibling;if(d!==null){d.return=l.return,Ie=d;break}Ie=l.return}}function Yb(o){for(;Ie!==null;){var l=Ie;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{lh(4,l)}catch(U){Xt(l,d,U)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var w=l.return;try{m.componentDidMount()}catch(U){Xt(l,w,U)}}var k=l.return;try{Fg(l)}catch(U){Xt(l,k,U)}break;case 5:var M=l.return;try{Fg(l)}catch(U){Xt(l,M,U)}}}catch(U){Xt(l,l.return,U)}if(l===o){Ie=null;break}var j=l.sibling;if(j!==null){j.return=l.return,Ie=j;break}Ie=l.return}}var CI=Math.ceil,uh=T.ReactCurrentDispatcher,$g=T.ReactCurrentOwner,ts=T.ReactCurrentBatchConfig,dt=0,kn=null,ln=null,On=0,Lr=0,Dl=ao(0),mn=0,Mc=null,ga=0,ch=0,Hg=0,Ic=null,pr=null,zg=0,Fl=1/0,bi=null,dh=!1,Ug=null,po=null,fh=!1,mo=null,hh=0,Nc=0,Bg=null,ph=-1,mh=0;function nr(){return(dt&6)!==0?Bt():ph!==-1?ph:ph=Bt()}function go(o){return(o.mode&1)===0?1:(dt&2)!==0&&On!==0?On&-On:uI.transition!==null?(mh===0&&(mh=Sn()),mh):(o=gt,o!==0||(o=window.event,o=o===void 0?16:Qx(o.type)),o)}function xs(o,l,d,m){if(50<Nc)throw Nc=0,Bg=null,Error(n(185));Mr(o,d,m),((dt&2)===0||o!==kn)&&(o===kn&&((dt&2)===0&&(ch|=d),mn===4&&vo(o,On)),mr(o,m),d===1&&dt===0&&(l.mode&1)===0&&(Fl=Bt()+500,Uf&&uo()))}function mr(o,l){var d=o.callbackNode;Fs(o,l);var m=In(o,o===kn?On:0);if(m===0)d!==null&&Qi(d),o.callbackNode=null,o.callbackPriority=0;else if(l=m&-m,o.callbackPriority!==l){if(d!=null&&Qi(d),l===1)o.tag===0?lI(Qb.bind(null,o)):Fw(Qb.bind(null,o)),sI(function(){(dt&6)===0&&uo()}),d=null;else{switch(Bx(m)){case 1:d=Ji;break;case 4:d=gl;break;case 16:d=aa;break;case 536870912:d=rc;break;default:d=aa}d=oS(d,Xb.bind(null,o))}o.callbackPriority=l,o.callbackNode=d}}function Xb(o,l){if(ph=-1,mh=0,(dt&6)!==0)throw Error(n(327));var d=o.callbackNode;if(jl()&&o.callbackNode!==d)return null;var m=In(o,o===kn?On:0);if(m===0)return null;if((m&30)!==0||(m&o.expiredLanes)!==0||l)l=gh(o,m);else{l=m;var w=dt;dt|=2;var k=eS();(kn!==o||On!==l)&&(bi=null,Fl=Bt()+500,ya(o,l));do try{RI();break}catch(j){Jb(o,j)}while(!0);lg(),uh.current=k,dt=w,ln!==null?l=0:(kn=null,On=0,l=mn)}if(l!==0){if(l===2&&(w=Zr(o),w!==0&&(m=w,l=Wg(o,w))),l===1)throw d=Mc,ya(o,0),vo(o,m),mr(o,Bt()),d;if(l===6)vo(o,m);else{if(w=o.current.alternate,(m&30)===0&&!PI(w)&&(l=gh(o,m),l===2&&(k=Zr(o),k!==0&&(m=k,l=Wg(o,k))),l===1))throw d=Mc,ya(o,0),vo(o,m),mr(o,Bt()),d;switch(o.finishedWork=w,o.finishedLanes=m,l){case 0:case 1:throw Error(n(345));case 2:_a(o,pr,bi);break;case 3:if(vo(o,m),(m&130023424)===m&&(l=zg+500-Bt(),10<l)){if(In(o,0)!==0)break;if(w=o.suspendedLanes,(w&m)!==m){nr(),o.pingedLanes|=o.suspendedLanes&w;break}o.timeoutHandle=X0(_a.bind(null,o,pr,bi),l);break}_a(o,pr,bi);break;case 4:if(vo(o,m),(m&4194240)===m)break;for(l=o.eventTimes,w=-1;0<m;){var M=31-we(m);k=1<<M,M=l[M],M>w&&(w=M),m&=~k}if(m=w,m=Bt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*CI(m/1960))-m,10<m){o.timeoutHandle=X0(_a.bind(null,o,pr,bi),m);break}_a(o,pr,bi);break;case 5:_a(o,pr,bi);break;default:throw Error(n(329))}}}return mr(o,Bt()),o.callbackNode===d?Xb.bind(null,o):null}function Wg(o,l){var d=Ic;return o.current.memoizedState.isDehydrated&&(ya(o,l).flags|=256),o=gh(o,l),o!==2&&(l=pr,pr=d,l!==null&&Gg(l)),o}function Gg(o){pr===null?pr=o:pr.push.apply(pr,o)}function PI(o){for(var l=o;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var m=0;m<d.length;m++){var w=d[m],k=w.getSnapshot;w=w.value;try{if(!ms(k(),w))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function vo(o,l){for(l&=~Hg,l&=~ch,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-we(l),m=1<<d;o[d]=-1,l&=~m}}function Qb(o){if((dt&6)!==0)throw Error(n(327));jl();var l=In(o,0);if((l&1)===0)return mr(o,Bt()),null;var d=gh(o,l);if(o.tag!==0&&d===2){var m=Zr(o);m!==0&&(l=m,d=Wg(o,m))}if(d===1)throw d=Mc,ya(o,0),vo(o,l),mr(o,Bt()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,_a(o,pr,bi),mr(o,Bt()),null}function Kg(o,l){var d=dt;dt|=1;try{return o(l)}finally{dt=d,dt===0&&(Fl=Bt()+500,Uf&&uo())}}function va(o){mo!==null&&mo.tag===0&&(dt&6)===0&&jl();var l=dt;dt|=1;var d=ts.transition,m=gt;try{if(ts.transition=null,gt=1,o)return o()}finally{gt=m,ts.transition=d,dt=l,(dt&6)===0&&uo()}}function qg(){Lr=Dl.current,Nt(Dl)}function ya(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,rI(d)),ln!==null)for(d=ln.return;d!==null;){var m=d;switch(rg(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Hf();break;case 3:Nl(),Nt(dr),Nt(Un),gg();break;case 5:pg(m);break;case 4:Nl();break;case 13:Nt(Wt);break;case 19:Nt(Wt);break;case 10:ug(m.type._context);break;case 22:case 23:qg()}d=d.return}if(kn=o,ln=o=yo(o.current,null),On=Lr=l,mn=0,Mc=null,Hg=ch=ga=0,pr=Ic=null,ha!==null){for(l=0;l<ha.length;l++)if(d=ha[l],m=d.interleaved,m!==null){d.interleaved=null;var w=m.next,k=d.pending;if(k!==null){var M=k.next;k.next=w,m.next=M}d.pending=m}ha=null}return o}function Jb(o,l){do{var d=ln;try{if(lg(),Jf.current=rh,eh){for(var m=Gt.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}eh=!1}if(ma=0,En=pn=Gt=null,kc=!1,Cc=0,$g.current=null,d===null||d.return===null){mn=1,Mc=l,ln=null;break}e:{var k=o,M=d.return,j=d,U=l;if(l=On,j.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=U,de=j,pe=de.tag;if((de.mode&1)===0&&(pe===0||pe===11||pe===15)){var ce=de.alternate;ce?(de.updateQueue=ce.updateQueue,de.memoizedState=ce.memoizedState,de.lanes=ce.lanes):(de.updateQueue=null,de.memoizedState=null)}var Pe=Eb(M);if(Pe!==null){Pe.flags&=-257,kb(Pe,M,j,k,l),Pe.mode&1&&Sb(k,re,l),l=Pe,U=re;var Le=l.updateQueue;if(Le===null){var je=new Set;je.add(U),l.updateQueue=je}else Le.add(U);break e}else{if((l&1)===0){Sb(k,re,l),Zg();break e}U=Error(n(426))}}else if(Ft&&j.mode&1){var sn=Eb(M);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),kb(sn,M,j,k,l),og(Ol(U,j));break e}}k=U=Ol(U,j),mn!==4&&(mn=2),Ic===null?Ic=[k]:Ic.push(k),k=M;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var Q=wb(k,U,l);qw(k,Q);break e;case 1:j=U;var K=k.type,J=k.stateNode;if((k.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(po===null||!po.has(J)))){k.flags|=65536,l&=-l,k.lanes|=l;var ye=bb(k,j,l);qw(k,ye);break e}}k=k.return}while(k!==null)}nS(d)}catch(Ve){l=Ve,ln===d&&d!==null&&(ln=d=d.return);continue}break}while(!0)}function eS(){var o=uh.current;return uh.current=rh,o===null?rh:o}function Zg(){(mn===0||mn===3||mn===2)&&(mn=4),kn===null||(ga&268435455)===0&&(ch&268435455)===0||vo(kn,On)}function gh(o,l){var d=dt;dt|=2;var m=eS();(kn!==o||On!==l)&&(bi=null,ya(o,l));do try{TI();break}catch(w){Jb(o,w)}while(!0);if(lg(),dt=d,uh.current=m,ln!==null)throw Error(n(261));return kn=null,On=0,mn}function TI(){for(;ln!==null;)tS(ln)}function RI(){for(;ln!==null&&!bf();)tS(ln)}function tS(o){var l=iS(o.alternate,o,Lr);o.memoizedProps=o.pendingProps,l===null?nS(o):ln=l,$g.current=null}function nS(o){var l=o;do{var d=l.alternate;if(o=l.return,(l.flags&32768)===0){if(d=wI(d,l,Lr),d!==null){ln=d;return}}else{if(d=bI(d,l),d!==null){d.flags&=32767,ln=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{mn=6,ln=null;return}}if(l=l.sibling,l!==null){ln=l;return}ln=l=o}while(l!==null);mn===0&&(mn=5)}function _a(o,l,d){var m=gt,w=ts.transition;try{ts.transition=null,gt=1,AI(o,l,d,m)}finally{ts.transition=w,gt=m}return null}function AI(o,l,d,m){do jl();while(mo!==null);if((dt&6)!==0)throw Error(n(327));d=o.finishedWork;var w=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=d.lanes|d.childLanes;if(cM(o,k),o===kn&&(ln=kn=null,On=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||fh||(fh=!0,oS(aa,function(){return jl(),null})),k=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||k){k=ts.transition,ts.transition=null;var M=gt;gt=1;var j=dt;dt|=4,$g.current=null,EI(o,d),Gb(d,o),YM(Z0),Pf=!!q0,Z0=q0=null,o.current=d,kI(d),nc(),dt=j,gt=M,ts.transition=k}else o.current=d;if(fh&&(fh=!1,mo=o,hh=w),k=o.pendingLanes,k===0&&(po=null),le(d.stateNode),mr(o,Bt()),l!==null)for(m=o.onRecoverableError,d=0;d<l.length;d++)w=l[d],m(w.value,{componentStack:w.stack,digest:w.digest});if(dh)throw dh=!1,o=Ug,Ug=null,o;return(hh&1)!==0&&o.tag!==0&&jl(),k=o.pendingLanes,(k&1)!==0?o===Bg?Nc++:(Nc=0,Bg=o):Nc=0,uo(),null}function jl(){if(mo!==null){var o=Bx(hh),l=ts.transition,d=gt;try{if(ts.transition=null,gt=16>o?16:o,mo===null)var m=!1;else{if(o=mo,mo=null,hh=0,(dt&6)!==0)throw Error(n(331));var w=dt;for(dt|=4,Ie=o.current;Ie!==null;){var k=Ie,M=k.child;if((Ie.flags&16)!==0){var j=k.deletions;if(j!==null){for(var U=0;U<j.length;U++){var re=j[U];for(Ie=re;Ie!==null;){var de=Ie;switch(de.tag){case 0:case 11:case 15:Ac(8,de,k)}var pe=de.child;if(pe!==null)pe.return=de,Ie=pe;else for(;Ie!==null;){de=Ie;var ce=de.sibling,Pe=de.return;if(Hb(de),de===re){Ie=null;break}if(ce!==null){ce.return=Pe,Ie=ce;break}Ie=Pe}}}var Le=k.alternate;if(Le!==null){var je=Le.child;if(je!==null){Le.child=null;do{var sn=je.sibling;je.sibling=null,je=sn}while(je!==null)}}Ie=k}}if((k.subtreeFlags&2064)!==0&&M!==null)M.return=k,Ie=M;else e:for(;Ie!==null;){if(k=Ie,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Ac(9,k,k.return)}var Q=k.sibling;if(Q!==null){Q.return=k.return,Ie=Q;break e}Ie=k.return}}var K=o.current;for(Ie=K;Ie!==null;){M=Ie;var J=M.child;if((M.subtreeFlags&2064)!==0&&J!==null)J.return=M,Ie=J;else e:for(M=K;Ie!==null;){if(j=Ie,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:lh(9,j)}}catch(Ve){Xt(j,j.return,Ve)}if(j===M){Ie=null;break e}var ye=j.sibling;if(ye!==null){ye.return=j.return,Ie=ye;break e}Ie=j.return}}if(dt=w,uo(),z&&typeof z.onPostCommitFiberRoot=="function")try{z.onPostCommitFiberRoot(la,o)}catch{}m=!0}return m}finally{gt=d,ts.transition=l}}return!1}function rS(o,l,d){l=Ol(d,l),l=wb(o,l,1),o=fo(o,l,1),l=nr(),o!==null&&(Mr(o,1,l),mr(o,l))}function Xt(o,l,d){if(o.tag===3)rS(o,o,d);else for(;l!==null;){if(l.tag===3){rS(l,o,d);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(po===null||!po.has(m))){o=Ol(d,o),o=bb(l,o,1),l=fo(l,o,1),o=nr(),l!==null&&(Mr(l,1,o),mr(l,o));break}}l=l.return}}function MI(o,l,d){var m=o.pingCache;m!==null&&m.delete(l),l=nr(),o.pingedLanes|=o.suspendedLanes&d,kn===o&&(On&d)===d&&(mn===4||mn===3&&(On&130023424)===On&&500>Bt()-zg?ya(o,0):Hg|=d),mr(o,l)}function sS(o,l){l===0&&((o.mode&1)===0?l=1:(l=ke,ke<<=1,(ke&130023424)===0&&(ke=4194304)));var d=nr();o=_i(o,l),o!==null&&(Mr(o,l,d),mr(o,d))}function II(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),sS(o,d)}function NI(o,l){var d=0;switch(o.tag){case 13:var m=o.stateNode,w=o.memoizedState;w!==null&&(d=w.retryLane);break;case 19:m=o.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(l),sS(o,d)}var iS;iS=function(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps||dr.current)hr=!0;else{if((o.lanes&d)===0&&(l.flags&128)===0)return hr=!1,xI(o,l,d);hr=(o.flags&131072)!==0}else hr=!1,Ft&&(l.flags&1048576)!==0&&jw(l,Wf,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;oh(o,l),o=l.pendingProps;var w=Cl(l,Un.current);Il(l,d),w=_g(null,l,m,o,w,d);var k=xg();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,fr(m)?(k=!0,zf(l)):k=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,fg(l),w.updater=sh,l.stateNode=w,w._reactInternals=l,Cg(l,m,o,d),l=Ag(null,l,m,!0,k,d)):(l.tag=0,Ft&&k&&ng(l),tr(null,l,w,d),l=l.child),l;case 16:m=l.elementType;e:{switch(oh(o,l),o=l.pendingProps,w=m._init,m=w(m._payload),l.type=m,w=l.tag=LI(m),o=vs(m,o),w){case 0:l=Rg(null,l,m,o,d);break e;case 1:l=Mb(null,l,m,o,d);break e;case 11:l=Cb(null,l,m,o,d);break e;case 14:l=Pb(null,l,m,vs(m.type,o),d);break e}throw Error(n(306,m,""))}return l;case 0:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),Rg(o,l,m,w,d);case 1:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),Mb(o,l,m,w,d);case 3:e:{if(Ib(l),o===null)throw Error(n(387));m=l.pendingProps,k=l.memoizedState,w=k.element,Kw(o,l),Xf(l,m,null,d);var M=l.memoizedState;if(m=M.element,k.isDehydrated)if(k={element:m,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){w=Ol(Error(n(423)),l),l=Nb(o,l,m,d,w);break e}else if(m!==w){w=Ol(Error(n(424)),l),l=Nb(o,l,m,d,w);break e}else for(Or=oo(l.stateNode.containerInfo.firstChild),Nr=l,Ft=!0,gs=null,d=Ww(l,null,m,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Rl(),m===w){l=wi(o,l,d);break e}tr(o,l,m,d)}l=l.child}return l;case 5:return Yw(l),o===null&&ig(l),m=l.type,w=l.pendingProps,k=o!==null?o.memoizedProps:null,M=w.children,Y0(m,w)?M=null:k!==null&&Y0(m,k)&&(l.flags|=32),Ab(o,l),tr(o,l,M,d),l.child;case 6:return o===null&&ig(l),null;case 13:return Ob(o,l,d);case 4:return hg(l,l.stateNode.containerInfo),m=l.pendingProps,o===null?l.child=Al(l,null,m,d):tr(o,l,m,d),l.child;case 11:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),Cb(o,l,m,w,d);case 7:return tr(o,l,l.pendingProps,d),l.child;case 8:return tr(o,l,l.pendingProps.children,d),l.child;case 12:return tr(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(m=l.type._context,w=l.pendingProps,k=l.memoizedProps,M=w.value,Tt(qf,m._currentValue),m._currentValue=M,k!==null)if(ms(k.value,M)){if(k.children===w.children&&!dr.current){l=wi(o,l,d);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var j=k.dependencies;if(j!==null){M=k.child;for(var U=j.firstContext;U!==null;){if(U.context===m){if(k.tag===1){U=xi(-1,d&-d),U.tag=2;var re=k.updateQueue;if(re!==null){re=re.shared;var de=re.pending;de===null?U.next=U:(U.next=de.next,de.next=U),re.pending=U}}k.lanes|=d,U=k.alternate,U!==null&&(U.lanes|=d),cg(k.return,d,l),j.lanes|=d;break}U=U.next}}else if(k.tag===10)M=k.type===l.type?null:k.child;else if(k.tag===18){if(M=k.return,M===null)throw Error(n(341));M.lanes|=d,j=M.alternate,j!==null&&(j.lanes|=d),cg(M,d,l),M=k.sibling}else M=k.child;if(M!==null)M.return=k;else for(M=k;M!==null;){if(M===l){M=null;break}if(k=M.sibling,k!==null){k.return=M.return,M=k;break}M=M.return}k=M}tr(o,l,w.children,d),l=l.child}return l;case 9:return w=l.type,m=l.pendingProps.children,Il(l,d),w=Jr(w),m=m(w),l.flags|=1,tr(o,l,m,d),l.child;case 14:return m=l.type,w=vs(m,l.pendingProps),w=vs(m.type,w),Pb(o,l,m,w,d);case 15:return Tb(o,l,l.type,l.pendingProps,d);case 17:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),oh(o,l),l.tag=1,fr(m)?(o=!0,zf(l)):o=!1,Il(l,d),_b(l,m,w),Cg(l,m,w,d),Ag(null,l,m,!0,o,d);case 19:return Db(o,l,d);case 22:return Rb(o,l,d)}throw Error(n(156,l.tag))};function oS(o,l){return tc(o,l)}function OI(o,l,d,m){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ns(o,l,d,m){return new OI(o,l,d,m)}function Yg(o){return o=o.prototype,!(!o||!o.isReactComponent)}function LI(o){if(typeof o=="function")return Yg(o)?1:0;if(o!=null){if(o=o.$$typeof,o===V)return 11;if(o===q)return 14}return 2}function yo(o,l){var d=o.alternate;return d===null?(d=ns(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function vh(o,l,d,m,w,k){var M=2;if(m=o,typeof o=="function")Yg(o)&&(M=1);else if(typeof o=="string")M=5;else e:switch(o){case I:return xa(d.children,w,k,l);case A:M=8,w|=8;break;case N:return o=ns(12,d,l,w|2),o.elementType=N,o.lanes=k,o;case G:return o=ns(13,d,l,w),o.elementType=G,o.lanes=k,o;case X:return o=ns(19,d,l,w),o.elementType=X,o.lanes=k,o;case Y:return yh(d,w,k,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case L:M=10;break e;case F:M=9;break e;case V:M=11;break e;case q:M=14;break e;case B:M=16,m=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ns(M,d,l,w),l.elementType=o,l.type=m,l.lanes=k,l}function xa(o,l,d,m){return o=ns(7,o,m,l),o.lanes=d,o}function yh(o,l,d,m){return o=ns(22,o,m,l),o.elementType=Y,o.lanes=d,o.stateNode={isHidden:!1},o}function Xg(o,l,d){return o=ns(6,o,null,l),o.lanes=d,o}function Qg(o,l,d){return l=ns(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function DI(o,l,d,m,w){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yr(0),this.expirationTimes=Yr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yr(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function Jg(o,l,d,m,w,k,M,j,U){return o=new DI(o,l,d,j,U),l===1?(l=1,k===!0&&(l|=8)):l=0,k=ns(3,null,null,l),o.current=k,k.stateNode=o,k.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},fg(k),o}function FI(o,l,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:m==null?null:""+m,children:o,containerInfo:l,implementation:d}}function aS(o){if(!o)return lo;o=o._reactInternals;e:{if(pi(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(fr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(fr(d))return Lw(o,d,l)}return l}function lS(o,l,d,m,w,k,M,j,U){return o=Jg(d,m,!0,o,w,k,M,j,U),o.context=aS(null),d=o.current,m=nr(),w=go(d),k=xi(m,w),k.callback=l??null,fo(d,k,w),o.current.lanes=w,Mr(o,w,m),mr(o,m),o}function _h(o,l,d,m){var w=l.current,k=nr(),M=go(w);return d=aS(d),l.context===null?l.context=d:l.pendingContext=d,l=xi(k,M),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=fo(w,l,M),o!==null&&(xs(o,w,M,k),Yf(o,w,M)),M}function xh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function uS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function ev(o,l){uS(o,l),(o=o.alternate)&&uS(o,l)}function jI(){return null}var cS=typeof reportError=="function"?reportError:function(o){console.error(o)};function tv(o){this._internalRoot=o}wh.prototype.render=tv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));_h(o,l,null,null)},wh.prototype.unmount=tv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;va(function(){_h(null,o,null,null)}),l[mi]=null}};function wh(o){this._internalRoot=o}wh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Kx();o={blockedOn:null,target:o,priority:l};for(var d=0;d<ro.length&&l!==0&&l<ro[d].priority;d++);ro.splice(d,0,o),d===0&&Yx(o)}};function nv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function bh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function dS(){}function VI(o,l,d,m,w){if(w){if(typeof m=="function"){var k=m;m=function(){var re=xh(M);k.call(re)}}var M=lS(l,m,o,0,null,!1,!1,"",dS);return o._reactRootContainer=M,o[mi]=M.current,vc(o.nodeType===8?o.parentNode:o),va(),M}for(;w=o.lastChild;)o.removeChild(w);if(typeof m=="function"){var j=m;m=function(){var re=xh(U);j.call(re)}}var U=Jg(o,0,!1,null,null,!1,!1,"",dS);return o._reactRootContainer=U,o[mi]=U.current,vc(o.nodeType===8?o.parentNode:o),va(function(){_h(l,U,d,m)}),U}function Sh(o,l,d,m,w){var k=d._reactRootContainer;if(k){var M=k;if(typeof w=="function"){var j=w;w=function(){var U=xh(M);j.call(U)}}_h(l,M,o,w)}else M=VI(d,l,o,w,m);return xh(M)}Wx=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var d=hn(l.pendingLanes);d!==0&&(C0(l,d|1),mr(l,Bt()),(dt&6)===0&&(Fl=Bt()+500,uo()))}break;case 13:va(function(){var m=_i(o,1);if(m!==null){var w=nr();xs(m,o,1,w)}}),ev(o,1)}},P0=function(o){if(o.tag===13){var l=_i(o,134217728);if(l!==null){var d=nr();xs(l,o,134217728,d)}ev(o,134217728)}},Gx=function(o){if(o.tag===13){var l=go(o),d=_i(o,l);if(d!==null){var m=nr();xs(d,o,l,m)}ev(o,l)}},Kx=function(){return gt},qx=function(o,l){var d=gt;try{return gt=o,l()}finally{gt=d}},ia=function(o,l,d){switch(l){case"input":if(Mt(o,d),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var m=d[l];if(m!==o&&m.form===o.form){var w=$f(m);if(!w)throw Error(n(90));Ae(m),Mt(m,w)}}}break;case"textarea":xn(o,d);break;case"select":l=d.value,l!=null&<(o,!!d.multiple,l,!1)}},nn=Kg,bn=va;var $I={usingClientEntryPoint:!1,Events:[xc,El,$f,qe,Pt,Kg]},Oc={findFiberByHostInstance:ua,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},HI={bundleType:Oc.bundleType,version:Oc.version,rendererPackageName:Oc.rendererPackageName,rendererConfig:Oc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=ec(o),o===null?null:o.stateNode},findFiberByHostInstance:Oc.findFiberByHostInstance||jI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eh.isDisabled&&Eh.supportsFiber)try{la=Eh.inject(HI),z=Eh}catch{}}return gr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$I,gr.createPortal=function(o,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nv(l))throw Error(n(200));return FI(o,l,null,d)},gr.createRoot=function(o,l){if(!nv(o))throw Error(n(299));var d=!1,m="",w=cS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=Jg(o,1,!1,null,null,d,!1,m,w),o[mi]=l.current,vc(o.nodeType===8?o.parentNode:o),new tv(l)},gr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=ec(l),o=o===null?null:o.stateNode,o},gr.flushSync=function(o){return va(o)},gr.hydrate=function(o,l,d){if(!bh(l))throw Error(n(200));return Sh(null,o,l,!0,d)},gr.hydrateRoot=function(o,l,d){if(!nv(o))throw Error(n(405));var m=d!=null&&d.hydratedSources||null,w=!1,k="",M=cS;if(d!=null&&(d.unstable_strictMode===!0&&(w=!0),d.identifierPrefix!==void 0&&(k=d.identifierPrefix),d.onRecoverableError!==void 0&&(M=d.onRecoverableError)),l=lS(l,null,o,1,d??null,w,!1,k,M),o[mi]=l.current,vc(o),m)for(o=0;o<m.length;o++)d=m[o],w=d._getVersion,w=w(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,w]:l.mutableSourceEagerHydrationData.push(d,w);return new wh(l)},gr.render=function(o,l,d){if(!bh(l))throw Error(n(200));return Sh(null,o,l,!1,d)},gr.unmountComponentAtNode=function(o){if(!bh(o))throw Error(n(40));return o._reactRootContainer?(va(function(){Sh(null,null,o,!1,function(){o._reactRootContainer=null,o[mi]=null})}),!0):!1},gr.unstable_batchedUpdates=Kg,gr.unstable_renderSubtreeIntoContainer=function(o,l,d,m){if(!bh(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Sh(o,l,d,!1,m)},gr.version="18.3.1-next-f1338f8080-20240426",gr}var DE;function Z6(){if(DE)return Nv.exports;DE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Nv.exports=lD(),Nv.exports}var FE;function uD(){if(FE)return Fh;FE=1;var t=Z6();return Fh.createRoot=t.createRoot,Fh.hydrateRoot=t.hydrateRoot,Fh}var cD=uD();const dD=Vm(cD),Hi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Y6(t){return"init"in t}function Ay(t){return typeof t.write=="function"}function fD(t){return!!t.onMount}function jE(t){return"v"in t||"e"in t}function om(t){if("e"in t)throw t.e;if((Hi?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function am(t){return typeof(t==null?void 0:t.then)=="function"}function hD(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function X6(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function Q6(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const a=new Set(s);for(const u of i)a.add(u);return a}function pD(t){return!!t.INTERNAL_onInit}const mD=(t,e,n,...r)=>n.read(...r),gD=(t,e,n,...r)=>n.write(...r),vD=(t,e,n)=>n.INTERNAL_onInit(e),yD=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},_D=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],u=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),pD(n)&&u(t,e,n)}return i},xD=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],u=t[6],c=t[13];if(!u.f&&!s.size&&!i.size&&!a.size)return;const f=[],h=p=>{try{p()}catch(v){f.push(v)}};do{u.f&&h(u.f);const p=new Set;for(const v of s){const y=(n=r.get(v))==null?void 0:n.l;if(y)for(const x of y)p.add(x)}s.clear();for(const v of a)p.add(v);a.clear();for(const v of i)p.add(v);i.clear();for(const v of p)h(v);s.size&&c(t,e)}while(s.size||a.size||i.size);if(f.length)throw new AggregateError(f)},wD=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],u=t[17];if(!s.size)return;const c=[],f=[],h=new WeakSet,p=new WeakSet,v=[],y=[];for(const x of s)v.push(x),y.push(i(t,e,x));for(;v.length;){const x=v.length-1,_=v[x],b=y[x];if(p.has(_)){v.pop(),y.pop();continue}if(h.has(_)){if(r.get(_)===b.n)c.push(_),f.push(b);else if((Hi?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),v.pop(),y.pop();continue}h.add(_);for(const E of Q6(_,b,n))h.has(E)||(v.push(E),y.push(i(t,e,E)))}for(let x=c.length-1;x>=0;--x){const _=c[x],b=f[x];let E=!1;for(const C of b.d.keys())if(C!==_&&s.has(C)){E=!0;break}E&&(r.set(_,b.n),a(t,e,_),u(t,e,_)),r.delete(_)}},My=new WeakSet,bD=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],f=t[7],h=t[11],p=t[12],v=t[13],y=t[14],x=t[16],_=t[17],b=t[20],E=t[26],C=t[28],P=h(t,e,n),T=C[0];if(jE(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===T)return P.m=T,P;let q=!1;for(const[B,Y]of P.d)if(y(t,e,B).n!==Y){q=!0;break}if(!q)return P.m=T,P}let R=!0;const O=new Set(P.d.keys()),I=()=>{for(const q of O)P.d.delete(q)},A=()=>{if(i.has(n)){const q=!u.size;_(t,e,n),q&&(v(t,e),p(t,e))}},N=q=>{var B;if(q===n){const $=h(t,e,q);if(!jE($))if(Y6(q))b(t,e,q,q.init);else throw new Error("no atom init");return om($)}const Y=y(t,e,q);try{return om(Y)}finally{O.delete(q),P.d.set(q,Y.n),am(P.v)&&X6(n,P.v,Y),i.has(n)&&((B=i.get(q))==null||B.t.add(n)),R||A()}};let L,F;const V={get signal(){return L||(L=new AbortController),L.signal},get setSelf(){return(Hi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Hi?"production":void 0)!=="production"&&!Ay(n)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&Ay(n)&&(F=(...q)=>{if((Hi?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return x(t,e,n,q)}finally{v(t,e),p(t,e)}}),F}},G=P.n,X=a.get(n)===G;try{(Hi?"production":void 0)!=="production"&&My.delete(e);const q=f(t,e,n,N,V);if((Hi?"production":void 0)!=="production"&&My.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),b(t,e,n,q),am(q)){E(t,e,q,()=>L==null?void 0:L.abort());const B=()=>{I(),A()};q.then(B,B)}else I();return(r=c.r)==null||r.call(c,n),P.m=T,P}catch(q){if(hD(q))throw q;return delete P.v,P.e=q,++P.n,P.m=T,P}finally{R=!1,P.n!==G&&X&&(a.set(n,P.n),u.add(n),(s=c.c)==null||s.call(c,n))}},SD=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const u=a.pop(),c=i(t,e,u);for(const f of Q6(u,c,r)){const h=i(t,e,f);s.get(f)!==h.n&&(s.set(f,h.n),a.push(f))}}},ED=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],f=t[13],h=t[14],p=t[15],v=t[16],y=t[17],x=t[20],_=t[28];let b=!0;const E=P=>om(h(t,e,P)),C=(P,...T)=>{var R;const O=u(t,e,P);try{if(P===n){if(!Y6(P))throw new Error("atom not writable");(Hi?"production":void 0)!=="production"&&My.add(e);const I=O.n,A=T[0];x(t,e,P,A),y(t,e,P),I!==O.n&&(++_[0],s.add(P),p(t,e,P),(R=i.c)==null||R.call(i,P));return}else return v(t,e,P,T)}finally{b||(f(t,e),c(t,e))}};try{return a(t,e,n,E,C,...r)}finally{b=!1}},kD=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],f=t[18],h=t[19],p=u(t,e,n),v=s.get(n);if(v&&p.d.size>0){for(const[y,x]of p.d)if(!v.d.has(y)){const _=u(t,e,y);f(t,e,y).t.add(n),v.d.add(y),x!==_.n&&(i.add(y),c(t,e,y),(r=a.c)==null||r.call(a,y))}for(const y of v.d)if(!p.d.has(y)){v.d.delete(y);const x=h(t,e,y);x==null||x.t.delete(n)}}},CD=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],f=t[12],h=t[13],p=t[14],v=t[16],y=t[18],x=c(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const b of x.d.keys())y(t,e,b).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),Ay(n)&&fD(n)){const b=()=>{let E=!0;const C=(...P)=>{try{return v(t,e,n,P)}finally{E||(h(t,e),f(t,e))}};try{const P=u(t,e,n,C);P&&(_.u=()=>{E=!0;try{P()}finally{E=!1}})}finally{E=!1}};i.add(b)}(r=a.m)==null||r.call(a,n)}return _},PD=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],f=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let v=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){v=!0;break}if(!v){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const y of h.d.keys()){const x=f(t,e,y);x==null||x.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},TD=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(am(r))for(const f of a.d.keys())X6(n,r,s(t,e,f));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,am(c)&&i(t,e,c))},RD=(t,e,n)=>{const r=t[14];return om(r(t,e,n))},AD=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],u=t[16],c=s.size;try{return u(t,e,n,r)}finally{s.size!==c&&(a(t,e),i(t,e))}},MD=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],f=a(t,e,n).l;return f.add(r),i(t,e),s(t,e),()=>{f.delete(r),u(t,e,n),i(t,e),s(t,e)}},ID=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const a=()=>s.delete(n);n.then(a,a)}i.add(r)},ND=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},J6=new WeakMap;function OD(t){const e=J6.get(t);if((Hi?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function LD(...t){const e={get(a){return r(n,e,a)},set(a,...u){return s(n,e,a,...u)},sub(a,u){return i(n,e,a,u)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},mD,gD,vD,yD,_D,xD,wD,bD,SD,ED,kD,CD,PD,TD,RD,AD,MD,void 0,new WeakMap,ID,ND,[0]].map((a,u)=>t[u]||a);J6.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const eP={};let DD=0;function tt(t,e){const n=`atom${++DD}`,r={toString(){return(eP?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=FD,r.write=jD),e&&(r.write=e),r}function FD(t){return t(this)}function jD(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function VD(){return LD()}let Gc;function $D(){return Gc||(Gc=VD(),(eP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Gc),globalThis.__JOTAI_DEFAULT_STORE__!==Gc&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Gc}const HD={},zD=g.createContext(void 0);function h2(t){return g.useContext(zD)||$D()}const Iy=t=>typeof(t==null?void 0:t.then)=="function",Ny=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},UD=ve.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ny(t),t)}),Dv=new WeakMap,VE=(t,e,n)=>{const r=OD(t),s=r[26];let i=Dv.get(e);return i||(i=new Promise((a,u)=>{let c=e;const f=v=>y=>{c===v&&a(y)},h=v=>y=>{c===v&&u(y)},p=()=>{try{const v=n();Iy(v)?(Dv.set(v,i),c=v,v.then(f(v),h(v)),s(r,t,v,p)):a(v)}catch(v){u(v)}};e.then(f(e),h(e)),s(r,t,e,p)}),Dv.set(e,i)),i};function Xe(t,e){const{delay:n,unstable_promiseStatus:r=!ve.use}={},s=h2(),[[i,a,u],c]=g.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let f=i;if((a!==s||u!==t)&&(c(),f=s.get(t)),g.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);Iy(p)&&Ny(VE(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
42
|
+
|
|
43
|
+
Migration guide:
|
|
44
|
+
|
|
45
|
+
Create a custom hook like the following.
|
|
46
|
+
|
|
47
|
+
function useAtomValueWithDelay<Value>(
|
|
48
|
+
atom: Atom<Value>,
|
|
49
|
+
options: { delay: number },
|
|
50
|
+
): Value {
|
|
51
|
+
const { delay } = options
|
|
52
|
+
const store = useStore(options)
|
|
53
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const unsub = store.sub(atom, () => {
|
|
56
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
57
|
+
})
|
|
58
|
+
return unsub
|
|
59
|
+
}, [store, atom, delay])
|
|
60
|
+
return value
|
|
61
|
+
}
|
|
62
|
+
`),setTimeout(c,n);return}c()});return c(),h},[s,t,n,r]),g.useDebugValue(f),Iy(f)){const h=VE(s,f,()=>s.get(t));return r&&Ny(h),UD(h)}return f}function st(t,e){const n=h2();return g.useCallback((...s)=>{if((HD?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function tP(t,e){return[Xe(t),st(t)]}const p2=g.createContext({});function m2(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const BD=typeof window<"u",g2=BD?g.useLayoutEffect:g.useEffect,Um=g.createContext(null);function v2(t,e){t.indexOf(e)===-1&&t.push(e)}function lm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ai=(t,e,n)=>n>e?e:n<t?t:n;let y2=()=>{};const Wo={},nP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rP=t=>typeof t=="object"&&t!==null,sP=t=>/^0[^.\s]+$/u.test(t);function iP(t){let e;return()=>(e===void 0&&(e=t()),e)}const ds=t=>t,cf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Od=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class _2{constructor(){this.subscriptions=[]}add(e){return v2(this.subscriptions,e),()=>lm(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Br=t=>t*1e3,as=t=>t/1e3,oP=(t,e)=>e?t*(1e3/e):0,aP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,WD=1e-7,GD=12;function KD(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=aP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>WD&&++u<GD);return a}function df(t,e,n,r){if(t===e&&n===r)return ds;const s=i=>KD(i,0,1,t,n);return i=>i===0||i===1?i:aP(s(i),e,r)}const lP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,uP=t=>e=>1-t(1-e),cP=df(.33,1.53,.69,.99),x2=uP(cP),dP=lP(x2),fP=t=>t>=1?1:(t*=2)<1?.5*x2(t):.5*(2-Math.pow(2,-10*(t-1))),w2=t=>1-Math.sin(Math.acos(t)),hP=uP(w2),pP=lP(w2),qD=df(.42,0,1,1),ZD=df(0,0,.58,1),mP=df(.42,0,.58,1),YD=t=>Array.isArray(t)&&typeof t[0]!="number",gP=t=>Array.isArray(t)&&typeof t[0]=="number",XD={linear:ds,easeIn:qD,easeInOut:mP,easeOut:ZD,circIn:w2,circInOut:pP,circOut:hP,backIn:x2,backInOut:dP,backOut:cP,anticipate:fP},QD=t=>typeof t=="string",$E=t=>{if(gP(t)){y2(t.length===4);const[e,n,r,s]=t;return df(e,n,r,s)}else if(QD(t))return XD[t];return t},jh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function JD(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(f){i.has(f)&&(c.schedule(f),t()),f(a)}const c={schedule:(f,h=!1,p=!1)=>{const y=p&&r?e:n;return h&&i.add(f),y.add(f),f},cancel:f=>{n.delete(f),i.delete(f)},process:f=>{if(a=f,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(f))}};return c}const e9=40;function vP(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=jh.reduce((P,T)=>(P[T]=JD(i),P),{}),{setup:u,read:c,resolveKeyframes:f,preUpdate:h,update:p,preRender:v,render:y,postRender:x}=a,_=()=>{const P=Wo.useManualTiming,T=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,e9),1)),s.timestamp=T,s.isProcessing=!0,u.process(s),c.process(s),f.process(s),h.process(s),p.process(s),v.process(s),y.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},b=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:jh.reduce((P,T)=>{const R=a[T];return P[T]=(O,I=!1,A=!1)=>(n||b(),R.schedule(O,I,A)),P},{}),cancel:P=>{for(let T=0;T<jh.length;T++)a[jh[T]].cancel(P)},state:s,steps:a}}const{schedule:Ct,cancel:Go,state:Dn,steps:Fv}=vP(typeof requestAnimationFrame<"u"?requestAnimationFrame:ds,!0);let fp;function t9(){fp=void 0}const or={now:()=>(fp===void 0&&or.set(Dn.isProcessing||Wo.useManualTiming?Dn.timestamp:performance.now()),fp),set:t=>{fp=t,queueMicrotask(t9)}},yP=t=>e=>typeof e=="string"&&e.startsWith(t),_P=yP("--"),n9=yP("var(--"),b2=t=>n9(t)?r9.test(t.split("/*")[0].trim()):!1,r9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function HE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Wu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ld={...Wu,transform:t=>ai(0,1,t)},Vh={...Wu,default:1},pd=t=>Math.round(t*1e5)/1e5,S2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function s9(t){return t==null}const i9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,E2=(t,e)=>n=>!!(typeof n=="string"&&i9.test(n)&&n.startsWith(t)||e&&!s9(n)&&Object.prototype.hasOwnProperty.call(n,e)),xP=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(S2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},o9=t=>ai(0,255,t),jv={...Wu,transform:t=>Math.round(o9(t))},za={test:E2("rgb","red"),parse:xP("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+jv.transform(t)+", "+jv.transform(e)+", "+jv.transform(n)+", "+pd(Ld.transform(r))+")"};function a9(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Oy={test:E2("#"),parse:a9,transform:za.transform},ff=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ii=ff("deg"),ii=ff("%"),De=ff("px"),l9=ff("vh"),u9=ff("vw"),zE={...ii,parse:t=>ii.parse(t)/100,transform:t=>ii.transform(t*100)},tu={test:E2("hsl","hue"),parse:xP("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ii.transform(pd(e))+", "+ii.transform(pd(n))+", "+pd(Ld.transform(r))+")"},cn={test:t=>za.test(t)||Oy.test(t)||tu.test(t),parse:t=>za.test(t)?za.parse(t):tu.test(t)?tu.parse(t):Oy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?za.transform(t):tu.transform(t),getAnimatableNone:t=>{const e=cn.parse(t);return e.alpha=0,cn.transform(e)}},c9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(S2))==null?void 0:e.length)||0)+(((n=t.match(c9))==null?void 0:n.length)||0)>0}const wP="number",bP="color",f9="var",h9="var(",UE="${}",p9=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ou(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(p9,c=>(cn.test(c)?(r.color.push(i),s.push(bP),n.push(cn.parse(c))):c.startsWith(h9)?(r.var.push(i),s.push(f9),n.push(c)):(r.number.push(i),s.push(wP),n.push(parseFloat(c))),++i,UE)).split(UE);return{values:n,split:u,indexes:r,types:s}}function m9(t){return Ou(t).values}function SP({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const a=e[i];a===wP?s+=pd(r[i]):a===bP?s+=cn.transform(r[i]):s+=r[i]}return s}}function g9(t){return SP(Ou(t))}const v9=t=>typeof t=="number"?0:cn.test(t)?cn.getAnimatableNone(t):t,y9=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:v9(t);function _9(t){const e=Ou(t);return SP(e)(e.values.map((r,s)=>y9(r,e.split[s])))}const Ts={test:d9,parse:m9,createTransformer:g9,getAnimatableNone:_9};function Vv(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function x9({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;s=Vv(c,u,t+1/3),i=Vv(c,u,t),a=Vv(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function um(t,e){return n=>n>0?e:t}const kt=(t,e,n)=>t+(e-t)*n,$v=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},w9=[Oy,za,tu],b9=t=>w9.find(e=>e.test(t));function BE(t){const e=b9(t);if(!e)return!1;let n=e.parse(t);return e===tu&&(n=x9(n)),n}const WE=(t,e)=>{const n=BE(t),r=BE(e);if(!n||!r)return um(t,e);const s={...n};return i=>(s.red=$v(n.red,r.red,i),s.green=$v(n.green,r.green,i),s.blue=$v(n.blue,r.blue,i),s.alpha=kt(n.alpha,r.alpha,i),za.transform(s))},Ly=new Set(["none","hidden"]);function S9(t,e){return Ly.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function E9(t,e){return n=>kt(t,e,n)}function k2(t){return typeof t=="number"?E9:typeof t=="string"?b2(t)?um:cn.test(t)?WE:P9:Array.isArray(t)?EP:typeof t=="object"?cn.test(t)?WE:k9:um}function EP(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>k2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function k9(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=k2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function C9(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],a=t.indexes[i][r[i]],u=t.values[a]??0;n[s]=u,r[i]++}return n}const P9=(t,e)=>{const n=Ts.createTransformer(e),r=Ou(t),s=Ou(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ly.has(t)&&!s.values.length||Ly.has(e)&&!r.values.length?S9(t,e):cf(EP(C9(r,s),s.values),n):um(t,e)};function kP(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?kt(t,e,n):k2(t)(t,e)}const T9=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Ct.update(e,n),stop:()=>Go(e),now:()=>Dn.isProcessing?Dn.timestamp:or.now()}},CP=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},cm=2e4;function C2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<cm;)e+=n,r=t.next(e);return e>=cm?1/0:e}function R9(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(C2(r),cm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:as(s)}}const Jt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Dy(t,e){return t*Math.sqrt(1-e*e)}const A9=12;function M9(t,e,n){let r=n;for(let s=1;s<A9;s++)r=r-t(r)/e(r);return r}const Hv=.001;function I9({duration:t=Jt.duration,bounce:e=Jt.bounce,velocity:n=Jt.velocity,mass:r=Jt.mass}){let s,i,a=1-e;a=ai(Jt.minDamping,Jt.maxDamping,a),t=ai(Jt.minDuration,Jt.maxDuration,as(t)),a<1?(s=f=>{const h=f*a,p=h*t,v=h-n,y=Dy(f,a),x=Math.exp(-p);return Hv-v/y*x},i=f=>{const p=f*a*t,v=p*n+n,y=Math.pow(a,2)*Math.pow(f,2)*t,x=Math.exp(-p),_=Dy(Math.pow(f,2),a);return(-s(f)+Hv>0?-1:1)*((v-y)*x)/_}):(s=f=>{const h=Math.exp(-f*t),p=(f-n)*t+1;return-Hv+h*p},i=f=>{const h=Math.exp(-f*t),p=(n-f)*(t*t);return h*p});const u=5/t,c=M9(s,i,u);if(t=Br(t),isNaN(c))return{stiffness:Jt.stiffness,damping:Jt.damping,duration:t};{const f=Math.pow(c,2)*r;return{stiffness:f,damping:a*2*Math.sqrt(r*f),duration:t}}}const N9=["duration","bounce"],O9=["stiffness","damping","mass"];function GE(t,e){return e.some(n=>t[n]!==void 0)}function L9(t){let e={velocity:Jt.velocity,stiffness:Jt.stiffness,damping:Jt.damping,mass:Jt.mass,isResolvedFromDuration:!1,...t};if(!GE(t,O9)&&GE(t,N9))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ai(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Jt.mass,stiffness:s,damping:i}}else{const n=I9({...t,velocity:0});e={...e,...n,mass:Jt.mass},e.isResolvedFromDuration=!0}return e}function dm(t=Jt.visualDuration,e=Jt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:f,mass:h,duration:p,velocity:v,isResolvedFromDuration:y}=L9({...n,velocity:-as(n.velocity||0)}),x=v||0,_=f/(2*Math.sqrt(c*h)),b=a-i,E=as(Math.sqrt(c/h)),C=Math.abs(b)<5;r||(r=C?Jt.restSpeed.granular:Jt.restSpeed.default),s||(s=C?Jt.restDelta.granular:Jt.restDelta.default);let P,T,R,O,I,A;if(_<1)R=Dy(E,_),O=(x+_*E*b)/R,P=L=>{const F=Math.exp(-_*E*L);return a-F*(O*Math.sin(R*L)+b*Math.cos(R*L))},I=_*E*O+b*R,A=_*E*b-O*R,T=L=>Math.exp(-_*E*L)*(I*Math.sin(R*L)+A*Math.cos(R*L));else if(_===1){P=F=>a-Math.exp(-E*F)*(b+(x+E*b)*F);const L=x+E*b;T=F=>Math.exp(-E*F)*(E*L*F-x)}else{const L=E*Math.sqrt(_*_-1);P=X=>{const q=Math.exp(-_*E*X),B=Math.min(L*X,300);return a-q*((x+_*E*b)*Math.sinh(B)+L*b*Math.cosh(B))/L};const F=(x+_*E*b)/L,V=_*E*F-b*L,G=_*E*b-F*L;T=X=>{const q=Math.exp(-_*E*X),B=Math.min(L*X,300);return q*(V*Math.sinh(B)+G*Math.cosh(B))}}const N={calculatedDuration:y&&p||null,velocity:L=>Br(T(L)),next:L=>{if(!y&&_<1){const V=Math.exp(-_*E*L),G=Math.sin(R*L),X=Math.cos(R*L),q=a-V*(O*G+b*X),B=Br(V*(I*G+A*X));return u.done=Math.abs(B)<=r&&Math.abs(a-q)<=s,u.value=u.done?a:q,u}const F=P(L);if(y)u.done=L>=p;else{const V=Br(T(L));u.done=Math.abs(V)<=r&&Math.abs(a-F)<=s}return u.value=u.done?a:F,u},toString:()=>{const L=Math.min(C2(N),cm),F=CP(V=>N.next(L*V).value,L,30);return L+"ms "+F},toTransition:()=>{}};return N}dm.applyToOptions=t=>{const e=R9(t,100,dm);return t.ease=e.ease,t.duration=Br(e.duration),t.type="keyframes",t};const D9=5;function PP(t,e,n){const r=Math.max(e-D9,0);return oP(n-t(r),e-r)}function Fy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:f=.5,restSpeed:h}){const p=t[0],v={done:!1,value:p},y=A=>u!==void 0&&A<u||c!==void 0&&A>c,x=A=>u===void 0?c:c===void 0||Math.abs(u-A)<Math.abs(c-A)?u:c;let _=n*e;const b=p+_,E=a===void 0?b:a(b);E!==b&&(_=E-p);const C=A=>-_*Math.exp(-A/r),P=A=>E+C(A),T=A=>{const N=C(A),L=P(A);v.done=Math.abs(N)<=f,v.value=v.done?E:L};let R,O;const I=A=>{y(v.value)&&(R=A,O=dm({keyframes:[v.value,x(v.value)],velocity:PP(P,A,v.value),damping:s,stiffness:i,restDelta:f,restSpeed:h}))};return I(0),{calculatedDuration:null,next:A=>{let N=!1;return!O&&R===void 0&&(N=!0,T(A),I(A)),R!==void 0&&A>=R?O.next(A-R):(!N&&T(A),v)}}}function F9(t,e,n){const r=[],s=n||Wo.mix||kP,i=t.length-1;for(let a=0;a<i;a++){let u=s(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||ds:e;u=cf(c,u)}r.push(u)}return r}function j9(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(y2(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=F9(e,r,s),c=u.length,f=h=>{if(a&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const v=Od(t[p],t[p+1],h);return u[p](v)};return n?h=>f(ai(t[0],t[i-1],h)):f}function V9(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Od(0,e,r);t.push(kt(n,1,s))}}function $9(t){const e=[0];return V9(e,t.length-1),e}function H9(t,e){return t.map(n=>n*e)}function z9(t,e){return t.map(()=>e||mP).splice(0,t.length-1)}function md({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=YD(r)?r.map($E):$E(r),i={done:!1,value:e[0]},a=H9(n&&n.length===e.length?n:$9(e),t),u=j9(a,e,{ease:Array.isArray(s)?s:z9(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const U9=t=>t!==null;function Bm(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(U9),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const B9={decay:Fy,inertia:Fy,tween:md,keyframes:md,spring:dm};function TP(t){typeof t.type=="string"&&(t.type=B9[t.type])}class P2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const W9=t=>t/100;class fm extends P2{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==or.now()&&this.tick(or.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;TP(e);const{type:n=md,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||md;c!==md&&typeof u[0]!="number"&&(this.mixKeyframes=cf(W9,kP(u[0],u[1])),u=[0,100]);const f=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),f.calculatedDuration===null&&(f.calculatedDuration=C2(f));const{calculatedDuration:h}=f;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=f}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:h,repeat:p,repeatType:v,repeatDelay:y,type:x,onUpdate:_,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-f*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,T=r;if(p){const A=Math.min(this.currentTime,s)/u;let N=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&N--,N=Math.min(N,p+1),!!(N%2)&&(v==="reverse"?(L=1-L,y&&(L-=y/u)):v==="mirror"&&(T=a)),P=ai(0,1,L)*u}let R;C?(this.delayState.value=h[0],R=this.delayState):R=T.next(P),i&&!C&&(R.value=i(R.value));let{done:O}=R;!C&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return I&&x!==Fy&&(R.value=Bm(h,this.options,b,this.speed)),_&&_(R.value),I&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return as(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+as(e)}get time(){return as(this.currentTime)}set time(e){e=Br(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return PP(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(or.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=as(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=T9,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(or.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function G9(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ua=t=>t*180/Math.PI,jy=t=>{const e=Ua(Math.atan2(t[1],t[0]));return Vy(e)},K9={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:jy,rotateZ:jy,skewX:t=>Ua(Math.atan(t[1])),skewY:t=>Ua(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Vy=t=>(t=t%360,t<0&&(t+=360),t),KE=jy,qE=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ZE=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),q9={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qE,scaleY:ZE,scale:t=>(qE(t)+ZE(t))/2,rotateX:t=>Vy(Ua(Math.atan2(t[6],t[5]))),rotateY:t=>Vy(Ua(Math.atan2(-t[2],t[0]))),rotateZ:KE,rotate:KE,skewX:t=>Ua(Math.atan(t[4])),skewY:t=>Ua(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $y(t){return t.includes("scale")?1:0}function Hy(t,e){if(!t||t==="none")return $y(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=q9,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=K9,s=u}if(!s)return $y(e);const i=r[e],a=s[1].split(",").map(Y9);return typeof i=="function"?i(a):a[i]}const Z9=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Hy(n,e)};function Y9(t){return parseFloat(t.trim())}const Gu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ku=new Set([...Gu,"pathRotation"]),YE=t=>t===Wu||t===De,X9=new Set(["x","y","z"]),Q9=Gu.filter(t=>!X9.has(t));function J9(t){const e=[];return Q9.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Lo={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Hy(e,"x"),y:(t,{transform:e})=>Hy(e,"y")};Lo.translateX=Lo.x;Lo.translateY=Lo.y;const tl=new Set;let zy=!1,Uy=!1,By=!1;function RP(){if(Uy){const t=Array.from(tl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=J9(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var u;(u=r.getValue(i))==null||u.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Uy=!1,zy=!1,tl.forEach(t=>t.complete(By)),tl.clear()}function AP(){tl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Uy=!0)})}function e7(){By=!0,AP(),RP(),By=!1}class T2{constructor(e,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(tl.add(this),zy||(zy=!0,Ct.read(AP),Ct.resolveKeyframes(RP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const u=r.readValue(n,a);u!=null&&(e[0]=u)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}G9(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),tl.delete(this)}cancel(){this.state==="scheduled"&&(tl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const t7=t=>t.startsWith("--");function MP(t,e,n){t7(e)?t.style.setProperty(e,n):t.style[e]=n}const n7={};function IP(t,e){const n=iP(t);return()=>n7[e]??n()}const r7=IP(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),NP=IP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),id=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,XE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:id([0,.65,.55,1]),circOut:id([.55,0,1,.45]),backIn:id([.31,.01,.66,-.59]),backOut:id([.33,1.53,.69,.99])};function OP(t,e){if(t)return typeof t=="function"?NP()?CP(t,e):"ease-out":gP(t)?id(t):Array.isArray(t)?t.map(n=>OP(n,e)||XE.easeOut):XE[t]}function s7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},f=void 0){const h={[e]:n};c&&(h.offset=c);const p=OP(u,s);Array.isArray(p)&&(h.easing=p);const v={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),t.animate(h,v)}function LP(t){return typeof t=="function"&&"applyToOptions"in t}function i7({type:t,...e}){return LP(t)&&NP()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class DP extends P2{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:u,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,y2(typeof e.type!="string");const f=i7(e);this.animation=s7(n,r,s,f,i),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=Bm(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),MP(n,r,h),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return as(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+as(e)}get time(){return as(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Br(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&r7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ds):s(this)}}const FP={anticipate:fP,backInOut:dP,circInOut:pP};function o7(t){return t in FP}function a7(t){typeof t.ease=="string"&&o7(t.ease)&&(t.ease=FP[t.ease])}const zv=10;class l7 extends DP{constructor(e){a7(e),TP(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const u=new fm({...a,autoplay:!1}),c=Math.max(zv,or.now()-this.startTime),f=ai(0,zv,c-zv),h=u.sample(c).value,{name:p}=this.options;i&&p&&MP(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-f)).value,h,f),u.stop()}}const QE=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ts.test(t)||t==="0")&&!t.startsWith("url("));function u7(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function c7(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],a=QE(s,e),u=QE(i,e);return!a||!u?!1:u7(t)||(n==="spring"||LP(n))&&r}function Wy(t){t.duration=0,t.type="keyframes"}const jP=new Set(["opacity","clipPath","filter","transform"]),d7=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function f7(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&d7.test(t[e]))return!0;return!1}const h7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),p7=iP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function m7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t;if(!(((p=e==null?void 0:e.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:h}=e.owner.getProps();return p7()&&n&&(jP.has(n)||h7.has(n)&&f7(u))&&(n!=="transform"||!h)&&!f&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const g7=40;class v7 extends P2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:f,element:h,...p}){var x;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=or.now();const v={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:f,element:h,...p},y=(h==null?void 0:h.KeyframeResolver)||T2;this.keyframeResolver=new y(u,(_,b,E)=>this.onKeyframesResolved(_,b,v,!E),c,f,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var E,C;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:f,onUpdate:h}=r;this.resolvedAt=or.now();let p=!0;c7(e,i,a,u)||(p=!1,(Wo.instantAnimations||!c)&&(h==null||h(Bm(e,r,n))),e[0]=e[e.length-1],Wy(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>g7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!f&&m7(y),_=(C=(E=y.motionValue)==null?void 0:E.owner)==null?void 0:C.current;let b;if(x)try{b=new l7({...y,element:_})}catch{b=new fm(y)}else b=new fm(y);b.finished.then(()=>{this.notifyFinished()}).catch(ds),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),e7()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function VP(t,e,n,r=0,s=1){const i=Array.from(t).sort((f,h)=>f.sortNodePosition(h)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const JE=30,y7=t=>!isNaN(parseFloat(t));class _7{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=or.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=or.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=y7(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new _2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Ct.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=or.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>JE)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,JE);return oP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lu(t,e){return new _7(t,e)}function $P(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function R2(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?$P(n,t):n}const x7={type:"spring",stiffness:500,damping:25,restSpeed:10},w7=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),b7={type:"keyframes",duration:.8},S7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},E7=(t,{keyframes:e})=>e.length>2?b7:Ku.has(t)?t.startsWith("scale")?w7(e[1]):x7:S7,k7=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function C7(t){for(const e in t)if(!k7.has(e))return!0;return!1}const A2=(t,e,n,r={},s,i)=>a=>{const u=R2(r,t)||{},c=u.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Br(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-f,onUpdate:v=>{e.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};C7(u)||Object.assign(h,E7(t,h)),h.duration&&(h.duration=Br(h.duration)),h.repeatDelay&&(h.repeatDelay=Br(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(Wy(h),h.delay===0&&(p=!0)),(Wo.instantAnimations||Wo.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,Wy(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const v=Bm(h.keyframes,u);if(v!==void 0){Ct.update(()=>{h.onUpdate(v),h.onComplete()});return}}return u.isSync?new fm(h):new v7(h)},P7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function T7(t){const e=P7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function HP(t,e,n=1){const[r,s]=T7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return nP(a)?parseFloat(a):a}return b2(s)?HP(s,e,n+1):s}function e4(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function M2(t,e,n,r){if(typeof e=="function"){const[s,i]=e4(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=e4(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function nl(t,e,n){const r=t.getProps();return M2(r,e,n!==void 0?n:r.custom,t)}const zP=new Set(["width","height","top","left","right","bottom",...Gu]),Gy=t=>Array.isArray(t);function R7(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Lu(n))}function A7(t){return Gy(t)?t[t.length-1]||0:t}function M7(t,e){const n=nl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=A7(i[a]);R7(t,a,u)}}const Vn=t=>!!(t&&t.getVelocity);function I7(t){return!!(Vn(t)&&t.add)}function Ky(t,e){const n=t.getValue("willChange");if(I7(n))return n.add(e);if(!n&&Wo.WillChange){const r=new Wo.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function I2(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const N7="framerAppearId",UP="data-"+I2(N7);function BP(t){return t.props[UP]}function O7({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function WP(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?$P(i,c):c;const f=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],v=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,u,i,n,p);for(const x in u){const _=t.getValue(x,t.latestValues[x]??null),b=u[x];if(b===void 0||v&&O7(v,x))continue;const E={delay:n,...R2(i||{},x)};h&&(E.skipAnimations=!0);const C=_.get();if(C!==void 0&&!_.isAnimating()&&!Array.isArray(b)&&b===C&&!E.velocity){Ct.update(()=>_.set(b));continue}let P=!1;if(window.MotionHandoffAnimation){const O=BP(t);if(O){const I=window.MotionHandoffAnimation(O,x,Ct);I!==null&&(E.startTime=I,P=!0)}}Ky(t,x);const T=f??t.shouldReduceMotion;_.start(A2(x,_,b,T&&zP.has(x)?{type:!1}:E,t,P));const R=_.animation;R&&p.push(R)}if(a){const x=()=>Ct.update(()=>{a&&M7(t,a)});p.length?Promise.all(p).then(x):x()}return p}function qy(t,e,n={}){var c;const r=nl(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(WP(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:v}=s;return L7(t,e,f,h,p,v,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[f,h]=u==="beforeChildren"?[i,a]:[a,i];return f().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function L7(t,e,n=0,r=0,s=0,i=1,a){const u=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),u.push(qy(c,e,{...a,delay:n+(typeof r=="function"?0:r)+VP(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function D7(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>qy(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=qy(t,e,n);else{const s=typeof e=="function"?nl(t,e,n.custom):e;r=Promise.all(WP(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const F7={test:t=>t==="auto",parse:t=>t},GP=t=>e=>e.test(t),KP=[Wu,De,ii,Ii,u9,l9,F7],t4=t=>KP.find(GP(t));function j7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||sP(t):!0}const V7=new Set(["brightness","contrast","saturate","opacity"]);function $7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(S2)||[];if(!r)return t;const s=n.replace(r,"");let i=V7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const H7=/\b([a-z-]*)\(.*?\)/gu,Zy={...Ts,getAnimatableNone:t=>{const e=t.match(H7);return e?e.map($7).join(" "):t}},Yy={...Ts,getAnimatableNone:t=>{const e=Ts.parse(t);return Ts.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},n4={...Wu,transform:Math.round},z7={rotate:Ii,pathRotation:Ii,rotateX:Ii,rotateY:Ii,rotateZ:Ii,scale:Vh,scaleX:Vh,scaleY:Vh,scaleZ:Vh,skew:Ii,skewX:Ii,skewY:Ii,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:Ld,originX:zE,originY:zE,originZ:De},hm={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,top:De,right:De,bottom:De,left:De,inset:De,insetBlock:De,insetBlockStart:De,insetBlockEnd:De,insetInline:De,insetInlineStart:De,insetInlineEnd:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,paddingBlock:De,paddingBlockStart:De,paddingBlockEnd:De,paddingInline:De,paddingInlineStart:De,paddingInlineEnd:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,marginBlock:De,marginBlockStart:De,marginBlockEnd:De,marginInline:De,marginInlineStart:De,marginInlineEnd:De,fontSize:De,backgroundPositionX:De,backgroundPositionY:De,...z7,zIndex:n4,fillOpacity:Ld,strokeOpacity:Ld,numOctaves:n4},U7={...hm,color:cn,backgroundColor:cn,outlineColor:cn,fill:cn,stroke:cn,borderColor:cn,borderTopColor:cn,borderRightColor:cn,borderBottomColor:cn,borderLeftColor:cn,filter:Zy,WebkitFilter:Zy,mask:Yy,WebkitMask:Yy},qP=t=>U7[t],B7=new Set([Zy,Yy]);function ZP(t,e){let n=qP(t);return B7.has(n)||(n=Ts),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const W7=new Set(["auto","none","0"]);function G7(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!W7.has(i)&&Ou(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=ZP(n,s)}class K7 extends T2{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),b2(p))){const v=HP(p,n.current);v!==void 0&&(e[h]=v),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!zP.has(r)||e.length!==2)return;const[s,i]=e,a=t4(s),u=t4(i),c=HE(s),f=HE(i);if(c!==f&&Lo[r]){this.needsMeasurement=!0;return}if(a!==u)if(YE(a)&&YE(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else Lo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||j7(e[s]))&&r.push(s);r.length&&G7(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Lo[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=Lo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const N2=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function YP(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const Xy=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function hp(t){return rP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:O2}=vP(queueMicrotask,!1),Es={x:!1,y:!1};function XP(){return Es.x||Es.y}function q7(t){return t==="x"||t==="y"?Es[t]?null:(Es[t]=!0,()=>{Es[t]=!1}):Es.x||Es.y?null:(Es.x=Es.y=!0,()=>{Es.x=Es.y=!1})}function QP(t,e){const n=YP(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Z7(t){return!(t.pointerType==="touch"||XP())}function Y7(t,e,n={}){const[r,s,i]=QP(t,n);return r.forEach(a=>{let u=!1,c=!1,f;const h=()=>{a.removeEventListener("pointerleave",x)},p=b=>{f&&(f(b),f=void 0),h()},v=b=>{u=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),c&&(c=!1,p(b))},y=()=>{u=!0,window.addEventListener("pointerup",v,s),window.addEventListener("pointercancel",v,s)},x=b=>{if(b.pointerType!=="touch"){if(u){c=!0;return}p(b)}},_=b=>{if(!Z7(b))return;c=!1;const E=e(a,b);typeof E=="function"&&(f=E,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",_,s),a.addEventListener("pointerdown",y,s)}),i}const JP=(t,e)=>e?t===e?!0:JP(t,e.parentElement):!1,L2=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,X7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Q7(t){return X7.has(t.tagName)||t.isContentEditable===!0}const J7=new Set(["INPUT","SELECT","TEXTAREA"]);function eF(t){return J7.has(t.tagName)||t.isContentEditable===!0}const pp=new WeakSet;function r4(t){return e=>{e.key==="Enter"&&t(e)}}function Uv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const tF=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=r4(()=>{if(pp.has(n))return;Uv(n,"down");const s=r4(()=>{Uv(n,"up")}),i=()=>Uv(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function s4(t){return L2(t)&&!XP()}const i4=new WeakSet;function nF(t,e,n={}){const[r,s,i]=QP(t,n),a=u=>{const c=u.currentTarget;if(!s4(u)||i4.has(u))return;pp.add(c),n.stopPropagation&&i4.add(u);const f=e(c,u),h={...s,capture:!0},p=(x,_)=>{window.removeEventListener("pointerup",v,h),window.removeEventListener("pointercancel",y,h),pp.has(c)&&pp.delete(c),s4(x)&&typeof f=="function"&&f(x,{success:_})},v=x=>{p(x,c===window||c===document||n.useGlobalTarget||JP(c,x.target))},y=x=>{p(x,!1)};window.addEventListener("pointerup",v,h),window.addEventListener("pointercancel",y,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),hp(u)&&(u.addEventListener("focus",f=>tF(f,s)),!Q7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function D2(t){return rP(t)&&"ownerSVGElement"in t}const mp=new WeakMap;let Eo;const e3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:D2(r)&&"getBBox"in r?r.getBBox()[e]:r[n],rF=e3("inline","width","offsetWidth"),sF=e3("block","height","offsetHeight");function iF({target:t,borderBoxSize:e}){var n;(n=mp.get(t))==null||n.forEach(r=>{r(t,{get width(){return rF(t,e)},get height(){return sF(t,e)}})})}function oF(t){t.forEach(iF)}function aF(){typeof ResizeObserver>"u"||(Eo=new ResizeObserver(oF))}function lF(t,e){Eo||aF();const n=YP(t);return n.forEach(r=>{let s=mp.get(r);s||(s=new Set,mp.set(r,s)),s.add(e),Eo==null||Eo.observe(r)}),()=>{n.forEach(r=>{const s=mp.get(r);s==null||s.delete(e),s!=null&&s.size||Eo==null||Eo.unobserve(r)})}}const gp=new Set;let nu;function uF(){nu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};gp.forEach(e=>e(t))},window.addEventListener("resize",nu)}function cF(t){return gp.add(t),nu||uF(),()=>{gp.delete(t),!gp.size&&typeof nu=="function"&&(window.removeEventListener("resize",nu),nu=void 0)}}function o4(t,e){return typeof t=="function"?cF(t):lF(t,e)}function dF(t){return D2(t)&&t.tagName==="svg"}const fF=[...KP,cn,Ts],hF=t=>fF.find(GP(t)),a4=()=>({translate:0,scale:1,origin:0,originPoint:0}),ru=()=>({x:a4(),y:a4()}),l4=()=>({min:0,max:0}),yn=()=>({x:l4(),y:l4()}),pF=new WeakMap;function Wm(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Dd(t){return typeof t=="string"||Array.isArray(t)}const F2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],j2=["initial",...F2];function Gm(t){return Wm(t.animate)||j2.some(e=>Dd(t[e]))}function t3(t){return!!(Gm(t)||t.variants)}function mF(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Vn(s))t.addValue(r,s);else if(Vn(i))t.addValue(r,Lu(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,Lu(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const pm={current:null},V2={current:!1},gF=typeof window<"u";function n3(){if(V2.current=!0,!!gF)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>pm.current=t.matches;t.addEventListener("change",e),e()}else pm.current=!1}const u4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mm={};function r3(t){mm=t}function vF(){return mm}class yF{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:u},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=T2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=or.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Ct.render(this.render,!1,!0))};const{latestValues:f,renderState:h}=u;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=Gm(n),this.isVariantNode=t3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in v){const x=v[y];f[y]!==void 0&&Vn(x)&&x.set(f[y])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,pF.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(V2.current||n3(),this.shouldReduceMotion=pm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Go(this.notifyUpdate),Go(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&jP.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:f,duration:h}=n.accelerate,p=new DP({element:this.current,name:e,keyframes:u,times:c,ease:f,duration:Br(h)}),v=a(p);this.valueSubscriptions.set(e,()=>{v(),p.cancel()});return}const r=Ku.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Ct.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in mm){const n=mm[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<u4.length;r++){const s=u4[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=mF(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Lu(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(nP(r)||sP(r))?r=parseFloat(r):!hF(r)&&Ts.test(n)&&(r=ZP(e,n)),this.setBaseTarget(e,Vn(r)?r.get():r)),Vn(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=M2(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Vn(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new _2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){O2.render(this.render)}}class s3 extends yF{constructor(){super(...arguments),this.KeyframeResolver=K7}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Vn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Jo{constructor(e){this.isMounted=!1,this.node=e}update(){}}function i3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function _F({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function xF(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Bv(t){return t===void 0||t===1}function Qy({scale:t,scaleX:e,scaleY:n}){return!Bv(t)||!Bv(e)||!Bv(n)}function Da(t){return Qy(t)||o3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function o3(t){return c4(t.x)||c4(t.y)}function c4(t){return t&&t!=="0%"}function gm(t,e,n){const r=t-n,s=e*r;return n+s}function d4(t,e,n,r,s){return s!==void 0&&(t=gm(t,s,r)),gm(t,n,r)+e}function Jy(t,e=0,n=1,r,s){t.min=d4(t.min,e,n,r,s),t.max=d4(t.max,e,n,r,s)}function a3(t,{x:e,y:n}){Jy(t.x,e.translate,e.scale,e.originPoint),Jy(t.y,n.translate,n.scale,n.originPoint)}const f4=.999999999999,h4=1.0000000000001;function wF(t,e,n,r=!1){var u;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let c=0;c<s;c++){i=n[c],a=i.projectionDelta;const{visualElement:f}=i.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Xs(t.x,-i.scroll.offset.x),Xs(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,a3(t,a)),r&&Da(i.latestValues)&&vp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<h4&&e.x>f4&&(e.x=1),e.y<h4&&e.y>f4&&(e.y=1)}function Xs(t,e){t.min+=e,t.max+=e}function p4(t,e,n,r,s=.5){const i=kt(t.min,t.max,s);Jy(t,e,n,i,r)}function m4(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function vp(t,e,n){const r=n??t;p4(t.x,m4(e.x,r.x),e.scaleX,e.scale,e.originX),p4(t.y,m4(e.y,r.y),e.scaleY,e.scale,e.originY)}function l3(t,e){return i3(xF(t.getBoundingClientRect(),e))}function bF(t,e,n){const r=l3(t,n),{scroll:s}=e;return s&&(Xs(r.x,s.offset.x),Xs(r.y,s.offset.y)),r}const SF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},EF=Gu.length;function kF(t,e,n){let r="",s=!0;for(let a=0;a<EF;a++){const u=Gu[a],c=t[u];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);f=u.startsWith("scale")?h===1:h===0}if(!f||n){const h=Xy(c,hm[u]);if(!f){s=!1;const p=SF[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Xy(i,hm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function $2(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const f=e[c];if(Ku.has(c)){a=!0;continue}else if(_P(c)){s[c]=f;continue}else{const h=Xy(f,hm[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=kF(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:f="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${f} ${h}`}}function u3(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function g4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Kc={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(De.test(t))t=parseFloat(t);else return t;const n=g4(t,e.target.x),r=g4(t,e.target.y);return`${n}% ${r}%`}},CF={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ts.parse(t);if(s.length>5)return r;const i=Ts.createTransformer(t),a=typeof s[0]!="number"?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+a]/=u,s[1+a]/=c;const f=kt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=f),typeof s[3+a]=="number"&&(s[3+a]/=f),i(s)}},e_={borderRadius:{...Kc,applyTo:[...N2]},borderTopLeftRadius:Kc,borderTopRightRadius:Kc,borderBottomLeftRadius:Kc,borderBottomRightRadius:Kc,boxShadow:CF};function c3(t,{layout:e,layoutId:n}){return Ku.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!e_[t]||t==="opacity")}function H2(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const u in r)(Vn(r[u])||s&&Vn(s[u])||c3(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function PF(t){return window.getComputedStyle(t)}class TF extends s3{constructor(){super(...arguments),this.type="html",this.renderInstance=u3}readValueFromInstance(e,n){var r;if(Ku.has(n))return(r=this.projection)!=null&&r.isProjecting?$y(n):Z9(e,n);{const s=PF(e),i=(_P(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return l3(e,n)}build(e,n,r){$2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return H2(e,n,r)}}const RF={offset:"stroke-dashoffset",array:"stroke-dasharray"},AF={offset:"strokeDashoffset",array:"strokeDasharray"};function MF(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?RF:AF;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const IF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function d3(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,f,h){if($2(t,u,f),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:v}=t;p.transform&&(v.transform=p.transform,delete p.transform),(v.transform||p.transformOrigin)&&(v.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),v.transform&&(v.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const y of IF)p[y]!==void 0&&(v[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&MF(p,s,i,a,!1)}const f3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),h3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function NF(t,e,n,r){u3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(f3.has(s)?s:I2(s),e.attrs[s])}function p3(t,e,n){const r=H2(t,e,n);for(const s in t)if(Vn(t[s])||Vn(e[s])){const i=Gu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class OF extends s3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ku.has(n)){const r=qP(n);return r&&r.default||0}return n=f3.has(n)?n:I2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return p3(e,n,r)}build(e,n,r){d3(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){NF(e,n,r,s)}mount(e){this.isSVGTag=h3(e.tagName),super.mount(e)}}const LF=j2.length;function m3(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?m3(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<LF;n++){const r=j2[n],s=t.props[r];(Dd(s)||s===!1)&&(e[r]=s)}return e}function g3(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const DF=[...F2].reverse(),FF=F2.length;function jF(t){return e=>Promise.all(e.map(({animation:n,options:r})=>D7(t,n,r)))}function VF(t){let e=jF(t),n=v4(),r=!0,s=!1;const i=f=>(h,p)=>{var y;const v=nl(t,p,f==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(v){const{transition:x,transitionEnd:_,...b}=v;h={...h,...b,..._}}return h};function a(f){e=f(t)}function u(f){const{props:h}=t,p=m3(t.parent)||{},v=[],y=new Set;let x={},_=1/0;for(let E=0;E<FF;E++){const C=DF[E],P=n[C],T=h[C]!==void 0?h[C]:p[C],R=Dd(T),O=C===f?P.isActive:null;O===!1&&(_=E);let I=T===p[C]&&T!==h[C]&&R;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),P.protectedKeys={...x},!P.isActive&&O===null||!T&&!P.prevProp||Wm(T)||typeof T=="boolean")continue;if(C==="exit"&&P.isActive&&O!==!0){P.prevResolvedValues&&(x={...x,...P.prevResolvedValues});continue}const A=$F(P.prevProp,T);let N=A||C===f&&P.isActive&&!I&&R||E>_&&R,L=!1;const F=Array.isArray(T)?T:[T];let V=F.reduce(i(C),{});O===!1&&(V={});const{prevResolvedValues:G={}}=P,X={...G,...V},q=$=>{N=!0,y.has($)&&(L=!0,y.delete($)),P.needsAnimating[$]=!0;const ee=t.getValue($);ee&&(ee.liveStyle=!1)};for(const $ in X){const ee=V[$],H=G[$];if(x.hasOwnProperty($))continue;let D=!1;Gy(ee)&&Gy(H)?D=!g3(ee,H)||A:D=ee!==H,D?ee!=null?q($):y.add($):ee!==void 0&&y.has($)?q($):P.protectedKeys[$]=!0}P.prevProp=T,P.prevResolvedValues=V,P.isActive&&(x={...x,...V}),(r||s)&&t.blockInitialAnimation&&(N=!1);const B=I&&A;N&&(!B||L)&&v.push(...F.map($=>{const ee={type:C};if(typeof $=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,D=nl(H,$);if(H.enteringChildren&&D){const{delayChildren:Z}=D.transition||{};ee.delay=VP(H.enteringChildren,t,Z)}}return{animation:$,options:ee}}))}if(y.size){const E={};if(typeof h.initial!="boolean"){const C=nl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);C&&C.transition&&(E.transition=C.transition)}y.forEach(C=>{const P=t.getBaseTarget(C),T=t.getValue(C);T&&(T.liveStyle=!0),E[C]=P??null}),v.push({animation:E})}let b=!!v.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?e(v):Promise.resolve()}function c(f,h){var v;if(n[f].isActive===h)return Promise.resolve();(v=t.variantChildren)==null||v.forEach(y=>{var x;return(x=y.animationState)==null?void 0:x.setActive(f,h)}),n[f].isActive=h;const p=u(f);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=v4(),s=!0}}}function $F(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!g3(e,t):!1}function Ca(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function v4(){return{animate:Ca(!0),whileInView:Ca(),whileHover:Ca(),whileTap:Ca(),whileDrag:Ca(),whileFocus:Ca(),exit:Ca()}}function t_(t,e){t.min=e.min,t.max=e.max}function ws(t,e){t_(t.x,e.x),t_(t.y,e.y)}function y4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const v3=1e-4,HF=1-v3,zF=1+v3,y3=.01,UF=0-y3,BF=0+y3;function ar(t){return t.max-t.min}function WF(t,e,n){return Math.abs(t-e)<=n}function _4(t,e,n,r=.5){t.origin=r,t.originPoint=kt(e.min,e.max,t.origin),t.scale=ar(n)/ar(e),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=HF&&t.scale<=zF||isNaN(t.scale))&&(t.scale=1),(t.translate>=UF&&t.translate<=BF||isNaN(t.translate))&&(t.translate=0)}function gd(t,e,n,r){_4(t.x,e.x,n.x,r?r.originX:void 0),_4(t.y,e.y,n.y,r?r.originY:void 0)}function x4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+ar(e)}function GF(t,e,n,r){x4(t.x,e.x,n.x,r==null?void 0:r.x),x4(t.y,e.y,n.y,r==null?void 0:r.y)}function w4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+ar(e)}function vm(t,e,n,r){w4(t.x,e.x,n.x,r==null?void 0:r.x),w4(t.y,e.y,n.y,r==null?void 0:r.y)}function b4(t,e,n,r,s){return t-=e,t=gm(t,1/n,r),s!==void 0&&(t=gm(t,1/s,r)),t}function KF(t,e=0,n=1,r=.5,s,i=t,a=t){if(ii.test(e)&&(e=parseFloat(e),e=kt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=kt(i.min,i.max,r);t===i&&(u-=e),t.min=b4(t.min,e,n,u,s),t.max=b4(t.max,e,n,u,s)}function S4(t,e,[n,r,s],i,a){KF(t,e[n],e[r],e[s],e.scale,i,a)}const qF=["x","scaleX","originX"],ZF=["y","scaleY","originY"];function E4(t,e,n,r){S4(t.x,e,qF,n?n.x:void 0,r?r.x:void 0),S4(t.y,e,ZF,n?n.y:void 0,r?r.y:void 0)}function k4(t){return t.translate===0&&t.scale===1}function _3(t){return k4(t.x)&&k4(t.y)}function C4(t,e){return t.min===e.min&&t.max===e.max}function YF(t,e){return C4(t.x,e.x)&&C4(t.y,e.y)}function P4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function x3(t,e){return P4(t.x,e.x)&&P4(t.y,e.y)}function T4(t){return ar(t.x)/ar(t.y)}function R4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Gs(t){return[t("x"),t("y")]}function XF(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:f,rotate:h,pathRotation:p,rotateX:v,rotateY:y,skewX:x,skewY:_}=n;f&&(r=`perspective(${f}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),v&&(r+=`rotateX(${v}deg) `),y&&(r+=`rotateY(${y}deg) `),x&&(r+=`skewX(${x}deg) `),_&&(r+=`skewY(${_}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const QF=N2.length,A4=t=>typeof t=="string"?parseFloat(t):t,M4=t=>typeof t=="number"||De.test(t);function JF(t,e,n,r,s,i){s?(t.opacity=kt(0,n.opacity??1,ej(r)),t.opacityExit=kt(e.opacity??1,0,tj(r))):i&&(t.opacity=kt(e.opacity??1,n.opacity??1,r));for(let a=0;a<QF;a++){const u=N2[a];let c=I4(e,u),f=I4(n,u);if(c===void 0&&f===void 0)continue;c||(c=0),f||(f=0),c===0||f===0||M4(c)===M4(f)?(t[u]=Math.max(kt(A4(c),A4(f),r),0),(ii.test(f)||ii.test(c))&&(t[u]+="%")):t[u]=f}(e.rotate||n.rotate)&&(t.rotate=kt(e.rotate||0,n.rotate||0,r))}function I4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const ej=w3(0,.5,hP),tj=w3(.5,.95,ds);function w3(t,e,n){return r=>r<t?0:r>e?1:n(Od(t,e,r))}function nj(t,e,n){const r=Vn(t)?t:Lu(t);return r.start(A2("",r,e,n)),r.animation}function Fd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const rj=(t,e)=>t.depth-e.depth;class sj{constructor(){this.children=[],this.isDirty=!1}add(e){v2(this.children,e),this.isDirty=!0}remove(e){lm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rj),this.isDirty=!1,this.children.forEach(e)}}function ij(t,e){const n=or.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Go(r),t(i-e))};return Ct.setup(r,!0),()=>Go(r)}function yp(t){return Vn(t)?t.get():t}class oj{constructor(){this.members=[]}add(e){v2(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(lm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(lm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:a}=e.options;(i===void 0||i!==a)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const _p={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Wv=["","X","Y","Z"],aj=1e3;let lj=0;function Gv(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function b3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=BP(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ct,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&b3(r)}function S3({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=lj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(dj),this.nodes.forEach(vj),this.nodes.forEach(yj),this.nodes.forEach(fj)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new sj)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new _2),this.eventHandlers.get(a).add(u)}notifyListeners(a,...u){const c=this.eventHandlers.get(a);c&&c.notify(...u)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=D2(a)&&!dF(a),this.instance=a;const{layoutId:u,layout:c,visualElement:f}=this.options;if(f&&!f.current&&f.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||u)&&(this.isLayoutDirty=!0),t){let h,p=0;const v=()=>this.root.updateBlockedByResize=!1;Ct.read(()=>{p=window.innerWidth}),t(a,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=ij(v,250),_p.hasAnimatedSinceResize&&(_p.hasAnimatedSinceResize=!1,this.nodes.forEach(L4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||Sj,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=f.getProps(),E=!this.targetLayout||!x3(this.targetLayout,y),C=!p&&v;if(this.options.layoutRoot||this.resumeFrom||C||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...R2(x,"layout"),onPlay:_,onComplete:b};(f.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,C,P.path)}else p||L4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Go(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_j),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&b3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:c}=this.options;if(u===void 0&&!c)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(pj),this.nodes.forEach(N4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(O4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mj),this.nodes.forEach(gj),this.nodes.forEach(uj),this.nodes.forEach(cj)):this.nodes.forEach(O4),this.clearAllSnapshots();const u=or.now();Dn.delta=ai(0,1e3/60,u-Dn.timestamp),Dn.timestamp=u,Dn.isProcessing=!0,Fv.update.process(Dn),Fv.preRender.process(Dn),Fv.render.process(Dn),Dn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,O2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hj),this.sharedNodes.forEach(xj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ar(this.snapshot.measuredBox.x)&&!ar(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=yn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(u=!1),u&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!_3(this.projectionDelta),c=this.getTransformTemplate(),f=c?c(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;a&&this.instance&&(u||Da(this.latestValues)||h)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),Ej(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return yn();const u=a.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(kj))){const{scroll:h}=this.root;h&&(Xs(u.x,h.offset.x),Xs(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=yn();if(ws(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:p,options:v}=h;h!==this.root&&p&&v.layoutScroll&&(p.wasRoot&&ws(u,a),Xs(u.x,p.offset.x),Xs(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const f=c||yn();ws(f,a);for(let v=0;v<this.path.length;v++){const y=this.path[v];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(Xs(f.x,-y.scroll.offset.x),Xs(f.y,-y.scroll.offset.y)),Da(y.latestValues)&&vp(f,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return Da(this.latestValues)&&vp(f,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),f}removeTransform(a){var c;const u=yn();ws(u,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!Da(h.latestValues))continue;let p;h.instance&&(Qy(h.latestValues)&&h.updateSnapshot(),p=yn(),ws(p,h.measurePageBox())),E4(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return Da(this.latestValues)&&E4(u,this.latestValues),u}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Dn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var y;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=Dn.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=yn(),this.targetWithTransforms=yn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),GF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ws(this.target,this.layout.layoutBox),a3(this.target,this.targetDelta)):ws(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Qy(this.parent.latestValues)||o3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,u,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yn(),this.relativeTargetOrigin=yn(),vm(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),ws(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Dn.timestamp&&(c=!1),c)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;ws(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;wF(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=yn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(y4(this.prevProjectionDelta.x,this.projectionDelta.x),y4(this.prevProjectionDelta.y,this.projectionDelta.y)),gd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!R4(this.projectionDelta.x,this.prevProjectionDelta.x)||!R4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ru(),this.projectionDelta=ru(),this.projectionDeltaWithTransform=ru()}setAnimationOrigin(a,u=!1,c){const f=this.snapshot,h=f?f.latestValues:{},p={...this.latestValues},v=ru();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const y=yn(),x=f?f.source:void 0,_=this.layout?this.layout.source:void 0,b=x!==_,E=this.getStack(),C=!E||E.members.length<=1,P=!!(b&&!C&&this.options.crossfade===!0&&!this.path.some(bj));this.animationProgress=0;let T;const R=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=O=>{const I=O/1e3,A=R==null?void 0:R(I);A?(v.x.translate=A.x,v.x.scale=kt(a.x.scale,1,I),v.x.origin=a.x.origin,v.x.originPoint=a.x.originPoint,v.y.translate=A.y,v.y.scale=kt(a.y.scale,1,I),v.y.origin=a.y.origin,v.y.originPoint=a.y.originPoint):(D4(v.x,a.x,I),D4(v.y,a.y,I)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vm(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),wj(this.relativeTarget,this.relativeTargetOrigin,y,I),T&&YF(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=yn()),ws(T,this.relativeTarget)),b&&(this.animationValues=p,JF(p,h,this.latestValues,I,P,C)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,f;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(f=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||f.stop(),this.pendingAnimation&&(Go(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ct.update(()=>{_p.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Lu(0)),this.motionValue.jump(0,!1),this.currentAnimation=nj(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(aj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:f,latestValues:h}=a;if(!(!u||!c||!f)){if(this!==a&&this.layout&&f&&E3(this.options.animationType,this.layout.layoutBox,f.layoutBox)){c=this.target||yn();const p=ar(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const v=ar(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+v}ws(u,c),vp(u,h),gd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new oj),this.sharedNodes.get(a).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var u;const{layoutId:a}=this.options;return a?((u=this.getStack())==null?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:a}=this.options;return a?(u=this.getStack())==null?void 0:u.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:u,preserveFollowOpacity:c}={}){const f=this.getStack();f&&f.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let u=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(u=!0),!u)return;const f={};c.z&&Gv("z",a,f,this.animationValues);for(let h=0;h<Wv.length;h++)Gv(`rotate${Wv[h]}`,a,f,this.animationValues),Gv(`skew${Wv[h]}`,a,f,this.animationValues);a.render();for(const h in f)a.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);a.scheduleRender()}applyProjectionStyles(a,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=yp(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=yp(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Da(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=XF(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:v,y}=this.projectionDelta;a.transformOrigin=`${v.origin*100}% ${y.origin*100}% 0`,f.animationValues?a.opacity=f===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in e_){if(h[x]===void 0)continue;const{correct:_,applyTo:b,isCSSVariable:E}=e_[x],C=p==="none"?h[x]:_(h[x],f);if(b){const P=b.length;for(let T=0;T<P;T++)a[b[T]]=C}else E?this.options.visualElement.renderState.vars[x]=C:a[x]=C}this.options.layoutId&&(a.pointerEvents=f===this?yp(u==null?void 0:u.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var u;return(u=a.currentAnimation)==null?void 0:u.stop()}),this.root.nodes.forEach(N4),this.root.sharedNodes.clear()}}}function uj(t){t.updateLayout()}function cj(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,a=e.source!==t.layout.source;if(i==="size")Gs(p=>{const v=a?e.measuredBox[p]:e.layoutBox[p],y=ar(v);v.min=r[p].min,v.max=v.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";t_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else E3(i,e.layoutBox,r)&&Gs(p=>{const v=a?e.measuredBox[p]:e.layoutBox[p],y=ar(r[p]);v.max=v.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const u=ru();gd(u,r,e.layoutBox);const c=ru();a?gd(c,t.applyTransform(s,!0),e.measuredBox):gd(c,r,e.layoutBox);const f=!_3(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:y}=p;if(v&&y){const x=t.options.layoutAnchor||void 0,_=yn();vm(_,e.layoutBox,v.layoutBox,x);const b=yn();vm(b,r,y.layoutBox,x),x3(_,b)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function dj(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function fj(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function hj(t){t.clearSnapshot()}function N4(t){t.clearMeasurements()}function pj(t){t.isLayoutDirty=!0,t.updateLayout()}function O4(t){t.isLayoutDirty=!1}function mj(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function gj(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function L4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function vj(t){t.resolveTargetDelta()}function yj(t){t.calcProjection()}function _j(t){t.resetSkewAndRotation()}function xj(t){t.removeLeadSnapshot()}function D4(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function F4(t,e,n,r){t.min=kt(e.min,n.min,r),t.max=kt(e.max,n.max,r)}function wj(t,e,n,r){F4(t.x,e.x,n.x,r),F4(t.y,e.y,n.y,r)}function bj(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Sj={duration:.45,ease:[.4,0,.1,1]},j4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),V4=j4("applewebkit/")&&!j4("chrome/")?Math.round:ds;function $4(t){t.min=V4(t.min),t.max=V4(t.max)}function Ej(t){$4(t.x),$4(t.y)}function E3(t,e,n){return t==="position"||t==="preserve-aspect"&&!WF(T4(e),T4(n),.2)}function kj(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Cj=S3({attachResizeListener:(t,e)=>Fd(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Kv={current:void 0},k3=S3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Kv.current){const t=new Cj({});t.mount(window),t.setOptions({layoutScroll:!0}),Kv.current=t}return Kv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),z2=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function H4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Pj(...t){return e=>{let n=!1;const r=t.map(s=>{const i=H4(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():H4(t[s],null)}}}}function Tj(...t){return g.useCallback(Pj(...t),t)}class Rj extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(hp(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=hp(r)&&r.offsetWidth||0,i=hp(r)&&r.offsetHeight||0,a=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(a.height),u.width=parseFloat(a.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=i-u.height-u.top,u.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Aj({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var v;const a=g.useId(),u=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=g.useContext(z2),h=((v=t.props)==null?void 0:v.ref)??(t==null?void 0:t.ref),p=Tj(u,h);return g.useInsertionEffect(()=>{const{width:y,height:x,top:_,left:b,right:E,bottom:C,direction:P}=c.current;if(e||i===!1||!u.current||!y||!x)return;const T=P==="rtl",R=n==="left"?T?`right: ${E}`:`left: ${b}`:T?`left: ${b}`:`right: ${E}`,O=r==="bottom"?`bottom: ${C}`:`top: ${_}`;u.current.dataset.motionPopId=a;const I=document.createElement("style");f&&(I.nonce=f);const A=s??document.head;return A.appendChild(I),I.sheet&&I.sheet.insertRule(`
|
|
63
|
+
[data-motion-pop-id="${a}"] {
|
|
64
|
+
position: absolute !important;
|
|
65
|
+
width: ${y}px !important;
|
|
66
|
+
height: ${x}px !important;
|
|
67
|
+
${R}px !important;
|
|
68
|
+
${O}px !important;
|
|
69
|
+
}
|
|
70
|
+
`),()=>{var N;(N=u.current)==null||N.removeAttribute("data-motion-pop-id"),A.contains(I)&&A.removeChild(I)}},[e]),S.jsx(Rj,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:p})})}const Mj=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:f})=>{const h=m2(Ij),p=g.useId(),v=g.useRef(n),y=g.useRef(r);g2(()=>{v.current=n,y.current=r});let x=!0,_=g.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:b=>{h.set(b,!0);for(const E of h.values())if(!E)return;r&&r()},register:b=>(h.set(b,!1),()=>{var E;h.delete(b),!v.current&&!h.size&&((E=y.current)==null||E.call(y))})}),[n,h,r]);return i&&x&&(_={..._}),g.useMemo(()=>{h.forEach((b,E)=>h.set(E,!1))},[n]),g.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(Aj,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:f,children:t}),S.jsx(Um.Provider,{value:_,children:t})};function Ij(){return new Map}function C3(t=!0){const e=g.useContext(Um);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const a=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const $h=t=>t.key||"";function z4(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const Ui=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:u="left",anchorY:c="top",root:f})=>{const[h,p]=C3(a),v=g.useMemo(()=>z4(t),[t]),y=a&&!h?[]:v.map($h),x=g.useRef(!0),_=g.useRef(v),b=m2(()=>new Map),E=g.useRef(new Set),[C,P]=g.useState(v),[T,R]=g.useState(v);g2(()=>{x.current=!1,_.current=v;for(let A=0;A<T.length;A++){const N=$h(T[A]);y.includes(N)?(b.delete(N),E.current.delete(N)):b.get(N)!==!0&&b.set(N,!1)}},[T,y.length,y.join("-")]);const O=[];if(v!==C){let A=[...v];for(let N=0;N<T.length;N++){const L=T[N],F=$h(L);y.includes(F)||(A.splice(N,0,L),O.push(L))}return i==="wait"&&O.length&&(A=O),R(z4(A)),P(v),null}const{forceRender:I}=g.useContext(p2);return S.jsx(S.Fragment,{children:T.map(A=>{const N=$h(A),L=a&&!h?!1:v===T||y.includes(N),F=()=>{if(E.current.has(N))return;if(b.has(N))E.current.add(N),b.set(N,!0);else return;let V=!0;b.forEach(G=>{G||(V=!1)}),V&&(I==null||I(),R(_.current),a&&(p==null||p()),r&&r())};return S.jsx(Mj,{isPresent:L,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:f,onExitComplete:L?void 0:F,anchorX:u,anchorY:c,children:A},N)})})},P3=g.createContext({strict:!1}),U4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let B4=!1;function Nj(){if(B4)return;const t={};for(const e in U4)t[e]={isEnabled:n=>U4[e].some(r=>!!n[r])};r3(t),B4=!0}function T3(){return Nj(),vF()}function Oj(t){const e=T3();for(const n in t)e[n]={...e[n],...t[n]};r3(e)}const Lj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ym(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Lj.has(t)}let R3=t=>!ym(t);function Dj(t){typeof t=="function"&&(R3=e=>e.startsWith("on")?!ym(e):t(e))}try{Dj(require("@emotion/is-prop-valid").default)}catch{}function Fj(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Vn(t[s])||(R3(s)||n===!0&&ym(s)||!e&&!ym(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Km=g.createContext({});function jj(t,e){if(Gm(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Dd(n)?n:void 0,animate:Dd(r)?r:void 0}}return t.inherit!==!1?e:{}}function Vj(t){const{initial:e,animate:n}=jj(t,g.useContext(Km));return g.useMemo(()=>({initial:e,animate:n}),[W4(e),W4(n)])}function W4(t){return Array.isArray(t)?t.join(" "):t}const U2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function A3(t,e,n){for(const r in e)!Vn(e[r])&&!c3(r,n)&&(t[r]=e[r])}function $j({transformTemplate:t},e){return g.useMemo(()=>{const n=U2();return $2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Hj(t,e){const n=t.style||{},r={};return A3(r,n,t),Object.assign(r,$j(t,e)),r}function zj(t,e){const n={},r=Hj(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const M3=()=>({...U2(),attrs:{}});function Uj(t,e,n,r){const s=g.useMemo(()=>{const i=M3();return d3(i,e,h3(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};A3(i,t.style,t),s.style={...i,...s.style}}return s}const Bj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function B2(t){return typeof t!="string"||t.includes("-")?!1:!!(Bj.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wj(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??B2(t)?Uj:zj)(e,r,s,t),f=Fj(e,typeof t=="string",i),h=t!==g.Fragment?{...f,...c,ref:n}:{},{children:p}=e,v=g.useMemo(()=>Vn(p)?p.get():p,[p]);return g.createElement(t,{...h,children:v})}function Gj({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:Kj(n,r,s,t),renderState:e()}}function Kj(t,e,n,r){const s={},i=r(t,{});for(const v in i)s[v]=yp(i[v]);let{initial:a,animate:u}=t;const c=Gm(t),f=t3(t);e&&f&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?u:a;if(p&&typeof p!="boolean"&&!Wm(p)){const v=Array.isArray(p)?p:[p];for(let y=0;y<v.length;y++){const x=M2(t,v[y]);if(x){const{transitionEnd:_,transition:b,...E}=x;for(const C in E){let P=E[C];if(Array.isArray(P)){const T=h?P.length-1:0;P=P[T]}P!==null&&(s[C]=P)}for(const C in _)s[C]=_[C]}}}return s}const I3=t=>(e,n)=>{const r=g.useContext(Km),s=g.useContext(Um),i=()=>Gj(t,e,r,s);return n?i():m2(i)},qj=I3({scrapeMotionValuesFromProps:H2,createRenderState:U2}),Zj=I3({scrapeMotionValuesFromProps:p3,createRenderState:M3}),Yj=Symbol.for("motionComponentSymbol");function Xj(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var u;i&&((u=t.onMount)==null||u.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const c=a(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const N3=g.createContext({});function Ql(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Qj(t,e,n,r,s,i){var P,T;const{visualElement:a}=g.useContext(Km),u=g.useContext(P3),c=g.useContext(Um),f=g.useContext(z2),h=f.reducedMotion,p=f.skipAnimations,v=g.useRef(null),y=g.useRef(!1);r=r||u.renderer,!v.current&&r&&(v.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const x=v.current,_=g.useContext(N3);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&Jj(v.current,n,s,_);const b=g.useRef(!1);g.useInsertionEffect(()=>{x&&b.current&&x.update(n,c)});const E=n[UP],C=g.useRef(!!E&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,E))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,E)));return g2(()=>{y.current=!0,x&&(b.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),C.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!C.current&&x.animationState&&x.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,E)}),C.current=!1),x.enteringChildren=void 0)}),x}function Jj(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:O3(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&Ql(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:f,layoutAnchor:h})}function O3(t){if(t)return t.options.allowProjection!==!1?t.projection:O3(t.parent)}function qv(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&Oj(r);const i=n?n==="svg":B2(t),a=i?Zj:qj;function u(f,h){let p;const v={...g.useContext(z2),...f,layoutId:eV(f)},{isStatic:y}=v,x=Vj(f),_=a(f,y);if(!y&&typeof window<"u"){tV();const b=nV(v);p=b.MeasureLayout,x.visualElement=Qj(t,_,v,s,b.ProjectionNode,i)}return S.jsxs(Km.Provider,{value:x,children:[p&&x.visualElement?S.jsx(p,{visualElement:x.visualElement,...v}):null,Wj(t,f,Xj(_,x.visualElement,h),_,y,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(u);return c[Yj]=t,c}function eV({layoutId:t}){const e=g.useContext(p2).id;return e&&t!==void 0?e+"-"+t:t}function tV(t,e){g.useContext(P3).strict}function nV(t){const e=T3(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rV(t,e){if(typeof Proxy>"u")return qv;const n=new Map,r=(i,a)=>qv(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,qv(a,void 0,t,e)),n.get(a))})}const sV=(t,e)=>e.isSVG??B2(t)?new OF(e):new TF(e,{allowProjection:t!==g.Fragment});class iV extends Jo{constructor(e){super(e),e.animationState||(e.animationState=VF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Wm(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let oV=0;class aV extends Jo{constructor(){super(...arguments),this.id=oV++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:a,custom:u}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=nl(this.node,a,u);if(c){const{transition:f,transitionEnd:h,...p}=c;for(const v in p)(i=this.node.getValue(v))==null||i.jump(p[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const lV={animation:{Feature:iV},exit:{Feature:aV}};function hf(t){return{point:{x:t.pageX,y:t.pageY}}}const uV=t=>e=>L2(e)&&t(e,hf(e));function vd(t,e,n,r){return Fd(t,e,uV(n),r)}const L3=({current:t})=>t?t.ownerDocument.defaultView:null,G4=(t,e)=>Math.abs(t-e);function cV(t,e){const n=G4(t.x,e.x),r=G4(t.y,e.y);return Math.sqrt(n**2+r**2)}const K4=new Set(["auto","scroll"]);class D3{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Hh(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Zv(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=cV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:E}=x,{timestamp:C}=Dn;this.history.push({...E,timestamp:C});const{onStart:P,onMove:T}=this.handlers;_||(P&&P(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=Hh(_,this.transformPagePoint),Ct.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:b,onSessionEnd:E,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=Zv(x.type==="pointercancel"?this.lastMoveEventInfo:Hh(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(x,P),E&&E(x,P)},!L2(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=hf(e),f=Hh(c,this.transformPagePoint),{point:h}=f,{timestamp:p}=Dn;this.history=[{...h,timestamp:p}];const{onSessionStart:v}=n;v&&v(e,Zv(f,this.history));const y={passive:!0,capture:!0};this.removeListeners=cf(vd(this.contextWindow,"pointermove",this.handlePointerMove,y),vd(this.contextWindow,"pointerup",this.handlePointerUp,y),vd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(K4.has(r.overflowX)||K4.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Ct.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Go(this.updatePoint)}}function Hh(t,e){return e?{point:e(t.point)}:t}function q4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Zv({point:t},e){return{point:t,delta:q4(t,F3(e)),offset:q4(t,dV(e)),velocity:fV(e,.1)}}function dV(t){return t[0]}function F3(t){return t[t.length-1]}function fV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=F3(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Br(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Br(e)*2&&(r=t[1]);const i=as(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function hV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?kt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?kt(n,t,r.max):Math.min(t,n)),t}function Z4(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function pV(t,{top:e,left:n,bottom:r,right:s}){return{x:Z4(t.x,n,s),y:Z4(t.y,e,r)}}function Y4(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function mV(t,e){return{x:Y4(t.x,e.x),y:Y4(t.y,e.y)}}function gV(t,e){let n=.5;const r=ar(t),s=ar(e);return s>r?n=Od(e.min,e.max-r,t.min):r>s&&(n=Od(t.min,t.max-s,e.min)),ai(0,1,n)}function vV(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const n_=.35;function yV(t=n_){return t===!1?t=0:t===!0&&(t=n_),{x:X4(t,"left","right"),y:X4(t,"top","bottom")}}function X4(t,e,n){return{min:Q4(t,e),max:Q4(t,n)}}function Q4(t,e){return typeof t=="number"?t:t[e]||0}const _V=new WeakMap;class xV{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=yn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(hf(p).point),this.stopAnimation()},a=(p,v)=>{const{drag:y,dragPropagation:x,onDragStart:_}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=q7(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gs(E=>{let C=this.getAxisMotionValue(E).get()||0;if(ii.test(C)){const{projection:P}=this.visualElement;if(P&&P.layout){const T=P.layout.layoutBox[E];T&&(C=ar(T)*(parseFloat(C)/100))}}this.originPoint[E]=C}),_&&Ct.update(()=>_(p,v),!1,!0),Ky(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},u=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:_,onDrag:b}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=v;if(x&&this.currentDirection===null){this.currentDirection=bV(E),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),b&&Ct.update(()=>b(p,v),!1,!0)},c=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v,this.stop(p,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new D3(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:L3(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:u}=this.getProps();u&&Ct.postRender(()=>u(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!zh(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=hV(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Ql(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=pV(r.layoutBox,e):this.constraints=!1,this.elastic=yV(n),s!==this.constraints&&!Ql(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Gs(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=vV(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ql(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=bF(r,s.root,this.visualElement.getTransformPagePoint());let a=mV(s.layout.layoutBox,i);if(n){const u=n(_F(a));this.hasMutatedConstraints=!!u,u&&(a=i3(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},f=Gs(h=>{if(!zh(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const v=s?200:1e6,y=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(f).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Ky(this.visualElement,e),r.start(A2(e,r,0,n,this.visualElement,!1))}stopAnimation(){Gs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Gs(n=>{const{drag:r}=this.getProps();if(!zh(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:u}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-kt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ql(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Gs(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=gV({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gs(a=>{if(!zh(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:f}=this.constraints[a];u.set(kt(c,f,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_V.set(this.visualElement,this);const e=this.visualElement.current,n=vd(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),v=f.target,y=v!==e&&eF(v);h&&p&&!y&&this.start(f)});let r;const s=()=>{const{dragConstraints:f}=this.getProps();Ql(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=wV(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ct.read(s);const u=Fd(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(Gs(p=>{const v=this.getAxisMotionValue(p);v&&(this.originPoint[p]+=f[p].translate,v.set(v.get()+f[p].translate))}),this.visualElement.render())}));return()=>{u(),n(),a(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=n_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function J4(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function wV(t,e,n){const r=o4(t,J4(n)),s=o4(e,J4(n));return()=>{r(),s()}}function zh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function bV(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class SV extends Jo{constructor(e){super(e),this.removeGroupControls=ds,this.removeListeners=ds,this.controls=new xV(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ds}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Yv=t=>(e,n)=>{t&&Ct.update(()=>t(e,n),!1,!0)};class EV extends Jo{constructor(){super(...arguments),this.removePointerDownListener=ds}onPointerDown(e){this.session=new D3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:L3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yv(e),onStart:Yv(n),onMove:Yv(r),onEnd:(i,a)=>{delete this.session,s&&Ct.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=vd(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Xv=!1;class kV extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Xv&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),_p.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Xv=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Ct.postRender(()=>{const u=a.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),O2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Xv=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function j3(t){const[e,n]=C3(),r=g.useContext(p2);return S.jsx(kV,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(N3),isPresent:e,safeToRemove:n})}const CV={pan:{Feature:EV},drag:{Feature:SV,ProjectionNode:k3,MeasureLayout:j3}};function ek(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Ct.postRender(()=>i(e,hf(e)))}class PV extends Jo{mount(){const{current:e}=this.node;e&&(this.unmount=Y7(e,(n,r)=>(ek(this.node,r,"Start"),s=>ek(this.node,s,"End"))))}unmount(){}}class TV extends Jo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=cf(Fd(this.node.current,"focus",()=>this.onFocus()),Fd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tk(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Ct.postRender(()=>i(e,hf(e)))}class RV extends Jo{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=nF(e,(s,i)=>(tk(this.node,i,"Start"),(a,{success:u})=>tk(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const r_=new WeakMap,Qv=new WeakMap,AV=t=>{const e=r_.get(t.target);e&&e(t)},MV=t=>{t.forEach(AV)};function IV({root:t,...e}){const n=t||document;Qv.has(n)||Qv.set(n,{});const r=Qv.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(MV,{root:t,...e})),r[s]}function NV(t,e,n){const r=IV(e);return r_.set(t,n),r.observe(t),()=>{r_.delete(t),r.unobserve(t)}}const OV={some:0,all:1};class LV extends Jo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:OV[s]},u=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:v}=this.node.getProps(),y=h?p:v;y&&y(f)};this.stopObserver=NV(this.node.current,a,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(DV(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function DV({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const FV={inView:{Feature:LV},tap:{Feature:RV},focus:{Feature:TV},hover:{Feature:PV}},jV={layout:{ProjectionNode:k3,MeasureLayout:j3}},VV={...lV,...FV,...CV,...jV},Bi=rV(VV,sV);function $V(){!V2.current&&n3();const[t]=g.useState(pm.current);return t}const rl=Bi;var qm=Z6();const HV=Vm(qm);function zV(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const UV=t=>{switch(t){case"success":return GV;case"info":return qV;case"warning":return KV;case"error":return ZV;default:return null}},BV=Array(12).fill(0),WV=({visible:t,className:e})=>ve.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},BV.map((n,r)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),GV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),KV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),qV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ZV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),YV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),XV=()=>{const[t,e]=ve.useState(document.hidden);return ve.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let s_=1;class QV{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:s_++,a=this.toasts.find(c=>c.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:r}),{...c,...e,id:i,dismissible:u,title:r}):c):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,a;const u=s.then(async f=>{if(a=["resolve",f],ve.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(e$(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...x})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:v,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,y=typeof h=="object"&&!ve.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((f,h)=>u.then(()=>a[0]==="reject"?h(a[1]):f(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||s_++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const _r=new QV,JV=(t,e)=>{const n=(e==null?void 0:e.id)||s_++;return _r.addToast({title:t,...e,id:n}),n},e$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",t$=JV,n$=()=>_r.toasts,r$=()=>_r.getActiveToasts(),ht=Object.assign(t$,{success:_r.success,info:_r.info,warning:_r.warning,error:_r.error,custom:_r.custom,message:_r.message,promise:_r.promise,dismiss:_r.dismiss,loading:_r.loading},{getHistory:n$,getToasts:r$});zV("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Uh(t){return t.label!==void 0}const s$=3,i$="24px",o$="16px",nk=4e3,a$=356,l$=14,u$=45,c$=200;function Us(...t){return t.filter(Boolean).join(" ")}function d$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const f$=t=>{var e,n,r,s,i,a,u,c,f;const{invert:h,toast:p,unstyled:v,interacting:y,setHeights:x,visibleToasts:_,heights:b,index:E,toasts:C,expanded:P,removeToast:T,defaultRichColors:R,closeButton:O,style:I,cancelButtonStyle:A,actionButtonStyle:N,className:L="",descriptionClassName:F="",duration:V,position:G,gap:X,expandByDefault:q,classNames:B,icons:Y,closeButtonAriaLabel:$="Close toast"}=t,[ee,H]=ve.useState(null),[D,Z]=ve.useState(null),[te,se]=ve.useState(!1),[oe,ue]=ve.useState(!1),[he,ie]=ve.useState(!1),[ae,me]=ve.useState(!1),[Se,Ae]=ve.useState(!1),[Ke,it]=ve.useState(0),[Oe,at]=ve.useState(0),Mt=ve.useRef(p.duration||V||nk),mt=ve.useRef(null),Fe=ve.useRef(null),Qe=E===0,lt=E+1<=_,Je=p.type,vt=p.dismissible!==!1,xn=p.className||"",zt=p.descriptionClassName||"",Rn=ve.useMemo(()=>b.findIndex(qe=>qe.toastId===p.id)||0,[b,p.id]),Xn=ve.useMemo(()=>{var qe;return(qe=p.closeButton)!=null?qe:O},[p.closeButton,O]),Rr=ve.useMemo(()=>p.duration||V||nk,[p.duration,V]),Qn=ve.useRef(0),wn=ve.useRef(0),Ms=ve.useRef(0),Is=ve.useRef(null),[An,di]=G.split("-"),fi=ve.useMemo(()=>b.reduce((qe,Pt,nn)=>nn>=Rn?qe:qe+Pt.height,0),[b,Rn]),hs=XV(),Ns=p.invert||h,cr=Je==="loading";wn.current=ve.useMemo(()=>Rn*X+fi,[Rn,fi]),ve.useEffect(()=>{Mt.current=Rr},[Rr]),ve.useEffect(()=>{se(!0)},[]),ve.useEffect(()=>{const qe=Fe.current;if(qe){const Pt=qe.getBoundingClientRect().height;return at(Pt),x(nn=>[{toastId:p.id,height:Pt,position:p.position},...nn]),()=>x(nn=>nn.filter(bn=>bn.toastId!==p.id))}},[x,p.id]),ve.useLayoutEffect(()=>{if(!te)return;const qe=Fe.current,Pt=qe.style.height;qe.style.height="auto";const nn=qe.getBoundingClientRect().height;qe.style.height=Pt,at(nn),x(bn=>bn.find(Ut=>Ut.toastId===p.id)?bn.map(Ut=>Ut.toastId===p.id?{...Ut,height:nn}:Ut):[{toastId:p.id,height:nn,position:p.position},...bn])},[te,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const Mn=ve.useCallback(()=>{ue(!0),it(wn.current),x(qe=>qe.filter(Pt=>Pt.toastId!==p.id)),setTimeout(()=>{T(p)},c$)},[p,T,x,wn]);ve.useEffect(()=>{if(p.promise&&Je==="loading"||p.duration===1/0||p.type==="loading")return;let qe;return P||y||hs?(()=>{if(Ms.current<Qn.current){const bn=new Date().getTime()-Qn.current;Mt.current=Mt.current-bn}Ms.current=new Date().getTime()})():(()=>{Mt.current!==1/0&&(Qn.current=new Date().getTime(),qe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Mn()},Mt.current))})(),()=>clearTimeout(qe)},[P,y,p,Je,hs,Mn]),ve.useEffect(()=>{p.delete&&(Mn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Mn,p.delete]);function ia(){var qe;if(Y!=null&&Y.loading){var Pt;return ve.createElement("div",{className:Us(B==null?void 0:B.loader,p==null||(Pt=p.classNames)==null?void 0:Pt.loader,"sonner-loader"),"data-visible":Je==="loading"},Y.loading)}return ve.createElement(WV,{className:Us(B==null?void 0:B.loader,p==null||(qe=p.classNames)==null?void 0:qe.loader),visible:Je==="loading"})}const qr=p.icon||(Y==null?void 0:Y[Je])||UV(Je);var Ar,hi;return ve.createElement("li",{tabIndex:0,ref:Fe,className:Us(L,xn,B==null?void 0:B.toast,p==null||(e=p.classNames)==null?void 0:e.toast,B==null?void 0:B.default,B==null?void 0:B[Je],p==null||(n=p.classNames)==null?void 0:n[Je]),"data-sonner-toast":"","data-rich-colors":(Ar=p.richColors)!=null?Ar:R,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":te,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":oe,"data-visible":lt,"data-y-position":An,"data-x-position":di,"data-index":E,"data-front":Qe,"data-swiping":he,"data-dismissible":vt,"data-type":Je,"data-invert":Ns,"data-swipe-out":ae,"data-swipe-direction":D,"data-expanded":!!(P||q&&te),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":C.length-E,"--offset":`${oe?Ke:wn.current}px`,"--initial-height":q?"auto":`${Oe}px`,...I,...p.style},onDragEnd:()=>{ie(!1),H(null),Is.current=null},onPointerDown:qe=>{qe.button!==2&&(cr||!vt||(mt.current=new Date,it(wn.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(ie(!0),Is.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,Pt,nn;if(ae||!vt)return;Is.current=null;const bn=Number(((qe=Fe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Os=Number(((Pt=Fe.current)==null?void 0:Pt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((nn=mt.current)==null?void 0:nn.getTime()),rn=ee==="x"?bn:Os,ps=Math.abs(rn)/Ut;if(Math.abs(rn)>=u$||ps>.11){it(wn.current),p.onDismiss==null||p.onDismiss.call(p,p),Z(ee==="x"?bn>0?"right":"left":Os>0?"down":"up"),Mn(),me(!0);return}else{var fn,Jn;(fn=Fe.current)==null||fn.style.setProperty("--swipe-amount-x","0px"),(Jn=Fe.current)==null||Jn.style.setProperty("--swipe-amount-y","0px")}Ae(!1),ie(!1),H(null)},onPointerMove:qe=>{var Pt,nn,bn;if(!Is.current||!vt||((Pt=window.getSelection())==null?void 0:Pt.toString().length)>0)return;const Ut=qe.clientY-Is.current.y,rn=qe.clientX-Is.current.x;var ps;const fn=(ps=t.swipeDirections)!=null?ps:d$(G);!ee&&(Math.abs(rn)>1||Math.abs(Ut)>1)&&H(Math.abs(rn)>Math.abs(Ut)?"x":"y");let Jn={x:0,y:0};const Ls=er=>1/(1.5+Math.abs(er)/20);if(ee==="y"){if(fn.includes("top")||fn.includes("bottom"))if(fn.includes("top")&&Ut<0||fn.includes("bottom")&&Ut>0)Jn.y=Ut;else{const er=Ut*Ls(Ut);Jn.y=Math.abs(er)<Math.abs(Ut)?er:Ut}}else if(ee==="x"&&(fn.includes("left")||fn.includes("right")))if(fn.includes("left")&&rn<0||fn.includes("right")&&rn>0)Jn.x=rn;else{const er=rn*Ls(rn);Jn.x=Math.abs(er)<Math.abs(rn)?er:rn}(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&Ae(!0),(nn=Fe.current)==null||nn.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(bn=Fe.current)==null||bn.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},Xn&&!p.jsx&&Je!=="loading"?ve.createElement("button",{"aria-label":$,"data-disabled":cr,"data-close-button":!0,onClick:cr||!vt?()=>{}:()=>{Mn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Us(B==null?void 0:B.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(hi=Y==null?void 0:Y.close)!=null?hi:YV):null,(Je||p.icon||p.promise)&&p.icon!==null&&((Y==null?void 0:Y[Je])!==null||p.icon)?ve.createElement("div",{"data-icon":"",className:Us(B==null?void 0:B.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||ia():null,p.type!=="loading"?qr:null):null,ve.createElement("div",{"data-content":"",className:Us(B==null?void 0:B.content,p==null||(i=p.classNames)==null?void 0:i.content)},ve.createElement("div",{"data-title":"",className:Us(B==null?void 0:B.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ve.createElement("div",{"data-description":"",className:Us(F,zt,B==null?void 0:B.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ve.isValidElement(p.cancel)?p.cancel:p.cancel&&Uh(p.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:qe=>{Uh(p.cancel)&&vt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,qe),Mn())},className:Us(B==null?void 0:B.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,ve.isValidElement(p.action)?p.action:p.action&&Uh(p.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||N,onClick:qe=>{Uh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,qe),!qe.defaultPrevented&&Mn())},className:Us(B==null?void 0:B.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function rk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function h$(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?o$:i$;function c(f){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=u:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}const p$=ve.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:f,offset:h,mobileOffset:p,theme:v="light",richColors:y,duration:x,style:_,visibleToasts:b=s$,toastOptions:E,dir:C=rk(),gap:P=l$,icons:T,containerAriaLabel:R="Notifications"}=e,[O,I]=ve.useState([]),A=ve.useMemo(()=>r?O.filter(te=>te.toasterId===r):O.filter(te=>!te.toasterId),[O,r]),N=ve.useMemo(()=>Array.from(new Set([i].concat(A.filter(te=>te.position).map(te=>te.position)))),[A,i]),[L,F]=ve.useState([]),[V,G]=ve.useState(!1),[X,q]=ve.useState(!1),[B,Y]=ve.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ve.useRef(null),ee=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ve.useRef(null),D=ve.useRef(!1),Z=ve.useCallback(te=>{I(se=>{var oe;return(oe=se.find(ue=>ue.id===te.id))!=null&&oe.delete||_r.dismiss(te.id),se.filter(({id:ue})=>ue!==te.id)})},[]);return ve.useEffect(()=>_r.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{I(se=>se.map(oe=>oe.id===te.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{HV.flushSync(()=>{I(se=>{const oe=se.findIndex(ue=>ue.id===te.id);return oe!==-1?[...se.slice(0,oe),{...se[oe],...te},...se.slice(oe+1)]:[te,...se]})})})}),[O]),ve.useEffect(()=>{if(v!=="system"){Y(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:se})=>{Y(se?"dark":"light")})}catch{te.addListener(({matches:oe})=>{try{Y(oe?"dark":"light")}catch(ue){console.error(ue)}})}},[v]),ve.useEffect(()=>{O.length<=1&&G(!1)},[O]),ve.useEffect(()=>{const te=se=>{var oe;if(a.every(ie=>se[ie]||se.code===ie)){var he;G(!0),(he=$.current)==null||he.focus()}se.code==="Escape"&&(document.activeElement===$.current||(oe=$.current)!=null&&oe.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[a]),ve.useEffect(()=>{if($.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,D.current=!1)}},[$.current]),ve.createElement("section",{ref:n,"aria-label":`${R} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((te,se)=>{var oe;const[ue,he]=te.split("-");return A.length?ve.createElement("ol",{key:te,dir:C==="auto"?rk():C,tabIndex:-1,ref:$,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ue,"data-x-position":he,style:{"--front-toast-height":`${((oe=L[0])==null?void 0:oe.height)||0}px`,"--width":`${a$}px`,"--gap":`${P}px`,..._,...h$(h,p)},onBlur:ie=>{D.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(D.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||D.current||(D.current=!0,H.current=ie.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{X||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},A.filter(ie=>!ie.position&&se===0||ie.position===te).map((ie,ae)=>{var me,Se;return ve.createElement(f$,{key:ie.id,icons:T,index:ae,toast:ie,defaultRichColors:y,duration:(me=E==null?void 0:E.duration)!=null?me:x,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:b,closeButton:(Se=E==null?void 0:E.closeButton)!=null?Se:c,interacting:X,position:te,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:Z,toasts:A.filter(Ae=>Ae.position==ie.position),heights:L.filter(Ae=>Ae.position==ie.position),setHeights:F,expandByDefault:u,gap:P,expanded:V,swipeDirections:e.swipeDirections})})):null}))});function Et(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)}}function sk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function m$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=sk(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():sk(t[s],null)}}}}function Yt(...t){return g.useCallback(m$(...t),t)}function ea(t,e=[]){let n=[];function r(i,a){const u=g.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const f=p=>{var E;const{scope:v,children:y,...x}=p,_=((E=v==null?void 0:v[t])==null?void 0:E[c])||u,b=g.useMemo(()=>x,Object.values(x));return S.jsx(_.Provider,{value:b,children:y})};f.displayName=i+"Provider";function h(p,v,y={}){var E;const{optional:x=!1}=y,_=((E=v==null?void 0:v[t])==null?void 0:E[c])||u,b=g.useContext(_);if(b)return b;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const s=()=>{const i=n.map(a=>g.createContext(a));return function(u){const c=(u==null?void 0:u[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])}};return s.scopeName=t,[r,g$(s,...e)]}function g$(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((u,{useScope:c,scopeName:f})=>{const p=c(i)[`__scope${f}`];return{...u,...p}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var oi=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},v$=U_[" useId ".trim().toString()]||(()=>{}),y$=0;function sl(t){const[e,n]=g.useState(v$());return oi(()=>{n(r=>r??String(y$++))},[t]),e?`radix-${e}`:""}var _$=U_[" useInsertionEffect ".trim().toString()]||oi;function fl({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,a]=x$({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s;{const h=g.useRef(t!==void 0);g.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,r])}const f=g.useCallback(h=>{var p;if(u){const v=w$(h)?h(t):h;v!==t&&((p=a.current)==null||p.call(a,v))}else i(h)},[u,t,i,a]);return[c,f]}function x$({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return _$(()=>{i.current=e},[e]),g.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function w$(t){return typeof t=="function"}function jd(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];ik(s)&&typeof Bh=="function"&&(s=Bh(s._payload)),g.Children.forEach(s,v=>{var y;if(C$(v)){u=!0;const x=v;let _="child"in x.props?x.props.child:x.props.children;ik(_)&&typeof Bh=="function"&&(_=Bh(_._payload)),a=S$(x,_),c.push((y=a==null?void 0:a.props)==null?void 0:y.children)}else c.push(v)}),a?a=g.cloneElement(a,void 0,c):!u&&g.Children.count(s)===1&&g.isValidElement(s)&&(a=s);const f=a?k$(a):void 0,h=Yt(r,f);if(!a){if(s||s===0)throw new Error(u?A$(t):R$(t));return s}const p=E$(i,a.props??{});return a.type!==g.Fragment&&(p.ref=r?h:f),g.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}var V3=Symbol.for("radix.slottable");function b$(t){const e=n=>"child"in n?n.children(n.child):n.children;return e.displayName=`${t}.Slottable`,e.__radixId=V3,e}var S$=(t,e)=>{if("child"in t.props){const n=t.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,t.props.children(n.props.children)):null}return g.isValidElement(e)?e:null};function E$(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const c=i(...u);return s(...u),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function k$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function C$(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===V3}var P$=Symbol.for("react.lazy");function ik(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===P$&&"_payload"in t&&T$(t._payload)}function T$(t){return typeof t=="object"&&t!==null&&"then"in t}var R$=t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,A$=t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Bh=U_[" use ".trim().toString()],M$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],At=M$.reduce((t,e)=>{const n=jd(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function I$(t,e){t&&qm.flushSync(()=>t.dispatchEvent(e))}function Du(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}var N$="DismissableLayer",i_="dismissableLayer.update",O$="dismissableLayer.pointerDownOutside",L$="dismissableLayer.focusOutside",ok,W2=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Zm=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:u,onDismiss:c,...f}=t,h=g.useContext(W2),[p,v]=g.useState(null),y=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=g.useState({}),_=Yt(e,v),b=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?b.indexOf(E):-1,P=p?b.indexOf(p):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,R=P>=C,O=g.useRef(!1),I=$$(F=>{i==null||i(F),u==null||u(F),F.defaultPrevented||c==null||c()},{ownerDocument:y,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(F=>{if(!(F instanceof Node))return!1;const V=[...h.branches].some(G=>G.contains(F));return R&&!V},[h.branches,R])}),A=H$(F=>{if(r&&O.current)return;const V=F.target;[...h.branches].some(X=>X.contains(V))||(a==null||a(F),u==null||u(F),F.defaultPrevented||c==null||c())},y),N=p?P===b.length-1:!1,L=Du(F=>{F.key==="Escape"&&(s==null||s(F),!F.defaultPrevented&&c&&(F.preventDefault(),c()))});return g.useEffect(()=>{if(N)return y.addEventListener("keydown",L,{capture:!0}),()=>y.removeEventListener("keydown",L,{capture:!0})},[y,N,L]),g.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(ok=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),ak(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(p),h.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=ok))}},[p,y,n,h]),g.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),ak())},[p,h]),g.useEffect(()=>{const F=()=>x({});return document.addEventListener(i_,F),()=>document.removeEventListener(i_,F)},[]),S.jsx(At.div,{...f,ref:_,style:{pointerEvents:T?R?"auto":"none":void 0,...t.style},onFocusCapture:Et(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Et(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Et(t.onPointerDownCapture,I.onPointerDownCapture)})});Zm.displayName=N$;var D$="DismissableLayerBranch",F$=g.forwardRef((t,e)=>{const n=g.useContext(W2),r=g.useRef(null),s=Yt(e,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),S.jsx(At.div,{...t,ref:s})});F$.displayName=D$;function j$(){const t=g.useContext(W2),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}var V$=()=>!0;function $$(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=V$}=e,u=Du(t),c=g.useRef(!1),f=g.useRef(!1),h=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function v(){f.current=!1,s.current=!1,h.current.clear()}function y(){return Array.from(h.current.values()).some(Boolean)}function x(P){if(!f.current)return;const T=P.target;T instanceof Node&&[...i].some(O=>O.contains(T))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}function _(P){f.current&&h.current.set(P.type,!1)}const b=P=>{if(P.target&&!c.current){let T=function(){n.removeEventListener("click",p.current);const O=y();v(),O||$3(O$,u,R,{discrete:!0})};if(!a(P.target)){n.removeEventListener("click",p.current),v(),c.current=!1;return}const R={originalEvent:P};f.current=!0,s.current=r&&P.button===0,h.current.clear(),!r||P.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),v();c.current=!1},E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of E)n.addEventListener(P,x,!0),n.addEventListener(P,_);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",b),n.removeEventListener("click",p.current);for(const P of E)n.removeEventListener(P,x,!0),n.removeEventListener(P,_)}},[n,u,r,s,i,a]),{onPointerDownCapture:()=>c.current=!0}}function H$(t,e=globalThis==null?void 0:globalThis.document){const n=Du(t),r=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!r.current&&$3(L$,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ak(){const t=new CustomEvent(i_);document.dispatchEvent(t)}function $3(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?I$(s,i):s.dispatchEvent(i)}var Jv="focusScope.autoFocusOnMount",e1="focusScope.autoFocusOnUnmount",lk={bubbles:!1,cancelable:!0},z$="FocusScope",G2=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[u,c]=g.useState(null),f=Du(s),h=Du(i),p=g.useRef(null),v=Yt(e,c),y=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let _=function(P){if(y.paused||!u)return;const T=P.target;u.contains(T)?p.current=T:ko(p.current,{select:!0})},b=function(P){if(y.paused||!u)return;const T=P.relatedTarget;T!==null&&(u.contains(T)||ko(p.current,{select:!0}))},E=function(P){if(document.activeElement===document.body)for(const R of P)R.removedNodes.length>0&&ko(u)};document.addEventListener("focusin",_),document.addEventListener("focusout",b);const C=new MutationObserver(E);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",b),C.disconnect()}}},[r,u,y.paused]),g.useEffect(()=>{if(u){ck.add(y);const _=document.activeElement;if(!u.contains(_)){const E=new CustomEvent(Jv,lk);u.addEventListener(Jv,f),u.dispatchEvent(E),E.defaultPrevented||(U$(q$(H3(u)),{select:!0}),document.activeElement===_&&ko(u))}return()=>{u.removeEventListener(Jv,f),setTimeout(()=>{const E=new CustomEvent(e1,lk);u.addEventListener(e1,h),u.dispatchEvent(E),E.defaultPrevented||ko(_??document.body,{select:!0}),u.removeEventListener(e1,h),ck.remove(y)},0)}}},[u,f,h,y]);const x=g.useCallback(_=>{if(!n&&!r||y.paused)return;const b=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,E=document.activeElement;if(b&&E){const C=_.currentTarget,[P,T]=B$(C);P&&T?!_.shiftKey&&E===T?(_.preventDefault(),n&&ko(P,{select:!0})):_.shiftKey&&E===P&&(_.preventDefault(),n&&ko(T,{select:!0})):E===C&&_.preventDefault()}},[n,r,y.paused]);return S.jsx(At.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});G2.displayName=z$;function U$(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ko(r,{select:e}),document.activeElement!==n)return}function B$(t){const e=H3(t),n=uk(e,t),r=uk(e.reverse(),t);return[n,r]}function H3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function uk(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):W$(r,{upTo:e})))return r}function W$(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function G$(t){return t instanceof HTMLInputElement&&"select"in t}function ko(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&G$(t)&&e&&t.select()}}var ck=K$();function K$(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=dk(t,e),t.unshift(e)},remove(e){var n;t=dk(t,e),(n=t[0])==null||n.resume()}}}function dk(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function q$(t){return t.filter(e=>e.tagName!=="A")}var Z$="Portal",Ym=g.forwardRef((t,e)=>{var u;const{container:n,...r}=t,[s,i]=g.useState(!1);oi(()=>i(!0),[]);const a=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?qm.createPortal(S.jsx(At.div,{...r,ref:e}),a):null});Ym.displayName=Z$;function Y$(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}var Yi=t=>{const{present:e,children:n}=t,r=X$(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=Q$(r.ref,J$(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null};Yi.displayName="Presence";function X$(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),a=g.useRef(void 0),u=t?"mounted":"unmounted",[c,f]=Y$(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=a.current??qc(r.current),a.current=void 0):i.current="none"},[c]),oi(()=>{const h=r.current,p=s.current;if(p!==t){const y=i.current,x=qc(h);t?(a.current=x,f("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&y!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),oi(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,v=x=>{const b=qc(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&b&&(f("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},y=x=>{x.target===e&&(i.current=qc(r.current))};return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=qc(p)}else r.current=null;n(h)},[])}}function fk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Q$(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const u=fk(a,n);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let a=0;a<i.length;a++){const u=i[a];typeof u=="function"?u():fk(r[a],null)}}},[])}function qc(t){return(t==null?void 0:t.animationName)||"none"}function J$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Wh=0,Bs=null;function z3(){g.useEffect(()=>{Bs||(Bs={start:hk(),end:hk()});const{start:t,end:e}=Bs;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Wh++,()=>{Wh===1&&(Bs==null||Bs.start.remove(),Bs==null||Bs.end.remove(),Bs=null),Wh=Math.max(0,Wh-1)}},[])}function hk(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Js=function(){return Js=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Js.apply(this,arguments)};function U3(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function eH(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var xp="right-scroll-bar-position",wp="width-before-scroll-bar",tH="with-scroll-bars-hidden",nH="--removed-body-scroll-bar-size";function t1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function rH(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var sH=typeof window<"u"?g.useLayoutEffect:g.useEffect,pk=new WeakMap;function iH(t,e){var n=rH(null,function(r){return t.forEach(function(s){return t1(s,r)})});return sH(function(){var r=pk.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||t1(u,null)}),i.forEach(function(u){s.has(u)||t1(u,a)})}pk.set(n,t)},[t]),n}function oH(t){return t}function aH(t,e){e===void 0&&(e=oH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var c=function(){var h=a;a=[],h.forEach(i)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return s}function lH(t){t===void 0&&(t={});var e=aH(null);return e.options=Js({async:!0,ssr:!1},t),e}var B3=function(t){var e=t.sideCar,n=U3(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Js({},n))};B3.isSideCarExport=!0;function uH(t,e){return t.useMedium(e),B3}var W3=lH(),n1=function(){},Xm=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:n1,onWheelCapture:n1,onTouchMoveCapture:n1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,f=t.removeScrollBar,h=t.enabled,p=t.shards,v=t.sideCar,y=t.noRelative,x=t.noIsolation,_=t.inert,b=t.allowPinchZoom,E=t.as,C=E===void 0?"div":E,P=t.gapMode,T=U3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=v,O=iH([n,e]),I=Js(Js({},T),s);return g.createElement(g.Fragment,null,h&&g.createElement(R,{sideCar:W3,removeScrollBar:f,shards:p,noRelative:y,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:P}),a?g.cloneElement(g.Children.only(u),Js(Js({},I),{ref:O})):g.createElement(C,Js({},I,{className:c,ref:O}),u))});Xm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xm.classNames={fullWidth:wp,zeroRight:xp};var cH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=cH();return e&&t.setAttribute("nonce",e),t}function fH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function hH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var pH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=dH())&&(fH(e,n),hH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},mH=function(){var t=pH();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},G3=function(){var t=mH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},gH={left:0,top:0,right:0,gap:0},r1=function(t){return parseInt(t||"",10)||0},vH=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[r1(n),r1(r),r1(s)]},yH=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return gH;var e=vH(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},_H=G3(),lu="data-scroll-locked",xH=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
|
|
71
|
+
.`.concat(tH,` {
|
|
72
|
+
overflow: hidden `).concat(r,`;
|
|
73
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
74
|
+
}
|
|
75
|
+
body[`).concat(lu,`] {
|
|
76
|
+
overflow: hidden `).concat(r,`;
|
|
77
|
+
overscroll-behavior: contain;
|
|
78
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
79
|
+
padding-left: `.concat(s,`px;
|
|
80
|
+
padding-top: `).concat(i,`px;
|
|
81
|
+
padding-right: `).concat(a,`px;
|
|
82
|
+
margin-left:0;
|
|
83
|
+
margin-top:0;
|
|
84
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
85
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.`).concat(xp,` {
|
|
89
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.`).concat(wp,` {
|
|
93
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.`).concat(xp," .").concat(xp,` {
|
|
97
|
+
right: 0 `).concat(r,`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.`).concat(wp," .").concat(wp,` {
|
|
101
|
+
margin-right: 0 `).concat(r,`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
body[`).concat(lu,`] {
|
|
105
|
+
`).concat(nH,": ").concat(u,`px;
|
|
106
|
+
}
|
|
107
|
+
`)},mk=function(){var t=parseInt(document.body.getAttribute(lu)||"0",10);return isFinite(t)?t:0},wH=function(){g.useEffect(function(){return document.body.setAttribute(lu,(mk()+1).toString()),function(){var t=mk()-1;t<=0?document.body.removeAttribute(lu):document.body.setAttribute(lu,t.toString())}},[])},bH=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;wH();var i=g.useMemo(function(){return yH(s)},[s]);return g.createElement(_H,{styles:xH(i,!e,s,n?"":"!important")})},o_=!1;if(typeof window<"u")try{var Gh=Object.defineProperty({},"passive",{get:function(){return o_=!0,!0}});window.addEventListener("test",Gh,Gh),window.removeEventListener("test",Gh,Gh)}catch{o_=!1}var Bl=o_?{passive:!1}:!1,SH=function(t){return t.tagName==="TEXTAREA"},K3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!SH(t)&&n[e]==="visible")},EH=function(t){return K3(t,"overflowY")},kH=function(t){return K3(t,"overflowX")},gk=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=q3(t,r);if(s){var i=Z3(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CH=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},PH=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},q3=function(t,e){return t==="v"?EH(e):kH(e)},Z3=function(t,e){return t==="v"?CH(e):PH(e)},TH=function(t,e){return t==="h"&&e==="rtl"?-1:1},RH=function(t,e,n,r,s){var i=TH(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),f=!1,h=a>0,p=0,v=0;do{if(!u)break;var y=Z3(t,u),x=y[0],_=y[1],b=y[2],E=_-b-i*x;(x||E)&&q3(t,u)&&(p+=E,v+=x);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(v)<1)&&(f=!0),f},Kh=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},vk=function(t){return[t.deltaX,t.deltaY]},yk=function(t){return t&&"current"in t?t.current:t},AH=function(t,e){return t[0]===e[0]&&t[1]===e[1]},MH=function(t){return`
|
|
108
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
109
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
110
|
+
`)},IH=0,Wl=[];function NH(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(IH++)[0],i=g.useState(G3)[0],a=g.useRef(t);g.useEffect(function(){a.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=eH([t.lockRef.current],(t.shards||[]).map(yk),!0).filter(Boolean);return _.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=g.useCallback(function(_,b){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var E=Kh(_),C=n.current,P="deltaX"in _?_.deltaX:C[0]-E[0],T="deltaY"in _?_.deltaY:C[1]-E[1],R,O=_.target,I=Math.abs(P)>Math.abs(T)?"h":"v";if("touches"in _&&I==="h"&&O.type==="range")return!1;var A=window.getSelection(),N=A&&A.anchorNode,L=N?N===O||N.contains(O):!1;if(L)return!1;var F=gk(I,O);if(!F)return!0;if(F?R=I:(R=I==="v"?"h":"v",F=gk(I,O)),!F)return!1;if(!r.current&&"changedTouches"in _&&(P||T)&&(r.current=R),!R)return!0;var V=r.current||R;return RH(V,b,_,V==="h"?P:T)},[]),c=g.useCallback(function(_){var b=_;if(!(!Wl.length||Wl[Wl.length-1]!==i)){var E="deltaY"in b?vk(b):Kh(b),C=e.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&AH(R.delta,E)})[0];if(C&&C.should){b.cancelable&&b.preventDefault();return}if(!C){var P=(a.current.shards||[]).map(yk).filter(Boolean).filter(function(R){return R.contains(b.target)}),T=P.length>0?u(b,P[0]):!a.current.noIsolation;T&&b.cancelable&&b.preventDefault()}}},[]),f=g.useCallback(function(_,b,E,C){var P={name:_,delta:b,target:E,should:C,shadowParent:OH(E)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(T){return T!==P})},1)},[]),h=g.useCallback(function(_){n.current=Kh(_),r.current=void 0},[]),p=g.useCallback(function(_){f(_.type,vk(_),_.target,u(_,t.lockRef.current))},[]),v=g.useCallback(function(_){f(_.type,Kh(_),_.target,u(_,t.lockRef.current))},[]);g.useEffect(function(){return Wl.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Bl),document.addEventListener("touchmove",c,Bl),document.addEventListener("touchstart",h,Bl),function(){Wl=Wl.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,Bl),document.removeEventListener("touchmove",c,Bl),document.removeEventListener("touchstart",h,Bl)}},[]);var y=t.removeScrollBar,x=t.inert;return g.createElement(g.Fragment,null,x?g.createElement(i,{styles:MH(s)}):null,y?g.createElement(bH,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function OH(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const LH=uH(W3,NH);var K2=g.forwardRef(function(t,e){return g.createElement(Xm,Js({},t,{ref:e,sideCar:LH}))});K2.classNames=Xm.classNames;var DH=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Gl=new WeakMap,qh=new WeakMap,Zh={},s1=0,Y3=function(t){return t&&(t.host||Y3(t.parentNode))},FH=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Y3(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},jH=function(t,e,n,r){var s=FH(e,Array.isArray(t)?t:[t]);Zh[n]||(Zh[n]=new WeakMap);var i=Zh[n],a=[],u=new Set,c=new Set(s),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))h(v);else try{var y=v.getAttribute(r),x=y!==null&&y!=="false",_=(Gl.get(v)||0)+1,b=(i.get(v)||0)+1;Gl.set(v,_),i.set(v,b),a.push(v),_===1&&x&&qh.set(v,!0),b===1&&v.setAttribute(n,"true"),x||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return h(e),u.clear(),s1++,function(){a.forEach(function(p){var v=Gl.get(p)-1,y=i.get(p)-1;Gl.set(p,v),i.set(p,y),v||(qh.has(p)||p.removeAttribute(r),qh.delete(p)),y||p.removeAttribute(n)}),s1--,s1||(Gl=new WeakMap,Gl=new WeakMap,qh=new WeakMap,Zh={})}},X3=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=DH(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),jH(r,s,n,"aria-hidden")):function(){return null}},Qm="Dialog",[Q3]=ea(Qm),[VH,Rs]=Q3(Qm),Jm=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=g.useRef(null),c=g.useRef(null),[f,h]=fl({prop:r,defaultProp:s??!1,onChange:i,caller:Qm});return S.jsx(VH,{scope:e,triggerRef:u,contentRef:c,contentId:sl(),titleId:sl(),descriptionId:sl(),open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),modal:a,children:n})};Jm.displayName=Qm;var J3="DialogTrigger",$H=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(J3,n),i=Yt(e,s.triggerRef);return S.jsx(At.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Z2(s.open),...r,ref:i,onClick:Et(t.onClick,s.onOpenToggle)})});$H.displayName=J3;var q2="DialogPortal",[HH,eT]=Q3(q2,{forceMount:void 0}),e0=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Rs(q2,e);return S.jsx(HH,{scope:e,forceMount:n,children:g.Children.map(r,a=>S.jsx(Yi,{present:n||i.open,children:S.jsx(Ym,{asChild:!0,container:s,children:a})}))})};e0.displayName=q2;var _m="DialogOverlay",t0=g.forwardRef((t,e)=>{const n=eT(_m,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Rs(_m,t.__scopeDialog);return i.modal?S.jsx(Yi,{present:r||i.open,children:S.jsx(UH,{...s,ref:e})}):null});t0.displayName=_m;var zH=jd("DialogOverlay.RemoveScroll"),UH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(_m,n),i=j$(),a=Yt(e,i);return S.jsx(K2,{as:zH,allowPinchZoom:!0,shards:[s.contentRef],children:S.jsx(At.div,{"data-state":Z2(s.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),Fu="DialogContent",n0=g.forwardRef((t,e)=>{const n=eT(Fu,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Rs(Fu,t.__scopeDialog);return S.jsx(Yi,{present:r||i.open,children:i.modal?S.jsx(BH,{...s,ref:e}):S.jsx(WH,{...s,ref:e})})});n0.displayName=Fu;var BH=g.forwardRef((t,e)=>{const n=Rs(Fu,t.__scopeDialog),r=g.useRef(null),s=Yt(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return X3(i)},[]),S.jsx(tT,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Et(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Et(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&i.preventDefault()}),onFocusOutside:Et(t.onFocusOutside,i=>i.preventDefault())})}),WH=g.forwardRef((t,e)=>{const n=Rs(Fu,t.__scopeDialog),r=g.useRef(!1),s=g.useRef(!1);return S.jsx(tT,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),tT=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,u=Rs(Fu,n);return z3(),S.jsx(S.Fragment,{children:S.jsx(G2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Zm,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Z2(u.open),...a,ref:e,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})}),nT="DialogTitle",r0=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(nT,n);return S.jsx(At.h2,{id:s.titleId,...r,ref:e})});r0.displayName=nT;var rT="DialogDescription",s0=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(rT,n);return S.jsx(At.p,{id:s.descriptionId,...r,ref:e})});s0.displayName=rT;var sT="DialogClose",GH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(sT,n);return S.jsx(At.button,{type:"button",...r,ref:e,onClick:Et(t.onClick,()=>s.onOpenChange(!1))})});GH.displayName=sT;function Z2(t){return t?"open":"closed"}const KH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),qH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),g.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),ZH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),YH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),XH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),QH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),JH=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),ez=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),tz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),nz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),rz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),sz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),iz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),oz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),az=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),lz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),uz=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),zn=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...f}=t,{color:h="currentColor",size:p,weight:v="regular",mirrored:y=!1,...x}=g.useContext(uz);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:a||y?"scale(-1, 1)":void 0,...x,...f},!!n&&g.createElement("title",null,n),u,c.get(i??v))});zn.displayName="IconBase";const iT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:KH}));iT.displayName="ArrowLeftIcon";const cz=iT,oT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:qH}));oT.displayName="ArrowSquareOutIcon";const dz=oT,aT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:ZH}));aT.displayName="ArrowUpIcon";const fz=aT,lT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:YH}));lT.displayName="CaretDownIcon";const hz=lT,uT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:XH}));uT.displayName="ChatCircleIcon";const pz=uT,cT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:QH}));cT.displayName="CheckIcon";const dT=cT,fT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:JH}));fT.displayName="CircleNotchIcon";const i0=fT,hT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:ez}));hT.displayName="CopyIcon";const Vd=hT,pT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:tz}));pT.displayName="MagnifyingGlassIcon";const mz=pT,mT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:nz}));mT.displayName="PencilSimpleIcon";const gz=mT,gT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:rz}));gT.displayName="SidebarSimpleIcon";const vz=gT,vT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:sz}));vT.displayName="SignOutIcon";const yz=vT,yT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:iz}));yT.displayName="SparkleIcon";const i1=yT,_T=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:oz}));_T.displayName="SwatchesIcon";const xT=_T,wT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:az}));wT.displayName="TrashIcon";const _z=wT,bT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:lz}));bT.displayName="XIcon";const ST=bT;function ET(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=ET(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function xz(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=ET(t))&&(r&&(r+=" "),r+=e);return r}const wz=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},bz=(t,e)=>({classGroupId:t,validator:e}),kT=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),xm="-",_k=[],Sz="arbitrary..",Ez=t=>{const e=Cz(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return kz(a);const u=a.split(xm),c=u[0]===""&&u.length>1?1:0;return CT(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],f=n[a];return c?f?wz(f,c):c:f||_k}return n[a]||_k}}},CT=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const f=CT(t,e+1,i);if(f)return f}const a=n.validators;if(a===null)return;const u=e===0?t.join(xm):t.slice(e).join(xm),c=a.length;for(let f=0;f<c;f++){const h=a[f];if(h.validator(u))return h.classGroupId}},kz=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Sz+r:void 0})(),Cz=t=>{const{theme:e,classGroups:n}=t;return Pz(n,e)},Pz=(t,e)=>{const n=kT();for(const r in t){const s=t[r];Y2(s,n,r,e)}return n},Y2=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];Tz(a,e,n,r)}},Tz=(t,e,n,r)=>{if(typeof t=="string"){Rz(t,e,n);return}if(typeof t=="function"){Az(t,e,n,r);return}Mz(t,e,n,r)},Rz=(t,e,n)=>{const r=t===""?e:PT(e,t);r.classGroupId=n},Az=(t,e,n,r)=>{if(Iz(t)){Y2(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(bz(n,t))},Mz=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];Y2(c,PT(e,u),n,r)}},PT=(t,e)=>{let n=t;const r=e.split(xm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=kT(),n.nextPart.set(a,u)),n=u}return n},Iz=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Nz=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},a_="!",xk=":",Oz=[],wk=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Lz=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,f;const h=s.length;for(let _=0;_<h;_++){const b=s[_];if(a===0&&u===0){if(b===xk){i.push(s.slice(c,_)),c=_+1;continue}if(b==="/"){f=_;continue}}b==="["?a++:b==="]"?a--:b==="("?u++:b===")"&&u--}const p=i.length===0?s:s.slice(c);let v=p,y=!1;p.endsWith(a_)?(v=p.slice(0,-1),y=!0):p.startsWith(a_)&&(v=p.slice(1),y=!0);const x=f&&f>c?f-c:void 0;return wk(i,y,v,x)};if(e){const s=e+xk,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):wk(Oz,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Dz=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],u=a[0]==="[",c=e.has(a);u||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Fz=t=>({cache:Nz(t.cacheSize),parseClassName:Lz(t),sortModifiers:Dz(t),postfixLookupClassGroupIds:jz(t),...Ez(t)}),jz=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},Vz=/\s+/,$z=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(Vz);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:v,modifiers:y,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:b}=n(p);if(v){f=p+(f.length>0?" "+f:f);continue}let E=!!b,C;if(E){const I=_.substring(0,b);C=r(I);const A=C&&a[C]?r(_):void 0;A&&A!==C&&(C=A,E=!1)}else C=r(_);if(!C){if(!E){f=p+(f.length>0?" "+f:f);continue}if(C=r(_),!C){f=p+(f.length>0?" "+f:f);continue}E=!1}const P=y.length===0?"":y.length===1?y[0]:i(y).join(":"),T=x?P+a_:P,R=T+C;if(u.indexOf(R)>-1)continue;u.push(R);const O=s(C,E);for(let I=0;I<O.length;++I){const A=O[I];u.push(T+A)}f=p+(f.length>0?" "+f:f)}return f},Hz=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=TT(n))&&(s&&(s+=" "),s+=r);return s},TT=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=TT(t[r]))&&(n&&(n+=" "),n+=e);return n},zz=(t,...e)=>{let n,r,s,i;const a=c=>{const f=e.reduce((h,p)=>p(h),t());return n=Fz(f),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const f=r(c);if(f)return f;const h=$z(c,n);return s(c,h),h};return i=a,(...c)=>i(Hz(...c))},Uz=[],gn=t=>{const e=n=>n[t]||Uz;return e.isThemeGetter=!0,e},RT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,AT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wo=t=>Bz.test(t),nt=t=>!!t&&!Number.isNaN(Number(t)),Ws=t=>!!t&&Number.isInteger(Number(t)),o1=t=>t.endsWith("%")&&nt(t.slice(0,-1)),Ci=t=>Wz.test(t),MT=()=>!0,Yz=t=>Gz.test(t)&&!Kz.test(t),X2=()=>!1,Xz=t=>qz.test(t),Qz=t=>Zz.test(t),Jz=t=>!Me(t)&&!Ne(t),eU=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),tU=t=>ta(t,OT,X2),Me=t=>RT.test(t),Pa=t=>ta(t,LT,Yz),bk=t=>ta(t,uU,nt),nU=t=>ta(t,FT,MT),rU=t=>ta(t,DT,X2),Sk=t=>ta(t,IT,X2),sU=t=>ta(t,NT,Qz),Yh=t=>ta(t,jT,Xz),Ne=t=>AT.test(t),Zc=t=>hl(t,LT),iU=t=>hl(t,DT),Ek=t=>hl(t,IT),oU=t=>hl(t,OT),aU=t=>hl(t,NT),Xh=t=>hl(t,jT,!0),lU=t=>hl(t,FT,!0),ta=(t,e,n)=>{const r=RT.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},hl=(t,e,n=!1)=>{const r=AT.exec(t);return r?r[1]?e(r[1]):n:!1},IT=t=>t==="position"||t==="percentage",NT=t=>t==="image"||t==="url",OT=t=>t==="length"||t==="size"||t==="bg-size",LT=t=>t==="length",uU=t=>t==="number",DT=t=>t==="family-name",FT=t=>t==="number"||t==="weight",jT=t=>t==="shadow",cU=()=>{const t=gn("color"),e=gn("font"),n=gn("text"),r=gn("font-weight"),s=gn("tracking"),i=gn("leading"),a=gn("breakpoint"),u=gn("container"),c=gn("spacing"),f=gn("radius"),h=gn("shadow"),p=gn("inset-shadow"),v=gn("text-shadow"),y=gn("drop-shadow"),x=gn("blur"),_=gn("perspective"),b=gn("aspect"),E=gn("ease"),C=gn("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...T(),Ne,Me],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],A=()=>[Ne,Me,c],N=()=>[wo,"full","auto",...A()],L=()=>[Ws,"none","subgrid",Ne,Me],F=()=>["auto",{span:["full",Ws,Ne,Me]},Ws,Ne,Me],V=()=>[Ws,"auto",Ne,Me],G=()=>["auto","min","max","fr",Ne,Me],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],Y=()=>[wo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[wo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ee=()=>[wo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],H=()=>[t,Ne,Me],D=()=>[...T(),Ek,Sk,{position:[Ne,Me]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",oU,tU,{size:[Ne,Me]}],se=()=>[o1,Zc,Pa],oe=()=>["","none","full",f,Ne,Me],ue=()=>["",nt,Zc,Pa],he=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[nt,o1,Ek,Sk],me=()=>["","none",x,Ne,Me],Se=()=>["none",nt,Ne,Me],Ae=()=>["none",nt,Ne,Me],Ke=()=>[nt,Ne,Me],it=()=>[wo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ci],breakpoint:[Ci],color:[MT],container:[Ci],"drop-shadow":[Ci],ease:["in","out","in-out"],font:[Jz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ci],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ci],shadow:[Ci],spacing:["px",nt],text:[Ci],"text-shadow":[Ci],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wo,Me,Ne,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Ne,Me]}],"container-named":[eU],columns:[{columns:[nt,Me,Ne,u]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Ws,"auto",Ne,Me]}],basis:[{basis:[wo,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,wo,"auto","initial","none",Me]}],grow:[{grow:["",nt,Ne,Me]}],shrink:[{shrink:["",nt,Ne,Me]}],order:[{order:[Ws,"first","last","none",Ne,Me]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[u,"screen",...Y()]}],"min-w":[{"min-w":[u,"screen","none",...Y()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Zc,Pa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,lU,nU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",o1,Me]}],"font-family":[{font:[iU,rU,e]}],"font-features":[{"font-features":[Me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ne,Me]}],"line-clamp":[{"line-clamp":[nt,"none",Ne,bk]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Ne,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",Ne,Pa]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[nt,"auto",Ne,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[Ws,Ne,Me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ne,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ws,Ne,Me],radial:["",Ne,Me],conic:[Ws,Ne,Me]},aU,sU]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,Ne,Me]}],"outline-w":[{outline:["",nt,Zc,Pa]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,Xh,Yh]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,Xh,Yh]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[nt,Pa]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",v,Xh,Yh]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[nt,Ne,Me]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ne,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,Me]}],filter:[{filter:["","none",Ne,Me]}],blur:[{blur:me()}],brightness:[{brightness:[nt,Ne,Me]}],contrast:[{contrast:[nt,Ne,Me]}],"drop-shadow":[{"drop-shadow":["","none",y,Xh,Yh]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",nt,Ne,Me]}],"hue-rotate":[{"hue-rotate":[nt,Ne,Me]}],invert:[{invert:["",nt,Ne,Me]}],saturate:[{saturate:[nt,Ne,Me]}],sepia:[{sepia:["",nt,Ne,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,Me]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[nt,Ne,Me]}],"backdrop-contrast":[{"backdrop-contrast":[nt,Ne,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,Ne,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,Ne,Me]}],"backdrop-invert":[{"backdrop-invert":["",nt,Ne,Me]}],"backdrop-opacity":[{"backdrop-opacity":[nt,Ne,Me]}],"backdrop-saturate":[{"backdrop-saturate":[nt,Ne,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,Ne,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",Ne,Me]}],ease:[{ease:["linear","initial",E,Ne,Me]}],delay:[{delay:[nt,Ne,Me]}],animate:[{animate:["none",C,Ne,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ne,Me]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[Ne,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],zoom:[{zoom:[Ws,Ne,Me]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ne,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ne,Me]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[nt,Zc,Pa,bk]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dU=zz(cU);function ur(...t){return dU(xz(t))}const $d={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},kk=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function VT(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=kk[Math.abs(e)%kk.length];return{color:n,backgroundColor:`${n}22`}}function $T(t,e={}){const{axis:n="y"}=e,r=g.useRef(new Map),[s,i]=g.useState(null),[a,u]=g.useState([]),c=g.useRef([]),f=g.useRef(0),h=g.useRef(null),p=g.useRef(null),v=g.useCallback(()=>{if(!t.current)return;const C=[];r.current.forEach((P,T)=>{C[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),c.current=C,u(C)},[t]),y=g.useCallback((E,C)=>{C?r.current.set(E,C):r.current.delete(E),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,v()})},[v]),x=g.useCallback(E=>{const C=E.clientX,P=E.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const T=t.current;if(!T)return;const R=T.getBoundingClientRect(),O=n==="x"?C:P;let I=null,A=1/0,N=null;const L=c.current,F=n==="x"?T.scrollLeft:T.scrollTop,V=n==="x"?T.clientLeft:T.clientTop,G=n==="x"?R.left:R.top,X=n==="x"?T.offsetWidth:T.offsetHeight,q=n==="x"?R.width:R.height,B=X>0?q/X:1;for(let Y=0;Y<L.length;Y++){const $=L[Y];if(!$)continue;const ee=n==="x"?$.left:$.top,H=G+(V+ee-F)*B,D=(n==="x"?$.width:$.height)*B,Z=H+D;O>=H&&O<=Z&&(N=Y);const te=H+D/2,se=Math.abs(O-te);se<A&&(A=se,I=Y)}i(N??I)})},[n,t]),_=g.useCallback(()=>{f.current+=1,v()},[v]),b=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:_,onMouseLeave:b},registerItem:y,measureItems:v}}function fU(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const HT=(t,e)=>`style:${t}:${e}`,zT=t=>`text:${t}`,UT=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},BT=t=>UT(t)[0],Qh=(t,e)=>UT(t).includes(e),hU=t=>{const e=BT(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${HT(e,t.property)}${n}`:`${zT(e)}${n}`},Ln=[];for(let t=0;t<256;++t)Ln.push((t+256).toString(16).slice(1));function pU(t,e=0){return(Ln[t[e+0]]+Ln[t[e+1]]+Ln[t[e+2]]+Ln[t[e+3]]+"-"+Ln[t[e+4]]+Ln[t[e+5]]+"-"+Ln[t[e+6]]+Ln[t[e+7]]+"-"+Ln[t[e+8]]+Ln[t[e+9]]+"-"+Ln[t[e+10]]+Ln[t[e+11]]+Ln[t[e+12]]+Ln[t[e+13]]+Ln[t[e+14]]+Ln[t[e+15]]).toLowerCase()}const mU=new Uint8Array(16);function gU(){return crypto.getRandomValues(mU)}function Ck(t,e,n){return crypto.randomUUID?crypto.randomUUID():vU(t)}function vU(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??gU();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,pU(r)}const yU=300;class _U{constructor(){xo(this,"history",{current:new Map,past:[],future:[]});xo(this,"pendingChanges",new Map);xo(this,"currentBatchId",null);xo(this,"debounceTimer",null);xo(this,"onChangeCallbacks",[]);xo(this,"stateBeforePending",null);xo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=Ck(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=BT(e.elementId),r=e.type==="style"?HT(n,e.property):zT(n),s=Array.from(this.history.current.entries()).find(([a])=>a===r||a.startsWith(`${r}:`));if(s){const a=s[1];e.type==="style"&&a.type==="style"?e.oldValue=a.oldValue:e.type==="text"&&a.type==="text"&&(e.oldText=a.oldText)}const i=hU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},yU),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&Qh(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&Qh(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>Qh(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>Qh(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=Ck(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const wm={kind:"base"};function Hd(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function xU(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const wU={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},desktopForceUpgrade:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},WT=Object.fromEntries(Object.entries(wU).map(([t,e])=>[t,{isEnabled:e.default}]));tt("view");const GT=tt(!0),KT=tt(null),bU=tt("chat"),qT=tt(0),ZT=tt({name:null,email:null}),Pk=tt(wm);tt(null);const zd=new Map,SU=t=>{const e=Hd(t);let n=zd.get(e);return n||(n=new _U,zd.set(e,n)),n};tt(t=>SU(t(Pk)),(t,e,n)=>{zd.set(Hd(t(Pk)),n)});const EU=t=>{for(const e of[...zd.keys()])e==="base"||t.has(e)||zd.delete(e)},Ud=tt(new Map),Tk=tt(null);tt(null);const l_=tt(0),bm=tt(null),u_=tt(!1),c_=tt(null),YT=tt(!1),XT=tt(!1),d_=tt(null),f_=tt(null),Bd=tt(null),Q2=tt(null),Ko=tt(null),pf=tt({active:!1}),QT=tt([]),Rk=tt(null),kU=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&xU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},CU=tt(null,(t,e,n)=>{const r=c=>{const f=c??wm;return f.kind==="variant"&&!n.has(Hd(f))},s=t(Ud);let i=null;for(const[c,f]of s)r(f.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const f of i)c.delete(f);e(Ud,c)}const a=t(Tk);a&&r(a.target)&&(e(Tk,null),e(AU,!1));const u=t(Rk);u&&(i!=null&&i.has(u.commentId))&&e(Rk,null),EU(n)}),h_=tt(WT),PU=tt(!1),JT=tt(null),mf=tt(!0),e5=tt(!1),t5=tt(!1),n5=tt(!1),r5=tt(null),TU=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},o0=tt(TU()),RU=tt(null),AU=tt(!1);tt(0);tt(0);var bp={exports:{}},MU=bp.exports,Ak;function IU(){return Ak||(Ak=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(MU,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},a=null;function u(_,b){var E=_[b];if(typeof E.bind=="function")return E.bind(_);try{return Function.prototype.bind.call(E,_)}catch{return function(){return Function.prototype.apply.apply(E,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?u(console,_):console.log!==void 0?u(console,"log"):e}function h(){for(var _=this.getLevel(),b=0;b<s.length;b++){var E=s[b];this[E]=b<_?e:this.methodFactory(E,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(h.call(this),this[_].apply(this,arguments))}}function v(_,b,E){return f(_)||p.apply(this,arguments)}function y(_,b){var E=this,C,P,T,R="loglevel";typeof _=="string"?R+=":"+_:typeof _=="symbol"&&(R=void 0);function O(F){var V=(s[F]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=V;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+V+";"}catch{}}}function I(){var F;if(!(typeof window===n||!R)){try{F=window.localStorage[R]}catch{}if(typeof F===n)try{var V=window.document.cookie,G=encodeURIComponent(R),X=V.indexOf(G+"=");X!==-1&&(F=/^([^;]+)/.exec(V.slice(X+G.length+1))[1])}catch{}return E.levels[F]===void 0&&(F=void 0),F}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function N(F){var V=F;if(typeof V=="string"&&E.levels[V.toUpperCase()]!==void 0&&(V=E.levels[V.toUpperCase()]),typeof V=="number"&&V>=0&&V<=E.levels.SILENT)return V;throw new TypeError("log.setLevel() called with invalid level: "+F)}E.name=_,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=b||v,E.getLevel=function(){return T??P??C},E.setLevel=function(F,V){return T=N(F),V!==!1&&O(T),h.call(E)},E.setDefaultLevel=function(F){P=N(F),I()||E.setLevel(F,!1)},E.resetLevel=function(){T=null,A(),h.call(E)},E.enableAll=function(F){E.setLevel(E.levels.TRACE,F)},E.disableAll=function(F){E.setLevel(E.levels.SILENT,F)},E.rebuild=function(){if(a!==E&&(C=N(a.getLevel())),h.call(E),a===E)for(var F in i)i[F].rebuild()},C=N(a?a.getLevel():"WARN");var L=I();L!=null&&(T=N(L)),h.call(E)}a=new y,a.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var E=i[b];return E||(E=i[b]=new y(b,a.methodFactory)),E};var x=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=x),a},a.getLoggers=function(){return i},a.default=a,a})})(bp)),bp.exports}var NU=IU();const ks=Vm(NU),OU="INFO",LU=OU.toUpperCase();ks.setLevel(ks.levels[LU]||ks.levels.INFO);const fs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>ks.trace(`${e}${n}`,...r),debug:(n,...r)=>ks.debug(`${e}${n}`,...r),info:(n,...r)=>ks.info(`${e}${n}`,...r),warn:(n,...r)=>ks.warn(`${e}${n}`,...r),error:(n,...r)=>{ks.error(`${e}${n}`,...r);try{const i=r.map(u=>u instanceof Error?u.message:String(u)).join(" ").slice(0,512),a={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Te.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>ks.info(`${e}API: ${n}`,...r),hook:(n,...r)=>ks.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>ks.debug(`${e}Mount: ${n}`,...r)}};let Sp=0;const DU=()=>{Sp+=1;let t=!1;return()=>{t||(t=!0,Sp=Math.max(0,Sp-1))}},FU=()=>Sp>0;function jU(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const VU=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],J2=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:VU.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),$U=["top","right","bottom","left"],qo=Math.min,Wi=Math.max,Sm=Math.round,Jh=Math.floor,Gi=t=>({x:t,y:t}),HU={left:"right",right:"left",bottom:"top",top:"bottom"};function s5(t,e,n){return Wi(t,qo(e,n))}function Ki(t,e){return typeof t=="function"?t(e):t}function Zo(t){return t.split("-")[0]}function qu(t){return t.split("-")[1]}function ex(t){return t==="x"?"y":"x"}function tx(t){return t==="y"?"height":"width"}function ni(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function nx(t){return ex(ni(t))}function zU(t,e,n){n===void 0&&(n=!1);const r=qu(t),s=nx(t),i=tx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Em(a)),[a,Em(a)]}function UU(t){const e=Em(t);return[p_(t),e,p_(e)]}function p_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Mk=["left","right"],Ik=["right","left"],BU=["top","bottom"],WU=["bottom","top"];function GU(t,e,n){switch(t){case"top":case"bottom":return n?e?Ik:Mk:e?Mk:Ik;case"left":case"right":return e?BU:WU;default:return[]}}function KU(t,e,n,r){const s=qu(t);let i=GU(Zo(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(p_)))),i}function Em(t){const e=Zo(t);return HU[e]+t.slice(e.length)}function qU(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function i5(t){return typeof t!="number"?qU(t):{top:t,right:t,bottom:t,left:t}}function km(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function Nk(t,e,n){let{reference:r,floating:s}=t;const i=ni(e),a=nx(e),u=tx(a),c=Zo(e),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[u]/2-s[u]/2;let y;switch(c){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const x=qu(e);return x&&(y[a]+=v*(x==="end"?1:-1)*(n&&f?-1:1)),y}async function ZU(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=Ki(e,t),x=i5(y),b=u[v?p==="floating"?"reference":"floating":p],E=km(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:f,rootBoundary:h,strategy:c})),C=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),T=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},R=km(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:P,strategy:c}):C);return{top:(E.top-R.top+x.top)/T.y,bottom:(R.bottom-E.bottom+x.bottom)/T.y,left:(E.left-R.left+x.left)/T.x,right:(R.right-E.right+x.right)/T.x}}const YU=50,XU=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:ZU},c=await(a.isRTL==null?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=Nk(f,r,c),v=r,y=0;const x={};for(let _=0;_<i.length;_++){const b=i[_];if(!b)continue;const{name:E,fn:C}=b,{x:P,y:T,data:R,reset:O}=await C({x:h,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:x,rects:f,platform:u,elements:{reference:t,floating:e}});h=P??h,p=T??p,x[E]={...x[E],...R},O&&y<YU&&(y++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(f=O.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:h,y:p}=Nk(f,v,c)),_=-1)}return{x:h,y:p,placement:v,strategy:s,middlewareData:x}},QU=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:u,middlewareData:c}=e,{element:f,padding:h=0}=Ki(t,e)||{};if(f==null)return{};const p=i5(h),v={x:n,y:r},y=nx(s),x=tx(y),_=await a.getDimensions(f),b=y==="y",E=b?"top":"left",C=b?"bottom":"right",P=b?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-v[y]-i.floating[x],R=v[y]-i.reference[y],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let I=O?O[P]:0;(!I||!await(a.isElement==null?void 0:a.isElement(O)))&&(I=u.floating[P]||i.floating[x]);const A=T/2-R/2,N=I/2-_[x]/2-1,L=qo(p[E],N),F=qo(p[C],N),V=I-_[x]-F,G=I/2-_[x]/2+A,X=s5(L,G,V),q=!c.arrow&&qu(s)!=null&&G!==X&&i.reference[x]/2-(G<L?L:F)-_[x]/2<0,B=q?G<L?G-L:G-V:0;return{[y]:v[y]+B,data:{[y]:X,centerOffset:G-X-B,...q&&{alignmentOffset:B}},reset:q}}}),JU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:u,platform:c,elements:f}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...b}=Ki(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=Zo(s),C=ni(u),P=Zo(u)===u,T=await(c.isRTL==null?void 0:c.isRTL(f.floating)),R=v||(P||!_?[Em(u)]:UU(u)),O=x!=="none";!v&&O&&R.push(...KU(u,_,x,T));const I=[u,...R],A=await c.detectOverflow(e,b),N=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&N.push(A[E]),p){const X=zU(s,a,T);N.push(A[X[0]],A[X[1]])}if(L=[...L,{placement:s,overflows:N}],!N.every(X=>X<=0)){var F,V;const X=(((F=i.flip)==null?void 0:F.index)||0)+1,q=I[X];if(q&&(!(p==="alignment"?C!==ni(q):!1)||L.every($=>ni($.placement)===C?$.overflows[0]>0:!0)))return{data:{index:X,overflows:L},reset:{placement:q}};let B=(V=L.filter(Y=>Y.overflows[0]<=0).sort((Y,$)=>Y.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!B)switch(y){case"bestFit":{var G;const Y=(G=L.filter($=>{if(O){const ee=ni($.placement);return ee===C||ee==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ee=>ee>0).reduce((ee,H)=>ee+H,0)]).sort(($,ee)=>$[1]-ee[1])[0])==null?void 0:G[0];Y&&(B=Y);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function Ok(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Lk(t){return $U.some(e=>t[e]>=0)}const eB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Ki(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=Ok(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Lk(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=Ok(a,n.floating);return{data:{escapedOffsets:u,escaped:Lk(u)}}}default:return{}}}}},o5=new Set(["left","top"]);async function tB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Zo(n),u=qu(n),c=ni(n)==="y",f=o5.has(a)?-1:1,h=i&&c?-1:1,p=Ki(e,t);let{mainAxis:v,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(y=u==="end"?x*-1:x),c?{x:y*h,y:v*f}:{x:v*f,y:y*h}}const nB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:u}=e,c=await tB(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},rB=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:a=!0,crossAxis:u=!1,limiter:c={fn:C=>{let{x:P,y:T}=C;return{x:P,y:T}}},...f}=Ki(t,e),h={x:n,y:r},p=await i.detectOverflow(e,f),v=ni(s),y=ex(v);let x=h[y],_=h[v];const b=(C,P)=>s5(P+p[C==="y"?"top":"left"],P,P-p[C==="y"?"bottom":"right"]);a&&(x=b(y,x)),u&&(_=b(v,_));const E=c.fn({...e,[y]:x,[v]:_});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[y]:a,[v]:u}}}}}},sB=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:u,middlewareData:c}=e,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=Ki(t,e),v={x:s,y:i},y=ni(a),x=ex(y);let _=v[x],b=v[y];const E=Ki(f,e),C=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(h){const R=x==="y"?"height":"width",O=u.reference[x]-u.floating[R]+C.mainAxis,I=u.reference[x]+u.reference[R]-C.mainAxis;_<O?_=O:_>I&&(_=I)}if(p){var P,T;const R=x==="y"?"width":"height",O=o5.has(Zo(a)),I=u.reference[y]-u.floating[R]+(O&&((P=c.offset)==null?void 0:P[y])||0)+(O?0:C.crossAxis),A=u.reference[y]+u.reference[R]+(O?0:((T=c.offset)==null?void 0:T[y])||0)-(O?C.crossAxis:0);b<I?b=I:b>A&&(b=A)}return{[x]:_,[y]:b}}}},iB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:a=()=>{},...u}=Ki(t,e),c=await s.detectOverflow(e,u),f=Zo(n),h=qu(n),p=ni(n)==="y",{width:v,height:y}=r.floating;let x,_;f==="top"||f==="bottom"?(x=f,_=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=f,x=h==="end"?"top":"bottom");const b=y-c.top-c.bottom,E=v-c.left-c.right,C=qo(y-c[x],b),P=qo(v-c[_],E),T=e.middlewareData.shift,R=!T;let O=C,I=P;T!=null&&T.enabled.x&&(I=E),T!=null&&T.enabled.y&&(O=b),R&&!h&&(p?I=v-2*Wi(c.left,c.right):O=y-2*Wi(c.top,c.bottom)),await a({...e,availableWidth:I,availableHeight:O});const A=await s.getDimensions(i.floating);return v!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function a0(){return typeof window<"u"}function Zu(t){return a5(t)?(t.nodeName||"").toLowerCase():"#document"}function Sr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Xi(t){var e;return(e=(a5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function a5(t){return a0()?t instanceof Node||t instanceof Sr(t).Node:!1}function li(t){return a0()?t instanceof Element||t instanceof Sr(t).Element:!1}function na(t){return a0()?t instanceof HTMLElement||t instanceof Sr(t).HTMLElement:!1}function Dk(t){return!a0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Sr(t).ShadowRoot}function l0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ui(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function oB(t){return/^(table|td|th)$/.test(Zu(t))}function u0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const aB=/transform|translate|scale|rotate|perspective|filter/,lB=/paint|layout|strict|content/,Ta=t=>!!t&&t!=="none";let a1;function rx(t){const e=li(t)?ui(t):t;return Ta(e.transform)||Ta(e.translate)||Ta(e.scale)||Ta(e.rotate)||Ta(e.perspective)||!sx()&&(Ta(e.backdropFilter)||Ta(e.filter))||aB.test(e.willChange||"")||lB.test(e.contain||"")}function uB(t){let e=cl(t);for(;na(e)&&!Wd(e);){if(rx(e))return e;if(u0(e))return null;e=cl(e)}return null}function sx(){return a1==null&&(a1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a1}function Wd(t){return/^(html|body|#document)$/.test(Zu(t))}function ui(t){return Sr(t).getComputedStyle(t)}function c0(t){return li(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function cl(t){if(Zu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Dk(t)&&t.host||Xi(t);return Dk(e)?e.host:e}function l5(t){const e=cl(t);return Wd(e)?(t.ownerDocument||t).body:na(e)&&l0(e)?e:l5(e)}function Gd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=l5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Sr(s);if(i){const u=m_(a);return e.concat(a,a.visualViewport||[],l0(s)?s:[],u&&n?Gd(u):[])}else return e.concat(s,Gd(s,[],n))}function m_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function u5(t){const e=ui(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=na(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=Sm(n)!==i||Sm(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function ix(t){return li(t)?t:t.contextElement}function uu(t){const e=ix(t);if(!na(e))return Gi(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=u5(e);let a=(i?Sm(n.width):n.width)/r,u=(i?Sm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const cB=Gi(0);function c5(t){const e=Sr(t);return!sx()||!e.visualViewport?cB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Sr(t)}function dl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=ix(t);let a=Gi(1);e&&(r?li(r)&&(a=uu(r)):a=uu(t));const u=dB(i,n,r)?c5(i):Gi(0);let c=(s.left+u.x)/a.x,f=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const v=Sr(i),y=li(r)?Sr(r):r;let x=v,_=m_(x);for(;_&&y!==x;){const b=uu(_),E=_.getBoundingClientRect(),C=ui(_),P=E.left+(_.clientLeft+parseFloat(C.paddingLeft))*b.x,T=E.top+(_.clientTop+parseFloat(C.paddingTop))*b.y;c*=b.x,f*=b.y,h*=b.x,p*=b.y,c+=P,f+=T,x=Sr(_),_=m_(x)}}return km({width:h,height:p,x:c,y:f})}function d0(t,e){const n=c0(t).scrollLeft;return e?e.left+n:dl(Xi(t)).left+n}function d5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-d0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function fB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=Xi(r),u=e?u0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Gi(1);const h=Gi(0),p=na(r);if((p||!i)&&((Zu(r)!=="body"||l0(a))&&(c=c0(r)),p)){const y=dl(r);f=uu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const v=a&&!p&&!i?d5(a,c):Gi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+h.x+v.x,y:n.y*f.y-c.scrollTop*f.y+h.y+v.y}}function hB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function pB(t){const e=c0(t),n=t.ownerDocument.body,r=Wi(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Wi(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+d0(t);const a=-e.scrollTop;return ui(n).direction==="rtl"&&(i+=Wi(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const mB=25;function gB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Sr(t),i=Xi(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,f=0,h=0;if(a){const v=!sx()||e==="fixed";r?v||(f=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,v&&(f=a.offsetLeft,h=a.offsetTop))}if(d0(i)<=0){const v=i.ownerDocument,y=v.body,x=getComputedStyle(y),_=v.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,b=Math.abs(i.clientWidth-y.clientWidth-_),E=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;E<=mB&&(u-=E)}return{width:u,height:c,x:f,y:h}}function vB(t,e){const n=dl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=uu(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,f=r*i.y;return{width:a,height:u,x:c,y:f}}function Fk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=gB(t,n,e);else if(e==="document")r=pB(Xi(t));else if(li(e))r=vB(e,n);else{const s=c5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return km(r)}function yB(t,e){const n=e.get(t);if(n)return n;let r=Gd(t,[],!1).filter(u=>li(u)&&Zu(u)!=="body"),s=null;const i=ui(t).position==="fixed";let a=i?cl(t):t;for(;li(a)&&!Wd(a);){const u=ui(a),c=rx(a),f=s?s.position:i?"fixed":"";!c&&(f==="fixed"||f==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=cl(a)}return e.set(t,r),r}function _B(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?u0(e)?[]:yB(e,this._c):[].concat(n),r],u=Fk(e,a[0],s);let c=u.top,f=u.right,h=u.bottom,p=u.left;for(let v=1;v<a.length;v++){const y=Fk(e,a[v],s);c=Wi(y.top,c),f=qo(y.right,f),h=qo(y.bottom,h),p=Wi(y.left,p)}return{width:f-p,height:h-c,x:p,y:c}}function xB(t){const{width:e,height:n}=u5(t);return{width:e,height:n}}function wB(t,e,n){const r=na(e),s=Xi(e),i=n==="fixed",a=dl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=Gi(0);if((r||!i)&&((Zu(e)!=="body"||l0(s))&&(u=c0(e)),r)){const v=dl(e,!0,i,e);c.x=v.x+e.clientLeft,c.y=v.y+e.clientTop}!r&&s&&(c.x=d0(s));const f=s&&!r&&!i?d5(s,u):Gi(0),h=a.left+u.scrollLeft-c.x-f.x,p=a.top+u.scrollTop-c.y-f.y;return{x:h,y:p,width:a.width,height:a.height}}function l1(t){return ui(t).position==="static"}function jk(t,e){if(!na(t)||ui(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Xi(t)===n&&(n=n.ownerDocument.body),n}function f5(t,e){const n=Sr(t);if(u0(t))return n;if(!na(t)){let s=cl(t);for(;s&&!Wd(s);){if(li(s)&&!l1(s))return s;s=cl(s)}return n}let r=jk(t,e);for(;r&&oB(r)&&l1(r);)r=jk(r,e);return r&&Wd(r)&&l1(r)&&!rx(r)?n:r||uB(t)||n}const bB=async function(t){const e=this.getOffsetParent||f5,n=this.getDimensions,r=await n(t.floating);return{reference:wB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SB(t){return ui(t).direction==="rtl"}const EB={convertOffsetParentRelativeRectToViewportRelativeRect:fB,getDocumentElement:Xi,getClippingRect:_B,getOffsetParent:f5,getElementRects:bB,getClientRects:hB,getDimensions:xB,getScale:uu,isElement:li,isRTL:SB};function h5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kB(t,e,n){let r=null,s;const i=Xi(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function u(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const v=t.getBoundingClientRect(),{left:y,top:x,width:_,height:b}=v;if(h||e(),!_||!b)return;const E=Jh(x),C=Jh(i.clientWidth-(y+_)),P=Jh(i.clientHeight-(x+b)),T=Jh(y),O={rootMargin:-E+"px "+-C+"px "+-P+"px "+-T+"px",threshold:Wi(0,qo(1,p))||1};let I=!0;function A(N){const L=N[0].intersectionRatio;if(!h5(v,t.getBoundingClientRect()))return u();if(L!==p){if(!I)return u();L?u(!1,L):s=setTimeout(()=>{u(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(A,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,O)}r.observe(t)}const c=Sr(t),f=()=>u(n);return c.addEventListener("resize",f),u(!0),()=>{c.removeEventListener("resize",f),a()}}function CB(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=ix(t),h=s||i?[...f?Gd(f):[],...e?Gd(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n),i&&E.addEventListener("resize",n)});const p=f&&u?kB(f,n,i):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[C]=E;C&&C.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var P;(P=y)==null||P.observe(e)})),n()}),f&&!c&&y.observe(f),e&&y.observe(e));let x,_=c?dl(t):null;c&&b();function b(){const E=dl(t);_&&!h5(_,E)&&n(),_=E,x=requestAnimationFrame(b)}return n(),()=>{var E;h.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p==null||p(),(E=y)==null||E.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const PB=nB,TB=rB,RB=JU,AB=iB,MB=eB,Vk=QU,IB=sB,NB=(t,e,n)=>{const r=new Map,s=n??{},i={...EB,...s.platform,_c:r};return XU(t,e,{...s,platform:i})};var OB=typeof document<"u",LB=function(){},Ep=OB?g.useLayoutEffect:LB;function Cm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Cm(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!Cm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function p5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $k(t,e){const n=p5(t);return Math.round(e*n)/n}function u1(t){const e=g.useRef(t);return Ep(()=>{e.current=t}),e}function DB(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:c,open:f}=t,[h,p]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=g.useState(r);Cm(v,r)||y(r);const[x,_]=g.useState(null),[b,E]=g.useState(null),C=g.useCallback($=>{$!==O.current&&(O.current=$,_($))},[]),P=g.useCallback($=>{$!==I.current&&(I.current=$,E($))},[]),T=i||x,R=a||b,O=g.useRef(null),I=g.useRef(null),A=g.useRef(h),N=c!=null,L=u1(c),F=u1(s),V=u1(f),G=g.useCallback(()=>{if(!O.current||!I.current)return;const $={placement:e,strategy:n,middleware:v};F.current&&($.platform=F.current),NB(O.current,I.current,$).then(ee=>{const H={...ee,isPositioned:V.current!==!1};X.current&&!Cm(A.current,H)&&(A.current=H,qm.flushSync(()=>{p(H)}))})},[v,e,n,F,V]);Ep(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[f]);const X=g.useRef(!1);Ep(()=>(X.current=!0,()=>{X.current=!1}),[]),Ep(()=>{if(T&&(O.current=T),R&&(I.current=R),T&&R){if(L.current)return L.current(T,R,G);G()}},[T,R,G,L,N]);const q=g.useMemo(()=>({reference:O,floating:I,setReference:C,setFloating:P}),[C,P]),B=g.useMemo(()=>({reference:T,floating:R}),[T,R]),Y=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const ee=$k(B.floating,h.x),H=$k(B.floating,h.y);return u?{...$,transform:"translate("+ee+"px, "+H+"px)",...p5(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:H}},[n,u,B.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:G,refs:q,elements:B,floatingStyles:Y}),[h,G,q,B,Y])}const FB=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Vk({element:r.current,padding:s}).fn(n):{}:r?Vk({element:r,padding:s}).fn(n):{}}}},jB=(t,e)=>{const n=PB(t);return{name:n.name,fn:n.fn,options:[t,e]}},VB=(t,e)=>{const n=TB(t);return{name:n.name,fn:n.fn,options:[t,e]}},$B=(t,e)=>({fn:IB(t).fn,options:[t,e]}),HB=(t,e)=>{const n=RB(t);return{name:n.name,fn:n.fn,options:[t,e]}},zB=(t,e)=>{const n=AB(t);return{name:n.name,fn:n.fn,options:[t,e]}},UB=(t,e)=>{const n=MB(t);return{name:n.name,fn:n.fn,options:[t,e]}},BB=(t,e)=>{const n=FB(t);return{name:n.name,fn:n.fn,options:[t,e]}};var WB="Arrow",m5=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return S.jsx(At.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});m5.displayName=WB;var GB=m5;function g5(t){const[e,n]=g.useState(void 0);return oi(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;a=f.inlineSize,u=f.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var ox="Popper",[v5,f0]=ea(ox),[KB,y5]=v5(ox),_5=t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,a]=g.useState(void 0);return S.jsx(KB,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})};_5.displayName=ox;var x5="PopperAnchor",w5=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=y5(x5,n),a=g.useRef(null),u=i.onAnchorChange,c=g.useCallback(x=>{a.current=x,x&&u(x)},[u]),f=Yt(e,c),h=g.useRef(null);g.useEffect(()=>{if(!r)return;const x=h.current;h.current=r.current,x!==h.current&&u(h.current)});const p=i.placementState&&lx(i.placementState),v=p==null?void 0:p[0],y=p==null?void 0:p[1];return r?null:S.jsx(At.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...s,ref:f})});w5.displayName=x5;var ax="PopperContent",[qB,ZB]=v5(ax),b5=g.forwardRef((t,e)=>{var ie,ae,me,Se,Ae,Ke;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,..._}=t,b=y5(ax,n),[E,C]=g.useState(null),P=Yt(e,C),[T,R]=g.useState(null),O=g5(T),I=(O==null?void 0:O.width)??0,A=(O==null?void 0:O.height)??0,N=r+(i!=="center"?"-"+i:""),L=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},F=Array.isArray(f)?f:[f],V=F.length>0,G={padding:L,boundary:F.filter(XB),altBoundary:V},{refs:X,floatingStyles:q,placement:B,isPositioned:Y,middlewareData:$}=DB({strategy:"fixed",placement:N,whileElementsMounted:(...it)=>CB(...it,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[jB({mainAxis:s+A,alignmentAxis:a}),c&&VB({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?$B():void 0,...G}),c&&HB({...G}),zB({...G,apply:({elements:it,rects:Oe,availableWidth:at,availableHeight:Mt})=>{const{width:mt,height:Fe}=Oe.reference,Qe=it.floating.style;Qe.setProperty("--radix-popper-available-width",`${at}px`),Qe.setProperty("--radix-popper-available-height",`${Mt}px`),Qe.setProperty("--radix-popper-anchor-width",`${mt}px`),Qe.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),T&&BB({element:T,padding:u}),QB({arrowWidth:I,arrowHeight:A}),v&&UB({strategy:"referenceHidden",...G,boundary:V?G.boundary:void 0})]}),ee=b.setPlacementState;oi(()=>(ee(B),()=>{ee(void 0)}),[B,ee]);const[H,D]=lx(B),Z=Du(x);oi(()=>{Y&&(Z==null||Z())},[Y,Z]);const te=(ie=$.arrow)==null?void 0:ie.x,se=(ae=$.arrow)==null?void 0:ae.y,oe=((me=$.arrow)==null?void 0:me.centerOffset)!==0,[ue,he]=g.useState();return oi(()=>{E&&he(window.getComputedStyle(E).zIndex)},[E]),S.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:Y?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Se=$.transformOrigin)==null?void 0:Se.x,(Ae=$.transformOrigin)==null?void 0:Ae.y].join(" "),...((Ke=$.hide)==null?void 0:Ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(qB,{scope:n,placedSide:H,placedAlign:D,onArrowChange:R,arrowX:te,arrowY:se,shouldHideArrow:oe,children:S.jsx(At.div,{"data-side":H,"data-align":D,..._,ref:P,style:{..._.style,animation:Y?void 0:"none"}})})})});b5.displayName=ax;var S5="PopperArrow",YB={top:"bottom",right:"left",bottom:"top",left:"right"},E5=g.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=ZB(S5,r),a=YB[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(GB,{...s,ref:n,style:{...s.style,display:"block"}})})});E5.displayName=S5;function XB(t){return t!==null}var QB=t=>({name:"transformOrigin",options:t,fn(e){var b,E,C;const{placement:n,rects:r,middlewareData:s}=e,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[f,h]=lx(n),p={start:"0%",center:"50%",end:"100%"}[h],v=(((E=s.arrow)==null?void 0:E.x)??0)+u/2,y=(((C=s.arrow)==null?void 0:C.y)??0)+c/2;let x="",_="";return f==="bottom"?(x=a?p:`${v}px`,_=`${-c}px`):f==="top"?(x=a?p:`${v}px`,_=`${r.floating.height+c}px`):f==="right"?(x=`${-c}px`,_=a?p:`${y}px`):f==="left"&&(x=`${r.floating.width+c}px`,_=a?p:`${y}px`),{data:{x,y:_}}}});function lx(t){const[e,n="center"]=t.split("-");return[e,n]}var k5=_5,ux=w5,C5=b5,P5=E5,h0="Popover",[T5]=ea(h0,[f0]),gf=f0(),[JB,ra]=T5(h0),R5=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=gf(e),c=g.useRef(null),[f,h]=g.useState(!1),[p,v]=fl({prop:r,defaultProp:s??!1,onChange:i,caller:h0});return S.jsx(k5,{...u,children:S.jsx(JB,{scope:e,contentId:sl(),triggerRef:c,open:p,onOpenChange:v,onOpenToggle:g.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:f,onCustomAnchorAdd:g.useCallback(()=>h(!0),[]),onCustomAnchorRemove:g.useCallback(()=>h(!1),[]),modal:a,children:n})})};R5.displayName=h0;var A5="PopoverAnchor",eW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ra(A5,n),i=gf(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=s;return g.useEffect(()=>(a(),()=>u()),[a,u]),S.jsx(ux,{...i,...r,ref:e})});eW.displayName=A5;var M5="PopoverTrigger",I5=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ra(M5,n),i=gf(n),a=Yt(e,s.triggerRef),u=S.jsx(At.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":F5(s.open),...r,ref:a,onClick:Et(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:S.jsx(ux,{asChild:!0,...i,children:u})});I5.displayName=M5;var cx="PopoverPortal",[tW,nW]=T5(cx,{forceMount:void 0}),N5=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=ra(cx,e);return S.jsx(tW,{scope:e,forceMount:n,children:S.jsx(Yi,{present:n||i.open,children:S.jsx(Ym,{asChild:!0,container:s,children:r})})})};N5.displayName=cx;var ju="PopoverContent",O5=g.forwardRef((t,e)=>{const n=nW(ju,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=ra(ju,t.__scopePopover);return S.jsx(Yi,{present:r||i.open,children:i.modal?S.jsx(sW,{...s,ref:e}):S.jsx(iW,{...s,ref:e})})});O5.displayName=ju;var rW=jd("PopoverContent.RemoveScroll"),sW=g.forwardRef((t,e)=>{const n=ra(ju,t.__scopePopover),r=g.useRef(null),s=Yt(e,r),i=g.useRef(!1);return g.useEffect(()=>{const a=r.current;if(a)return X3(a)},[]),S.jsx(K2,{as:rW,allowPinchZoom:!0,children:S.jsx(L5,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(t.onCloseAutoFocus,a=>{var u;a.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Et(t.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Et(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),iW=g.forwardRef((t,e)=>{const n=ra(ju,t.__scopePopover),r=g.useRef(!1),s=g.useRef(!1);return S.jsx(L5,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),L5=g.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,...p}=t,v=ra(ju,n),y=gf(n);return z3(),S.jsx(G2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Zm,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(C5,{"data-state":F5(v.open),role:"dialog",id:v.contentId,...y,...p,ref:e,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),D5="PopoverClose",oW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ra(D5,n);return S.jsx(At.button,{type:"button",...r,ref:e,onClick:Et(t.onClick,()=>s.onOpenChange(!1))})});oW.displayName=D5;var aW="PopoverArrow",lW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=gf(n);return S.jsx(P5,{...s,...r,ref:e})});lW.displayName=aW;function F5(t){return t?"open":"closed"}var j5=R5,V5=I5,$5=N5,H5=O5;const z5=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[f,h]=g.useState(!1),p=i?a??t:t,v=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${v?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),v?S.jsxs(j5,{open:f,onOpenChange:h,children:[S.jsx(V5,{asChild:!0,children:S.jsx("button",{"aria-label":u,disabled:s||i,title:u,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(hz,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx($5,{children:S.jsx(H5,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(y=>{const x=y.icon;return S.jsxs("button",{onClick:()=>{y.isDisabled||(y.onClick(),h(!1))},disabled:y.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[x?S.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var uW=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cW="VisuallyHidden",U5=g.forwardRef((t,e)=>S.jsx(At.span,{...t,ref:e,style:{...uW,...t.style}}));U5.displayName=cW;var dW=U5,[p0]=ea("Tooltip",[f0]),m0=f0(),B5="TooltipProvider",fW=700,g_="tooltip.open",[hW,dx]=p0(B5),W5=t=>{const{__scopeTooltip:e,delayDuration:n=fW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=g.useRef(!0),u=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),S.jsx(hW,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:g.useCallback(f=>{u.current=f},[]),disableHoverableContent:s,children:i})};W5.displayName=B5;var Kd="Tooltip",[pW,vf]=p0(Kd),G5=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=dx(Kd,t.__scopeTooltip),f=m0(e),[h,p]=g.useState(null),v=sl(),y=g.useRef(0),x=a??c.disableHoverableContent,_=u??c.delayDuration,b=g.useRef(!1),[E,C]=fl({prop:r,defaultProp:s??!1,onChange:I=>{I?(c.onOpen(),document.dispatchEvent(new CustomEvent(g_))):c.onClose(),i==null||i(I)},caller:Kd}),P=g.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),T=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,C(!0)},[C]),R=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),O=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,C(!0),y.current=0},_)},[_,C]);return g.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),S.jsx(k5,{...f,children:S.jsx(pW,{scope:e,contentId:v,open:E,stateAttribute:P,trigger:h,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?O():T()},[c.isOpenDelayedRef,O,T]),onTriggerLeave:g.useCallback(()=>{x?R():(window.clearTimeout(y.current),y.current=0)},[R,x]),onOpen:T,onClose:R,disableHoverableContent:x,children:n})})};G5.displayName=Kd;var v_="TooltipTrigger",K5=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=vf(v_,n),i=dx(v_,n),a=m0(n),u=g.useRef(null),c=Yt(e,u,s.onTriggerChange),f=g.useRef(!1),h=g.useRef(!1),p=g.useCallback(()=>f.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),S.jsx(ux,{asChild:!0,...a,children:S.jsx(At.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Et(t.onPointerMove,v=>{v.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Et(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Et(t.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Et(t.onFocus,()=>{f.current||s.onOpen()}),onBlur:Et(t.onBlur,s.onClose),onClick:Et(t.onClick,s.onClose)})})});K5.displayName=v_;var fx="TooltipPortal",[mW,gW]=p0(fx,{forceMount:void 0}),q5=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=vf(fx,e);return S.jsx(mW,{scope:e,forceMount:n,children:S.jsx(Yi,{present:n||i.open,children:S.jsx(Ym,{asChild:!0,container:s,children:r})})})};q5.displayName=fx;var Vu="TooltipContent",Z5=g.forwardRef((t,e)=>{const n=gW(Vu,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=vf(Vu,t.__scopeTooltip);return S.jsx(Yi,{present:r||a.open,children:a.disableHoverableContent?S.jsx(Y5,{side:s,...i,ref:e}):S.jsx(vW,{side:s,...i,ref:e})})}),vW=g.forwardRef((t,e)=>{const n=vf(Vu,t.__scopeTooltip),r=dx(Vu,t.__scopeTooltip),s=g.useRef(null),i=Yt(e,s),[a,u]=g.useState(null),{trigger:c,onClose:f}=n,h=s.current,{onPointerInTransitChange:p}=r,v=g.useCallback(()=>{u(null),p(!1)},[p]),y=g.useCallback((x,_)=>{const b=x.currentTarget,E={x:x.clientX,y:x.clientY},C=bW(E,b.getBoundingClientRect()),P=SW(E,C),T=EW(_.getBoundingClientRect()),R=CW([...P,...T]);u(R),p(!0)},[p]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(c&&h){const x=b=>y(b,h),_=b=>y(b,c);return c.addEventListener("pointerleave",x),h.addEventListener("pointerleave",_),()=>{c.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",_)}}},[c,h,y,v]),g.useEffect(()=>{if(a){const x=_=>{const b=_.target,E={x:_.clientX,y:_.clientY},C=(c==null?void 0:c.contains(b))||(h==null?void 0:h.contains(b)),P=!kW(E,a);C?v():P&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,h,a,f,v]),S.jsx(Y5,{...t,ref:i})}),[yW,_W]=p0(Kd,{isInside:!1}),xW=b$("TooltipContent"),Y5=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...u}=t,c=vf(Vu,n),f=m0(n),{onClose:h}=c;return g.useEffect(()=>(document.addEventListener(g_,h),()=>document.removeEventListener(g_,h)),[h]),g.useEffect(()=>{if(c.trigger){const p=v=>{v.target instanceof Node&&v.target.contains(c.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,h]),S.jsx(Zm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:S.jsxs(C5,{"data-state":c.stateAttribute,...f,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(xW,{children:r}),S.jsx(yW,{scope:n,isInside:!0,children:S.jsx(dW,{id:c.contentId,role:"tooltip",children:s||r})})]})})});Z5.displayName=Vu;var X5="TooltipArrow",wW=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=m0(n);return _W(X5,n).isInside?null:S.jsx(P5,{...s,...r,ref:e})});wW.displayName=X5;function bW(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function SW(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function EW(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function kW(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const u=e[i],c=e[a],f=u.x,h=u.y,p=c.x,v=c.y;h>r!=v>r&&n<(p-f)*(r-h)/(v-h)+f&&(s=!s)}return s}function CW(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),PW(e)}function PW(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var TW=W5,RW=G5,AW=K5,MW=q5,IW=Z5;const yd={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},Q5={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},J5=g.createContext(null);function g0(){const t=g.useContext(J5);return t?t.classes:Q5.pill}function NW(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function OW({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{NW(()=>r(i))},[]);return S.jsx(J5.Provider,{value:{shape:n,setShape:s,classes:Q5[n]},children:t})}const eR=g.createContext(null);function tR({value:t,children:e}){return S.jsx(eR.Provider,{value:t,children:e})}function LW(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function hx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,f]=g.useState(!1),h=a!==void 0?a:c,[p,v]=g.useState(!1),y=g0(),x=g.useContext(eR);g.useEffect(()=>{h&&v(!0)},[h]);const _=()=>{h||v(!1)},b=LW(n);return S.jsx(TW,{delayDuration:s,children:S.jsxs(RW,{open:h,onOpenChange:E=>{f(E),u==null||u(E)},children:[S.jsx(AW,{asChild:!0,children:e}),p&&S.jsx(MW,{forceMount:!0,container:x??void 0,children:S.jsx(IW,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Bi.div,{className:ur("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:yd.medium},initial:{opacity:0,scale:.8,...b},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Do=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(hx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),v0="/__rivet/preview",Hk=`${v0}/variant/`,zk=`${v0}/history/`,nR=t=>t?t.startsWith("/")?t:`/${t}`:"/",DW=t=>`${v0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${nR(t.routePath)}`,FW=t=>`${v0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${nR(t.routePath)}`,jW=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(Hk)||e.pathname.startsWith(zk)}catch{return t.startsWith(Hk)||t.startsWith(zk)}},Uk=t=>{var s,i,a,u;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?DW({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((a=r.executionPlan)==null?void 0:a.mode)!=="vite_app"&&((u=n.preview)==null?void 0:u.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},Bk="/rivet/",rR=t=>{if(!t.startsWith(Bk))return null;const e=t.slice(Bk.length);return!e||e==="/"?null:`/${e}`},qd=(t,e=fetch)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},VW=(t,e=fetch)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),qd(r,e))}},Wk=6,y_="original",px="Original",mx="The original state of your app before any variants were generated.",Gk=200,vn=fs("AgentVariantsPanel"),c1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},$W=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,Yc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},HW=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function cu(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function bo(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const zW=t=>{var n,r;const e=((r=(n=t.actions)==null?void 0:n.commit)==null?void 0:r.enabled)??t.status==="succeeded";return t.status==="succeeded"&&e},Va=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},sR=t=>t.status==="succeeded"&&!Va(t)&&!t.previewUnavailable,kp=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},Kk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},UW=t=>{var e;return zW(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},qk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),BW=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),WW=()=>{var aa,Ef,rc,la;const t=Xe(pf),e=Xe(QT),n=Xe(JT),r=Xe(mf),s=Xe(h_),i=((aa=s.deployPrototype)==null?void 0:aa.isEnabled)??!1,a=((Ef=s.canvasShare)==null?void 0:Ef.isEnabled)??!1,u=((rc=s.variantSend)==null?void 0:rc.isEnabled)??!1,c=((la=s.designContextViewer)==null?void 0:la.isEnabled)??!1,f=Xe(n5),h=Xe(r5),p=st(l_),v=st(bm),y=st(u_),x=st(c_),_=st(YT),b=st(XT),E=st(Bd),C=st(Q2),P=st(KT);g.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const T=Xe(Ko),R=st(Ko),O=g.useCallback(()=>{VW(T),R(null)},[R,T]),I=Xe(d_),A=st(d_),N=Xe(f_),L=st(f_),F=N?`${N.sessionId}:${N.variantId}`:null,[V,G]=g.useState(""),[X,q]=g.useState(null),[B,Y]=g.useState(null),[$,ee]=g.useState({}),[H,D]=g.useState(null),[Z,te]=g.useState({}),[se,oe]=g.useState(null),[ue,he]=g.useState([]),ie=g.useRef([]);ie.current=ue;const[ae,me]=g.useState(!1),Se=g.useMemo(()=>t.active?t.variants:[],[t]),Ae=g.useMemo(()=>Se.filter(UW),[Se]),Ke=g.useMemo(()=>qk(Ae,$),[Ae,$]),it=(H==null?void 0:H.key)===Ke?H.shareUrl:null,Oe=t.active?t.sessionId:null,at=g.useMemo(()=>{const z=new Set;for(const le of ue){const we=le.parentVariant;we&&we.sessionId!==le.sessionId&&z.add(we.sessionId)}return z},[ue]),Mt=g.useMemo(()=>{var le;const z=new Set;for(const we of Se)(le=we.adoptedSource)!=null&&le.sessionId&&z.add(we.adoptedSource.sessionId);return z},[Se]),mt=g.useMemo(()=>[...ue.filter(le=>le.sessionId!==Oe&&!at.has(le.sessionId)&&!Mt.has(le.sessionId))].sort((le,we)=>{const ge=new Date(le.createdAt).getTime(),be=new Date(we.createdAt).getTime();return(Number.isNaN(be)?0:be)-(Number.isNaN(ge)?0:ge)}),[ue,Oe,at,Mt]),Fe=g.useMemo(()=>N?Se.find(z=>{var le,we;return((le=z.adoptedSource)==null?void 0:le.sessionId)===N.sessionId&&((we=z.adoptedSource)==null?void 0:we.variantId)===N.variantId})??null:null,[N,Se]),Qe=g.useMemo(()=>N?mt.find(z=>z.sessionId===N.sessionId&&z.variantId===N.variantId)??null:null,[N,mt]),lt=t.active?t.projectContext:null,Je=(lt==null?void 0:lt.kind)==="fresh"?lt.workspacePath:n,vt=!t.active&&mt.length>0&&mt.every(z=>z.projectKind==="fresh"),xn=t.active?HW(lt):!!n&&!vt,zt=g.useMemo(()=>Je?`?projectPath=${encodeURIComponent(Je)}`:"",[Je]),Rn=g.useRef(null),Xn=g.useRef(null),Rr=typeof window>"u"?"/":rR(window.location.pathname)??"/",Qn=g.useRef(null),wn=g.useRef(!1),Ms=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),c1(),Qn.current={kind:"live",variantId:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]),Is=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),c1(),Qn.current={kind:"past",entry:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]);g.useEffect(()=>{const z=ge=>{const be=Qn.current;if(!be)return;const Ce=ge.clientX-be.startX,We=ge.clientY-be.startY;if(!be.committed){if(Ce*Ce+We*We<Wk*Wk)return;if(c1(),be.kind==="live"){const ke=Se.find(In=>In.workItemId===be.variantId);if(!ke||ke.status!=="succeeded"){Qn.current=null;return}const hn=Uk({sessionId:Oe,variant:ke,projectContext:lt,routePath:Rr});E({sessionId:Oe??"",variantId:ke.workItemId,label:ke.label||"Direction",url:hn,source:"live",runLabel:ke.runLabel,description:ke.description})}else{const{entry:ke}=be,hn=Yc(ke),In=hn?FW({sessionId:ke.sessionId,variantId:ke.variantId,routePath:Rr}):`/api/variants/history/${encodeURIComponent(ke.sessionId)}/${encodeURIComponent(ke.variantId)}/preview${zt}`;if(E({sessionId:ke.sessionId,variantId:ke.variantId,label:ke.label||"Direction",url:In,source:hn?"history-dev-server":"history-static",runLabel:ke.runLabel,description:ke.brief}),hn){const Ds=Kk(`/api/variants/history/${encodeURIComponent(ke.sessionId)}/${encodeURIComponent(ke.variantId)}/run${zt}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Ds,{method:"POST"})).ok)return;const Zr=Kk(In,"replay",String(Date.now()));E(Sn=>!Sn||Sn.sessionId!==ke.sessionId||Sn.variantId!==ke.variantId||Sn.source!=="history-dev-server"?Sn:{...Sn,url:Zr}),R(Sn=>{if(!Sn)return Sn;const Yr=Mr=>!Mr||Mr.sessionId!==ke.sessionId||Mr.variantId!==ke.variantId?Mr:{...Mr,url:Zr};return{...Sn,left:Yr(Sn.left),right:Yr(Sn.right)}})}catch(Fs){vn.warn("history replay drag boot failed",Fs)}})()}}be.committed=!0}C({x:ge.clientX,y:ge.clientY})},le=()=>{const ge=Qn.current;ge!=null&&ge.committed&&(wn.current=!0),Qn.current=null,C(null)},we=ge=>{if(ge.key!=="Escape")return;const be=Qn.current;be!=null&&be.committed&&(be.kind==="past"&&Yc(be.entry)&&qd({sessionId:be.entry.sessionId,variantId:be.entry.variantId,source:"history-dev-server"}),Qn.current=null,E(null),C(null))};return window.addEventListener("pointermove",z),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",we),()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",we)}},[Se,Oe,lt,Rr,zt,E,C,R]);const An=g.useMemo(()=>{var le;if(ae||F)return null;const z=I?Se.find(we=>we.workItemId===I):null;return I&&!z?null:z?Va(z)?z.workItemId:null:t.active?((le=Se.find(we=>{var ge,be;return Va(we)&&(((ge=we.preview)==null?void 0:ge.kind)==="static_artifact"||((be=we.preview)==null?void 0:be.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[I,F,ae,t,Se]),di=g.useCallback(async z=>{var we,ge,be,Ce;if(!Oe)return;const le=(z==null?void 0:z.workItemId)??null;q({kind:"switch",variantId:le??void 0});try{if(((we=z==null?void 0:z.preview)==null?void 0:we.kind)==="static_artifact"){if(y(!1),x(null),((ge=z.refinement)==null?void 0:ge.status)==="succeeded"){const ke=z.preview.url.includes("?")?"&":"?";v(`${z.preview.url}${ke}refinement=${encodeURIComponent(z.refinement.workItemId)}`)}else v(z.preview.url);p(ke=>ke+1);return}if(le&&Oe&&t.active&&t.projectContext.kind==="fresh"&&((be=t.projectContext.executionPlan)==null?void 0:be.mode)!=="vite_app"&&((Ce=z==null?void 0:z.preview)==null?void 0:Ce.kind)!=="dev_server"){y(!1),x(null),v(`/api/variants/${Oe}/static/${le}`),p(ke=>ke+1);return}const We=z&&le?Uk({sessionId:Oe,variant:z,projectContext:t.active?t.projectContext:null,routePath:Rr}):null;if(We){y(!1),x(null),v(We),p(ke=>ke+1);return}Te.capture("variants_panel.preview_display_failed",{sessionId:Oe,variantId:le,previewKind:z?kp(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),x(null)}catch(We){vn.warn("preview display failed",We),Te.capture("variants_panel.preview_display_failed",{sessionId:Oe,variantId:le,previewKind:z?kp(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:We instanceof Error?We.message:String(We)}),y(!1),x(null)}finally{q(null)}},[Oe,t,Rr,p,v,y,x]),fi=g.useRef(!1),hs=g.useRef(null),Ns=g.useRef(0),cr=g.useCallback(()=>{if(Ns.current++,_(!1),b(!1),!fi.current)return;const z=hs.current;fi.current=!1,hs.current=null;const le=z?new URLSearchParams({sessionId:z.sessionId,variantId:z.variantId}):null,we=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(we,{method:"POST"}).catch(ge=>vn.warn("history replay stop failed",ge))},[_,b]),Mn=g.useCallback(z=>{var Ce,We,ke,hn,In;if(wn.current){wn.current=!1;return}const le=Va(z),we=z.status==="pending"||z.status==="running"||sR(z);if(!le&&!we)return;cr();const ge=kp(z),be=Se.find(Ds=>Ds.workItemId===I);Te.capture("variants_panel.preview_requested",{sessionId:Oe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:z.workItemId,variantStatus:z.status,isPreviewReady:le,isArmed:we,previewKind:ge,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((We=(Ce=z.actions)==null?void 0:Ce.view)==null?void 0:We.enabled)??null,previewUnavailableReason:((ke=z.previewUnavailable)==null?void 0:ke.reason)??null}),A(z.workItemId),L(null),le?(Xn.current=z.workItemId,me(!1),O(),di(z)):(me(!1),v(null),y(!1),Te.capture("variants_panel.preview_armed",{sessionId:Oe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:z.workItemId,variantStatus:z.status,previewKind:ge,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((In=(hn=z.actions)==null?void 0:hn.view)==null?void 0:In.enabled)??null})),Te.capture("variants_panel.preview_switched",{sessionId:Oe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:z.workItemId,armed:we})},[I,Oe,O,A,L,cr,di,Se,v,y]),ia=t.active?`${t.sessionId}:${t.stage}`:"inactive";g.useEffect(()=>{if(r)return;let z=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${zt}`,{credentials:"same-origin"});if(!le.ok)return;const we=await le.json();if(z)return;const ge=(we.variants??[]).filter(be=>{var Ce,We;return((Ce=be.preview)==null?void 0:Ce.kind)==="static"||((We=be.serve)==null?void 0:We.kind)==="static"||Yc(be)});if(BW(ie.current,ge))return;ie.current=ge,he(ge)}catch(le){vn.warn("Failed to load past variants",le)}})(),()=>{z=!0}},[r,ia,zt]);const qr=g.useCallback(()=>{fi.current=!1,hs.current=null,_(!1),b(!1),L(null),A(null),me(!0),y(!1),x(null),v(null),p(z=>z+1)},[A,_,b,p,v,x,L,y]),Ar=g.useCallback(z=>{if(wn.current){wn.current=!1;return}if(O(),L({sessionId:z.sessionId,variantId:z.variantId,previewKind:Yc(z)?"dev_server":"static"}),A(null),me(!1),Yc(z)){const le=++Ns.current;fi.current=!0,hs.current={sessionId:z.sessionId,variantId:z.variantId},_(!0),b(!0),(async()=>{q({kind:"switch"}),Te.capture("variants_panel.history_replay_started",{sessionId:z.sessionId,variantId:z.variantId});const we=ge=>Te.capture("variants_panel.history_replay_failed",{sessionId:z.sessionId,variantId:z.variantId,...ge});try{const ge=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/run${zt}`,{method:"POST"});if(le!==Ns.current)return;if(!ge.ok){const{errorCode:be}=await bo(ge);vn.warn(`history replay failed: HTTP ${ge.status} ${be??""}`),we({httpStatus:ge.status,errorCode:be}),qr();return}b(!1),y(!0),x(null),v(null),p(be=>be+1),Te.capture("variants_panel.history_replay_ready",{sessionId:z.sessionId,variantId:z.variantId})}catch(ge){if(le!==Ns.current)return;vn.warn("history replay failed",ge),we({errorMessage:ge instanceof Error?ge.message:String(ge)}),qr()}finally{q(null)}})();return}cr(),y(!1),x(null),v(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/preview${zt}`)},[qr,q,_,b,p,L,A,v,x,O,y,cr,zt]),hi=g.useCallback(async()=>{cr();const z=()=>{O(),A(null),L(null),me(!0),Xn.current=null,y(!1),x(null),v(null),p(le=>le+1)};if(!Oe){z();return}q({kind:"switch"});try{const le=await fetch(`/api/variants/${Oe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){vn.warn(`switch to original failed: HTTP ${le.status}`);return}z(),y(!0),Te.capture("variants_panel.preview_switched",{sessionId:Oe,fromVariantId:I,toVariantId:null,target:"original",armed:!1})}catch(le){vn.warn("preview-port original switch failed",le)}finally{q(null)}},[I,Oe,A,L,p,v,x,O,y,cr]),qe=g.useCallback(async z=>{var we,ge;const le=((ge=(we=z.actions)==null?void 0:we.commit)==null?void 0:ge.enabled)??z.status==="succeeded";if(!(!Oe||!le)){Te.capture("variants_panel.commit_clicked",{sessionId:Oe,variantId:z.workItemId,variantLabel:z.label}),q({kind:"commit",variantId:z.workItemId});try{const be=await fetch(`/api/variants/${Oe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!be.ok){const{message:We,errorCode:ke}=await bo(be);vn.warn(`commit failed: HTTP ${be.status} ${ke??""} ${We??""}`),Te.capture("variants_panel.commit_failed",{sessionId:Oe,variantId:z.workItemId,httpStatus:be.status,errorCode:ke??null,errorMessage:We??null}),ht.error("Couldn't send direction",{description:We??`The server rejected the request (HTTP ${be.status}). Try again, or pick a different direction.`});return}const Ce=await be.json().catch(()=>null);Te.capture("variants_panel.commit_succeeded",{sessionId:Oe,variantId:z.workItemId,payloadKind:(Ce==null?void 0:Ce.payloadKind)??null,duplicate:(Ce==null?void 0:Ce.duplicate)??!1}),ht.success(`Sent "${z.label}" to your project`,{description:(Ce==null?void 0:Ce.payloadKind)==="project-created"?`Project created at ${(Ce==null?void 0:Ce.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ce==null?void 0:Ce.payloadKind)!=="project-created"&&(v(null),y(!1),p(We=>We+1))}catch(be){vn.warn("commit failed",be),Te.capture("variants_panel.commit_failed",{sessionId:Oe,variantId:z.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:be instanceof Error?be.message:String(be)}),ht.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{q(null)}}},[Oe,p,v,y]),Pt=g.useCallback(async(z,le,we)=>{Te.capture("variants_panel.deploy_clicked",{sessionId:z,variantId:le,variantLabel:we});try{const ge=await fetch(`/api/variants/${z}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...n?{projectPath:n}:{}})});if(!ge.ok){const{message:We,errorCode:ke}=await bo(ge);return vn.warn(`deploy failed: HTTP ${ge.status} ${ke??""} ${We??""}`),Te.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:ge.status,errorCode:ke??null,errorMessage:We??null}),ht.error("Couldn't deploy this direction",{description:We??`The server rejected the request (HTTP ${ge.status}). Try again.`}),null}const be=await ge.json().catch(()=>null),Ce=be==null?void 0:be.shareUrl;return Ce?(await navigator.clipboard.writeText(Ce).catch(()=>{}),Te.capture("variants_panel.deploy_succeeded",{sessionId:z,variantId:le}),ht.success(`"${we}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}}),Ce):(ht.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(ge){return vn.warn("deploy failed",ge),Te.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:ge instanceof Error?ge.message:String(ge)}),ht.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),nn=g.useCallback(async z=>{if(!Oe)return;const le=$[z.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}q({kind:"deploy",variantId:z.workItemId});try{const we=await Pt(Oe,z.workItemId,z.label);we&&ee(ge=>({...ge,[z.workItemId]:we}))}finally{q(null)}},[Oe,$,Pt]),bn=g.useCallback(async()=>{if(!(!Oe||Ae.length===0)){if(it){await navigator.clipboard.writeText(it).catch(()=>{}),ht.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(it,"_blank","noopener")}});return}Te.capture("variants_panel.deploy_clicked",{sessionId:Oe,variantId:"canvas",variantLabel:"Canvas",variantCount:Ae.length}),q({kind:"deploy-canvas"});try{const z=await fetch(`/api/variants/${Oe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Ae.map(Ce=>Ce.workItemId),...n?{projectPath:n}:{}})});if(!z.ok){const{message:Ce,errorCode:We}=await bo(z);vn.warn(`canvas deploy failed: HTTP ${z.status} ${We??""} ${Ce??""}`),Te.capture("variants_panel.deploy_failed",{sessionId:Oe,variantId:"canvas",httpStatus:z.status,errorCode:We??null,errorMessage:Ce??null,variantCount:Ae.length}),ht.error("Couldn't share this canvas",{description:Ce??`The server rejected the request (HTTP ${z.status}). Try again.`});return}const le=await z.json().catch(()=>null),we=le==null?void 0:le.shareUrl;if(!we){ht.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const ge=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(Ce=>typeof Ce.variantId=="string"&&typeof Ce.shareUrl=="string").map(Ce=>[Ce.variantId,Ce.shareUrl])),be=Object.keys(ge).length>0?{...$,...ge}:$;be!==$&&ee(be),await navigator.clipboard.writeText(we).catch(()=>{}),D({key:qk(Ae,be),shareUrl:we}),Te.capture("variants_panel.deploy_succeeded",{sessionId:Oe,variantId:"canvas",variantCount:Ae.length}),ht.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(we,"_blank","noopener")}})}catch(z){vn.warn("canvas deploy failed",z),Te.capture("variants_panel.deploy_failed",{sessionId:Oe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:z instanceof Error?z.message:String(z),variantCount:Ae.length}),ht.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{q(null)}}},[it,Ae,$,n,Oe]),Os=g.useCallback(async z=>{const le=`${z.sessionId}:${z.variantId}`,we=Z[le];if(we){await navigator.clipboard.writeText(we).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(we,"_blank","noopener")}});return}oe(le);try{const ge=await Pt(z.sessionId,z.variantId,z.label);ge&&te(be=>({...be,[le]:ge}))}finally{oe(null)}},[Z,Pt]),Ut=g.useCallback(async z=>{if(Oe){Te.capture("variants_panel.remove_clicked",{sessionId:Oe,variantId:z.workItemId,variantLabelLength:z.label.length}),q({kind:"remove",variantId:z.workItemId});try{const le=await fetch(`/api/variants/${Oe}/${z.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:we}=await bo(le);vn.warn(`remove failed: HTTP ${le.status} ${we??""}`),ht.error("Couldn't remove direction",{description:we??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(z.workItemId===An||z.workItemId===I)&&(A(null),v(null),y(!1),p(we=>we+1))}catch(le){vn.warn("remove failed",le),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{q(null)}}},[Oe,I,An,A,v,y,p]),rn=g.useCallback(async z=>{if(!Je){ht.error("Couldn't remove direction",{description:"No project path available."});return}Te.capture("variants_panel.remove_past_clicked",{sessionId:z.sessionId,variantId:z.variantId});const le=`${z.sessionId}:${z.variantId}`,we=ge=>ge.sessionId===z.sessionId&&ge.variantId===z.variantId;q({kind:"remove",variantId:le}),he(ge=>ge.filter(be=>!we(be))),F===le&&(L(null),v(null),y(!1),p(ge=>ge+1));try{const ge=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Je})});if(!ge.ok){const{message:be}=await bo(ge);he(Ce=>Ce.some(we)?Ce:[...Ce,z]),ht.error("Couldn't remove direction",{description:be??`The server rejected the request (HTTP ${ge.status}). Try again.`})}}catch(ge){vn.warn("remove past failed",ge),he(be=>be.some(we)?be:[...be,z]),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{q(null)}},[Je,F,L,v,y,p]),ps=g.useCallback(z=>{Y(z)},[]),fn=g.useCallback(async()=>{if(B)try{B.kind==="active"?await Ut(B.variant):await rn(B.entry)}finally{Y(null)}},[B,Ut,rn]),Jn=$W(B),Ls=(X==null?void 0:X.kind)==="remove"&&X.variantId===Jn,[er,oa]=g.useState(null),[Xu,Qu]=g.useState(null),E0=g.useCallback(z=>{Qu(z)},[]),k0=g.useCallback(()=>{Qu(null)},[]),pi=g.useCallback(async z=>{const le=z.trim();if(le)try{await navigator.clipboard.writeText(le),ht.success("Copied")}catch{ht.error("Couldn't copy")}},[]),xf=g.useCallback(async(z,le)=>{Qu(null);const we=le.trim();if(!we||z.kind==="original")return;if(z.kind==="active"){if(!Oe||we===z.variant.label)return;Te.capture("variants_panel.rename",{sessionId:Oe,variantId:z.variant.workItemId,labelLength:we.length,past:!1});try{const Ce=await fetch(`/api/variants/${Oe}/${z.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:we})});if(!Ce.ok){const{message:We}=await bo(Ce);ht.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){vn.warn("rename failed",Ce),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:ge}=z;if(we===ge.label.trim())return;if(!Je){ht.error("Couldn't rename direction",{description:"No project path available."});return}Te.capture("variants_panel.rename",{sessionId:ge.sessionId,variantId:ge.variantId,labelLength:we.length,past:!0});const be=Ce=>Ce.sessionId===ge.sessionId&&Ce.variantId===ge.variantId;he(Ce=>Ce.map(We=>be(We)?{...We,label:we}:We));try{const Ce=await fetch(`/api/variants/history/${encodeURIComponent(ge.sessionId)}/${encodeURIComponent(ge.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:we,projectPath:Je})});if(!Ce.ok){const{message:We}=await bo(Ce);he(ke=>ke.map(hn=>be(hn)?{...hn,label:ge.label}:hn)),ht.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){vn.warn("rename failed",Ce),he(We=>We.map(ke=>be(ke)?{...ke,label:ge.label}:ke)),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Oe,Je]);g.useEffect(()=>{if(Rn.current!==Oe){const le=Rn.current===null;if(Rn.current=Oe,Xn.current=null,D(null),v(null),y(!1),x(null),O(),A(null),L(null),me(!1),!le)return}if(F||ae||!An||t.active!==!0||Xn.current===An)return;const z=Se.find(le=>le.workItemId===An);z&&(Xn.current=An,O(),di(z))},[Oe,F,ae,An,t,Se,di,O,A,L,v,x,y]),g.useEffect(()=>{!N||!Fe||(Xn.current=null,L(null),A(Fe.workItemId),me(!1))},[Fe,N,Oe,A,L]),g.useEffect(()=>{!N||Fe||Qe||L(null)},[Fe,N,Qe,Oe,L,mt]),g.useEffect(()=>{const z=V.trim().toLowerCase(),le=Se.filter(ke=>Va(ke)&&cu(z,ke.label,ke.runLabel)),we=mt.filter(ke=>cu(z,ke.label,ke.runLabel,ke.brief)),ge=xn&&cu(z,px,mx);if(le.length===0&&we.length===0&&!ge)return;const be=[...le.map(ke=>({source:"live",variant:ke})),...we.map(ke=>({source:"past",entry:ke})),...ge?[{source:"original"}]:[]],Ce=ke=>ke.source==="live"?`live:${ke.variant.workItemId}`:ke.source==="past"?`past:${ke.entry.sessionId}:${ke.entry.variantId}`:y_,We=ke=>{if(FU())return;if(ke.key==="Enter"){const Yr=Se.find(Mr=>Mr.workItemId===er);Yr&&Va(Yr)&&(ke.preventDefault(),Mn(Yr));return}if(ke.key!=="ArrowUp"&&ke.key!=="ArrowDown")return;ke.preventDefault();let In=An?`live:${An}`:null;F?In=`past:${F}`:ae&&(In=y_);const Ds=In?be.findIndex(Yr=>Ce(Yr)===In):-1;let Fs;if(Ds===-1?Fs=ke.key==="ArrowDown"?0:be.length-1:ke.key==="ArrowDown"?Fs=Math.min(Ds+1,be.length-1):Fs=Math.max(Ds-1,0),Fs===Ds)return;const Zr=be[Fs];Zr.source==="live"?Mn(Zr.variant):Zr.source==="past"?Ar(Zr.entry):hi();const Sn=document.querySelector(`[data-variant-key="${Ce(Zr)}"]`);Sn instanceof HTMLElement&&Sn.focus({preventScroll:!0})};return window.addEventListener("keydown",We),()=>window.removeEventListener("keydown",We)},[Se,mt,V,xn,F,ae,An,er,Mn,Ar,hi]);const ml=Se.find(z=>z.workItemId===An)??null,Ju=F?mt.find(z=>`${z.sessionId}:${z.variantId}`===F)??null:null,ec=!!Ju,wf=t.active?t.artifacts??[]:[],tc=t.active?Se.filter(z=>z.status!=="cancelled"):[],Qi=[...tc.map(z=>({kind:"active",variant:z})),...mt.map(z=>({kind:"past",entry:z})),...xn?[{kind:"original"}]:[]],bf=V.trim().toLowerCase(),nc=bf?Qi.filter(z=>ZW(z,bf)):Qi,Bt=new Set(Se.map(z=>z.requestId).filter(Boolean)),Sf=e.filter(z=>!Bt.has(z.requestId)),Ji=Sf.length>0,gl=r&&!Ji&&Qi.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Qi.length>0?S.jsx("div",{className:"px-3 pt-2 pb-1",children:S.jsxs("div",{className:"relative",children:[S.jsx(mz,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:V,onChange:z=>G(z.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[Ji?S.jsx(aG,{groups:Sf}):null,gl?S.jsx(lG,{}):null,t.active&&tc.length===0&&!Ji&&!gl?S.jsx(uG,{}):null,!t.active&&!Ji&&!gl&&mt.length===0&&!xn?S.jsx(cG,{isMCPSession:f,mcpEditor:h}):null,Qi.length>0&&nc.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",V.trim(),"”."]}):null,nc.length>0?S.jsx(XW,{rows:nc,activeVariantId:I??An,activePastKey:F,isOriginalSelected:ae,busy:X,editingKey:Xu,onSelectActive:Mn,onSelectPast:Ar,onSelectOriginal:hi,onActivePointerDown:Ms,onPastPointerDown:Is,onHover:oa,onRemove:z=>ps({kind:"active",variant:z}),onRemovePast:z=>ps({kind:"past",entry:z}),onStartRename:E0,onCommitRename:xf,onCancelRename:k0,onCopyDescription:pi}):null,t.active&&c?S.jsx(rG,{artifacts:wf}):null]}),ec&&Ju?S.jsx(eG,{entry:Ju,deploying:se===F,deployedUrl:F?Z[F]??null:null,onDeploy:Os,isDeployDisabled:!i}):null,!ec&&t.active?S.jsx(oG,{selectedVariant:ml,busy:X,onSend:qe,onDeploy:nn,onDeployCanvas:bn,canDeploy:i&&(lt==null?void 0:lt.kind)==="fresh",canDeployCanvas:i&&a&&(lt==null?void 0:lt.kind)==="fresh",canSendToAgent:u,canvasVariantCount:Ae.length,canvasDeployedUrl:it,deployedUrl:ml?$[ml.workItemId]??null:null}):null,S.jsx(KW,{target:B,isConfirming:Ls,onCancel:()=>Y(null),onConfirm:fn})]})},GW=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",KW=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=GW(t);return S.jsx(Jm,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:S.jsxs(e0,{children:[S.jsx(t0,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(n0,{className:"fixed left-1/2 top-1/2 z-max w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(r0,{className:"text-base font-medium text-content",children:"Remove direction?"}),S.jsxs(s0,{className:"text-sm leading-5 text-content-subtle",children:['This removes "',s,'" from the directions list.']}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"rounded-md px-3 py-1.5 text-sm font-medium text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":"Remove direction"})]})]})})]})})},qW=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:y_,ZW=(t,e)=>t.kind==="active"?cu(e,t.variant.label,t.variant.runLabel):t.kind==="past"?cu(e,t.entry.label,t.entry.runLabel,t.entry.brief):cu(e,px,mx),YW=t=>t.length<=Gk?t:`${t.slice(0,Gk-1)}…`,XW=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:v,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:b,onCopyDescription:E})=>{const C=g.useRef(null),{activeIndex:P,itemRects:T,sessionRef:R,handlers:O,registerItem:I}=$T(C),A=(s==null?void 0:s.kind)==="switch",N=P!==null?T[P]:null;return S.jsxs("div",{ref:C,className:"relative",onMouseEnter:O.onMouseEnter,onMouseMove:O.onMouseMove,onMouseLeave:O.onMouseLeave,children:[S.jsx(Ui,{children:N&&S.jsx(rl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:N.top,left:N.left,width:N.width,height:N.height},animate:{opacity:1,top:N.top,left:N.left,width:N.width,height:N.height},exit:{opacity:0,transition:{duration:.06}},transition:{...$d.fast,opacity:{duration:.08}}},R.current)}),S.jsx("ul",{className:"relative",children:t.map((L,F)=>{const V=qW(L);let G=!1;return L.kind==="active"?G=L.variant.workItemId===e:L.kind==="past"?G=`${L.entry.sessionId}:${L.entry.variantId}`===n:G=r,S.jsx(QW,{rowKey:V,row:L,index:F,isSelected:G,isEditing:i===V,isSwitchInFlight:A,busy:s,registerItem:I,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:v,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:b,onCopyDescription:E},V)})})]})},QW=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:u,onSelectActive:c,onSelectPast:f,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:v,onHover:y,onRemove:x,onRemovePast:_,onStartRename:b,onCommitRename:E,onCancelRename:C,onCopyDescription:P})=>{var oe,ue;const T=g.useRef(null);fU(u,n,T);const R=e.kind==="active",O=e.kind==="original",I=e.kind==="active"?e.variant:null,A=e.kind==="past"?e.entry:null,N=R?I.status==="succeeded":!0,L=R?Va(I):!0,F=R?sR(I):!1,V=R&&(I.status==="pending"||I.status==="running"),G=R?N&&(L||F)||V:!0,X=R&&I.status==="failed",q=R&&I.status==="cancelled",B=R&&(!G||i),Y=R&&(a==null?void 0:a.kind)==="remove"&&a.variantId===I.workItemId,$=R&&(((oe=I.refinement)==null?void 0:oe.status)==="pending"||((ue=I.refinement)==null?void 0:ue.status)==="running");let ee=px;R?ee=I.label||`Direction ${n+1}`:A&&(ee=A.label.trim()||"Untitled direction");let H;R?H=I.runLabel:A&&(H=A.runLabel);let D=mx;R?D=I.description:A&&(D=A.brief);const Z=D?YW(D):null,te=R?I.changedFilesCount:void 0,se=R&&I.status==="succeeded"&&kp(I)==="none"&&typeof te=="number"&&te>0?`${te} file${te===1?"":"s"} changed`:null;return s?S.jsx("li",{ref:T,"data-proximity-index":n,className:"group relative z-10",children:S.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(JW,{initial:ee,onCommit:he=>E(e,he),onCancel:C}),Z&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:Z})]})})}):S.jsxs("li",{ref:T,"data-proximity-index":n,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:G?0:-1,"data-variant-id":R?I.workItemId:void 0,"data-variant-key":t,onClick:()=>{if(B)return;const he=window.getSelection();he&&!he.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?f(e.entry):h())},onKeyDown:he=>{B||(he.key==="Enter"||he.key===" ")&&(he.preventDefault(),he.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?f(e.entry):h())},onPointerDown:he=>{B||(e.kind==="active"?N&&p(e.variant.workItemId,he):e.kind==="past"&&v(e.entry,he))},"aria-pressed":G?r:void 0,"aria-disabled":R?!G:void 0,"aria-busy":V||$,onMouseEnter:R?()=>y(I.workItemId):void 0,onMouseLeave:R?()=>y(null):void 0,className:ur("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",N&&L&&"cursor-grab active:cursor-grabbing",(V||F)&&"cursor-pointer",!N&&!V&&!F&&"cursor-not-allowed opacity-60",B&&"cursor-not-allowed opacity-50"),style:N?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(V||$)&&S.jsx(J2,{className:"text-content-muted shrink-0 text-sm","data-testid":$&&!V?"variant-refining":void 0}),S.jsx(Do,{label:"Double-click to rename",disabled:O,children:S.jsx("span",{onDoubleClick:he=>{he.stopPropagation(),O||b(t)},className:ur("min-w-0 flex-1 truncate text-sm font-medium select-text",O?"cursor-default":"cursor-text",N||r?"text-content":"text-content-muted"),children:ee})}),X&&S.jsx(Zk,{label:"Failed"}),q&&S.jsx(Zk,{label:"Cancelled"}),H&&S.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:VT(H),children:H})]}),Z&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:Z}),se&&S.jsx("span",{"data-testid":"variant-diff-summary",className:"text-content-muted mt-0.5 block text-[11px] leading-snug",children:se})]})}),S.jsxs("div",{className:ur("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100"),children:[D&&S.jsx(Do,{label:"Copy description",children:S.jsx("button",{type:"button","aria-label":"Copy description",onClick:he=>{he.stopPropagation();const ie=ee.trim();P(ie?`${ie}
|
|
111
|
+
${D}`:D)},onPointerDown:he=>he.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(Vd,{size:13,weight:"bold"})})}),!O&&S.jsx(Do,{label:"Rename",children:S.jsx("button",{type:"button","aria-label":"Rename direction",onClick:he=>{he.stopPropagation(),b(t)},onPointerDown:he=>he.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(gz,{size:13,weight:"bold"})})}),!O&&S.jsx(Do,{label:"Remove",children:S.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:Y,onClick:he=>{he.stopPropagation(),e.kind==="active"?x(e.variant):_(e.entry)},onPointerDown:he=>he.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(_z,{size:13,weight:"bold"})})})]})]})},JW=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),a=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),u(!0)):c.key==="Escape"&&(c.preventDefault(),u(!1))},onBlur:()=>u(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},Zk=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),eG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(Vd,{size:12,weight:"bold"}):null,a]})]})},tG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},nG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},rG=({artifacts:t})=>{const[e,n]=g.useState(null),r=g.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(sG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},sG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=nG[t.kind],s=t.source?tG[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,u=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(dz,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":u,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(iG,{artifact:t})}):null]})},iG=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),oG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:f,deployedUrl:h})=>{var I,A,N,L;const p=t?((A=(I=t.actions)==null?void 0:I.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,v=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",b=!i||!p||e!==null,E=a&&c>0,P=x?"Deploying…":h?"Copy link":"Share",R=_?"Sharing…":f?"Copy canvas link":"Share canvas",O=y?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(z5,{primaryLabel:P,primaryIcon:h&&!x?Vd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:b,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:E?[{label:R,icon:f&&!_?Vd:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!v,title:(L=(N=t==null?void 0:t.actions)==null?void 0:N.commit)==null?void 0:L.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:O}):null]})]})},iR=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(J2,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),aG=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(iR,{},`${e.requestId}-${r}`)))}),lG=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(iR,{},e))}),uG=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),Yk="Try different ways to create a dropdown that feels fluid and dynamic",cG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=jU(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Yk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",Yk,"”"]}),S.jsx("button",{type:"button",onClick:a,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(dT,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Vd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},dG=({onClose:t})=>{const e=Xe(KT);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(Do,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(vz,{className:"h-4 w-4",weight:"bold"})})})]}):null},fG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',hG=({itemSelector:t=fG,loop:e=!1}={})=>{const n=g.useRef(null),r=g.useRef(null),s=g.useCallback(a=>{var u;n.current=a,a?r.current=DU():((u=r.current)==null||u.call(r),r.current=null)},[]),i=g.useCallback(a=>{var x;const{key:u}=a;if(u!=="ArrowDown"&&u!=="ArrowUp"&&u!=="Home"&&u!=="End")return;const c=n.current;if(!c)return;const f=Array.from(c.querySelectorAll(t));if(f.length===0)return;a.preventDefault(),a.stopPropagation();const h=f.indexOf(document.activeElement),p=f.length-1,v=_=>{if(h===-1)return _===1?0:p;const b=h+_;return e?(b+f.length)%f.length:Math.min(Math.max(b,0),p)};let y;u==="Home"?y=0:u==="End"?y=p:u==="ArrowDown"?y=v(1):y=v(-1),(x=f[y])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Xk="/assets/arena-Db0j1set.png",pG=fs("useIntegrations"),Qk=["integrations"],mG="rivet:connect-result",gG=t=>typeof t=="object"&&t!==null&&t.type===mG,vG=tt(null),yG=()=>{const t=d8(),[e,n]=tP(vG),r=z1({queryKey:Qk,queryFn:async()=>{const u=await fetch("/api/integrations");if(!u.ok)throw new Error(`Failed to load integrations (${u.status})`);return(await u.json()).integrations??[]},staleTime:1e4}),s=g.useCallback(()=>t.invalidateQueries({queryKey:Qk}),[t]),i=g.useCallback(async u=>{const c=window.open("","_blank","width=560,height=720");if(!c)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const f=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await f.json().catch(()=>({}));if(!f.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);c.location.href=h.authUrl,await new Promise(p=>{const v=()=>{window.removeEventListener("message",y),clearInterval(x),s(),p()},y=_=>{gG(_.data)&&_.data.provider===u&&(_.data.status==="error"&&pG.warn(`Connect failed for ${u}:`,_.data.message),v())};window.addEventListener("message",y);const x=setInterval(()=>{c.closed&&v()},500)})}finally{n(null)}},[s,n]),a=g.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const f=await c.json().catch(()=>({}));throw new Error(f.error||`Could not disconnect ${u}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:a,refetch:s}},du=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=S.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?S.jsx(hx,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},Jk=fs("ConnectorsModal"),_G=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),xG=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Xk})`,maskImage:`url(${Xk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),wG=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(_G,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(xG,{})}],bG=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",u=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`flex flex-col rounded-xl bg-main-light p-[18px] ${r?"ring-2 ring-secondary":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?S.jsx(dT,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-main-input px-3.5 text-[13px] font-semibold text-content-muted transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-secondary px-3.5 text-[13px] font-semibold text-secondary-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},__=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:f}=yG(),[h,p]=g.useState(null),v=b=>s.find(E=>E.provider===b),y=g.useCallback(b=>{c(b).catch(E=>{const C=E instanceof Error?E.message:"Could not connect.";Jk.warn(`Connect error for ${b}:`,C),ht.error(C)})},[c]),x=g.useCallback(b=>{f(b).catch(E=>{const C=E instanceof Error?E.message:"Could not disconnect.";Jk.warn(`Disconnect error for ${b}:`,C),ht.error(C)})},[f]),_=n==="onboarding";return S.jsx(Jm,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(e0,{children:[S.jsx(t0,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(n0,{ref:p,className:"fixed left-1/2 top-1/2 z-max w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(tR,{value:h,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(r0,{className:"text-base font-medium text-content",children:"Connect design references"}),S.jsx(du,{onClick:e,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content",children:S.jsx(ST,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(s0,{className:"text-sm text-content-subtle",children:"Connect your design references to use them with Rivet’s MCP."}),a?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:wG.map(b=>S.jsx(bG,{meta:b,integration:v(b.provider),isPending:i||u===b.provider,isHighlighted:r===b.provider,onConnect:()=>y(b.provider),onDisconnect:()=>x(b.provider)},b.provider))}),_?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-xs text-content-subtle",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push flex-none rounded-lg bg-secondary px-3.5 py-2 text-[13px] font-medium text-secondary-foreground transition-colors hover:bg-accent",children:"Skip for now"})]}):null]})]})})]})})},eC=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),SG=fs("SupportTicketModal"),tC=5e3,d1="feedback",EG=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},kG=async t=>{let e;try{e=await t.json()}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=EG(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},CG=({isOpen:t,onClose:e,contactEmail:n})=>{const r=tD(),[s,i]=g.useState(""),[a,u]=g.useState(!1),[c,f]=g.useState(null),h=g.useCallback(()=>{i("")},[]),p=g.useCallback(()=>{a||(h(),e())},[a,e,h]),v=g.useCallback(async()=>{const b=s.trim();if(!(!b||a)){u(!0);try{const E=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,C=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,P=n==null?void 0:n.trim(),T=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:d1,message:b,contactEmail:P||void 0,metadata:{posthogSessionId:E??void 0,posthogDistinctId:C??void 0,appVersion:"0.13.4",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const R=await kG(T);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:d1,has_posthog_session_id:!!E}),ht.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(E){const C=E instanceof Error?E.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:d1,error:C}),SG.error("Failed to submit support ticket:",C),ht.error("Could not send feedback",{description:C})}finally{u(!1)}}},[n,a,s,e,r,h]),y=g.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),v())},[v]),x=tC-s.length,_=a||s.trim().length===0;return S.jsx(Jm,{open:t,onOpenChange:b=>!b&&p(),children:S.jsxs(e0,{children:[S.jsx(t0,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(n0,{ref:f,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(tR,{value:c,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(r0,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(du,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(ST,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(s0,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:b=>i(b.target.value),onKeyDown:y,maxLength:tC,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:x}),S.jsx(du,{onClick:v,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?S.jsx(i0,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(fz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},PG=fs("ProfileAvatar"),oR=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},TG=(t,e)=>oR(t,e).charAt(0).toUpperCase(),RG=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=Xe(ZT),i=Xe(t5),a=Xe(e5),[u,c]=g.useState(!1),[f,h]=g.useState(!1),[p,v]=g.useState(!1),[y,x]=g.useState(!1),{containerRef:_,onKeyDown:b}=hG(),E=Xe(mf),C=TG(r,s);if(!C)return E?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(eC,{className:"h-7 w-7 rounded-full"}),S.jsx(eC,{className:"h-3 w-16"})]}):null;const P=oR(r,s),T=(r==null?void 0:r.trim())||null,R=(s==null?void 0:s.trim())||null,O=async()=>{x(!0);try{const I=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!I.ok)throw new Error(`Logout failed: ${I.status}`)}catch(I){PG.warn("Logout request failed",I),ht.error("Could not log out. Please try again."),x(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(j5,{open:u,onOpenChange:c,children:[S.jsx(V5,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`flex shrink-0 select-none items-center gap-2 text-content-muted transition-colors hover:text-content ${t}`,children:[S.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-main-border bg-main-input text-[11px] font-semibold leading-none",children:C}),P?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:P}):null]})}),S.jsx($5,{children:S.jsxs(H5,{ref:_,onKeyDown:b,role:"menu",className:"z-[60] min-w-[180px] rounded-lg bg-surface-2 p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[T||R?S.jsxs("div",{className:"border-b border-main-border px-3 py-2",children:[T?S.jsx("div",{className:"truncate text-xs font-medium text-content",children:T}):null,R?S.jsx("div",{className:"truncate text-[11px] text-content-muted",children:R}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),h(!0)},disabled:!i||a,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(xT,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),v(!0)},className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none",children:[S.jsx(pz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:O,disabled:y,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(yz,{className:"h-3.5 w-3.5",weight:"bold"}),y?"Logging out…":"Log out"]})]})})]}),S.jsx(__,{isOpen:f,onClose:()=>h(!1)}),S.jsx(CG,{isOpen:p,onClose:()=>v(!1),contactEmail:s??void 0})]})},AG=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(dG,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(WW,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(RG,{side:"top",align:"start"})})]}),MG=fs("useServerConfig"),IG=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),a=g.useCallback(async()=>{var u;try{r(!0),i(null);const c=await fetch("/api/health");if(!c.ok)throw new Error(`Failed to fetch config: ${c.status}`);const f=await c.json();if(!f.framework)throw new Error("Server did not return framework information");const h={userPort:((u=f.ports)==null?void 0:u.userDevServer)||3e3,framework:f.framework};return e(h),h}catch(c){const f=c instanceof Error?c.message:"Failed to fetch server config";throw i(f),MG.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},NG="#1C1C20",Pi=[118,118,124],nC=.85,OG=3,LG=.15,ep=36,DG=4.4,FG=.7,jG=3.5,VG=.8,rC=9,$G=11,HG=[1.35,1.12,.95,.85],zG=[0,1.1,2.3,3.1],UG=[0,.35,.16,.13],BG=[.9,.5,.4,.35],Ra=3,f1=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],tp=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},Cp=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Aa=(t,e)=>(Math.round(t/e-.5)+.5)*e,WG=Math.sin(Math.PI/3),sC=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*WG;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},GG=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-rC}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-rC}return Cp(.5-r/(2*$G))},aR=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=st(qT),r=g.useRef(null),s=g.useCallback(i=>{var L;if((L=r.current)==null||L.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(F=>F+1);const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],f=0,h=0,p=ep,v=ep,y=null,x=null,_=0,b=-1;const E=new Array(33),C=F=>{const V=Math.round(F*32);let G=E[V];if(!G){const X=V/32,q=Math.round(Pi[0]+(255-Pi[0])*X),B=Math.round(Pi[1]+(255-Pi[1])*X),Y=Math.round(Pi[2]+(255-Pi[2])*X);G=`rgba(${q}, ${B}, ${Y}, ${nC})`,E[V]=G}return G},P=F=>{const V=1-.35*F,G=Math.round(Pi[0]*V),X=Math.round(Pi[1]*V),q=Math.round(Pi[2]*V);return`rgba(${G}, ${X}, ${q}, ${nC})`},T=F=>{let V=Math.floor(Math.random()*f1.length);V===b&&(V=(V+1)%f1.length),b=V;const G=[0,0,0,0],X=f1[V].map((D,Z)=>{const te=D.level,se=G[te]++,oe=zG[te]+se*UG[te],ue=BG[te]+tp(V*131+Z*17+5)*.2;if(D.hline){const ae=Aa((D.y??0)*h,v);return{hline:!0,x1:Aa(D.x1*f,p),x2:Aa(D.x2*f,p),y1:ae,y2:ae,level:te,start:oe,dur:ue}}const he=Aa(D.x1*f,p),ie=Aa((D.y1??0)*h,v);return{hline:!1,x1:he,y1:ie,x2:Math.max(Aa(D.x2*f,p),he+p),y2:Math.max(Aa((D.y2??0)*h,v),ie+v),level:te,start:oe,dur:ue}}),q=X.reduce((D,Z)=>Math.max(D,Z.start+Z.dur),0),B=c.length,Y=new Float32Array(B*Ra),$=new Int16Array(B*Ra).fill(-1),ee=new Uint8Array(B),H=X[0];for(let D=0;D<B;D++){const Z=c[D];Z.x>H.x1&&Z.x<H.x2&&Z.y>H.y1&&Z.y<H.y2&&(ee[D]=1);const te=D*Ra;for(let se=0;se<X.length;se++){const oe=GG(Z.x,Z.y,X[se]);if(oe<=.02)continue;let ue=te;for(let he=te;he<te+Ra;he++){if($[he]===-1){ue=he;break}Y[he]<Y[ue]&&(ue=he)}($[ue]===-1||oe>Y[ue])&&(Y[ue]=oe,$[ue]=se)}}return{startT:F,buildEnd:q,els:X,frame:H,cellQ:Y,cellEl:$,inFrame:ee}},R=()=>{const F=i.getBoundingClientRect();f=Math.max(1,F.width),h=Math.max(1,F.height);const V=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(f*V),i.height=Math.round(h*V),a.setTransform(V,0,0,V,0,0);const G=Math.max(8,Math.round(f/ep)),X=Math.max(6,Math.round(h/ep));p=f/G,v=h/X,c=[];for(let q=0;q<X;q++){const B=X>1?q/(X-1):.5,Y=DG*(1+FG*.4*(B*2-1));for(let $=0;$<G;$++){const ee=q*8191+$*131+1,H={x:($+.5)*p,y:(q+.5)*v,size:Y,seed:ee,phase:tp(ee),kind:0};H.kind=Math.floor(tp(ee*97)*3),c.push(H)}}x=null,y=null},O=new Float32Array(32),I=F=>{a.fillStyle=NG,a.fillRect(0,0,f,h),y||(y=T(F+.2)),F>=y.startT+y.buildEnd+jG&&(x=y,_=F,y=T(F+.2));let V=0;x&&(V=1-Cp((F-_)/VG),V<=0&&(x=null));const G=y;for(let H=0;H<G.els.length;H++){const D=G.els[H];O[H]=Cp(Math.min(1,Math.max(0,(F-G.startT-D.start)/D.dur)))}const X=O[0],q=P(0),B=P(X),Y=V>0?P(V):q,$=V>0?P(Math.max(X,V)):B,ee=c.length;for(let H=0;H<ee;H++){const D=c[H];let Z=0,te=0;const se=H*Ra;for(let Se=se;Se<se+Ra;Se++){const Ae=G.cellEl[Se];if(Ae<0)break;const Ke=G.cellQ[Se]*O[Ae];Ke>Z&&(Z=Ke,te=G.els[Ae].level)}if(x)for(let Se=se;Se<se+Ra;Se++){const Ae=x.cellEl[Se];if(Ae<0)break;const Ke=x.cellQ[Se]*V;Ke>Z&&(Z=Ke,te=x.els[Ae].level)}const oe=F/OG+D.phase,ue=Math.floor(oe),he=oe-ue,ie=Cp(Math.min(he,1-he)/LG),ae=Math.floor(tp(D.seed*97+ue*7919)*3);ae!==D.kind&&Z<.02&&ie<.05&&(D.kind=ae);const me=Math.max(ie*(1-Z),Z);if(!(me<.01))if(Z<.02){const Se=G.inFrame[H]===1,Ae=x?x.inFrame[H]===1:!1;Se?a.fillStyle=Ae?$:B:a.fillStyle=Ae?Y:q;const Ke=Math.max(Se?X:0,Ae?V:0);sC(a,D.kind,D.x,D.y,D.size*me*(1-.2*Ke))}else{a.fillStyle=C(Z);const Se=1+(HG[te]-1)*Z;sC(a,D.kind,D.x,D.y,D.size*me*Se)}}};R();let A=0;if(u)y=T(-100),I(0);else{const F=performance.now(),V=G=>{I((G-F)/1e3),A=requestAnimationFrame(V)};A=requestAnimationFrame(V)}const N=new ResizeObserver(()=>{R(),u&&(y=T(-100),I(0))});N.observe(i),r.current=()=>{cancelAnimationFrame(A),N.disconnect(),e&&n(F=>F-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},KG=async(t=null)=>{if(t)return qG(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return np();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable"};let r;try{r=await e.json()}catch{return np()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable"}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable"}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable"}:np()},qG=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},np=async()=>{try{const t=await fetch("/");return{isOk:t.status!==502&&t.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},iC=fs("usePreviewUpstreamHealth"),ZG=500,YG=4e3,XG=15e3,QG=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??ZG,i=e.probeMsWhileUp??YG,a=e.firstUnreachableCaptureAfterMs??XG,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,f=e.skip??!1,[h,p]=g.useState(t==="static"),[v,y]=g.useState(0),[x,_]=g.useState(null),[b,E]=g.useState(0),[C,P]=g.useState(!1),[T,R]=g.useState(!1),[O,I]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){p(!0),_(null),E(0),P(!1),R(!0),I(null);return}if(f){p(!1),_(null),E(0),P(!1),R(!0),I("upstream_unreachable"),n.current=null;return}let A=!0;const N=Date.now();_(N),E(0),P(!1),p(!1),R(!1),I("upstream_unreachable");const L={current:!1},F={current:!1},V={current:!1},G={current:null},X={current:!1};let q=null;const B=()=>{V.current||(V.current=!0,A&&R(!0))},Y=()=>{q!==null&&(clearTimeout(q),q=null)},$=(H,D)=>{Y(),q=setTimeout(D,H)},ee=async()=>{if(!A)return;E(se=>se+1);const{isOk:H,unavailableReason:D}=await KG(c);if(!A)return;if(B(),H){const se=!X.current;X.current=!0,p(!0),I(null),G.current=null,F.current=!1,P(!1),L.current?se&&(Te==null||Te.capture("preview_upstream_restored",{framework:t})):(L.current=!0,Te==null||Te.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-N})),$(i,ee);return}const Z=X.current;X.current=!1,p(!1),I(D),G.current===null&&(G.current=Date.now(),F.current=!1,P(!1)),Z&&(Te==null||Te.capture("preview_upstream_lost",{framework:t}),y(se=>se+1),iC.warn("Preview upstream became unavailable after it was ready"));const te=Date.now()-G.current;te>=a&&!F.current&&(F.current=!0,P(!0),Te==null||Te.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:te}),iC.warn("Dev server did not become ready within timeout window")),$(s,ee)};return n.current=()=>$(0,ee),$(0,ee),()=>{A=!1,n.current=null,Y()}},[t,s,i,a,c,f]),g.useEffect(()=>{var N;if(t==="static"||u===void 0)return;const A=r.current;r.current=u,A!==null&&A!==u&&((N=n.current)==null||N.call(n))},[t,u]),{isUpstreamReady:h,iframeRemountKey:v,probeStartedAt:x,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:T,unavailableReason:O}};function JG(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const lR=t=>{var e;return t!=="embedded"||typeof window>"u"?"":((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.previewOrigin)??`${window.location.protocol}//localhost:${window.location.port}`},uR=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${lR(t)}${e}`:e,eK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",tK=t=>eK,nK=fs("PreviewSurface"),oC=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",cR=({target:t,src:e,framework:n,remountKey:r})=>(Xe(o0),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:tK(),onLoad:()=>{Te==null||Te.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Te==null||Te.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:oC(e,t),framework:n}))},onError:()=>{Te==null||Te.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Te==null||Te.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:oC(e,t),framework:n})),nK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),rK="modulepreload",sK=function(t){return"/"+t},aC={},iK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=a(n.map(f=>{if(f=sK(f),f in aC)return;aC[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":rK,h||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),h)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},oK=g.lazy(()=>iK(()=>Promise.resolve().then(()=>jq),void 0)),aK={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},lK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},uK={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},_d=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:f,role:h="status",busy:p=!1,className:v=""})=>{const y=g.useCallback(_=>{_&&f&&(Te==null||Te.capture("status_surface_shown",{state:f,tone:i,fill:a}))},[f,i,a]),x=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:y,className:`${aK[a]} ${v}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":f,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,x?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:lK[u],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:uK[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},xd=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(_d,{...r,size:n,busy:!0,backdrop:S.jsx(aR,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(_d,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(oK,{className:"absolute inset-0"})})}):S.jsx(_d,{...r,size:n,busy:!0,media:S.jsx(i0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),dR=({icon:t,...e})=>S.jsx(_d,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Pm=t=>S.jsx(_d,{...t,tone:"error",role:"alert"}),lC="/static/",cK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(lC)}catch{return t.endsWith(lC)}},dK=({isInteractionDisabled:t=!1,framework:e,userPort:n,activeDemoSessionId:r=null,holdPreviewNavigation:s=!1})=>{const i=Xe(l_),a=st(l_),u=Xe(bm),c=st(bm),f=Xe(pf),h=Xe(o0),p=Xe(u_),v=Xe(c_),y=Xe(YT),x=Xe(XT),_=st(c_),b=Xe(Ko),E=Xe(f_),C=st(u_),P=f.active&&f.projectContext.kind==="fresh",T=Xe(d_),R=f.active?f.variants.find(Fe=>Fe.workItemId===T&&(Fe.status==="pending"||Fe.status==="running"||Fe.status==="succeeded"&&!Fe.preview&&typeof Fe.port!="number"&&!Fe.previewUnavailable))??null:null,O=f.active&&f.variants.some(Fe=>Fe.status==="pending"||Fe.status==="running"),I=P||O,A=f.active?f.variants.find(Fe=>Fe.workItemId===T&&Fe.status==="succeeded"&&!!Fe.previewUnavailable)??null:null,N=e==="static"&&u!==null&&cK(u);g.useEffect(()=>{f.active||C(!1)},[f.active,C]);const L=g.useRef(!1);g.useEffect(()=>{const Fe=!!(b!=null&&b.left||b!=null&&b.right),Qe=Fe&&!L.current;L.current=Fe;const lt=f.active?f.sessionId:null;!lt||!JG({enteringSplit:Qe,isExistingSession:f.active&&f.projectContext.kind==="existing",hasActiveVariantProxy:p&&v!==null})||(C(!1),_(null),a(Je=>Je+1),fetch(`/api/variants/${encodeURIComponent(lt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[b,f,p,v,C,_,a]);const V=g.useMemo(()=>{var xn;if(p||u&&!N||!f.active)return null;const{stage:Fe,variants:Qe}=f,lt=Fe==="ready"||Fe==="degraded",Je=Qe.some(zt=>{var Rn,Xn;return((Rn=zt.refinement)==null?void 0:Rn.status)==="pending"||((Xn=zt.refinement)==null?void 0:Xn.status)==="running"});if(!lt&&!Je)return null;const vt=Qe.find(zt=>{var Rn;return zt.status==="succeeded"&&((Rn=zt.preview)==null?void 0:Rn.kind)==="static_artifact"});return((xn=vt==null?void 0:vt.preview)==null?void 0:xn.kind)==="static_artifact"?vt.preview.url:null},[N,u,p,f])??u,G=g.useMemo(()=>!f.active||!V?null:f.variants.find(Fe=>{var Qe;return((Qe=Fe.preview)==null?void 0:Qe.kind)==="static_artifact"&&V.startsWith(Fe.preview.url)})??null,[V,f]),X=g.useMemo(()=>{if((E==null?void 0:E.previewKind)==="static")return{kind:"variant",sessionId:E.sessionId,variantId:E.variantId};if(!f.active)return wm;if(G)return{kind:"variant",sessionId:f.sessionId,variantId:G.workItemId};if(V){const Qe=V.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),lt=Qe!=null&&Qe[1]?decodeURIComponent(Qe[1]):null,Je=Qe!=null&&Qe[2]?decodeURIComponent(Qe[2]):null;if(lt===f.sessionId&&Je&&f.variants.some(zt=>zt.workItemId===Je))return{kind:"variant",sessionId:f.sessionId,variantId:Je};const vt=V.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),xn=vt!=null&&vt[1]?decodeURIComponent(vt[1]):null;if(xn&&f.variants.some(zt=>zt.workItemId===xn))return{kind:"variant",sessionId:f.sessionId,variantId:xn}}const Fe=!!(b!=null&&b.left||b!=null&&b.right);return(!Fe||P)&&!V&&p&&v&&f.variants.some(Qe=>Qe.workItemId===v)?{kind:"variant",sessionId:f.sessionId,variantId:v}:(!Fe||P)&&!V&&T&&f.variants.some(Qe=>Qe.workItemId===T)?{kind:"variant",sessionId:f.sessionId,variantId:T}:wm},[E,G,f,p,v,V,b,P,T]),q=g.useRef(null);g.useEffect(()=>{var Je,vt;if(!G||((Je=G.preview)==null?void 0:Je.kind)!=="static_artifact"||((vt=G.refinement)==null?void 0:vt.status)!=="succeeded")return;const Fe=`${G.workItemId}:${G.refinement.workItemId}`;if(q.current===Fe)return;q.current=Fe;const Qe=G.preview.url.includes("?")?"&":"?",lt=`${G.preview.url}${Qe}refinement=${encodeURIComponent(G.refinement.workItemId)}`;V!==lt&&(c(lt),a(xn=>xn+1))},[V,G,a,c,f]);const B=V!==null&&jW(V),Y=V!==null&&!B||P&&!p&&!B,{isUpstreamReady:$,iframeRemountKey:ee,probeAttemptCount:H,initialProbeComplete:D}=QG(e,{rerunProbeImmediatelyOnVersion:i,probePath:B?V:null,skip:Y}),[Z,te]=g.useState(()=>y&&$?i:null),se=g.useRef(null);g.useEffect(()=>{if(!y){se.current=null,te(null);return}if(Z===i){se.current=null;return}const Fe=se.current;if(!Fe||Fe.remountKey!==i){se.current={remountKey:i,probeAttemptCount:H};return}$&&H>Fe.probeAttemptCount&&(se.current=null,te(i))},[Z,i,y,H,$]);const ue=V!==null&&!B||$,ie=x||y&&Z!==i||y&&!ue,ae=`${ee}:${i}`,me=r?`/try/${encodeURIComponent(r)}`:"",Se=rR(window.location.pathname),Ae=e==="static"?`${me}/static${Se??"/"}`:`${me}${Se??"/"}`,Ke=lR(h);let it=null;V&&(it=uR({agentApplyMode:h,url:V}));const at=R||ie?"about:blank":(B&&!ue?"about:blank":it)??(s||!ue?"about:blank":`${Ke}${Ae}`),Mt=!!R||!!A||!ue&&D;let mt=null;return ie?mt=S.jsx(xd,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):R?mt=R.status==="succeeded"?S.jsx(xd,{fill:"overlay",loader:"spinner",state:"variant_building",title:"Starting preview",description:"Its preview server is starting up."}):S.jsx(xd,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):A?mt=S.jsx(Pm,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):Mt&&(mt=I?S.jsx(dR,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Pm,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[mt,S.jsx(cR,{target:X,src:at,framework:e,remountKey:ae})]})};function uC({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var E;const u=st(Ko),c=Xe(pf),f=Xe(o0),h=g.useRef(!1),p=g.useCallback(()=>{h.current||(h.current=!0,qd({source:i,sessionId:e,variantId:n}))},[i,e,n]),v=g.useCallback(()=>{if(a){u(null);return}p(),u(C=>{if(!C)return null;const P={...C};return delete P[t],P.left||P.right?P:null})},[u,t,a,p]),y=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=g.useMemo(()=>!c.active||c.sessionId!==e?null:c.variants.find(C=>C.workItemId===n)??null,[e,n,c]),_=g.useMemo(()=>{var P,T;let C=r;if(((P=x==null?void 0:x.preview)==null?void 0:P.kind)==="static_artifact"&&((T=x.refinement)==null?void 0:T.status)==="succeeded"){const R=x.preview.url.includes("?")?"&":"?";C=`${x.preview.url}${R}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return uR({agentApplyMode:f,url:C})},[f,x,r]),b=((E=x==null?void 0:x.refinement)==null?void 0:E.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(Do,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:v,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(cR,{target:y,src:_,framework:"static",remountKey:b})})]})}const cC=240;function fK(){const t=Xe(Bd),e=Xe(Q2),n=g.useRef(null);return g.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-cC/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:S.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:cC},children:S.jsxs("div",{className:"variant-drag-ghost-body",children:[S.jsxs("div",{className:"variant-drag-ghost-row",children:[S.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?S.jsx("div",{className:"variant-drag-ghost-tag",style:VT(t.runLabel),children:t.runLabel}):null]}),t.description?S.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function hK(){const t=Xe(Bd),e=Xe(Q2),n=Xe(Ko),r=st(Bd),s=st(Ko),i=g.useRef(null),[a,u]=g.useState(null),[c,f]=g.useState("hidden");g.useEffect(()=>{if(!t){f("hidden"),u(null);return}const v=requestAnimationFrame(()=>f("visible"));return()=>cancelAnimationFrame(v)},[t]);const h=g.useCallback((v,y)=>{const x=i.current;if(!x)return null;const _=x.getBoundingClientRect();return v<_.left||v>_.right||y<_.top||y>_.bottom?null:v<(_.left+_.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const v=h(e.x,e.y);u(y=>y===v?y:v)},[t,e,h]),g.useEffect(()=>{if(!t)return;const v=y=>{const x=h(y.clientX,y.clientY);if(x&&t.url){const _={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[x];b&&(b.sessionId!==_.sessionId||b.variantId!==_.variantId)&&qd(b),s(E=>({...E??{},[x]:_})),f("exiting"),window.setTimeout(()=>r(null),220)}else qd(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,h,r,s,n]),!t)return null;const p=["variant-drop-zones",c==="visible"&&"is-visible",c==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:i,className:p,"aria-hidden":"true",children:[S.jsx(dC,{side:"left",hovered:a==="left",canDrop:!!t.url,label:t.label}),S.jsx(dC,{side:"right",hovered:a==="right",canDrop:!!t.url,label:t.label})]})}function dC({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const fR=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(u=>u.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((a=r.refinement)==null?void 0:a.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},fC=(t,e)=>{if(!t)return;const n=fR(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},pK=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(aR,{trackGlobalLoaderCount:!1})})}),mK=({isLoading:t=!1,isInteractionDisabled:e=!1,activeDemoSessionId:n=null,holdHostedTryoutPreviewNavigation:r=!1})=>{const{config:s,fetchConfig:i,isLoading:a,error:u}=IG();return g.useEffect(()=>{i().catch(c=>{Te==null||Te.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})},[i]),a?r?S.jsx("div",{className:"bg-main flex h-full min-h-0 w-full flex-1","aria-busy":"true"}):S.jsx(pK,{}):u||!s?S.jsx(Pm,{fill:"surface",size:"sm",state:"preview_config_error",title:"Couldn't load preview",description:"We couldn't load the preview configuration.",actions:[{label:"Retry",onClick:()=>{Te==null||Te.capture("preview_config_retry_clicked"),i().catch(c=>{Te==null||Te.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})}}]}):S.jsx(gK,{isLoading:t,isInteractionDisabled:e,framework:s.framework,userPort:s.userPort,activeDemoSessionId:n,holdHostedTryoutPreviewNavigation:r})};function gK(t){const e=Xe(Ko),n=Xe(Bd),r=Xe(pf),s=Xe(bm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=g.useMemo(()=>{var R,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const _=(R=i??a)==null?void 0:R.variantId,b=r.variants.filter(I=>{var A;return I.status==="succeeded"&&((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&I.workItemId!==_}),E=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=b.find(I=>{var A;return((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&I.preview.url===E})??b[0];if(((O=P==null?void 0:P.preview)==null?void 0:O.kind)!=="static_artifact")return;const T=fR(r,r.sessionId,P.workItemId);if(T)return{sessionId:r.sessionId,variantId:P.workItemId,label:P.label,url:T,source:"live"}},[r,i,a,s]),c=fC(i,r)??(a?u:void 0),f=fC(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!f,v=!!(c||f),y=S.jsx(dK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort,activeDemoSessionId:t.activeDemoSessionId,holdPreviewNavigation:t.holdHostedTryoutPreviewNavigation});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${v?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(uC,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:h},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&f)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),f&&S.jsx(uC,{side:"right",sessionId:f.sessionId,variantId:f.variantId,url:f.url,label:f.label,source:f.source,isFallback:p},`right-${f.sessionId}:${f.variantId}:${f.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(hK,{}),S.jsx(fK,{})]})})}const hR=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(i0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]});function Oi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pR(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
112
|
+
* GSAP 3.15.0
|
|
113
|
+
* https://gsap.com
|
|
114
|
+
*
|
|
115
|
+
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
116
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
117
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
118
|
+
*/var Wr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Zd={duration:.5,overwrite:!1,delay:0},gx,Hn,Ht,ls=1e8,St=1/ls,x_=Math.PI*2,vK=x_/4,yK=0,mR=Math.sqrt,_K=Math.cos,xK=Math.sin,Tn=function(e){return typeof e=="string"},tn=function(e){return typeof e=="function"},qi=function(e){return typeof e=="number"},vx=function(e){return typeof e>"u"},ci=function(e){return typeof e=="object"},Er=function(e){return e!==!1},yx=function(){return typeof window<"u"},rp=function(e){return tn(e)||Tn(e)},gR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Yn=Array.isArray,wK=/random\([^)]+\)/g,bK=/,\s*/g,hC=/(?:-?\.?\d|\.)+/gi,vR=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,su=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,h1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,yR=/[+-]=-?[.\d]+/,SK=/[^,'"\[\]\s]+/gi,EK=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,qt,Ks,w_,_x,Gr={},Tm={},_R,xR=function(e){return(Tm=$u(e,Gr))&&Tr},xx=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Yd=function(e,n){return!n&&console.warn(e)},wR=function(e,n){return e&&(Gr[e]=n)&&Tm&&(Tm[e]=n)||Gr},Xd=function(){return 0},kK={suppressEvents:!0,isStart:!0,kill:!1},Pp={suppressEvents:!0,kill:!1},CK={suppressEvents:!0},wx={},Ho=[],b_={},bR,jr={},p1={},pC=30,Tp=[],bx="",Sx=function(e){var n=e[0],r,s;if(ci(n)||tn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Tp.length;s--&&!Tp[s].targetTest(n););r=Tp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new BR(e[s],r)))||e.splice(s,1);return e},il=function(e){return e._gsap||Sx(us(e))[0]._gsap},SR=function(e,n,r){return(r=e[n])&&tn(r)?e[n]():vx(r)&&e.getAttribute&&e.getAttribute(n)||r},kr=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},Kt=function(e){return Math.round(e*1e7)/1e7||0},fu=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},PK=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Rm=function(){var e=Ho.length,n=Ho.slice(0),r,s;for(b_={},Ho.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Ex=function(e){return!!(e._initted||e._startAt||e.add)},ER=function(e,n,r,s){Ho.length&&!Hn&&Rm(),e.render(n,r,!!(Hn&&n<0&&Ex(e))),Ho.length&&!Hn&&Rm()},kR=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(SK).length<2?n:Tn(e)?e.trim():e},CR=function(e){return e},Kr=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},TK=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},$u=function(e,n){for(var r in n)e[r]=n[r];return e},mC=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=ci(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Am=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},wd=function(e){var n=e.parent||qt,r=e.keyframes?TK(Yn(e.keyframes)):Kr;if(Er(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},RK=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},PR=function(e,n,r,s,i){var a=e[s],u;if(i)for(u=n[i];a&&a[i]>u;)a=a._prev;return a?(n._next=a._next,a._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=a,n.parent=n._dp=e,n},y0=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,a=n._next;i?i._next=a:e[r]===n&&(e[r]=a),a?a._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},Yo=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},ol=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},AK=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},S_=function(e,n,r,s){return e._startAt&&(Hn?e._startAt.revert(Pp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},MK=function t(e){return!e||e._ts&&t(e.parent)},gC=function(e){return e._repeat?Hu(e._tTime,e=e.duration()+e._rDelay)*e:0},Hu=function(e,n){var r=Math.floor(e=Kt(e/n));return e&&r===e?r-1:r},Mm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},_0=function(e){return e._end=Kt(e._start+(e._tDur/Math.abs(e._ts||e._rts||St)||0))},x0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Kt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),_0(e),r._dirty||ol(r,e)),e},TR=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Mm(e.rawTime(),n),(!n._dur||yf(0,n.totalDuration(),r)-n._tTime>St)&&n.render(r,!0)),ol(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-St}},ei=function(e,n,r,s){return n.parent&&Yo(n),n._start=Kt((qi(r)?r:r||e!==qt?ss(e,r,n):e._time)+n._delay),n._end=Kt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),PR(e,n,"_first","_last",e._sort?"_start":0),E_(n)||(e._recent=n),s||TR(e,n),e._ts<0&&x0(e,e._tTime),e},RR=function(e,n){return(Gr.ScrollTrigger||xx("scrollTrigger",n))&&Gr.ScrollTrigger.create(n,e)},AR=function(e,n,r,s,i){if(Cx(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!Hn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&bR!==Vr.frame)return Ho.push(e),e._lazy=[i,s],1},IK=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},E_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},NK=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&IK(e)&&!(!e._initted&&E_(e))||(e._ts<0||e._dp._ts<0)&&!E_(e))?0:1,u=e._rDelay,c=0,f,h,p;if(u&&e._repeat&&(c=yf(0,e._tDur,n),h=Hu(c,u),e._yoyo&&h&1&&(a=1-a),h!==Hu(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Hn||s||e._zTime===St||!n&&e._zTime){if(!e._initted&&AR(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?St:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,f=e._pt;f;)f.r(a,f.d),f=f._next;n<0&&S_(e,n,r,!0),e._onUpdate&&!r&&Hr(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&Hr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&Yo(e,1),!r&&!Hn&&(Hr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},OK=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},zu=function(e,n,r,s){var i=e._repeat,a=Kt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Kt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&x0(e,e._tTime=e._tDur*u),e.parent&&_0(e),r||ol(e.parent,e),e},vC=function(e){return e instanceof wr?ol(e):zu(e,e._dur)},LK={_start:0,endTime:Xd,totalDuration:Xd},ss=function t(e,n,r){var s=e.labels,i=e._recent||LK,a=e.duration()>=ls?i.endTime(!1):e._dur,u,c,f;return Tn(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),f=n.substr(-1)==="%",u=n.indexOf("="),c==="<"||c===">"?(u>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(f?(u<0?i:r).totalDuration()/100:1)):u<0?(n in s||(s[n]=a),s[n]):(c=parseFloat(n.charAt(u-1)+n.substr(u+1)),f&&r&&(c=c/100*(Yn(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},bd=function(e,n,r){var s=qi(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],u,c;if(s&&(a.duration=n[1]),a.parent=r,e){for(u=a,c=r;c&&!("immediateRender"in u);)u=c.vars.defaults||{},c=Er(c.vars.inherit)&&c.parent;a.immediateRender=Er(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new dn(n[0],a,n[i+1])},sa=function(e,n){return e||e===0?n(e):n},yf=function(e,n,r){return r<e?e:r>n?n:r},Zn=function(e,n){return!Tn(e)||!(n=EK.exec(e))?"":n[1]},DK=function(e,n,r){return sa(r,function(s){return yf(e,n,s)})},k_=[].slice,MR=function(e,n){return e&&ci(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&ci(e[0]))&&!e.nodeType&&e!==Ks},FK=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Tn(s)&&!n||MR(s,1)?(i=r).push.apply(i,us(s)):r.push(s)})||r},us=function(e,n,r){return Ht&&!n&&Ht.selector?Ht.selector(e):Tn(e)&&!r&&(w_||!Uu())?k_.call((n||_x).querySelectorAll(e),0):Yn(e)?FK(e,r):MR(e)?k_.call(e,0):e?[e]:[]},C_=function(e){return e=us(e)[0]||Yd("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return us(n,r.querySelectorAll?r:r===e?Yd("Invalid scope")||_x.createElement("div"):e)}},IR=function(e){return e.sort(function(){return .5-Math.random()})},NR=function(e){if(tn(e))return e;var n=ci(e)?e:{each:e},r=al(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,f=n.axis,h=s,p=s;return Tn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(v,y,x){var _=(x||n).length,b=a[_],E,C,P,T,R,O,I,A,N;if(!b){if(N=n.grid==="auto"?0:(n.grid||[1,ls])[1],!N){for(I=-ls;I<(I=x[N++].getBoundingClientRect().left)&&N<_;);N<_&&N--}for(b=a[_]=[],E=c?Math.min(N,_)*h-.5:s%N,C=N===ls?0:c?_*p/N-.5:s/N|0,I=0,A=ls,O=0;O<_;O++)P=O%N-E,T=C-(O/N|0),b[O]=R=f?Math.abs(f==="y"?T:P):mR(P*P+T*T),R>I&&(I=R),R<A&&(A=R);s==="random"&&IR(b),b.max=I-A,b.min=A,b.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(N>_?_-1:f?f==="y"?_/N:N:Math.max(N,_/N))||0)*(s==="edges"?-1:1),b.b=_<0?i-_:i,b.u=Zn(n.amount||n.each)||0,r=r&&_<0?YK(r):r}return _=(b[v]-b.min)/b.max||0,Kt(b.b+(r?r(_):_)*b.v)+b.u}},P_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Kt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(qi(r)?0:Zn(r))}},OR=function(e,n){var r=Yn(e),s,i;return!r&&ci(e)&&(s=r=e.radius||ls,e.values?(e=us(e.values),(i=!qi(e[0]))&&(s*=s)):e=P_(e.increment)),sa(n,r?tn(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var u=parseFloat(i?a.x:a),c=parseFloat(i?a.y:0),f=ls,h=0,p=e.length,v,y;p--;)i?(v=e[p].x-u,y=e[p].y-c,v=v*v+y*y):v=Math.abs(e[p]-u),v<f&&(f=v,h=p);return h=!s||f<=s?e[h]:a,i||h===a||qi(a)?h:h+Zn(a)}:P_(e))},LR=function(e,n,r,s){return sa(Yn(e)?!n:r===!0?!!(r=0):!s,function(){return Yn(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},jK=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,a){return a(i)},s)}},VK=function(e,n){return function(r){return e(parseFloat(r))+(n||Zn(r))}},$K=function(e,n,r){return FR(e,n,0,1,r)},DR=function(e,n,r){return sa(r,function(s){return e[~~n(s)]})},HK=function t(e,n,r){var s=n-e;return Yn(e)?DR(e,t(0,e.length),n):sa(r,function(i){return(s+(i-e)%s)%s+e})},zK=function t(e,n,r){var s=n-e,i=s*2;return Yn(e)?DR(e,t(0,e.length-1),n):sa(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},Qd=function(e){return e.replace(wK,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(bK);return LR(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},FR=function(e,n,r,s,i){var a=n-e,u=s-r;return sa(i,function(c){return r+((c-e)/a*u||0)})},UK=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var a=Tn(e),u={},c,f,h,p,v;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(Yn(e)&&!Yn(n)){for(h=[],p=e.length,v=p-2,f=1;f<p;f++)h.push(t(e[f-1],e[f]));p--,i=function(x){x*=p;var _=Math.min(v,~~x);return h[_](x-_)},r=n}else s||(e=$u(Yn(e)?[]:{},e));if(!h){for(c in n)kx.call(u,e,c,"get",n[c]);i=function(x){return Rx(x,u)||(a?e.p:e)}}}return sa(r,i)},yC=function(e,n,r){var s=e.labels,i=ls,a,u,c;for(a in s)u=s[a]-n,u<0==!!r&&u&&i>(u=Math.abs(u))&&(c=a,i=u);return c},Hr=function(e,n,r){var s=e.vars,i=s[n],a=Ht,u=e._ctx,c,f,h;if(i)return c=s[n+"Params"],f=s.callbackScope||e,r&&Ho.length&&Rm(),u&&(Ht=u),h=c?i.apply(f,c):i.call(f),Ht=a,h},od=function(e){return Yo(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Hn),e.progress()<1&&Hr(e,"onInterrupt"),e},iu,jR=[],VR=function(e){if(e)if(e=!e.name&&e.default||e,yx()||e.headless){var n=e.name,r=tn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Xd,render:Rx,add:kx,kill:oq,modifier:iq,rawVars:0},a={targetTest:0,get:0,getSetter:Tx,aliases:{},register:0};if(Uu(),e!==s){if(jr[n])return;Kr(s,Kr(Am(e,i),a)),$u(s.prototype,$u(i,Am(e,a))),jr[s.prop=n]=s,e.targetTest&&(Tp.push(s),wx[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}wR(n,s),e.register&&e.register(Tr,s,Cr)}else jR.push(e)},xt=255,ad={aqua:[0,xt,xt],lime:[0,xt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,xt],navy:[0,0,128],white:[xt,xt,xt],olive:[128,128,0],yellow:[xt,xt,0],orange:[xt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[xt,0,0],pink:[xt,192,203],cyan:[0,xt,xt],transparent:[xt,xt,xt,0]},m1=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*xt+.5|0},$R=function(e,n,r){var s=e?qi(e)?[e>>16,e>>8&xt,e&xt]:0:ad.black,i,a,u,c,f,h,p,v,y,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),ad[e])s=ad[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),u=e.charAt(3),e="#"+i+i+a+a+u+u+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&xt,s&xt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&xt,e&xt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(hC),!n)c=+s[0]%360/360,f=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(f+1):h+f-h*f,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=m1(c+1/3,i,a),s[1]=m1(c,i,a),s[2]=m1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(vR),r&&s.length<4&&(s[3]=1),s}else s=e.match(hC)||ad.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/xt,a=s[1]/xt,u=s[2]/xt,p=Math.max(i,a,u),v=Math.min(i,a,u),h=(p+v)/2,p===v?c=f=0:(y=p-v,f=h>.5?y/(2-p-v):y/(p+v),c=p===i?(a-u)/y+(a<u?6:0):p===a?(u-i)/y+2:(i-a)/y+4,c*=60),s[0]=~~(c+.5),s[1]=~~(f*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},HR=function(e){var n=[],r=[],s=-1;return e.split(zo).forEach(function(i){var a=i.match(su)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},_C=function(e,n,r){var s="",i=(e+s).match(zo),a=n?"hsla(":"rgba(",u=0,c,f,h,p;if(!i)return e;if(i=i.map(function(v){return(v=$R(v,n,1))&&a+(n?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(h=HR(e),c=r.c,c.join(s)!==h.c.join(s)))for(f=e.replace(zo,"1").split(su),p=f.length-1;u<p;u++)s+=f[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!f)for(f=e.split(zo),p=f.length-1;u<p;u++)s+=f[u]+i[u];return s+f[p]},zo=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ad)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),BK=/hsl[a]?\(/,zR=function(e){var n=e.join(" "),r;if(zo.lastIndex=0,zo.test(n))return r=BK.test(n),e[1]=_C(e[1],r),e[0]=_C(e[0],r,HR(e[1])),!0},Jd,Vr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,f,h,p,v,y,x=function _(b){var E=t()-s,C=b===!0,P,T,R,O;if((E>e||E<0)&&(r+=E-n),s+=E,R=s-r,P=R-a,(P>0||C)&&(O=++p.frame,v=R-p.time*1e3,p.time=R=R/1e3,a+=P+(P>=i?4:i-P),T=1),C||(c=f(_)),T)for(y=0;y<u.length;y++)u[y](R,v,O,b)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(b){return v/(1e3/(b||60))},wake:function(){_R&&(!w_&&yx()&&(Ks=w_=window,_x=Ks.document||{},Gr.gsap=Tr,(Ks.gsapVersions||(Ks.gsapVersions=[])).push(Tr.version),xR(Tm||Ks.GreenSockGlobals||!Ks.gsap&&Ks||{}),jR.forEach(VR)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),f=h||function(b){return setTimeout(b,a-p.time*1e3+1|0)},Jd=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),Jd=0,f=Xd},lagSmoothing:function(b,E){e=b||1/0,n=Math.min(E||33,e)},fps:function(b){i=1e3/(b||240),a=p.time*1e3+i},add:function(b,E,C){var P=E?function(T,R,O,I){b(T,R,O,I),p.remove(P)}:b;return p.remove(b),u[C?"unshift":"push"](P),Uu(),P},remove:function(b,E){~(E=u.indexOf(b))&&u.splice(E,1)&&y>=E&&y--},_listeners:u},p})(),Uu=function(){return!Jd&&Vr.wake()},ct={},WK=/^[\d.\-M][\d.\-,\s]/,GK=/["']/g,KK=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,f;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,f=c.substr(0,u),n[s]=isNaN(f)?f.replace(GK,"").trim():+f,s=c.substr(u+1).trim();return n},qK=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},ZK=function(e){var n=(e+"").split("("),r=ct[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[KK(n[1])]:qK(e).split(",").map(kR)):ct._CE&&WK.test(e)?ct._CE("",e):r},YK=function(e){return function(n){return 1-e(1-n)}},al=function(e,n){return e&&(tn(e)?e:ct[e]||ZK(e))||n},pl=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},a;return kr(e,function(u){ct[u]=Gr[u]=i,ct[a=u.toLowerCase()]=r;for(var c in i)ct[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ct[u+"."+c]=i[c]}),i},UR=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},g1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/x_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*xK((h-a)*i)+1},c=e==="out"?u:e==="in"?function(f){return 1-u(1-f)}:UR(u);return i=x_/i,c.config=function(f,h){return t(e,f,h)},c},v1=function t(e,n){n===void 0&&(n=1.70158);var r=function(a){return a?--a*a*((n+1)*a+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:UR(r);return s.config=function(i){return t(e,i)},s};kr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;pl(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});ct.Linear.easeNone=ct.none=ct.Linear.easeIn;pl("Elastic",g1("in"),g1("out"),g1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(u){return u<n?t*u*u:u<r?t*Math.pow(u-1.5/e,2)+.75:u<s?t*(u-=2.25/e)*u+.9375:t*Math.pow(u-2.625/e,2)+.984375};pl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);pl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});pl("Circ",function(t){return-(mR(1-t*t)-1)});pl("Sine",function(t){return t===1?1:-_K(t*vK)+1});pl("Back",v1("in"),v1("out"),v1());ct.SteppedEase=ct.steps=Gr.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,a=1-St;return function(u){return((s*yf(0,a,u)|0)+i)*r}}};Zd.ease=ct["quad.out"];kr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return bx+=t+","+t+"Params,"});var BR=function(e,n){this.id=yK++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:SR,this.set=n?n.getSetter:Tx},ef=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,zu(this,+n.duration,1,1),this.data=n.data,Ht&&(this._ctx=Ht,Ht.data.push(this)),Jd||Vr.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,zu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Uu(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(x0(this,r),!i._dp||i.parent||TR(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&ei(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===St||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),ER(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+gC(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+gC(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?Hu(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-St?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Mm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-St?0:this._rts,this.totalTime(yf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),_0(this),AK(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Uu(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==St&&(this._tTime-=St)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Kt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ei(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Er(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Mm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=CK);var s=Hn;return Hn=r,Ex(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Hn=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,vC(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,vC(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(ss(this,r),Er(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Er(s)),this._dur||(this._zTime=-St),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-St:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-St,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-St)},e.eventCallback=function(r,s,i){var a=this.vars;return arguments.length>1?(s?(a[r]=s,i&&(a[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete a[r],this):a[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(a){var u=tn(r)?r:CR,c=function(){var h=s.then;s.then=null,i&&i(),tn(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=h),a(u),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){od(this)},t})();Kr(ef.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-St,_prom:0,_ps:!1,_rts:1});var wr=(function(t){pR(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Er(r.sortChildren),qt&&ei(r.parent||qt,Oi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&RR(Oi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return bd(0,arguments,this),this},n.from=function(s,i,a){return bd(1,arguments,this),this},n.fromTo=function(s,i,a,u){return bd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,wd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new dn(s,i,ss(this,a),1),this},n.call=function(s,i,a){return ei(this,dn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,f,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=f,a.onCompleteParams=h,a.parent=this,new dn(s,a,ss(this,c)),this},n.staggerFrom=function(s,i,a,u,c,f,h){return a.runBackwards=1,wd(a).immediateRender=Er(a.immediateRender),this.staggerTo(s,i,a,u,c,f,h)},n.staggerFromTo=function(s,i,a,u,c,f,h,p){return u.startAt=a,wd(u).immediateRender=Er(u.immediateRender),this.staggerTo(s,i,u,c,f,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,f=this._dur,h=s<=0?0:Kt(s),p=this._zTime<0!=s<0&&(this._initted||!f),v,y,x,_,b,E,C,P,T,R,O,I;if(this!==qt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&f&&(h+=this._time-u,s+=this._time-u),v=h,T=this._start,P=this._ts,E=!P,p&&(f||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,b=f+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,a);if(v=Kt(h%b),h===c?(_=this._repeat,v=f):(R=Kt(h/b),_=~~R,_&&_===R&&(v=f,_--),v>f&&(v=f)),R=Hu(this._tTime,b),!u&&this._tTime&&R!==_&&this._tTime-R*b-this._dur<=0&&(R=_),O&&_&1&&(v=f-v,I=1),_!==R&&!this._lock){var A=O&&R&1,N=A===(O&&_&1);if(_<R&&(A=!A),u=A?0:h%f?f:h,this._lock=1,this.render(u||(I?0:Kt(_*b)),i,!f)._lock=0,this._tTime=h,!i&&this.parent&&Hr(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,R=_),u&&u!==this._time||E!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(f=this._dur,c=this._tDur,N&&(this._lock=2,u=A?f:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!E)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(C=OK(this,Kt(u),Kt(v)),C&&(h-=v-(v=C._start))),this._tTime=h,this._time=v,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&f&&!i&&!R&&(Hr(this,"onStart"),this._tTime!==h))return this;if(v>=u&&s>=0)for(y=this._first;y;){if(x=y._next,(y._act||v>=y._start)&&y._ts&&C!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(v-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(v-y._start)*y._ts,i,a),v!==this._time||!this._ts&&!E){C=0,x&&(h+=this._zTime=-St);break}}y=x}else{y=this._last;for(var L=s<0?s:v;y;){if(x=y._prev,(y._act||L<=y._end)&&y._ts&&C!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(L-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(L-y._start)*y._ts,i,a||Hn&&Ex(y)),v!==this._time||!this._ts&&!E){C=0,x&&(h+=this._zTime=L?-St:St);break}}y=x}}if(C&&!i&&(this.pause(),C.render(v>=u?0:-St)._zTime=v>=u?1:-1,this._ts))return this._start=T,_0(this),this.render(s,i,a);this._onUpdate&&!i&&Hr(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(T===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!f)&&(h===c&&this._ts>0||!h&&this._ts<0)&&Yo(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(Hr(this,h===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(qi(i)||(i=ss(this,i,s)),!(s instanceof ef)){if(Yn(s))return s.forEach(function(u){return a.add(u,i)}),this;if(Tn(s))return this.addLabel(s,i);if(tn(s))s=dn.delayedCall(0,s);else return this}return this!==s?ei(this,s,i):this},n.getChildren=function(s,i,a,u){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),u===void 0&&(u=-ls);for(var c=[],f=this._first;f;)f._start>=u&&(f instanceof dn?i&&c.push(f):(a&&c.push(f),s&&c.push.apply(c,f.getChildren(!0,i,a)))),f=f._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return Tn(s)?this.removeLabel(s):tn(s)?this.killTweensOf(s):(s.parent===this&&y0(this,s),s===this._recent&&(this._recent=this._last),ol(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Kt(Vr.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=ss(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=dn.delayedCall(0,i||Xd,a);return u.data="isPause",this._hasPause=1,ei(this,u,ss(this,s))},n.removePause=function(s){var i=this._first;for(s=ss(this,s);i;)i._start===s&&i.data==="isPause"&&Yo(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)Fo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=us(s),c=this._first,f=qi(i),h;c;)c instanceof dn?PK(c._targets,u)&&(f?(!Fo||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(h=c.getTweensOf(u,i)).length&&a.push.apply(a,h),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=ss(a,s),c=i,f=c.startAt,h=c.onStart,p=c.onStartParams,v=c.immediateRender,y,x=dn.to(a,Kr({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(f&&"time"in f?f.time:a._time))/a.timeScale())||St,onStart:function(){if(a.pause(),!y){var b=i.duration||Math.abs((u-(f&&"time"in f?f.time:a._time))/a.timeScale());x._dur!==b&&zu(x,b,0,1).render(x._time,!0,!0),y=1}h&&h.apply(x,p||[])}},i));return v?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,Kr({startAt:{time:ss(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),yC(this,ss(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),yC(this,ss(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+St)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,f;for(s=Kt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(f in c)c[f]>=a&&(c[f]+=s);return ol(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),ol(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=ls,f,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;u;)f=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,ei(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Kt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=f;zu(a,a===qt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(qt._ts&&(ER(qt,Mm(s,qt)),bR=Vr.frame),Vr.frame>=pC){pC+=Wr.autoSleep||120;var i=qt._first;if((!i||!i._ts)&&Wr.autoSleep&&Vr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Vr.sleep()}}},e})(ef);Kr(wr.prototype,{_lock:0,_hasPause:0,_forcing:0});var XK=function(e,n,r,s,i,a,u){var c=new Cr(this._pt,e,n,0,1,YR,null,i),f=0,h=0,p,v,y,x,_,b,E,C;for(c.b=r,c.e=s,r+="",s+="",(E=~s.indexOf("random("))&&(s=Qd(s)),a&&(C=[r,s],a(C,e,n),r=C[0],s=C[1]),v=r.match(h1)||[];p=h1.exec(s);)x=p[0],_=s.substring(f,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),x!==v[h++]&&(b=parseFloat(v[h-1])||0,c._pt={_next:c._pt,p:_||h===1?_:",",s:b,c:x.charAt(1)==="="?fu(b,x)-b:parseFloat(x)-b,m:y&&y<4?Math.round:0},f=h1.lastIndex);return c.c=f<s.length?s.substring(f,s.length):"",c.fp=u,(yR.test(s)||E)&&(c.e=0),this._pt=c,c},kx=function(e,n,r,s,i,a,u,c,f,h){tn(s)&&(s=s(i||0,e,a));var p=e[n],v=r!=="get"?r:tn(p)?f?e[n.indexOf("set")||!tn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](f):e[n]():p,y=tn(p)?f?nq:qR:Px,x;if(Tn(s)&&(~s.indexOf("random(")&&(s=Qd(s)),s.charAt(1)==="="&&(x=fu(v,s)+(Zn(v)||0),(x||x===0)&&(s=x))),!h||v!==s||T_)return!isNaN(v*s)&&s!==""?(x=new Cr(this._pt,e,n,+v||0,s-(v||0),typeof p=="boolean"?sq:ZR,0,y),f&&(x.fp=f),u&&x.modifier(u,this,e),this._pt=x):(!p&&!(n in e)&&xx(n,s),XK.call(this,e,n,v,s,y,c||Wr.stringFilter,f))},QK=function(e,n,r,s,i){if(tn(e)&&(e=Sd(e,i,n,r,s)),!ci(e)||e.style&&e.nodeType||Yn(e)||gR(e))return Tn(e)?Sd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Sd(e[u],i,n,r,s);return a},WR=function(e,n,r,s,i,a){var u,c,f,h;if(jr[e]&&(u=new jr[e]).init(i,u.rawVars?n[e]:QK(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Cr(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==iu))for(f=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)f[u._props[h]]=c;return u},Fo,T_,Cx=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,f=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,v=s.keyframes,y=s.autoRevert,x=e._dur,_=e._startAt,b=e._targets,E=e.parent,C=E&&E.data==="nested"?E.vars.targets:b,P=e._overwrite==="auto"&&!gx,T=e.timeline,R=s.easeReverse||p,O,I,A,N,L,F,V,G,X,q,B,Y,$;if(T&&(!v||!i)&&(i="none"),e._ease=al(i,Zd.ease),e._rEase=R&&(al(R)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||v&&!s.stagger){if(G=b[0]?il(b[0]).harness:0,Y=G&&s[G.prop],O=Am(s,wx),_&&(_._zTime<0&&_.progress(1),n<0&&h&&u&&!y?_.render(-1,!0):_.revert(h&&x?Pp:kK),_._lazy=0),a){if(Yo(e._startAt=dn.set(b,Kr({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:!_&&Er(c),startAt:null,delay:0,onUpdate:f&&function(){return Hr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Hn||!u&&!y)&&e._startAt.revert(Pp),u&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!_){if(n&&(u=!1),A=Kr({overwrite:!1,data:"isFromStart",lazy:u&&!_&&Er(c),immediateRender:u,stagger:0,parent:E},O),Y&&(A[G.prop]=Y),Yo(e._startAt=dn.set(b,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Hn?e._startAt.revert(Pp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,St,St);else if(!n)return}for(e._pt=e._ptCache=0,c=x&&Er(c)||c&&!x,I=0;I<b.length;I++){if(L=b[I],V=L._gsap||Sx(b)[I]._gsap,e._ptLookup[I]=q={},b_[V.id]&&Ho.length&&Rm(),B=C===b?I:C.indexOf(L),G&&(X=new G).init(L,Y||O,e,B,C)!==!1&&(e._pt=N=new Cr(e._pt,L,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(ee){q[ee]=N}),X.priority&&(F=1)),!G||Y)for(A in O)jr[A]&&(X=WR(A,O,e,B,L,C))?X.priority&&(F=1):q[A]=N=kx.call(e,L,A,"get",O[A],B,C,0,s.stringFilter);e._op&&e._op[I]&&e.kill(L,e._op[I]),P&&e._pt&&(Fo=e,qt.killTweensOf(L,q,e.globalTime(n)),$=!e.parent,Fo=0),e._pt&&c&&(b_[V.id]=1)}F&&XR(e),e._onInit&&e._onInit(e)}e._onUpdate=f,e._initted=(!e._op||e._pt)&&!$,v&&n<=0&&T.render(ls,!0,!0)},JK=function(e,n,r,s,i,a,u,c){var f=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,v,y;if(!f)for(f=e._ptCache[n]=[],v=e._ptLookup,y=e._targets.length;y--;){if(h=v[y][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return T_=1,e.vars[n]="+=0",Cx(e,u),T_=0,c?Yd(n+" not eligible for reset. Try splitting into individual properties"):1;f.push(h)}for(y=f.length;y--;)p=f[y],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=an(r)+Zn(p.e)),p.b&&(p.b=h.s+Zn(p.b))},eq=function(e,n){var r=e[0]?il(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=$u({},n);for(a in s)if(a in i)for(c=s[a].split(","),u=c.length;u--;)i[c[u]]=i[a];return i},tq=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(Yn(n))u=r[e]||(r[e]=[]),n.forEach(function(c,f){return u.push({t:f/(n.length-1)*100,v:c,e:i})});else for(a in n)u=r[a]||(r[a]=[]),a==="ease"||u.push({t:parseFloat(e),v:n[a],e:i})},Sd=function(e,n,r,s,i){return tn(e)?e.call(n,r,s,i):Tn(e)&&~e.indexOf("random(")?Qd(e):e},GR=bx+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",KR={};kr(GR+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return KR[t]=1});var dn=(function(t){pR(e,t);function e(r,s,i,a){var u;typeof s=="number"&&(i.duration=s,s=i,i=null),u=t.call(this,a?s:wd(s))||this;var c=u.vars,f=c.duration,h=c.delay,p=c.immediateRender,v=c.stagger,y=c.overwrite,x=c.keyframes,_=c.defaults,b=c.scrollTrigger,E=s.parent||qt,C=(Yn(r)||gR(r)?qi(r[0]):"length"in s)?[r]:us(r),P,T,R,O,I,A,N,L;if(u._targets=C.length?Sx(C):Yd("GSAP target "+r+" not found. https://gsap.com",!Wr.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=y,x||v||rp(f)||rp(h)){s=u.vars;var F=s.easeReverse||s.yoyoEase;if(P=u.timeline=new wr({data:"nested",defaults:_||{},targets:E&&E.data==="nested"?E.vars.targets:C}),P.kill(),P.parent=P._dp=Oi(u),P._start=0,v||rp(f)||rp(h)){if(O=C.length,N=v&&NR(v),ci(v))for(I in v)~GR.indexOf(I)&&(L||(L={}),L[I]=v[I]);for(T=0;T<O;T++)R=Am(s,KR),R.stagger=0,F&&(R.easeReverse=F),L&&$u(R,L),A=C[T],R.duration=+Sd(f,Oi(u),T,A,C),R.delay=(+Sd(h,Oi(u),T,A,C)||0)-u._delay,!v&&O===1&&R.delay&&(u._delay=h=R.delay,u._start+=h,R.delay=0),P.to(A,R,N?N(T,A,C):0),P._ease=ct.none;P.duration()?f=h=0:u.timeline=0}else if(x){wd(Kr(P.vars.defaults,{ease:"none"})),P._ease=al(x.ease||s.ease||"none");var V=0,G,X,q;if(Yn(x))x.forEach(function(B){return P.to(C,B,">")}),P.duration();else{R={};for(I in x)I==="ease"||I==="easeEach"||tq(I,x[I],R,x.easeEach);for(I in R)for(G=R[I].sort(function(B,Y){return B.t-Y.t}),V=0,T=0;T<G.length;T++)X=G[T],q={ease:X.e,duration:(X.t-(T?G[T-1].t:0))/100*f},q[I]=X.v,P.to(C,q,V),V+=q.duration;P.duration()<f&&P.to({},{duration:f-P.duration()})}}f||u.duration(f=P.duration())}else u.timeline=0;return y===!0&&!gx&&(Fo=Oi(u),qt.killTweensOf(C),Fo=0),ei(E,Oi(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!f&&!x&&u._start===Kt(E._time)&&Er(p)&&MK(Oi(u))&&E.data!=="nested")&&(u._tTime=-St,u.render(Math.max(0,-h)||0)),b&&RR(Oi(u),b),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,f=this._dur,h=s<0,p=s>c-St&&!h?c:s<St?0:s,v,y,x,_,b,E,C,P;if(!f)NK(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(v=p,P=this.timeline,this._repeat){if(_=f+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,a);if(v=Kt(p%_),p===c?(x=this._repeat,v=f):(b=Kt(p/_),x=~~b,x&&x===b?(v=f,x--):v>f&&(v=f)),E=this._yoyo&&x&1,E&&(v=f-v),b=Hu(this._tTime,_),v===u&&!a&&this._initted&&x===b)return this._tTime=p,this;x!==b&&this.vars.repeatRefresh&&!E&&!this._lock&&v!==_&&this._initted&&(this._lock=a=1,this.render(Kt(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(AR(this,h?s:v,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&x!==b))return this;if(f!==this._dur)return this.render(s,i,a)}if(this._rEase){var T=v<u;if(T!==this._inv){var R=T?u:f-u;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=R?(T?-1:1)/R:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=C=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=C=this._ease(v/f);if(this._from&&(this.ratio=C=1-C),this._tTime=p,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!b&&(Hr(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(C,y.d),y=y._next;P&&P.render(s<0?s:P._dur*P._ease(v/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&S_(this,s,i,a),Hr(this,"onUpdate")),this._repeat&&x!==b&&this.vars.onRepeat&&!i&&this.parent&&Hr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&S_(this,s,!0,!0),(s||!f)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&Yo(this,1),!i&&!(h&&!u)&&(p||u||E)&&(Hr(this,p===c?"onComplete":"onReverseComplete",!0),this._prom&&!(p<c&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,a,u,c){Jd||Vr.wake(),this._ts||this.play();var f=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||Cx(this,f),h=this._ease(f/this._dur),JK(this,s,i,a,u,h,f,c)?this.resetTo(s,i,a,u,1):(x0(this,0),this.parent||PR(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?od(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Hn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Fo&&Fo.vars.overwrite!==!0)._first||od(this),this.parent&&a!==this.timeline.totalDuration()&&zu(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?us(s):u,f=this._ptLookup,h=this._pt,p,v,y,x,_,b,E;if((!i||i==="all")&&RK(u,c))return i==="all"&&(this._pt=0),od(this);for(p=this._op=this._op||[],i!=="all"&&(Tn(i)&&(_={},kr(i,function(C){return _[C]=1}),i=_),i=eq(u,i)),E=u.length;E--;)if(~c.indexOf(u[E])){v=f[E],i==="all"?(p[E]=i,x=v,y={}):(y=p[E]=p[E]||{},x=i);for(_ in x)b=v&&v[_],b&&((!("kill"in b.d)||b.d.kill(_)===!0)&&y0(this,b,"_pt"),delete v[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&h&&od(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return bd(1,arguments)},e.delayedCall=function(s,i,a,u){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:u})},e.fromTo=function(s,i,a){return bd(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,a){return qt.killTweensOf(s,i,a)},e})(ef);Kr(dn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});kr("staggerTo,staggerFrom,staggerFromTo",function(t){dn[t]=function(){var e=new wr,n=k_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Px=function(e,n,r){return e[n]=r},qR=function(e,n,r){return e[n](r)},nq=function(e,n,r,s){return e[n](s.fp,r)},rq=function(e,n,r){return e.setAttribute(n,r)},Tx=function(e,n){return tn(e[n])?qR:vx(e[n])&&e.setAttribute?rq:Px},ZR=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},sq=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},YR=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},Rx=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},iq=function(e,n,r,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,n,r),i=a},oq=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?y0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},aq=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},XR=function(e){for(var n=e._pt,r,s,i,a;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:a=n,n=r}e._pt=i},Cr=(function(){function t(n,r,s,i,a,u,c,f,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||ZR,this.d=c||this,this.set=f||Px,this.pr=h||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=aq,this.m=r,this.mt=i,this.tween=s},t})();kr(bx+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return wx[t]=1});Gr.TweenMax=Gr.TweenLite=dn;Gr.TimelineLite=Gr.TimelineMax=wr;qt=new wr({sortChildren:!1,defaults:Zd,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Wr.stringFilter=zR;var ll=[],Rp={},lq=[],xC=0,uq=0,y1=function(e){return(Rp[e]||lq).map(function(n){return n()})},R_=function(){var e=Date.now(),n=[];e-xC>2&&(y1("matchMediaInit"),ll.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,f;for(u in s)a=Ks.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,f=1);f&&(r.revert(),c&&n.push(r))}),y1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),xC=e,y1("matchMedia"))},QR=(function(){function t(n,r){this.selector=r&&C_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=uq++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){tn(r)&&(i=s,s=r,r=tn);var a=this,u=function(){var f=Ht,h=a.selector,p;return f&&f!==a&&f.data.push(a),i&&(a.selector=C_(i)),Ht=a,p=s.apply(a,arguments),tn(p)&&a._r.push(p),Ht=f,a.selector=h,a.isReverted=!1,p};return a.last=u,r===tn?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},e.ignore=function(r){var s=Ht;Ht=null,r(this),Ht=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof dn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var u=i.getTweens(),c=i.data.length,f;c--;)f=i.data[c],f.data==="isFlip"&&(f.revert(),f.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),c=i.data.length;c--;)f=i.data[c],f instanceof wr?f.data!=="nested"&&(f.scrollTrigger&&f.scrollTrigger.revert(),f.kill()):!(f instanceof dn)&&f.revert&&f.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=ll.length;a--;)ll[a].id===this.id&&ll.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),cq=(function(){function t(n){this.contexts=[],this.scope=n,Ht&&Ht.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){ci(r)||(r={matches:r});var a=new QR(0,i||this.scope),u=a.conditions={},c,f,h;Ht&&!a.selector&&(a.selector=Ht.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(f in r)f==="all"?h=1:(c=Ks.matchMedia(r[f]),c&&(ll.indexOf(a)<0&&ll.push(a),(u[f]=c.matches)&&(h=1),c.addListener?c.addListener(R_):c.addEventListener("change",R_)));return h&&s(a,function(p){return a.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Im={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return VR(s)})},timeline:function(e){return new wr(e)},getTweensOf:function(e,n){return qt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Tn(e)&&(e=us(e)[0]);var i=il(e||{}).get,a=r?CR:kR;return r==="native"&&(r=""),e&&(n?a((jr[n]&&jr[n].get||i)(e,n,r,s)):function(u,c,f){return a((jr[u]&&jr[u].get||i)(e,u,c,f))})},quickSetter:function(e,n,r){if(e=us(e),e.length>1){var s=e.map(function(h){return Tr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=jr[n],u=il(e),c=u.harness&&(u.harness.aliases||{})[n]||n,f=a?function(h){var p=new a;iu._pt=0,p.init(e,r?h+r:h,iu,0,[e]),p.render(1,p),iu._pt&&Rx(1,iu)}:u.set(e,c);return a?f:function(h){return f(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=Tr.to(e,Kr((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,f,h){return i.resetTo(n,c,f,h)};return a.tween=i,a},isTweening:function(e){return qt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=al(e.ease,Zd.ease)),mC(Zd,e||{})},config:function(e){return mC(Wr,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(u){return u&&!jr[u]&&!Gr[u]&&Yd(n+" effect requires "+u+" plugin.")}),p1[n]=function(u,c,f){return r(us(u),Kr(c||{},i),f)},a&&(wr.prototype[n]=function(u,c,f){return this.add(p1[n](u,ci(c)?c:(f=c)&&{},this),f)})},registerEase:function(e,n){ct[e]=al(n)},parseEase:function(e,n){return arguments.length?al(e,n):ct},getById:function(e){return qt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new wr(e),s,i;for(r.smoothChildTiming=Er(e.smoothChildTiming),qt.remove(r),r._dp=0,r._time=r._tTime=qt._time,s=qt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof dn&&s.vars.onComplete===s._targets[0]))&&ei(r,s,s._start-s._delay),s=i;return ei(qt,r,0),r},context:function(e,n){return e?new QR(e,n):Ht},matchMedia:function(e){return new cq(e)},matchMediaRefresh:function(){return ll.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||R_()},addEventListener:function(e,n){var r=Rp[e]||(Rp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Rp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:HK,wrapYoyo:zK,distribute:NR,random:LR,snap:OR,normalize:$K,getUnit:Zn,clamp:DK,splitColor:$R,toArray:us,selector:C_,mapRange:FR,pipe:jK,unitize:VK,interpolate:UK,shuffle:IR},install:xR,effects:p1,ticker:Vr,updateRoot:wr.updateRoot,plugins:jr,globalTimeline:qt,core:{PropTween:Cr,globals:wR,Tween:dn,Timeline:wr,Animation:ef,getCache:il,_removeLinkedListItem:y0,reverting:function(){return Hn},context:function(e){return e&&Ht&&(Ht.data.push(e),e._ctx=Ht),Ht},suppressOverwrites:function(e){return gx=e}}};kr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Im[t]=dn[t]});Vr.add(wr.updateRoot);iu=Im.to({},{duration:0});var dq=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},fq=function(e,n){var r=e._targets,s,i,a;for(s in n)for(i=r.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=dq(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},_1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,f;if(Tn(i)&&(c={},kr(i,function(h){return c[h]=1}),i=c),n){c={};for(f in i)c[f]=n(i[f]);i=c}fq(u,i)}}}},Tr=Im.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,u,c;this.tween=r;for(a in n)c=e.getAttribute(a)||"",u=this.add(e,"setAttribute",(c||0)+"",n[a],s,i,0,0,a),u.op=a,u.b=c,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)Hn?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},_1("roundProps",P_),_1("modifiers"),_1("snap",OR))||Im;dn.version=wr.version=Tr.version="3.15.0";_R=1;yx()&&Uu();ct.Power0;ct.Power1;ct.Power2;ct.Power3;ct.Power4;ct.Linear;ct.Quad;ct.Cubic;ct.Quart;ct.Quint;ct.Strong;ct.Elastic;ct.Back;ct.SteppedEase;ct.Bounce;ct.Sine;ct.Expo;ct.Circ;/*!
|
|
119
|
+
* CSSPlugin 3.15.0
|
|
120
|
+
* https://gsap.com
|
|
121
|
+
*
|
|
122
|
+
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
123
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
124
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
125
|
+
*/var wC,jo,hu,Ax,Ba,bC,Mx,hq=function(){return typeof window<"u"},Zi={},Fa=180/Math.PI,pu=Math.PI/180,Kl=Math.atan2,SC=1e8,Ix=/([A-Z])/g,pq=/(left|right|width|margin|padding|x)/i,mq=/[\s,\(]\S/,ri={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},A_=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},gq=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},vq=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},yq=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},_q=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},JR=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},eA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},xq=function(e,n,r){return e.style[n]=r},wq=function(e,n,r){return e.style.setProperty(n,r)},bq=function(e,n,r){return e._gsap[n]=r},Sq=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},Eq=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},kq=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Zt="transform",Pr=Zt+"Origin",Cq=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in Zi&&i){if(this.tfm=this.tfm||{},e!=="transform")e=ri[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=Di(s,u)}):this.tfm[e]=a.x?a[e]:Di(s,e),e===Pr&&(this.tfm.zOrigin=a.zOrigin);else return ri.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(Zt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Pr,n,"")),e=Zt}(i||n)&&this.props.push(e,n,i[e])},tA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Pq=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,a;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(Ix,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=Mx(),(!i||!i.isStart)&&!r[Zt]&&(tA(r),s.zOrigin&&r[Pr]&&(r[Pr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},nA=function(e,n){var r={target:e,props:[],revert:Pq,save:Cq};return e._gsap||Tr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},rA,M_=function(e,n){var r=jo.createElementNS?jo.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):jo.createElement(e);return r&&r.style?r:jo.createElement(e)},zr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Ix,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Bu(n)||n,1)||""},EC="O,Moz,ms,Ms,Webkit".split(","),Bu=function(e,n,r){var s=n||Ba,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(EC[a]+e in i););return a<0?null:(a===3?"ms":a>=0?EC[a]:"")+e},I_=function(){hq()&&window.document&&(wC=window,jo=wC.document,hu=jo.documentElement,Ba=M_("div")||{style:{}},M_("div"),Zt=Bu(Zt),Pr=Zt+"Origin",Ba.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",rA=!!Bu("perspective"),Mx=Tr.core.reverting,Ax=1)},kC=function(e){var n=e.ownerSVGElement,r=M_("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),hu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),hu.removeChild(r),i},CC=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},sA=function(e){var n,r;try{n=e.getBBox()}catch{n=kC(e),r=1}return n&&(n.width||n.height)||r||(n=kC(e)),n&&!n.width&&!n.x&&!n.y?{x:+CC(e,["x","cx","x1"])||0,y:+CC(e,["y","cy","y1"])||0,width:0,height:0}:n},iA=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&sA(e))},Xo=function(e,n){if(n){var r=e.style,s;n in Zi&&n!==Pr&&(n=Zt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Ix,"-$1").toLowerCase())):r.removeAttribute(n)}},Vo=function(e,n,r,s,i,a){var u=new Cr(e._pt,n,r,0,1,a?eA:JR);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},PC={deg:1,rad:1,turn:1},Tq={grid:1,flex:1},Qo=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=Ba.style,c=pq.test(n),f=e.tagName.toLowerCase()==="svg",h=(f?"client":"offset")+(c?"Width":"Height"),p=100,v=s==="px",y=s==="%",x,_,b,E;if(s===a||!i||PC[s]||PC[a])return i;if(a!=="px"&&!v&&(i=t(e,n,r,"px")),E=e.getCTM&&iA(e),(y||a==="%")&&(Zi[n]||~n.indexOf("adius")))return x=E?e.getBBox()[c?"width":"height"]:e[h],an(y?i/x*p:i/100*x);if(u[c?"width":"height"]=p+(v?a:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!f?e:e.parentNode,E&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===jo||!_.appendChild)&&(_=jo.body),b=_._gsap,b&&y&&b.width&&c&&b.time===Vr.time&&!b.uncache)return an(i/b.width*p);if(y&&(n==="height"||n==="width")){var C=e.style[n];e.style[n]=p+s,x=e[h],C?e.style[n]=C:Xo(e,n)}else(y||a==="%")&&!Tq[zr(_,"display")]&&(u.position=zr(e,"position")),_===e&&(u.position="static"),_.appendChild(Ba),x=Ba[h],_.removeChild(Ba),u.position="absolute";return c&&y&&(b=il(_),b.time=Vr.time,b.width=_[h]),an(v?x*i/p:x&&i?p/x*i:0)},Di=function(e,n,r,s){var i;return Ax||I_(),n in ri&&n!=="transform"&&(n=ri[n],~n.indexOf(",")&&(n=n.split(",")[0])),Zi[n]&&n!=="transform"?(i=nf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Om(zr(e,Pr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Nm[n]&&Nm[n](e,n,r)||zr(e,n)||SR(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Qo(e,n,i,r)+r:i},Rq=function(e,n,r,s){if(!r||r==="none"){var i=Bu(n,e,1),a=i&&zr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=zr(e,"borderTopColor"))}var u=new Cr(this._pt,e.style,n,0,1,YR),c=0,f=0,h,p,v,y,x,_,b,E,C,P,T,R;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=zr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=zr(e,n)||s,_?e.style[n]=_:Xo(e,n)),h=[r,s],zR(h),r=h[0],s=h[1],v=r.match(su)||[],R=s.match(su)||[],R.length){for(;p=su.exec(s);)b=p[0],C=s.substring(c,p.index),x?x=(x+1)%5:(C.substr(-5)==="rgba("||C.substr(-5)==="hsla(")&&(x=1),b!==(_=v[f++]||"")&&(y=parseFloat(_)||0,T=_.substr((y+"").length),b.charAt(1)==="="&&(b=fu(y,b)+T),E=parseFloat(b),P=b.substr((E+"").length),c=su.lastIndex-P.length,P||(P=P||Wr.units[n]||T,c===s.length&&(s+=P,u.e+=P)),T!==P&&(y=Qo(e,n,_,P)||0),u._pt={_next:u._pt,p:C||f===1?C:",",s:y,c:E-y,m:x&&x<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?eA:JR;return yR.test(s)&&(u.e=0),this._pt=u,u},TC={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Aq=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=TC[r]||r,n[1]=TC[s]||s,n.join(" ")},Mq=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,a=r._gsap,u,c,f;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),f=i.length;--f>-1;)u=i[f],Zi[u]&&(c=1,u=u==="transformOrigin"?Pr:Zt),Xo(r,u);c&&(Xo(r,Zt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",nf(r,1),a.uncache=1,tA(s)))}},Nm={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Cr(e._pt,n,r,0,0,Mq);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},tf=[1,0,0,1,0,0],oA={},aA=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},RC=function(e){var n=zr(e,Zt);return aA(n)?tf:n.substr(7).match(vR).map(an)},Nx=function(e,n){var r=e._gsap||il(e),s=e.style,i=RC(e),a,u,c,f;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?tf:i):(i===tf&&!e.offsetParent&&e!==hu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(f=1,u=e.nextElementSibling,hu.appendChild(e)),i=RC(e),c?s.display=c:Xo(e,"display"),f&&(u?a.insertBefore(e,u):a?a.appendChild(e):hu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},N_=function(e,n,r,s,i,a){var u=e._gsap,c=i||Nx(e,!0),f=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,v=u.yOffset||0,y=c[0],x=c[1],_=c[2],b=c[3],E=c[4],C=c[5],P=n.split(" "),T=parseFloat(P[0])||0,R=parseFloat(P[1])||0,O,I,A,N;r?c!==tf&&(I=y*b-x*_)&&(A=T*(b/I)+R*(-_/I)+(_*C-b*E)/I,N=T*(-x/I)+R*(y/I)-(y*C-x*E)/I,T=A,R=N):(O=sA(e),T=O.x+(~P[0].indexOf("%")?T/100*O.width:T),R=O.y+(~(P[1]||P[0]).indexOf("%")?R/100*O.height:R)),s||s!==!1&&u.smooth?(E=T-f,C=R-h,u.xOffset=p+(E*y+C*_)-E,u.yOffset=v+(E*x+C*b)-C):u.xOffset=u.yOffset=0,u.xOrigin=T,u.yOrigin=R,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Pr]="0px 0px",a&&(Vo(a,u,"xOrigin",f,T),Vo(a,u,"yOrigin",h,R),Vo(a,u,"xOffset",p,u.xOffset),Vo(a,u,"yOffset",v,u.yOffset)),e.setAttribute("data-svg-origin",T+" "+R)},nf=function(e,n){var r=e._gsap||new BR(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",u="deg",c=getComputedStyle(e),f=zr(e,Pr)||"0",h,p,v,y,x,_,b,E,C,P,T,R,O,I,A,N,L,F,V,G,X,q,B,Y,$,ee,H,D,Z,te,se,oe;return h=p=v=_=b=E=C=P=T=0,y=x=1,r.svg=!!(e.getCTM&&iA(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Zt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Zt]!=="none"?c[Zt]:"")),s.scale=s.rotate=s.translate="none"),I=Nx(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),f=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",Y=""):Y=!n&&e.getAttribute("data-svg-origin"),N_(e,Y||f,!!Y||r.originIsAbsolute,r.smooth!==!1,I)),R=r.xOrigin||0,O=r.yOrigin||0,I!==tf&&(F=I[0],V=I[1],G=I[2],X=I[3],h=q=I[4],p=B=I[5],I.length===6?(y=Math.sqrt(F*F+V*V),x=Math.sqrt(X*X+G*G),_=F||V?Kl(V,F)*Fa:0,C=G||X?Kl(G,X)*Fa+_:0,C&&(x*=Math.abs(Math.cos(C*pu))),r.svg&&(h-=R-(R*F+O*G),p-=O-(R*V+O*X))):(oe=I[6],te=I[7],H=I[8],D=I[9],Z=I[10],se=I[11],h=I[12],p=I[13],v=I[14],A=Kl(oe,Z),b=A*Fa,A&&(N=Math.cos(-A),L=Math.sin(-A),Y=q*N+H*L,$=B*N+D*L,ee=oe*N+Z*L,H=q*-L+H*N,D=B*-L+D*N,Z=oe*-L+Z*N,se=te*-L+se*N,q=Y,B=$,oe=ee),A=Kl(-G,Z),E=A*Fa,A&&(N=Math.cos(-A),L=Math.sin(-A),Y=F*N-H*L,$=V*N-D*L,ee=G*N-Z*L,se=X*L+se*N,F=Y,V=$,G=ee),A=Kl(V,F),_=A*Fa,A&&(N=Math.cos(A),L=Math.sin(A),Y=F*N+V*L,$=q*N+B*L,V=V*N-F*L,B=B*N-q*L,F=Y,q=$),b&&Math.abs(b)+Math.abs(_)>359.9&&(b=_=0,E=180-E),y=an(Math.sqrt(F*F+V*V+G*G)),x=an(Math.sqrt(B*B+oe*oe)),A=Kl(q,B),C=Math.abs(A)>2e-4?A*Fa:0,T=se?1/(se<0?-se:se):0),r.svg&&(Y=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!aA(zr(e,Zt)),Y&&e.setAttribute("transform",Y))),Math.abs(C)>90&&Math.abs(C)<270&&(i?(y*=-1,C+=_<=0?180:-180,_+=_<=0?180:-180):(x*=-1,C+=C<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=v+a,r.scaleX=an(y),r.scaleY=an(x),r.rotation=an(_)+u,r.rotationX=an(b)+u,r.rotationY=an(E)+u,r.skewX=C+u,r.skewY=P+u,r.transformPerspective=T+a,(r.zOrigin=parseFloat(f.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Pr]=Om(f)),r.xOffset=r.yOffset=0,r.force3D=Wr.force3D,r.renderTransform=r.svg?Nq:rA?lA:Iq,r.uncache=0,r},Om=function(e){return(e=e.split(" "))[0]+" "+e[1]},x1=function(e,n,r){var s=Zn(n);return an(parseFloat(n)+parseFloat(Qo(e,"x",r+"px",s)))+s},Iq=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,lA(e,n)},Ma="0deg",Xc="0px",Ia=") ",lA=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,f=r.rotation,h=r.rotationY,p=r.rotationX,v=r.skewX,y=r.skewY,x=r.scaleX,_=r.scaleY,b=r.transformPerspective,E=r.force3D,C=r.target,P=r.zOrigin,T="",R=E==="auto"&&e&&e!==1||E===!0;if(P&&(p!==Ma||h!==Ma)){var O=parseFloat(h)*pu,I=Math.sin(O),A=Math.cos(O),N;O=parseFloat(p)*pu,N=Math.cos(O),a=x1(C,a,I*N*-P),u=x1(C,u,-Math.sin(O)*-P),c=x1(C,c,A*N*-P+P)}b!==Xc&&(T+="perspective("+b+Ia),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(R||a!==Xc||u!==Xc||c!==Xc)&&(T+=c!==Xc||R?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+Ia),f!==Ma&&(T+="rotate("+f+Ia),h!==Ma&&(T+="rotateY("+h+Ia),p!==Ma&&(T+="rotateX("+p+Ia),(v!==Ma||y!==Ma)&&(T+="skew("+v+", "+y+Ia),(x!==1||_!==1)&&(T+="scale("+x+", "+_+Ia),C.style[Zt]=T||"translate(0, 0)"},Nq=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,f=r.skewX,h=r.skewY,p=r.scaleX,v=r.scaleY,y=r.target,x=r.xOrigin,_=r.yOrigin,b=r.xOffset,E=r.yOffset,C=r.forceCSS,P=parseFloat(a),T=parseFloat(u),R,O,I,A,N;c=parseFloat(c),f=parseFloat(f),h=parseFloat(h),h&&(h=parseFloat(h),f+=h,c+=h),c||f?(c*=pu,f*=pu,R=Math.cos(c)*p,O=Math.sin(c)*p,I=Math.sin(c-f)*-v,A=Math.cos(c-f)*v,f&&(h*=pu,N=Math.tan(f-h),N=Math.sqrt(1+N*N),I*=N,A*=N,h&&(N=Math.tan(h),N=Math.sqrt(1+N*N),R*=N,O*=N)),R=an(R),O=an(O),I=an(I),A=an(A)):(R=p,A=v,O=I=0),(P&&!~(a+"").indexOf("px")||T&&!~(u+"").indexOf("px"))&&(P=Qo(y,"x",a,"px"),T=Qo(y,"y",u,"px")),(x||_||b||E)&&(P=an(P+x-(x*R+_*I)+b),T=an(T+_-(x*O+_*A)+E)),(s||i)&&(N=y.getBBox(),P=an(P+s/100*N.width),T=an(T+i/100*N.height)),N="matrix("+R+","+O+","+I+","+A+","+P+","+T+")",y.setAttribute("transform",N),C&&(y.style[Zt]=N)},Oq=function(e,n,r,s,i){var a=360,u=Tn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Fa:1),f=c-s,h=s+f+"deg",p,v;return u&&(p=i.split("_")[1],p==="short"&&(f%=a,f!==f%(a/2)&&(f+=f<0?a:-a)),p==="cw"&&f<0?f=(f+a*SC)%a-~~(f/a)*a:p==="ccw"&&f>0&&(f=(f-a*SC)%a-~~(f/a)*a)),e._pt=v=new Cr(e._pt,n,r,s,f,gq),v.e=h,v.u="deg",e._props.push(r),v},AC=function(e,n){for(var r in n)e[r]=n[r];return e},Lq=function(e,n,r){var s=AC({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,f,h,p,v,y,x;s.svg?(f=r.getAttribute("transform"),r.setAttribute("transform",""),a[Zt]=n,u=nf(r,1),Xo(r,Zt),r.setAttribute("transform",f)):(f=getComputedStyle(r)[Zt],a[Zt]=n,u=nf(r,1),a[Zt]=f);for(c in Zi)f=s[c],h=u[c],f!==h&&i.indexOf(c)<0&&(y=Zn(f),x=Zn(h),p=y!==x?Qo(r,c,f,x):parseFloat(f),v=parseFloat(h),e._pt=new Cr(e._pt,u,c,p,v-p,A_),e._pt.u=x||0,e._props.push(c));AC(u,s)};kr("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",a=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(u){return e<2?t+u:"border"+u+t});Nm[e>1?"border"+t:t]=function(u,c,f,h,p){var v,y;if(arguments.length<4)return v=a.map(function(x){return Di(u,x,f)}),y=v.join(" "),y.split(v[0]).length===5?v[0]:y;v=(h+"").split(" "),y={},a.forEach(function(x,_){return y[x]=v[_]=v[_]||v[(_-1)/2|0]}),u.init(c,y,p)}});var uA={name:"css",register:I_,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,u=e.style,c=r.vars.startAt,f,h,p,v,y,x,_,b,E,C,P,T,R,O,I,A,N;Ax||I_(),this.styles=this.styles||nA(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(jr[_]&&WR(_,n,r,s,e,i)))){if(y=typeof h,x=Nm[_],y==="function"&&(h=h.call(r,s,e,i),y=typeof h),y==="string"&&~h.indexOf("random(")&&(h=Qd(h)),x)x(this,e,_,h,r)&&(I=1);else if(_.substr(0,2)==="--")f=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",zo.lastIndex=0,zo.test(f)||(b=Zn(f),E=Zn(h),E?b!==E&&(f=Qo(e,_,f,E)+E):b&&(h+=b)),this.add(u,"setProperty",f,h,s,i,0,0,_),a.push(_),A.push(_,0,u[_]);else if(y!=="undefined"){if(c&&_ in c?(f=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Tn(f)&&~f.indexOf("random(")&&(f=Qd(f)),Zn(f+"")||f==="auto"||(f+=Wr.units[_]||Zn(Di(e,_))||""),(f+"").charAt(1)==="="&&(f=Di(e,_))):f=Di(e,_),v=parseFloat(f),C=y==="string"&&h.charAt(1)==="="&&h.substr(0,2),C&&(h=h.substr(2)),p=parseFloat(h),_ in ri&&(_==="autoAlpha"&&(v===1&&Di(e,"visibility")==="hidden"&&p&&(v=0),A.push("visibility",0,u.visibility),Vo(this,u,"visibility",v?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=ri[_],~_.indexOf(",")&&(_=_.split(",")[0]))),P=_ in Zi,P){if(this.styles.save(_),N=h,y==="string"&&h.substring(0,6)==="var(--"){if(h=zr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var L=e.style.perspective;e.style.perspective=h,h=zr(e,"perspective"),L?e.style.perspective=L:Xo(e,"perspective")}p=parseFloat(h)}if(T||(R=e._gsap,R.renderTransform&&!n.parseTransform||nf(e,n.parseTransform),O=n.smoothOrigin!==!1&&R.smooth,T=this._pt=new Cr(this._pt,u,Zt,0,1,R.renderTransform,R,0,-1),T.dep=1),_==="scale")this._pt=new Cr(this._pt,R,"scaleY",R.scaleY,(C?fu(R.scaleY,C+p):p)-R.scaleY||0,A_),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(Pr,0,u[Pr]),h=Aq(h),R.svg?N_(e,h,0,O,0,this):(E=parseFloat(h.split(" ")[2])||0,E!==R.zOrigin&&Vo(this,R,"zOrigin",R.zOrigin,E),Vo(this,u,_,Om(f),Om(h)));continue}else if(_==="svgOrigin"){N_(e,h,1,O,0,this);continue}else if(_ in oA){Oq(this,R,_,v,C?fu(v,C+h):h);continue}else if(_==="smoothOrigin"){Vo(this,R,"smooth",R.smooth,h);continue}else if(_==="force3D"){R[_]=h;continue}else if(_==="transform"){Lq(this,h,e);continue}}else _ in u||(_=Bu(_)||_);if(P||(p||p===0)&&(v||v===0)&&!mq.test(h)&&_ in u)b=(f+"").substr((v+"").length),p||(p=0),E=Zn(h)||(_ in Wr.units?Wr.units[_]:b),b!==E&&(v=Qo(e,_,f,E)),this._pt=new Cr(this._pt,P?R:u,_,v,(C?fu(v,C+p):p)-v,!P&&(E==="px"||_==="zIndex")&&n.autoRound!==!1?_q:A_),this._pt.u=E||0,P&&N!==h?(this._pt.b=f,this._pt.e=N,this._pt.r=yq):b!==E&&E!=="%"&&(this._pt.b=f,this._pt.r=vq);else if(_ in u)Rq.call(this,e,_,f,C?C+h:h);else if(_ in e)this.add(e,_,f||e[_],C?C+h:h,s,i);else if(_!=="parseTransform"){xx(_,h);continue}P||(_ in u?A.push(_,0,u[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,f||e[_])),a.push(_)}}I&&XR(this)},render:function(e,n){if(n.tween._time||!Mx())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Di,aliases:ri,getSetter:function(e,n,r){var s=ri[n];return s&&s.indexOf(",")<0&&(n=s),n in Zi&&n!==Pr&&(e._gsap.x||Di(e,"x"))?r&&bC===r?n==="scale"?Sq:bq:(bC=r||{})&&(n==="scale"?Eq:kq):e.style&&!vx(e.style[n])?xq:~n.indexOf("-")?wq:Tx(e,n)},core:{_removeProperty:Xo,_getMatrix:Nx}};Tr.utils.checkPrefix=Bu;Tr.core.getStyleSaver=nA;(function(t,e,n,r){var s=kr(t+","+e+","+n,function(i){Zi[i]=1});kr(e,function(i){Wr.units[i]="deg",oA[i]=1}),ri[s[13]]=t+","+e,kr(r,function(i){var a=i.split(":");ri[a[1]]=s[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");kr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Wr.units[t]="px"});Tr.registerPlugin(uA);var bs=Tr.registerPlugin(uA)||Tr;bs.core.Tween;const Ap="/assets/logo-animation",w1=1280,Dq=[{id:"eraser",src:`${Ap}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Ap}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${Ap}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],Fq=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],O_=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(E,C)=>E+Math.random()*(C-E);let f=null,h,p=1;const v=Dq.map(E=>({...E})),y=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const E=s.getBoundingClientRect(),C=E.width||w1,P=E.height||w1*.64;p=C/w1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const R=250*p/337,O=[],I=(A,N,L)=>{const F=document.createElement("div");return F.className="la-obj",F.style.width=`${N}px`,F.innerHTML=`<img src="${A}" alt="" style="${L?"transform:scaleX(-1)":""}">`,s.appendChild(F),F};return Fq.forEach((A,N)=>{const L=A.w*p,F=I(`${Ap}/sea/${A.k}.png`,L,N%2===0);bs.set(F,{x:A.x*C-L/2,y:A.y*P-L/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:F,hero:!1,rest:1})}),v.forEach(A=>{const N=A.cssW*p;A.el=I(A.src,N,!!A.flip),A.finalScale=A.fit*R/(A.cssW*p),bs.set(A.el,{x:A.seaX*C-N/2,y:A.seaY*P-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:A.el,hero:!0,rest:150/A.cssW})}),O},x=(E,C)=>{const P=s.getBoundingClientRect(),T=a.getBoundingClientRect();return{x:T.left-P.left+E/326*T.width,y:T.top-P.top+C/337*T.height}},_=()=>{f&&f.revert();const E=y();if(u){f=bs.context(()=>{E.filter(T=>!T.hero).forEach(T=>bs.set(T.el,{scale:0})),v.forEach(T=>{if(!T.el)return;const R=x(T.localX,T.localY);bs.set(T.el,{x:R.x-T.cssW*p/2,y:R.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const C=[],P=[];f=bs.context(()=>{const T=bs.timeline();T.to(E.map(R=>R.el),{scale:R=>E[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{E.forEach(({el:R,hero:O},I)=>{const A=O?C:P,N=I%2?1:-1;A.push(bs.to(R,{rotation:"+="+c(2.5,6)*N,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),bs.to(R,{y:"+="+c(5,11)*N,x:"+="+c(4,9)*-N,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),T.to({},{duration:1.1}),T.add("pick"),v.forEach((R,O)=>{R.el&&T.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),T.add("clear","pick+=0.7"),T.add(()=>P.forEach(R=>R.kill()),"clear"),T.to(E.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),T.add("assemble","clear+=0.25"),T.add(()=>C.forEach(R=>R.kill()),"assemble"),v.forEach((R,O)=>{if(!R.el||R.finalScale===void 0)return;const I=x(R.localX,R.localY);T.to(R.el,{x:I.x-R.cssW*p/2,y:I.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),v.forEach(R=>{!R.el||R.finalScale===void 0||T.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};bs.ticker.fps(12),_();const b=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),clearTimeout(h),f==null||f.revert(),s.querySelectorAll(".la-obj").forEach(E=>E.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},jq=Object.freeze(Object.defineProperty({__proto__:null,default:O_},Symbol.toStringTag,{value:"Module"})),MC=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),cA=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(O_,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(MC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?S.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,S.jsx(O_,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(MC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Vq="data:image/svg+xml,%3csvg%20width='94'%20height='24'%20viewBox='0%200%2094%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M-0.000156164%2023.832V7.704H5.11184L6.47984%208.424C7.58384%207.704%209.04784%207.344%2010.8718%207.344C12.0718%207.344%2013.1278%207.476%2014.0398%207.74C14.9518%207.98%2015.6838%208.244%2016.2358%208.532C16.8118%208.82%2017.1718%209.024%2017.3158%209.144L15.5158%2013.824C15.2758%2013.656%2014.8198%2013.428%2014.1478%2013.14C13.4998%2012.852%2012.7318%2012.588%2011.8438%2012.348C10.9558%2012.084%2010.0198%2011.952%209.03584%2011.952H8.63984C7.96784%2011.952%207.45184%2012.072%207.09184%2012.312C6.73184%2012.528%206.55184%2013.02%206.55184%2013.788V23.832H-0.000156164ZM23.464%206.156C21.04%206.156%2019.828%205.124%2019.828%203.06C19.828%201.908%2020.128%201.116%2020.728%200.684C21.352%200.227999%2022.264%20-1.43051e-06%2023.464%20-1.43051e-06C24.736%20-1.43051e-06%2025.66%200.227999%2026.236%200.684C26.836%201.116%2027.136%201.908%2027.136%203.06C27.136%205.124%2025.912%206.156%2023.464%206.156ZM20.152%2023.832V7.704H26.704V23.832H20.152ZM37.4767%2023.832L29.6647%207.704H36.9007L40.3207%2016.524L41.2567%2019.116H41.6167L42.5527%2016.524L46.0087%207.704H53.1727L52.5967%209.9L45.4327%2023.832H37.4767ZM61.1953%2023.832C59.6113%2023.832%2058.3873%2023.604%2057.5233%2023.148C56.6833%2022.692%2056.1073%2022.068%2055.7953%2021.276C55.4833%2020.46%2055.3273%2019.524%2055.3273%2018.468V13.032C55.3273%2012.072%2055.4833%2011.196%2055.7953%2010.404C56.1313%209.588%2056.7193%208.94%2057.5593%208.46C58.3993%207.956%2059.6113%207.704%2061.1953%207.704H68.6473C70.5193%207.704%2071.9473%207.932%2072.9313%208.388C73.9393%208.82%2074.6233%209.444%2074.9833%2010.26C75.3673%2011.052%2075.5593%2011.976%2075.5593%2013.032V17.64H69.2593C67.0993%2017.64%2065.4553%2017.592%2064.3273%2017.496C63.2233%2017.4%2062.4433%2017.34%2061.9873%2017.316V17.856C61.9633%2018.816%2062.5393%2019.296%2063.7153%2019.296H64.8313C66.7513%2019.296%2068.5273%2019.26%2070.1593%2019.188C71.7913%2019.092%2073.0033%2019.008%2073.7953%2018.936L75.9553%2022.356C75.9553%2022.596%2075.7513%2022.824%2075.3433%2023.04C74.9353%2023.256%2074.2153%2023.448%2073.1833%2023.616C72.1753%2023.76%2070.7353%2023.832%2068.8633%2023.832H61.1953ZM61.9873%2014.184H68.8993V13.68C68.8993%2013.2%2068.8513%2012.864%2068.7553%2012.672C68.6833%2012.48%2068.4313%2012.36%2067.9993%2012.312C67.5673%2012.264%2066.8353%2012.24%2065.8033%2012.24H63.7153C62.5633%2012.24%2061.9873%2012.72%2061.9873%2013.68V14.184ZM85.8224%2023.832C83.9984%2023.832%2082.7504%2023.448%2082.0784%2022.68C81.4064%2021.912%2081.0704%2020.76%2081.0704%2019.224V12.24H78.1184V7.704H79.6304C80.0384%207.704%2080.3624%207.632%2080.6024%207.488C80.8664%207.32%2081.0344%207.032%2081.1064%206.624L81.7904%202.772H87.6944V7.704H93.7064V12.24H87.6944V17.82C87.6944%2018.42%2087.8384%2018.816%2088.1264%2019.008C88.4144%2019.2%2088.8464%2019.296%2089.4224%2019.296H93.0224L93.7424%2023.472C93.2384%2023.544%2092.4704%2023.628%2091.4384%2023.724C90.4064%2023.796%2089.2784%2023.832%2088.0544%2023.832H85.8224Z'%20fill='%23FF3300'/%3e%3c/svg%3e",$q=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:Vq,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(i0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),Hq="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",Lm=44,Qc=8,sp=16,zq=4,IC=-18,Uq=.18,Bq=[.22,1,.36,1],NC=.92,Wq=1,Gq=.95,Kq=.4,qq=[.19,1,.22,1],b1=0,Zq=1,Yq=0,Xq=0,Qq=0,dA=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Qc,s=Math.max(r,e.width-Lm-Qc),i=Math.max(Qc,e.height-Lm-Qc);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Qc,t.y))}},Ox=()=>({width:window.innerWidth,height:window.innerHeight}),Jq=({position:t,boundsLeftPx:e=0})=>dA({position:t,viewport:Ox(),boundsLeft:e}),eZ=()=>{if(typeof window>"u")return{x:sp,y:sp};const t=Ox();return{x:t.width-Lm-sp,y:t.height-Lm-sp}},tZ=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=zq,nZ=t=>t.button===void 0||t.button<=Qq,OC=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},rZ=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=g.useRef(null),c=g.useRef(!1),[f,h]=g.useState(!1),[p,v]=g.useState(!1),y=n?!1:{opacity:b1,scale:NC,x:IC},x=n?{opacity:b1}:{opacity:b1,scale:NC,x:IC},_=n?{duration:Xq}:{duration:Uq,ease:Bq,scale:{duration:Kq,ease:qq}},b=g.useCallback(()=>{const R=u.current;R&&(c.current=R.hasMoved),u.current=null,h(!1)},[]),E=g.useCallback(R=>{const O=u.current;if(!O)return;const I=OC(R),A=I.x-O.startPointer.x,N=I.y-O.startPointer.y,L=O.hasMoved||tZ({deltaX:A,deltaY:N});u.current={...O,hasMoved:L},L&&a(dA({position:{x:O.startPosition.x+A,y:O.startPosition.y+N},viewport:Ox(),boundsLeft:s}))},[a,s]),C=g.useCallback(R=>{if(u.current||!nZ(R))return;const O=OC(R);u.current={startPointer:O,startPosition:r,hasMoved:!1},h(!0)},[r]),P=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[f?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:b,onPointerCancel:b,onMouseMove:E,onMouseUp:b}):null,S.jsx(Ui,{children:t?S.jsx(Do,{label:T,side:"top",forceOpen:p&&!f?void 0:!1,children:S.jsx(rl.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),initial:y,animate:{opacity:Zq,scale:Wq,x:Yq},whileTap:{scale:Gq},exit:x,transition:_,onPointerDown:C,onMouseDown:C,onPointerMove:E,onPointerUp:b,onPointerCancel:b,onMouseMove:E,onMouseUp:b,onClick:P,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${f?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:Hq,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},S1=fs("useConfig"),sZ=300*1e3,iZ=1800*1e3,oZ=60*1e3,aZ=300*1e3,lZ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},uZ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},cZ=t=>({...WT,...t??{}}),dZ=()=>{const t=Xe(h_),e=st(h_),n=st(n5),r=st(r5),s=st(o0),i=st(RU),a=st(t5),u=st(PU),c=st(mf),f=st(ZT),h=st(e5),p=g.useCallback(C=>{a(C.agentModeAvailable),f({name:C.name??null,email:C.email??null}),h(C.demoMode===!0),C.isMCPSession&&n(!0),C.mcpEditor&&r(C.mcpEditor),s(C.agentApplyMode??uZ()??null),i(C.queueAccessToken??lZ())},[s,a,h,n,r,i,f]),v=z1({queryKey:["rivet-config"],queryFn:async()=>{const C=await fetch("/api/config");if(!C.ok)throw new Error(`Failed to fetch config: ${C.statusText}`);return await C.json()},staleTime:sZ,gcTime:iZ}),y=z1({queryKey:["rivet-feature-flags"],queryFn:async()=>{const C=await fetch("/api/feature-flags");if(!C.ok)throw new Error(`Failed to fetch feature flags: ${C.statusText}`);return await C.json()},staleTime:oZ,gcTime:aZ}),{refetch:x}=v,{refetch:_}=y;g.useLayoutEffect(()=>{v.data&&(p(v.data),c(!1),S1.info("Config loaded:",v.data)),y.data&&(e(cZ(y.data.featureFlags)),u(!0))},[v.data,y.data,p,c,e,u]),g.useLayoutEffect(()=>{v.error&&(u(!0),c(!1),S1.warn("Failed to load config:",v.error instanceof Error?v.error.message:"Failed to load config")),y.error&&(u(!0),S1.warn("Failed to load feature flags:",y.error instanceof Error?y.error.message:"Failed to load feature flags"))},[v.error,y.error,c,u]);const b=g.useCallback(async()=>{const[C]=await Promise.all([x(),_()]);return C.data?C.data:null},[x,_]);let E=null;return v.error instanceof Error?E=v.error.message:v.error&&(E="Failed to load config"),{config:v.data??null,featureFlags:t,loading:v.isPending||!v.error&&y.isPending,error:E,refetchConfig:b}},Mp="rivet_just_signed_in",ql=fs("useOAuthCallback"),fZ="https://rivet-proxy.onrender.com",hZ=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,f;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{ql.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),v=h.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");ql.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${fZ}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:v}),signal:n.signal}),b=await _.json();if(!_.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(ql.info("OAuth authentication completed successfully"),r)return;if((u=b.user)!=null&&u.id?(Te.identify(b.user.id,{...b.user.email?{email:b.user.email}:{}}),b.user.email&&Te.alias(b.user.email,b.user.id)):(c=b.user)!=null&&c.email&&Te.identify(b.user.email,{email:b.user.email}),(f=b.user)!=null&&f.email&&p)try{const C=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:p,refreshToken:v,userId:b.user.id}),signal:n.signal});C.ok||ql.warn(`Local auth store returned ${C.status}`)}catch(C){if(r)return;ql.warn("Failed to store auth locally:",C)}if(r)return;window.sessionStorage.setItem(Mp,"1");const E=window.location.pathname;window.history.replaceState({},document.title,E),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";ql.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},E1=fs("useAgentVariantsSession"),pZ=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,LC=(t,e,n)=>{e.size===0&&!n||t.set(Ud,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[a,u]of r)u.status==="sending"&&u.variantRequestId&&(e.has(u.variantRequestId)||n&&u.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},mZ=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,a]of t){if(a.status!=="sending"||!a.awaitingSnapshotOutcome||a.variantRequest!==void 0)continue;const u=a.target;if(!u||u.kind!=="variant"||u.sessionId!==e.sessionId)continue;const c=(s=e.variants.find(f=>f.workItemId===u.variantId))==null?void 0:s.refinement;c&&(c.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(c.status==="failed"||c.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},gZ=({enabled:t=!0}={})=>{const e=st(pf),n=st(GT),r=st(bU),s=st(QT),i=st(CU),a=h2(),u=g.useRef(null);g.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=f=>{try{const h=JSON.parse(f.data),p=u.current;if(h.active){const x=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(E=>!x.has(E.requestId))),LC(a,x,!1),a.set(Ud,_=>{let b=_;for(const E of h.variants){const C=E.adoptedSource;C&&(b=kU(b,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:h.sessionId,variantId:E.workItemId}))}return b}),a.set(Ud,_=>mZ(_,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,LC(a,new Set,pZ(h));e(h);const v=!h.active&&p!==null,y=h.active&&h.sessionId!==p;if(y&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>E1.warn("failed to reset preview-port on session switch",x)),v||y){const x=new Set;if(h.active)for(const b of h.variants)x.add(Hd({kind:"variant",sessionId:h.sessionId,variantId:b.workItemId}));const _=a.get(Ko);for(const b of[_==null?void 0:_.left,_==null?void 0:_.right])b&&x.add(Hd({kind:"variant",sessionId:b.sessionId,variantId:b.variantId}));i(x)}}catch(h){E1.warn("failed to parse SSE event payload",h)}},c.onerror=f=>{E1.warn("SSE error (auto-reconnects)",f)},()=>{c.close()}},[t,e,n,r,s,i,a])};function fA(t){const e=t+"CollectionProvider",[n,r]=ea(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=_=>{const{scope:b,children:E}=_,C=g.useRef(null),P=g.useRef(new Map).current;return S.jsx(s,{scope:b,itemMap:P,collectionRef:C,children:E})};a.displayName=e;const u=t+"CollectionSlot",c=jd(u),f=g.forwardRef((_,b)=>{const{scope:E,children:C}=_,P=i(u,E),T=Yt(b,P.collectionRef);return S.jsx(c,{ref:T,children:C})});f.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",v=jd(h),y=g.forwardRef((_,b)=>{const{scope:E,children:C,...P}=_,T=g.useRef(null),R=Yt(b,T),O=i(h,E);return g.useEffect(()=>(O.itemMap.set(T,{ref:T,...P}),()=>void O.itemMap.delete(T))),S.jsx(v,{[p]:"",ref:R,children:C})});y.displayName=h;function x(_){const b=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const P=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((O,I)=>P.indexOf(O.ref.current)-P.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}var w0="Collapsible",[vZ,hA]=ea(w0),[yZ,Lx]=vZ(w0),pA=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[c,f]=fl({prop:r,defaultProp:s??!1,onChange:a,caller:w0});return S.jsx(yZ,{scope:n,disabled:i,contentId:sl(),open:c,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(At.div,{"data-state":Fx(c),"data-disabled":i?"":void 0,...u,ref:e})})});pA.displayName=w0;var mA="CollapsibleTrigger",gA=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Lx(mA,n);return S.jsx(At.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Fx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:Et(t.onClick,s.onOpenToggle)})});gA.displayName=mA;var Dx="CollapsibleContent",vA=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Lx(Dx,t.__scopeCollapsible);return S.jsx(Yi,{present:n||s.open,children:({present:i})=>S.jsx(_Z,{...r,ref:e,present:i})})});vA.displayName=Dx;var _Z=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Lx(Dx,n),[u,c]=g.useState(r),f=g.useRef(null),h=Yt(e,f),p=g.useRef(0),v=p.current,y=g.useRef(0),x=y.current,_=a.open||u,b=g.useRef(_),E=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),oi(()=>{const C=f.current;if(C){E.current=E.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const P=C.getBoundingClientRect();p.current=P.height,y.current=P.width,b.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),c(r)}},[a.open,r]),S.jsx(At.div,{"data-state":Fx(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...t.style},children:_&&s})});function Fx(t){return t?"open":"closed"}var xZ=pA,wZ=gA,bZ=vA,SZ=g.createContext(void 0);function yA(t){const e=g.useContext(SZ);return t||e||"ltr"}var As="Accordion",EZ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[jx,kZ,CZ]=fA(As),[b0]=ea(As,[CZ,hA]),Vx=hA(),_A=g.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return S.jsx(jx.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?S.jsx(AZ,{...i,ref:e}):S.jsx(RZ,{...s,ref:e})})});_A.displayName=As;var[xA,PZ]=b0(As),[wA,TZ]=b0(As,{collapsible:!1}),RZ=g.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[u,c]=fl({prop:n,defaultProp:r??"",onChange:s,caller:As});return S.jsx(xA,{scope:t.__scopeAccordion,value:g.useMemo(()=>u?[u]:[],[u]),onItemOpen:c,onItemClose:g.useCallback(()=>i&&c(""),[i,c]),children:S.jsx(wA,{scope:t.__scopeAccordion,collapsible:i,children:S.jsx(bA,{...a,ref:e})})})}),AZ=g.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,u]=fl({prop:n,defaultProp:r??[],onChange:s,caller:As}),c=g.useCallback(h=>u((p=[])=>[...p,h]),[u]),f=g.useCallback(h=>u((p=[])=>p.filter(v=>v!==h)),[u]);return S.jsx(xA,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:f,children:S.jsx(wA,{scope:t.__scopeAccordion,collapsible:!0,children:S.jsx(bA,{...i,ref:e})})})}),[MZ,S0]=b0(As),bA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,u=g.useRef(null),c=Yt(u,e),f=kZ(n),p=yA(s)==="ltr",v=Et(t.onKeyDown,y=>{var A;if(!EZ.includes(y.key))return;const x=y.target,_=f().filter(N=>{var L;return!((L=N.ref.current)!=null&&L.disabled)}),b=_.findIndex(N=>N.ref.current===x),E=_.length;if(b===-1)return;y.preventDefault();let C=b;const P=0,T=E-1,R=()=>{C=b+1,C>T&&(C=P)},O=()=>{C=b-1,C<P&&(C=T)};switch(y.key){case"Home":C=P;break;case"End":C=T;break;case"ArrowRight":i==="horizontal"&&(p?R():O());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(p?O():R());break;case"ArrowUp":i==="vertical"&&O();break}const I=C%E;(A=_[I].ref.current)==null||A.focus()});return S.jsx(MZ,{scope:n,disabled:r,direction:s,orientation:i,children:S.jsx(jx.Slot,{scope:n,children:S.jsx(At.div,{...a,"data-orientation":i,ref:c,onKeyDown:r?void 0:v})})})}),Dm="AccordionItem",[IZ,$x]=b0(Dm),SA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=S0(Dm,n),a=PZ(Dm,n),u=Vx(n),c=sl(),f=r&&a.value.includes(r)||!1,h=i.disabled||t.disabled;return S.jsx(IZ,{scope:n,open:f,disabled:h,triggerId:c,children:S.jsx(xZ,{"data-orientation":i.orientation,"data-state":RA(f),...u,...s,ref:e,disabled:h,open:f,onOpenChange:p=>{p?a.onItemOpen(r):a.onItemClose(r)}})})});SA.displayName=Dm;var EA="AccordionHeader",kA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=S0(As,n),i=$x(EA,n);return S.jsx(At.h3,{"data-orientation":s.orientation,"data-state":RA(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});kA.displayName=EA;var L_="AccordionTrigger",CA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=S0(As,n),i=$x(L_,n),a=TZ(L_,n),u=Vx(n);return S.jsx(jx.ItemSlot,{scope:n,children:S.jsx(wZ,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:e})})});CA.displayName=L_;var PA="AccordionContent",TA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=S0(As,n),i=$x(PA,n),a=Vx(n);return S.jsx(bZ,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});TA.displayName=PA;function RA(t){return t?"open":"closed"}var AA=_A,NZ=SA,OZ=kA,LZ=CA,DZ=TA;/**
|
|
126
|
+
* @license lucide-react v1.24.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const MA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
131
|
+
* @license lucide-react v1.24.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const FZ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
136
|
+
* @license lucide-react v1.24.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const jZ=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
141
|
+
* @license lucide-react v1.24.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const DC=t=>{const e=jZ(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
146
|
+
* @license lucide-react v1.24.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/var k1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
151
|
+
* @license lucide-react v1.24.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const VZ=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},$Z=g.createContext({}),HZ=()=>g.useContext($Z),zZ=g.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:v="currentColor",className:y=""}=HZ()??{},x=r??p?Number(n??h)*24/Number(e??f):n??h;return g.createElement("svg",{ref:c,...k1,width:e??f??k1.width,height:e??f??k1.height,stroke:t??v,strokeWidth:x,className:MA("lucide",y,s),...!i&&!VZ(u)&&{"aria-hidden":"true"},...u},[...a.map(([_,b])=>g.createElement(_,b)),...Array.isArray(i)?i:[i]])});/**
|
|
156
|
+
* @license lucide-react v1.24.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const Ze=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(zZ,{ref:i,iconNode:e,className:MA(`lucide-${FZ(DC(t))}`,`lucide-${t}`,r),...s}));return n.displayName=DC(t),n};/**
|
|
161
|
+
* @license lucide-react v1.24.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const UZ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BZ=Ze("arrow-left",UZ);/**
|
|
166
|
+
* @license lucide-react v1.24.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const WZ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],GZ=Ze("arrow-right",WZ);/**
|
|
171
|
+
* @license lucide-react v1.24.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const KZ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],qZ=Ze("arrow-up",KZ);/**
|
|
176
|
+
* @license lucide-react v1.24.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const ZZ=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],YZ=Ze("bell",ZZ);/**
|
|
181
|
+
* @license lucide-react v1.24.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const XZ=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],QZ=Ze("brain",XZ);/**
|
|
186
|
+
* @license lucide-react v1.24.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const JZ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eY=Ze("check",JZ);/**
|
|
191
|
+
* @license lucide-react v1.24.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const tY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nY=Ze("chevron-down",tY);/**
|
|
196
|
+
* @license lucide-react v1.24.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const rY=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sY=Ze("chevron-right",rY);/**
|
|
201
|
+
* @license lucide-react v1.24.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const iY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],oY=Ze("circle",iY);/**
|
|
206
|
+
* @license lucide-react v1.24.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const aY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],lY=Ze("clock",aY);/**
|
|
211
|
+
* @license lucide-react v1.24.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const uY=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cY=Ze("copy",uY);/**
|
|
216
|
+
* @license lucide-react v1.24.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const dY=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],fY=Ze("dot",dY);/**
|
|
221
|
+
* @license lucide-react v1.24.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const hY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],pY=Ze("globe",hY);/**
|
|
226
|
+
* @license lucide-react v1.24.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const mY=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],gY=Ze("heart",mY);/**
|
|
231
|
+
* @license lucide-react v1.24.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const vY=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],yY=Ze("house",vY);/**
|
|
236
|
+
* @license lucide-react v1.24.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const _Y=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],xY=Ze("image",_Y);/**
|
|
241
|
+
* @license lucide-react v1.24.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const wY=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],bY=Ze("inbox",wY);/**
|
|
246
|
+
* @license lucide-react v1.24.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const SY=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],EY=Ze("lightbulb",SY);/**
|
|
251
|
+
* @license lucide-react v1.24.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const kY=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],CY=Ze("link",kY);/**
|
|
256
|
+
* @license lucide-react v1.24.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const PY=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],TY=Ze("loader",PY);/**
|
|
261
|
+
* @license lucide-react v1.24.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const RY=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],AY=Ze("lock",RY);/**
|
|
266
|
+
* @license lucide-react v1.24.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const MY=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],IY=Ze("mail",MY);/**
|
|
271
|
+
* @license lucide-react v1.24.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const NY=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],OY=Ze("menu",NY);/**
|
|
276
|
+
* @license lucide-react v1.24.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const LY=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],DY=Ze("message-circle",LY);/**
|
|
281
|
+
* @license lucide-react v1.24.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const FY=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],jY=Ze("monitor",FY);/**
|
|
286
|
+
* @license lucide-react v1.24.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const VY=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],$Y=Ze("moon",VY);/**
|
|
291
|
+
* @license lucide-react v1.24.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const HY=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],zY=Ze("paintbrush",HY);/**
|
|
296
|
+
* @license lucide-react v1.24.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const UY=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],BY=Ze("palette",UY);/**
|
|
301
|
+
* @license lucide-react v1.24.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const WY=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],GY=Ze("pause",WY);/**
|
|
306
|
+
* @license lucide-react v1.24.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const KY=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],qY=Ze("pencil",KY);/**
|
|
311
|
+
* @license lucide-react v1.24.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const ZY=[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]],YY=Ze("pipette",ZY);/**
|
|
316
|
+
* @license lucide-react v1.24.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const XY=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],QY=Ze("play",XY);/**
|
|
321
|
+
* @license lucide-react v1.24.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const JY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],eX=Ze("plus",JY);/**
|
|
326
|
+
* @license lucide-react v1.24.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const tX=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],nX=Ze("rectangle-horizontal",tX);/**
|
|
331
|
+
* @license lucide-react v1.24.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const rX=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],sX=Ze("rocket",rX);/**
|
|
336
|
+
* @license lucide-react v1.24.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const iX=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],oX=Ze("rotate-ccw",iX);/**
|
|
341
|
+
* @license lucide-react v1.24.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const aX=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],lX=Ze("search",aX);/**
|
|
346
|
+
* @license lucide-react v1.24.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const uX=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],cX=Ze("settings",uX);/**
|
|
351
|
+
* @license lucide-react v1.24.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const dX=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],fX=Ze("shield",dX);/**
|
|
356
|
+
* @license lucide-react v1.24.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const hX=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],pX=Ze("skip-forward",hX);/**
|
|
361
|
+
* @license lucide-react v1.24.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const mX=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],gX=Ze("square-library",mX);/**
|
|
366
|
+
* @license lucide-react v1.24.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const vX=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],yX=Ze("star",vX);/**
|
|
371
|
+
* @license lucide-react v1.24.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const _X=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],xX=Ze("sun",_X);/**
|
|
376
|
+
* @license lucide-react v1.24.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const wX=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],bX=Ze("user",wX);/**
|
|
381
|
+
* @license lucide-react v1.24.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const SX=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],EX=Ze("users",SX);/**
|
|
386
|
+
* @license lucide-react v1.24.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const kX=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],CX=Ze("x",kX),PX={"chevron-right":sY,"chevron-down":nY,pipette:YY,x:CX,copy:cY,menu:OY,dot:fY,monitor:jY,sun:xX,moon:$Y,"rectangle-horizontal":nX,circle:oY,"square-library":gX,clock:lY,star:yX,settings:cX,plus:eX,"arrow-left":BZ,"arrow-right":GZ,"arrow-up":qZ,search:lX,loader:TY,users:EX,lock:AY,mail:IY,bell:YZ,shield:fX,palette:BY,lightbulb:EY,rocket:sX,heart:gY,paintbrush:zY,brain:QZ,globe:pY,user:bX,image:xY,link:CY,check:eY,"rotate-ccw":oX,play:QY,pause:GY,home:yY,"message-circle":DY,inbox:bY,pencil:qY,"skip-forward":pX},FC={lucide:PX},IA=g.createContext(null);function TX(t){const e=g.useContext(IA);return e?FC[e.iconLibrary][t]:FC.lucide[t]}function RX({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(IA.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const NA=g.createContext(null);function Hx(){return g.useContext(NA)}const OA=g.createContext(null);function LA(){const t=g.useContext(OA);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const AX=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=g.useRef(null),u=g.useRef(new Map),[c,f]=g.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:v,sessionRef:y,handlers:x,registerItem:_,measureItems:b}=$T(a),E=g.useCallback((ie,ae)=>{ae?u.current.set(ie,ae):u.current.delete(ie)},[]),C=g.useCallback(()=>{if(!a.current)return;const ie=new Map;u.current.forEach((ae,me)=>{ie.set(me,{top:ae.offsetTop,left:ae.offsetLeft,width:ae.offsetWidth,height:ae.offsetHeight})}),f(ie)},[]),[P,T]=g.useState(()=>r==="single"?t.defaultValue??"":""),[R,O]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,A=t.onValueChange,N=t.value,L=new Set(r==="multiple"?t.value??R:(()=>{const ie=t.value??P;return ie?[ie]:[]})()),F=g.useCallback(ie=>{const ae=t;ae.onValueChange?ae.onValueChange(ie):T(ie)},[I]),V=g.useCallback(ie=>{const ae=t;ae.onValueChange?ae.onValueChange(ie):O(ie)},[A]),G=g.useCallback(ie=>{if(r==="multiple"){const ae=t.value??R;V(ae.filter(me=>me!==ie))}else F("")},[r,F,V,R,N]);g.useEffect(()=>{b(),C()},[b,C,n]);const X=[...L].join(",");g.useEffect(()=>{b(),C()},[b,C,X]);const[q,B]=g.useState(null),Y=h!==null?v[h]:null,$=q!==null?v[q]:null,ee=h!==null&&!c.has(h),H=g0(),{value:D,defaultValue:Z,onValueChange:te,collapsible:se,type:oe,...ue}=i,he=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:V}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:F};return S.jsx(NA.Provider,{value:{registerItem:_,registerFullItem:E,activeIndex:h,grouped:!0,remeasure:()=>{b(),C()},openValues:L,openItemRects:c,toggleValue:G},children:S.jsx(AA,{...he,asChild:!0,children:S.jsxs("div",{ref:ie=>{a.current=ie,typeof e=="function"?e(ie):e&&(e.current=ie)},onMouseEnter:x.onMouseEnter,onMouseMove:ie=>{const ae=a.current;if(ae){const me=ae.getBoundingClientRect(),Se=ae.offsetHeight,Ae=me.height,Ke=Se>0?Ae/Se:1,it=(ie.clientY-me.top)/Ke+ae.scrollTop;for(const[Oe,at]of c){const Mt=v[Oe];if(!Mt)continue;const mt=Mt.top+Mt.height,Fe=at.top+at.height;if(it>=mt&&it<=Fe){p(null);return}}}x.onMouseMove(ie)},onMouseLeave:x.onMouseLeave,onFocus:ie=>{var me;const ae=(me=ie.target.closest("[data-proximity-index]"))==null?void 0:me.getAttribute("data-proximity-index");if(ae!=null){const Se=Number(ae);p(Se),B(ie.target.matches(":focus-visible")?Se:null)}},onBlur:ie=>{var ae;(ae=a.current)!=null&&ae.contains(ie.relatedTarget)||(B(null),p(null))},className:ur("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ue,children:[S.jsx(Ui,{children:[...c.entries()].map(([ie,ae])=>S.jsx(Bi.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ae.top,left:ae.left,width:ae.width,height:ae.height,opacity:ee?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${ie}`))}),S.jsx(Ui,{children:Y&&S.jsx(Bi.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Y.top,left:Y.left,width:Y.width,height:Y.height},animate:{opacity:1,top:Y.top,left:Y.left,width:Y.width,height:Y.height},exit:{opacity:0,transition:{duration:.06}},transition:{...$d.fast,opacity:{duration:.08}}},y.current)}),S.jsx(Ui,{children:$&&S.jsx(Bi.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...$d.fast,opacity:{duration:.08}}})}),n]})})})});AX.displayName="AccordionGroup";const DA=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[f,h]=g.useState(()=>e==="single"?r??"":""),[p,v]=g.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const C=s??f;return C?[C]:[]})()),x=g.useCallback(C=>{i?i(C):h(C)},[i]),_=g.useCallback(C=>{i?i(C):v(C)},[i]),b=g.useCallback(C=>{e==="multiple"?_((s??p).filter(T=>T!==C)):x("")},[e,s,p,x,_]),E=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??f,defaultValue:r,onValueChange:x};return S.jsx(AA,{...E,asChild:!0,children:S.jsx("div",{ref:c,className:ur("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:S.jsx(FA.Provider,{value:y,children:S.jsx(jA.Provider,{value:b,children:t})})})})});DA.displayName="Accordion";const FA=g.createContext(new Set),jA=g.createContext(()=>{}),VA=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=g.useRef(null),c=Hx(),f=g.useContext(FA),h=g.useContext(jA),p=g0(),v=c!=null&&c.grouped?c.openValues.has(t):f.has(t),y=g.useRef(null),x=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,y.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return v?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,v]),S.jsx(OA.Provider,{value:{index:e,value:t,isOpen:v,onToggle:x,triggerRef:y},children:S.jsxs(NZ,{ref:_=>{u.current=_,typeof a=="function"?a(_):a&&(a.current=_)},value:t,disabled:n,"data-proximity-index":e,className:ur(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(Ui,{children:v&&S.jsx(Bi.div,{className:`absolute inset-0 ${p.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});VA.displayName="AccordionItem";const $A=g.forwardRef(({children:t,className:e,...n},r)=>{const s=TX("chevron-right"),i=Hx(),{index:a,isOpen:u,triggerRef:c}=LA(),f=g0(),[h,p]=g.useState(!1),v=i!=null&&i.grouped?i.activeIndex===a:h,y=S.jsx(OZ,{asChild:!0,children:S.jsx("div",{children:S.jsxs(LZ,{ref:r,className:ur(`relative z-10 flex items-center gap-2.5 ${f.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:yd.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:ur("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||v?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?yd.semibold:yd.normal},children:t})]}),S.jsx(Bi.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:$d.fast,children:S.jsx(s,{size:16,strokeWidth:u||v?2:1.5,className:ur("transition-[color,stroke-width] duration-80",u||v?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:y}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(Ui,{children:h&&S.jsx(Bi.div,{className:`absolute inset-0 ${f.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),y]})});$A.displayName="AccordionTrigger";const HA=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Hx(),{isOpen:i}=LA();return S.jsx(Ui,{initial:!1,children:i&&S.jsx(DZ,{forceMount:!0,asChild:!0,...n,children:S.jsx(Bi.div,{ref:r,className:ur("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...$d.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});HA.displayName="AccordionContent";const Ip=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(DA,{type:"multiple",defaultValue:e,className:ur("w-full",n),children:t}),MX=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return S.jsxs(VA,{value:t,className:ur("w-full",!u&&"border-t border-main-border"),children:[S.jsxs($A,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(HA,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Ip.Item=MX;const IX=()=>{const t=g.useRef(Date.now()),[e,n]=g.useState(0);return g.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},NX=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},jC="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",VC="M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",OX="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",Np=["Applying","Thinking","Planning","Crafting"],LX=Np.reduce((t,e)=>t.length>=e.length?t:e),DX=20,FX="Still working — runs can take a few minutes.",jX=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=IX();g.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%Np.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=DX?FX:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(rl.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(rl.path,{animate:{d:[jC,VC,OX,VC,jC]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:yd.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:LX}),S.jsx(Ui,{mode:"popLayout",initial:!1,children:S.jsx(rl.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:Np[n]},Np[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:NX(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};function zA(t,[e,n]){return Math.min(n,Math.max(e,t))}function VX(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var UA=["PageUp","PageDown"],BA=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],WA={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Yu="Slider",[D_,$X,HX]=fA(Yu),[zx]=ea(Yu,[HX]),[zX,_f]=zx(Yu),GA=g.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:u=!1,minStepsBetweenThumbs:c=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:v=()=>{},inverted:y=!1,form:x,..._}=t,b=g.useRef(new Set),E=g.useRef(0),C=g.useRef(!1),T=a==="horizontal"?UX:BX,[R,O]=g.useState(null),I=Yt(e,O),[A=[],N]=fl({prop:h,defaultProp:f,onChange:B=>{var $;($=[...b.current][E.current])==null||$.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,p(B)}}),L=g.useRef(A),F=g.useRef(A);g.useEffect(()=>{const B=x?R==null?void 0:R.ownerDocument.getElementById(x):R==null?void 0:R.closest("form");if(B instanceof HTMLFormElement){const Y=()=>N(F.current);return B.addEventListener("reset",Y),()=>B.removeEventListener("reset",Y)}},[R,x,N]);function V(B){const Y=qX(A,B);q(B,Y)}function G(B){q(B,E.current)}function X(){const B=L.current[E.current];A[E.current]!==B&&v(A)}function q(B,Y,{commit:$}={commit:!1}){const ee=lM(i),H=Lp(Math.round((B-r)/i)*i+r,ee),D=zA(H,[r,s]);N((Z=[])=>{const te=GX(Z,D,Y);if(XX(te,c*i)){E.current=te.indexOf(D);const se=String(te)!==String(Z);return se&&$&&v(te),se?te:Z}else return Z})}return S.jsx(zX,{scope:t.__scopeSlider,name:n,disabled:u,min:r,max:s,valueIndexToChangeRef:E,thumbs:b.current,values:A,orientation:a,form:x,children:S.jsx(D_.Provider,{scope:t.__scopeSlider,children:S.jsx(D_.Slot,{scope:t.__scopeSlider,children:S.jsx(T,{"aria-disabled":u,"data-disabled":u?"":void 0,..._,ref:I,onPointerDown:Et(_.onPointerDown,()=>{u||(L.current=A,C.current=!1)}),min:r,max:s,inverted:y,onSlideStart:u?void 0:V,onSlideMove:u?void 0:G,onSlideEnd:u?void 0:X,onHomeKeyDown:()=>{u||(C.current=!0,q(r,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,q(s,A.length-1,{commit:!0}))},onStepKeyDown:({event:B,direction:Y})=>{if(!u){C.current=!0;const H=UA.includes(B.key)||B.shiftKey&&BA.includes(B.key)?10:1,D=E.current,Z=A[D],te=QX(Z,{min:r,step:i,direction:Y,multiplier:H});q(te,D,{commit:!0})}}})})})})});GA.displayName=Yu;var[KA,qA]=zx(Yu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),UX=g.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:f,...h}=t,[p,v]=g.useState(null),y=Yt(e,v),x=g.useRef(void 0),_=yA(s),b=_==="ltr",E=b&&!i||!b&&i;function C(P){const T=x.current||p.getBoundingClientRect(),R=[0,T.width],I=Ux(R,E?[n,r]:[r,n]);return x.current=T,I(P-T.left)}return S.jsx(KA,{scope:t.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:S.jsx(ZA,{dir:_,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const T=C(P.clientX);a==null||a(T)},onSlideMove:P=>{const T=C(P.clientX);u==null||u(T)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:P=>{const R=WA[E?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:R?-1:1})}})})}),BX=g.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:u,onStepKeyDown:c,...f}=t,h=g.useRef(null),p=Yt(e,h),v=g.useRef(void 0),y=!s;function x(_){const b=v.current||h.current.getBoundingClientRect(),E=[0,b.height],P=Ux(E,y?[r,n]:[n,r]);return v.current=b,P(_-b.top)}return S.jsx(KA,{scope:t.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:S.jsx(ZA,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:_=>{const b=x(_.clientY);i==null||i(b)},onSlideMove:_=>{const b=x(_.clientY);a==null||a(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:_=>{const E=WA[y?"from-bottom":"from-top"].includes(_.key);c==null||c({event:_,direction:E?-1:1})}})})}),ZA=g.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:u,onStepKeyDown:c,...f}=t,h=_f(Yu,n);return S.jsx(At.span,{...f,ref:e,onKeyDown:Et(t.onKeyDown,p=>{p.key==="Home"?(a(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):UA.concat(BA).includes(p.key)&&(c(p),p.preventDefault())}),onPointerDown:Et(t.onPointerDown,p=>{const v=p.target;v.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):r(p)}),onPointerMove:Et(t.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Et(t.onPointerUp,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&(v.releasePointerCapture(p.pointerId),i(p))})})}),YA="SliderTrack",XA=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=_f(YA,n);return S.jsx(At.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});XA.displayName=YA;var F_="SliderRange",QA=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=_f(F_,n),i=qA(F_,n),a=g.useRef(null),u=Yt(e,a),c=s.values.length,f=s.values.map(v=>aM(v,s.min,s.max)),h=c>1?Math.min(...f):0,p=100-Math.max(...f);return S.jsx(At.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:u,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});QA.displayName=F_;var JA="SliderThumb",[WX,eM]=zx(JA),tM="SliderThumbProvider";function nM(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=_f(tM,e),a=$X(e),[u,c]=g.useState(null),f=g.useMemo(()=>u?a().findIndex(b=>b.ref.current===u):-1,[a,u]),h=g5(u),p=u?!!i.form||!!u.closest("form"):!0,v=i.values[f],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=v===void 0?0:aM(v,i.min,i.max);g.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const _={value:v,name:y,form:i.form,isFormControl:p,index:f,thumb:u,onThumbChange:c,percent:x,size:h};return S.jsx(WX,{scope:e,..._,children:JX(s)?s(_):r})}nM.displayName=tM;var Op="SliderThumbTrigger",rM=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=_f(Op,n),i=qA(Op,n),{index:a,value:u,percent:c,size:f,onThumbChange:h}=eM(Op,n),p=Yt(e,h),v=KX(a,s.values.length),y=f==null?void 0:f[i.size],x=y?ZX(y,c,i.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${c}% + ${x}px)`},children:S.jsx(D_.ItemSlot,{scope:n,children:S.jsx(At.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":s.min,"aria-valuenow":u,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:p,style:u===void 0?{display:"none"}:t.style,onFocus:Et(t.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})});rM.displayName=Op;var sM=g.forwardRef((t,e)=>{const{__scopeSlider:n,name:r,...s}=t;return S.jsx(nM,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:i,isFormControl:a})=>S.jsxs(S.Fragment,{children:[S.jsx(rM,{...s,ref:e,__scopeSlider:n}),a?S.jsx(oM,{__scopeSlider:n},i):null]})})});sM.displayName=JA;var iM="SliderBubbleInput",oM=g.forwardRef(({__scopeSlider:t,...e},n)=>{const{value:r,name:s,form:i}=eM(iM,t),a=g.useRef(null),u=Yt(a,n),c=VX(r);return g.useEffect(()=>{const f=a.current;if(!f)return;const h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==r&&v){const y=new Event("input",{bubbles:!0});v.call(f,r),f.dispatchEvent(y)}},[c,r]),S.jsx(At.input,{style:{display:"none"},name:s,form:i,...e,ref:u,defaultValue:r})});oM.displayName=iM;function GX(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function aM(t,e,n){const i=100/(n-e)*(t-e);return zA(i,[0,100])}function KX(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function qX(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function ZX(t,e,n){const r=t/2,i=Ux([0,50],[0,r]);return(r-i(e)*n)*n}function YX(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function XX(t,e){if(e>0){const n=YX(t);return Math.min(...n)>=e}return!0}function Ux(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function lM(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",a=Number(s);return Math.max(0,i.length-a)}const n=e.split(".")[1];return n?n.length:0}function Lp(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function QX(t,{min:e,step:n,direction:r,multiplier:s}){const i=lM(n),a=(t-e)/n,u=Math.round(a),c=Lp(u*n+e,i)===Lp(t,i);let f;return c?f=u+s*r:r>0?f=Math.ceil(a):f=Math.floor(a),Lp(f*n+e,i)}function JX(t){return typeof t=="function"}const j_=g.forwardRef(({className:t,...e},n)=>S.jsxs(GA,{ref:n,className:ur("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(XA,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(QA,{className:"absolute h-full bg-primary"})}),S.jsx(sM,{className:ur("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));j_.displayName="Slider";const eQ=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],tQ=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],nQ=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],ip=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],rQ=()=>{window.location.hash=""},Ti=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),$C=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),sQ=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",iQ=()=>{const t=ip.filter(n=>n.status==="showcased").length,e=ip.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:rQ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(cz,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(xT,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Ti,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(du,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(du,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(du,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(z5,{primaryLabel:"Ship",primaryIcon:i1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(Do,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(hx,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Ti,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx($C,{swatches:eQ})}),S.jsx(Ti,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx($C,{swatches:tQ})}),S.jsx(Ti,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Ti,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:nQ.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Ti,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(Ip,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(Ip.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(i1,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(Ip.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(j_,{defaultValue:[64],max:100,step:1}),S.jsx(j_,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Ti,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(hR,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(J2,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(jX,{hint:"Reading selected elements"})})]})}),S.jsx(Ti,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(xd,{fill:"surface",loader:"spinner",title:"Starting preview",description:"Its preview server is starting up."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(xd,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(dR,{icon:S.jsx(i1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Pm,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Ti,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:ip.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:ip.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${sQ(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},oQ=64,Fm=new Set;let Dp=null;const aQ=()=>{Dp=null;for(const t of Fm)t()},lQ=()=>{Fm.size!==0&&(Dp!==null&&clearTimeout(Dp),Dp=setTimeout(aQ,oQ))},uQ=t=>(Fm.add(t),()=>{Fm.delete(t)}),cQ=(t,e)=>typeof URL<"u"&&t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url):new URL(String(t),e),dQ=(t,e)=>{try{const n=cQ(t,e);return n.origin!==e?!1:n.pathname.startsWith("/api/")}catch{return!1}},fQ=({nativeFetch:t,pageOrigin:e,getShouldIntercept:n})=>{const r=(s,i)=>t(s,i).then(a=>(a.status===401&&n()&&dQ(s,e)&&lQ(),a));return window.fetch=r,()=>{window.fetch=t}},hQ=t=>!t.hasConfig||t.configLoading||t.demoMode!==!0||t.agentModeAvailable!==!0||t.pathnameDemoSessionId!==null?!1:(t.activeDemoSessionId??t.configuredDemoSessionId??null)===null,pQ=(t,e,n)=>t===!0&&e!==!0?null:n,mQ=t=>t?"Preparing your demo session…":null,gQ=t=>!(t==="/rivet"||t.startsWith("/rivet/")),vQ=t=>!gQ(t.pathname)||t.hasConfig?!1:!t.configLoading&&!t.isRetryingConfig,yQ=t=>{const e=t.match(/^\/try\/([^/]+)/);return e!=null&&e[1]?decodeURIComponent(e[1]):null},_Q=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",C1=fs("App"),xQ=2e3,wQ=60,HC="Connecting to Google...",zC="https://rivet-proxy.onrender.com",bQ=`<!doctype html>
|
|
391
|
+
<html lang="en">
|
|
392
|
+
<head>
|
|
393
|
+
<meta charset="utf-8" />
|
|
394
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
395
|
+
<title>${HC}</title>
|
|
396
|
+
<style>
|
|
397
|
+
:root { color-scheme: light dark; }
|
|
398
|
+
body {
|
|
399
|
+
margin: 0;
|
|
400
|
+
min-height: 100vh;
|
|
401
|
+
display: grid;
|
|
402
|
+
place-items: center;
|
|
403
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
404
|
+
background: #111215;
|
|
405
|
+
color: #f3f4f6;
|
|
406
|
+
}
|
|
407
|
+
.panel {
|
|
408
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
409
|
+
border-radius: 12px;
|
|
410
|
+
padding: 18px 22px;
|
|
411
|
+
background: rgba(255, 255, 255, 0.06);
|
|
412
|
+
font-size: 14px;
|
|
413
|
+
}
|
|
414
|
+
</style>
|
|
415
|
+
</head>
|
|
416
|
+
<body>
|
|
417
|
+
<div class="panel">${HC}</div>
|
|
418
|
+
</body>
|
|
419
|
+
</html>`,SQ="Too many people are trying Rivet right now. Please try again in a few minutes.",uM="Failed to start an isolated demo session.",EQ=async t=>{if(t.status===429)return SQ;try{const e=await t.json();if(e.error)return e.error;if(e.message)return e.message}catch{}return uM},V_=274,jm=395,P1=Math.min(jm,Math.round((V_+jm)/2*1.1)),UC="rivet:panelWidth:v2",kQ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},CQ=({projectPath:t,activeDemoSessionId:e=null,showLoginGate:n=!1,onStartLogin:r,isStartingLogin:s=!1,loginError:i=null,fullPageHostedLoginProgressMessage:a=null,holdHostedTryoutPreviewNavigation:u=!1,hostedTryoutPreviewHoldMessage:c=null,deferInspectorUntilPreviewReady:f=!1})=>{const h=Xe(qT)>0,[p,v]=tP(GT),y=$V(),[x,_]=g.useState(()=>{if(typeof window>"u")return P1;const X=Number(window.localStorage.getItem(UC));return Number.isFinite(X)&&X>=V_&&X<=jm?X:P1}),[b,E]=g.useState(!1),[C,P]=g.useState(eZ),T=p?x:0,[R,O]=g.useState(p);g.useEffect(()=>{if(!p){O(!1);return}P(X=>Jq({position:X,boundsLeftPx:x}))},[p,x]),g.useEffect(()=>{window.localStorage.setItem(UC,String(x))},[x]),g.useEffect(()=>{if(!p)return;const X=q=>{q.key==="Escape"&&(kQ(q.target)||(q.preventDefault(),v(!1)))};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[p,v]);const I=g.useCallback(X=>{X.preventDefault(),X.stopPropagation();const q=X.clientX,B=x;E(!0);const Y=ee=>{const H=Math.min(jm,Math.max(V_,B+(ee.clientX-q)));_(H)},$=()=>{window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),E(!1)};window.addEventListener("pointermove",Y),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$)},[x]),A=g.useCallback(()=>_(P1),[]),N=hZ(),L=Xe(mf);gZ({enabled:!L});const F=N.isProcessing?"Completing authentication...":a,V=F!==null,G=st(JT);return g.useEffect(()=>{G(t??null)},[t,G]),g.useEffect(()=>{n&&(document.body.style.cursor="auto")},[n]),S.jsxs(rl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[F!==null&&!n?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx($q,{message:F})}):null,n?S.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/45 backdrop-blur-[2px]",children:S.jsx(cA,{isSigningIn:s||V,onStartSignIn:()=>{r==null||r()},errorMessage:i,displayMode:"modal"})}):null,S.jsxs("div",{className:`relative flex min-w-0 flex-1 flex-col ${n?"pointer-events-none select-none":""}`,children:[S.jsx(mK,{holdHostedTryoutPreviewNavigation:u,isInteractionDisabled:n,activeDemoSessionId:e}),u&&c?S.jsx("div",{className:"bg-main absolute inset-0 z-30 flex items-center justify-center",children:S.jsx("div",{className:"border-divider bg-main-light rounded-lg border p-6 shadow-lg",children:S.jsx(hR,{message:c})})}):null]}),n?null:S.jsx(S.Fragment,{children:!f&&!h?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:R?x:0},children:S.jsxs(rl.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:p?0:-x},transition:y?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{p&&O(!0)},style:{width:x,willChange:"transform"},children:[S.jsx(AG,{onClose:()=>v(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:I,onDoubleClick:A,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${b?"w-0.5 bg-content-muted":"w-px bg-divider group-hover/resize:w-0.5 group-hover/resize:bg-content-muted"}`})})]})}),b&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(rZ,{isVisible:!0,isPanelOpen:p,isReducedMotion:!!y,position:C,dragBoundsLeftPx:T,onPositionChange:P,onToggle:()=>v(X=>!X)})]}):null}),S.jsx(p$,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},$_="rivet_connect_deep_link",PQ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem($_);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem($_,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},TQ=PQ(),RQ=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Mp)==="1"),[r,s]=g.useState(!1),[i,a]=g.useState(TQ);g.useEffect(()=>{n&&window.sessionStorage.removeItem(Mp)},[n]);const{config:u,refetchConfig:c,loading:f,error:h}=dZ(),p=st(mf),[v,y]=g.useState(!1),[x,_]=g.useState(null),[b,E]=g.useState(!1),[C,P]=g.useState(!1),[T,R]=g.useState(null),[O,I]=g.useState(!1),A=g.useRef(!1),N=g.useRef(!1),L=yQ(window.location.pathname),F=(u==null?void 0:u.activeDemoSessionId)??null,V=L??T??F,G=g.useMemo(()=>pQ(u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,V),[u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,V]),X=g.useMemo(()=>hQ({configLoading:f,hasConfig:u!==null,demoMode:u==null?void 0:u.demoMode,agentModeAvailable:u==null?void 0:u.agentModeAvailable,pathnameDemoSessionId:L,activeDemoSessionId:T,configuredDemoSessionId:F}),[u,f,L,T,F]);g.useLayoutEffect(()=>{if(!X){I(!1);return}I(!0)},[X]);const q=O,B=g.useMemo(()=>mQ(q),[q]),Y=(u==null?void 0:u.demoMode)===!0&&q,$=g.useRef(null);$.current=V;const ee=g.useCallback(async()=>{if(!A.current)return;R(null);const me=await c();if((me==null?void 0:me.demoMode)===!0&&me.agentModeAvailable!==!0){P(!1);return}(me==null?void 0:me.demoMode)===!0&&P(!0)},[c]);g.useEffect(()=>{if((u==null?void 0:u.demoMode)===!0)return uQ(()=>{ee()})},[u==null?void 0:u.demoMode,ee]),g.useEffect(()=>{if(A.current=(u==null?void 0:u.demoMode)===!0,(u==null?void 0:u.demoMode)!==!0)return;const me=window.fetch.bind(window);return fQ({nativeFetch:me,pageOrigin:window.location.origin,getShouldIntercept:()=>A.current})},[u==null?void 0:u.demoMode]),g.useEffect(()=>{(u==null?void 0:u.agentModeAvailable)===!0&&P(!1)},[u==null?void 0:u.agentModeAvailable]);const H=g.useCallback(async me=>{const Se=$.current;if(!(me!=null&&me.forceRefresh)&&Se)return Se;if(N.current)return"";N.current=!0;try{const Ae=await fetch("/api/demo/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!Ae.ok){const it=await EQ(Ae);throw new Error(it)}const Ke=await Ae.json();if(!Ke.sessionId)throw new Error("Demo session response missing session id.");return R(Ke.sessionId),Ke.sessionId}finally{N.current=!1}},[]);g.useEffect(()=>{F&&R(F)},[F]),g.useEffect(()=>{u!=null&&u.userId?(Te.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Te.alias(u.email,u.userId)):u!=null&&u.email&&Te.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),g.useEffect(()=>{if(!u)return;const me=!!u.demoMode,Se=me?V:null;Te.register({source:me?"tryout":"core",demo_mode:me,...Se?{demo_session_id:Se}:{}})},[u,V]);const D=g.useCallback(async()=>{var Se;y(!0),_(null);let me=null;try{if(me=window.open("","_blank"),!me)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{me.document.open(),me.document.write(bQ),me.document.close()}catch(it){C1.warn("Failed to render loading state in auth popup:",it)}const Ae=await fetch(`${zC}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),Ke=await Ae.json();if(!Ae.ok||!Ke.success||!Ke.authUrl||!Ke.sessionId||!Ke.pollSecret)throw new Error(Ke.error||Ke.message||"Failed to start Google login");if(me.closed)throw new Error("Sign-in window was closed before Google login started.");me.location.href=Ke.authUrl;for(let it=0;it<wQ;it+=1){if(me.closed)throw new Error("Sign-in window was closed before authentication completed.");const at=await(await fetch(`${zC}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:Ke.sessionId,pollSecret:Ke.pollSecret})})).json();if(at.success&&at.token&&((Se=at.user)!=null&&Se.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:at.user.email,token:at.token,refreshToken:at.refreshToken,userId:at.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");if(me.close(),window.sessionStorage.setItem(Mp,"1"),(u==null?void 0:u.demoMode)===!0){await H({forceRefresh:!0}),window.location.reload();return}window.location.reload();return}if(at.error&&at.error!=="Pending")throw new Error(at.error||"Google login failed");await new Promise(Mt=>setTimeout(Mt,xQ))}throw new Error("Authentication timed out. Please try again.")}catch(Ae){me&&!me.closed&&me.close();const Ke=Ae instanceof Error?Ae.message:"Failed to start login flow";C1.warn("Hosted login failed:",Ke),_(Ke),y(!1)}},[u==null?void 0:u.demoMode,H]),Z=(u==null?void 0:u.demoMode)===!0&&((u==null?void 0:u.agentModeAvailable)!==!0||C||v),te=u!=null&&u.agentModeAvailable!==!0,se=_Q(t),oe=g.useCallback(async()=>{E(!0),p(!0);try{await c()}finally{p(!1),E(!1)}},[c,p]);if(g.useEffect(()=>{if(!X)return;let me=!1;return H({forceRefresh:!0}).catch(Se=>{const Ae=Se instanceof Error?Se.message:uM;C1.warn("Hosted session bootstrap failed:",Ae),_(Ae),ht.error(Ae)}).finally(()=>{me||I(!1)}),()=>{me=!0}},[X,H]),g.useEffect(()=>{const me=()=>{const Se=window.location.hash;e(Se)};return window.addEventListener("hashchange",me),()=>window.removeEventListener("hashchange",me)},[]),se==="design-system")return S.jsx(iQ,{});const ue={pathname:window.location.pathname,configLoading:f,hasConfig:u!==null,isRetryingConfig:b};if(vQ(ue)){const me=h||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:me}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{oe()},children:"Retry"})]})})}if(te)return S.jsx(cA,{isSigningIn:v,onStartSignIn:()=>{D()},errorMessage:x,displayMode:"full"});const ie=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&i!==null,ae=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&n&&!r&&!ie;return S.jsxs(S.Fragment,{children:[S.jsx(CQ,{projectPath:u==null?void 0:u.projectPath,activeDemoSessionId:G,showLoginGate:Z,onStartLogin:D,isStartingLogin:v,loginError:x,fullPageHostedLoginProgressMessage:(u==null?void 0:u.demoMode)===!0&&v?"Completing sign-in...":null,holdHostedTryoutPreviewNavigation:q,hostedTryoutPreviewHoldMessage:B,deferInspectorUntilPreviewReady:Y}),S.jsx(__,{context:"onboarding",isOpen:ae,onClose:()=>s(!0)}),S.jsx(__,{context:"menu",isOpen:ie,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem($_),a(null)}})]})},AQ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",MQ=new xN,IQ={session_recording:{maskAllInputs:!1,maskInputOptions:{password:!0},maskTextSelector:null}},NQ=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});dD.createRoot(document.getElementById("root")).render(S.jsx(ve.StrictMode,{children:S.jsx(eD,{apiKey:AQ,options:{api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...IQ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"core",rivet_version:"0.13.4",env:"production"})}},children:S.jsx(iD,{fallback:S.jsx(NQ,{}),children:S.jsx(wN,{client:MQ,children:S.jsx(OW,{defaultShape:"rounded",children:S.jsx(RX,{defaultLibrary:"lucide",children:S.jsx(RQ,{})})})})})})}));
|