rivet-design 0.14.12 → 0.14.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +17 -3
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +238 -31
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +1 -0
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +1 -0
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +1 -1
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +4 -0
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +0 -1
- package/dist/cli/commands/shared.d.ts.map +1 -1
- package/dist/cli/commands/shared.js +9 -1
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/envelope.d.ts +8 -1
- package/dist/cli/envelope.d.ts.map +1 -1
- package/dist/cli/envelope.js +31 -9
- package/dist/cli/envelope.js.map +1 -1
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +29 -7
- package/dist/cli/router.js.map +1 -1
- package/dist/install/legacyMcp.d.ts +13 -0
- package/dist/install/legacyMcp.d.ts.map +1 -1
- package/dist/install/legacyMcp.js +40 -4
- package/dist/install/legacyMcp.js.map +1 -1
- package/dist/routes/mcp.d.ts.map +1 -1
- package/dist/routes/mcp.js +0 -5
- package/dist/routes/mcp.js.map +1 -1
- package/dist/services/ConfigManager.d.ts +8 -0
- package/dist/services/ConfigManager.d.ts.map +1 -1
- package/dist/services/ConfigManager.js +14 -0
- package/dist/services/ConfigManager.js.map +1 -1
- package/dist/services/DevServerRuntimeService.d.ts +5 -17
- package/dist/services/DevServerRuntimeService.d.ts.map +1 -1
- package/dist/services/DevServerRuntimeService.js +43 -81
- package/dist/services/DevServerRuntimeService.js.map +1 -1
- package/dist/services/ProjectDetectionService.d.ts.map +1 -1
- package/dist/services/ProjectDetectionService.js +6 -1
- package/dist/services/ProjectDetectionService.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 +12 -0
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +1 -0
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +12 -1
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts +3 -3
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +41 -25
- package/dist/services/WorktreeManager.js.map +1 -1
- package/dist/services/createAgentVariantsOrchestrator.d.ts.map +1 -1
- package/dist/services/createAgentVariantsOrchestrator.js +4 -1
- package/dist/services/createAgentVariantsOrchestrator.js.map +1 -1
- package/dist/utils/devServerCommand.d.ts +10 -0
- package/dist/utils/devServerCommand.d.ts.map +1 -1
- package/dist/utils/devServerCommand.js +37 -1
- package/dist/utils/devServerCommand.js.map +1 -1
- package/dist/utils/devServerError.d.ts +2 -1
- package/dist/utils/devServerError.d.ts.map +1 -1
- package/dist/utils/devServerError.js +12 -0
- package/dist/utils/devServerError.js.map +1 -1
- package/dist/utils/loginShellPath.d.ts +2 -2
- package/dist/utils/loginShellPath.d.ts.map +1 -1
- package/dist/utils/loginShellPath.js +18 -12
- package/dist/utils/loginShellPath.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +1 -1
- package/dist/utils/skills/claude-skill.d.ts.map +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 +4 -2
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/main-BfVGaiD6.js +422 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-CgF_gMPR.js +0 -422
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
var AO=Object.defineProperty;var eE=t=>{throw TypeError(t)};var IO=(t,e,n)=>e in t?AO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Do=(t,e,n)=>IO(t,typeof e!="symbol"?e+"":e,n),hv=(t,e,n)=>e.has(t)||eE("Cannot "+n);var U=(t,e,n)=>(hv(t,e,"read from private field"),n?n.call(t):e.get(t)),ze=(t,e,n)=>e.has(t)?eE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Re=(t,e,n,r)=>(hv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ut=(t,e,n)=>(hv(t,e,"access private method"),n);var zh=(t,e,n,r)=>({set _(s){Re(t,e,s,n)},get _(){return U(t,e,r)}});function MO(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 n0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pv={exports:{}},qc={},mv={exports:{}},ot={};/**
|
|
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 tE;function OO(){if(tE)return ot;tE=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"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function w(j,X,te){this.props=j,this.context=X,this.refs=y,this.updater=te||_}w.prototype.isReactComponent={},w.prototype.setState=function(j,X){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,X,"setState")},w.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function E(){}E.prototype=w.prototype;function P(j,X,te){this.props=j,this.context=X,this.refs=y,this.updater=te||_}var T=P.prototype=new E;T.constructor=P,x(T,w.prototype),T.isPureReactComponent=!0;var k=Array.isArray,R=Object.prototype.hasOwnProperty,L={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function A(j,X,te){var ie,ae={},ue=null,Se=null;if(X!=null)for(ie in X.ref!==void 0&&(Se=X.ref),X.key!==void 0&&(ue=""+X.key),X)R.call(X,ie)&&!O.hasOwnProperty(ie)&&(ae[ie]=X[ie]);var oe=arguments.length-2;if(oe===1)ae.children=te;else if(1<oe){for(var se=Array(oe),ye=0;ye<oe;ye++)se[ye]=arguments[ye+2];ae.children=se}if(j&&j.defaultProps)for(ie in oe=j.defaultProps,oe)ae[ie]===void 0&&(ae[ie]=oe[ie]);return{$$typeof:t,type:j,key:ue,ref:Se,props:ae,_owner:L.current}}function M(j,X){return{$$typeof:t,type:j.type,key:X,ref:j.ref,props:j.props,_owner:j._owner}}function D(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function F(j){var X={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(te){return X[te]})}var N=/\/+/g;function W(j,X){return typeof j=="object"&&j!==null&&j.key!=null?F(""+j.key):X.toString(36)}function Y(j,X,te,ie,ae){var ue=typeof j;(ue==="undefined"||ue==="boolean")&&(j=null);var Se=!1;if(j===null)Se=!0;else switch(ue){case"string":case"number":Se=!0;break;case"object":switch(j.$$typeof){case t:case e:Se=!0}}if(Se)return Se=j,ae=ae(Se),j=ie===""?"."+W(Se,0):ie,k(ae)?(te="",j!=null&&(te=j.replace(N,"$&/")+"/"),Y(ae,X,te,"",function(ye){return ye})):ae!=null&&(D(ae)&&(ae=M(ae,te+(!ae.key||Se&&Se.key===ae.key?"":(""+ae.key).replace(N,"$&/")+"/")+j)),X.push(ae)),1;if(Se=0,ie=ie===""?".":ie+":",k(j))for(var oe=0;oe<j.length;oe++){ue=j[oe];var se=ie+W(ue,oe);Se+=Y(ue,X,te,se,ae)}else if(se=m(j),typeof se=="function")for(j=se.call(j),oe=0;!(ue=j.next()).done;)ue=ue.value,se=ie+W(ue,oe++),Se+=Y(ue,X,te,se,ae);else if(ue==="object")throw X=String(j),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return Se}function q(j,X,te){if(j==null)return j;var ie=[],ae=0;return Y(j,ie,"","",function(ue){return X.call(te,ue,ae++)}),ie}function B(j){if(j._status===-1){var X=j._result;X=X(),X.then(function(te){(j._status===0||j._status===-1)&&(j._status=1,j._result=te)},function(te){(j._status===0||j._status===-1)&&(j._status=2,j._result=te)}),j._status===-1&&(j._status=0,j._result=X)}if(j._status===1)return j._result.default;throw j._result}var K={current:null},$={transition:null},J={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:$,ReactCurrentOwner:L};function H(){throw Error("act(...) is not supported in production builds of React.")}return ot.Children={map:q,forEach:function(j,X,te){q(j,function(){X.apply(this,arguments)},te)},count:function(j){var X=0;return q(j,function(){X++}),X},toArray:function(j){return q(j,function(X){return X})||[]},only:function(j){if(!D(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},ot.Component=w,ot.Fragment=n,ot.Profiler=s,ot.PureComponent=P,ot.StrictMode=r,ot.Suspense=c,ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,ot.act=H,ot.cloneElement=function(j,X,te){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var ie=x({},j.props),ae=j.key,ue=j.ref,Se=j._owner;if(X!=null){if(X.ref!==void 0&&(ue=X.ref,Se=L.current),X.key!==void 0&&(ae=""+X.key),j.type&&j.type.defaultProps)var oe=j.type.defaultProps;for(se in X)R.call(X,se)&&!O.hasOwnProperty(se)&&(ie[se]=X[se]===void 0&&oe!==void 0?oe[se]:X[se])}var se=arguments.length-2;if(se===1)ie.children=te;else if(1<se){oe=Array(se);for(var ye=0;ye<se;ye++)oe[ye]=arguments[ye+2];ie.children=oe}return{$$typeof:t,type:j.type,key:ae,ref:ue,props:ie,_owner:Se}},ot.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:i,_context:j},j.Consumer=j},ot.createElement=A,ot.createFactory=function(j){var X=A.bind(null,j);return X.type=j,X},ot.createRef=function(){return{current:null}},ot.forwardRef=function(j){return{$$typeof:u,render:j}},ot.isValidElement=D,ot.lazy=function(j){return{$$typeof:h,_payload:{_status:-1,_result:j},_init:B}},ot.memo=function(j,X){return{$$typeof:d,type:j,compare:X===void 0?null:X}},ot.startTransition=function(j){var X=$.transition;$.transition={};try{j()}finally{$.transition=X}},ot.unstable_act=H,ot.useCallback=function(j,X){return K.current.useCallback(j,X)},ot.useContext=function(j){return K.current.useContext(j)},ot.useDebugValue=function(){},ot.useDeferredValue=function(j){return K.current.useDeferredValue(j)},ot.useEffect=function(j,X){return K.current.useEffect(j,X)},ot.useId=function(){return K.current.useId()},ot.useImperativeHandle=function(j,X,te){return K.current.useImperativeHandle(j,X,te)},ot.useInsertionEffect=function(j,X){return K.current.useInsertionEffect(j,X)},ot.useLayoutEffect=function(j,X){return K.current.useLayoutEffect(j,X)},ot.useMemo=function(j,X){return K.current.useMemo(j,X)},ot.useReducer=function(j,X,te){return K.current.useReducer(j,X,te)},ot.useRef=function(j){return K.current.useRef(j)},ot.useState=function(j){return K.current.useState(j)},ot.useSyncExternalStore=function(j,X,te){return K.current.useSyncExternalStore(j,X,te)},ot.useTransition=function(){return K.current.useTransition()},ot.version="18.3.1",ot}var nE;function m2(){return nE||(nE=1,mv.exports=OO()),mv.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 rE;function LO(){if(rE)return qc;rE=1;var t=m2(),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,d){var h,p={},m=null,_=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(_=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:m,ref:_,props:p,_owner:s.current}}return qc.Fragment=n,qc.jsx=a,qc.jsxs=a,qc}var sE;function DO(){return sE||(sE=1,pv.exports=LO()),pv.exports}var S=DO(),g=m2();const ve=n0(g),wf=MO({__proto__:null,default:ve},[g]);var bf=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(){}},al,Vo,Du,A8,NO=(A8=class extends bf{constructor(){super();ze(this,al);ze(this,Vo);ze(this,Du);Re(this,Du,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Vo)||this.setEventListener(U(this,Du))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Vo))==null||e.call(this),Re(this,Vo,void 0))}setEventListener(e){var n;Re(this,Du,e),(n=U(this,Vo))==null||n.call(this),Re(this,Vo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){U(this,al)!==e&&(Re(this,al,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof U(this,al)=="boolean"?U(this,al):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},al=new WeakMap,Vo=new WeakMap,Du=new WeakMap,A8),g2=new NO,jO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},$o,p2,I8,FO=(I8=class{constructor(){ze(this,$o,jO);ze(this,p2,!1)}setTimeoutProvider(t){Re(this,$o,t)}setTimeout(t,e){return U(this,$o).setTimeout(t,e)}clearTimeout(t){U(this,$o).clearTimeout(t)}setInterval(t,e){return U(this,$o).setInterval(t,e)}clearInterval(t){U(this,$o).clearInterval(t)}},$o=new WeakMap,p2=new WeakMap,I8),nl=new FO;function VO(t){setTimeout(t,0)}var $O=typeof window>"u"||"Deno"in globalThis;function Tr(){}function HO(t,e){return typeof t=="function"?t(e):t}function G1(t){return typeof t=="number"&&t>=0&&t!==1/0}function $8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Qo(t,e){return typeof t=="function"?t(e):t}function Kr(t,e){return typeof t=="function"?t(e):t}function iE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==v2(a,e.options))return!1}else if(!Zu(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 oE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(jd(e.options.mutationKey)!==jd(i))return!1}else if(!Zu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function v2(t,e){return((e==null?void 0:e.queryKeyHashFn)||jd)(t)}function jd(t){return JSON.stringify(t,(e,n)=>Z1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){for(let r=0;r<e.length;r++)if(!Zu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Zu(t[r],e[r]))return!1;return!0}return!1}var zO=Object.prototype.hasOwnProperty;function H8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=aE(t)&&aE(e);if(!r&&!(Z1(t)&&Z1(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 d=0;for(let h=0;h<u;h++){const p=r?h:a[h],m=t[p],_=e[p];if(m===_){c[p]=m,(r?h<i:zO.call(t,p))&&d++;continue}if(m===null||_===null||typeof m!="object"||typeof _!="object"){c[p]=_;continue}const x=H8(m,_,n+1);c[p]=x,x===m&&d++}return i===u&&d===i?t:c}function K1(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 aE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Z1(t){if(!lE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!lE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function lE(t){return Object.prototype.toString.call(t)==="[object Object]"}function UO(t){return new Promise(e=>{nl.setTimeout(e,t)})}function q1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?H8(t,e):e}function BO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function WO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var y2=Symbol();function z8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===y2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function U8(t,e){return typeof t=="function"?t(...e):!!t}function GO(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 Fd=(()=>{let t=()=>$O;return{isServer(){return t()},setIsServer(e){t=e}}})();function Y1(){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 KO=VO;function ZO(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=KO;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 Hn=ZO(),Nu,Ho,ju,M8,qO=(M8=class extends bf{constructor(){super();ze(this,Nu,!0);ze(this,Ho);ze(this,ju);Re(this,ju,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(){U(this,Ho)||this.setEventListener(U(this,ju))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Ho))==null||e.call(this),Re(this,Ho,void 0))}setEventListener(e){var n;Re(this,ju,e),(n=U(this,Ho))==null||n.call(this),Re(this,Ho,e(this.setOnline.bind(this)))}setOnline(e){U(this,Nu)!==e&&(Re(this,Nu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return U(this,Nu)}},Nu=new WeakMap,Ho=new WeakMap,ju=new WeakMap,M8),Jp=new qO;function YO(t){return Math.min(1e3*2**t,3e4)}function B8(t){return(t??"online")==="online"?Jp.isOnline():!0}var X1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function W8(t){let e=!1,n=0,r;const s=Y1(),i=()=>s.status!=="pending",a=y=>{var w;if(!i()){const E=new X1(y);m(E),(w=t.onCancel)==null||w.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},d=()=>g2.isFocused()&&(t.networkMode==="always"||Jp.isOnline())&&t.canRun(),h=()=>B8(t.networkMode)&&t.canRun(),p=y=>{i()||(r==null||r(),s.resolve(y))},m=y=>{i()||(r==null||r(),s.reject(y))},_=()=>new Promise(y=>{var w;r=E=>{(i()||d())&&y(E)},(w=t.onPause)==null||w.call(t)}).then(()=>{var y;r=void 0,i()||(y=t.onContinue)==null||y.call(t)}),x=()=>{if(i())return;let y;const w=n===0?t.initialPromise:void 0;try{y=w??t.fn()}catch(E){y=Promise.reject(E)}Promise.resolve(y).then(p).catch(E=>{var L;if(i())return;const P=t.retry??(Fd.isServer()?0:3),T=t.retryDelay??YO,k=typeof T=="function"?T(n,E):T,R=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,E);if(e||!R){m(E);return}n++,(L=t.onFail)==null||L.call(t,n,E),UO(k).then(()=>d()?void 0:_()).then(()=>{e?m(E):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?x():_().then(x),s)}}var ll,O8,G8=(O8=class{constructor(){ze(this,ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),G1(this.gcTime)&&Re(this,ll,nl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Fd.isServer()?1/0:300*1e3))}clearGcTimeout(){U(this,ll)!==void 0&&(nl.clearTimeout(U(this,ll)),Re(this,ll,void 0))}},ll=new WeakMap,O8);function XO(t){return{onFetch:(e,n)=>{var h,p,m,_,x;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((_=e.state.data)==null?void 0:_.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let y=!1;const w=T=>{GO(T,()=>e.signal,()=>y=!0)},E=z8(e.options,e.fetchOptions),P=async(T,k,R)=>{if(y)return Promise.reject(e.signal.reason);if(k==null&&T.pages.length)return Promise.resolve(T);const O=(()=>{const F={client:e.client,queryKey:e.queryKey,pageParam:k,direction:R?"backward":"forward",meta:e.options.meta};return w(F),F})(),A=await E(O),{maxPages:M}=e.options,D=R?WO:BO;return{pages:D(T.pages,A,M),pageParams:D(T.pageParams,k,M)}};if(s&&i.length){const T=s==="backward",k=T?QO:uE,R={pages:i,pageParams:a},L=k(r,R);u=await P(R,L,T)}else{const T=t??i.length;do{const k=c===0?a[0]??r.initialPageParam:uE(r,u);if(c>0&&k==null)break;u=await P(u,k),c++}while(c<T)}return u};e.options.persister?e.fetchFn=()=>{var y,w;return(w=(y=e.options).persister)==null?void 0:w.call(y,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function uE(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 QO(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 Fu,ul,Vu,ys,cl,Rn,gf,dl,Wr,K8,$i,L8,JO=(L8=class extends G8{constructor(e){super();ze(this,Wr);ze(this,Fu);ze(this,ul);ze(this,Vu);ze(this,ys);ze(this,cl);ze(this,Rn);ze(this,gf);ze(this,dl);Re(this,dl,!1),Re(this,gf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Re(this,cl,e.client),Re(this,ys,U(this,cl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Re(this,ul,dE(this.options)),this.state=e.state??U(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return U(this,Fu)}get promise(){var e;return(e=U(this,Rn))==null?void 0:e.promise}setOptions(e){if(this.options={...U(this,gf),...e},e!=null&&e._type&&Re(this,Fu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=dE(this.options);n.data!==void 0&&(this.setState(cE(n.data,n.dataUpdatedAt)),Re(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,ys).remove(this)}setData(e,n){const r=q1(this.state.data,e,this.options);return ut(this,Wr,$i).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ut(this,Wr,$i).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=U(this,Rn))==null?void 0:r.promise;return(s=U(this,Rn))==null||s.cancel(e),n?n.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Kr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===y2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qo(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:!$8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=U(this,Rn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=U(this,Rn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),U(this,ys).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(U(this,Rn)&&(U(this,dl)||ut(this,Wr,K8).call(this)?U(this,Rn).cancel({revert:!0}):U(this,Rn).cancelRetry()),this.scheduleGc()),U(this,ys).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,Wr,$i).call(this,{type:"invalidate"})}async fetch(e,n){var d,h,p,m,_,x,y,w,E,P,T;if(this.state.fetchStatus!=="idle"&&((d=U(this,Rn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Rn))return U(this,Rn).continueRetry(),U(this,Rn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(R=>R.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Re(this,dl,!0),r.signal)})},i=()=>{const k=z8(this.options,n),L=(()=>{const O={client:U(this,cl),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return Re(this,dl,!1),this.options.persister?this.options.persister(k,L,this):k(L)},u=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,cl),state:this.state,fetchFn:i};return s(k),k})(),c=U(this,Fu)==="infinite"?XO(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),Re(this,Vu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ut(this,Wr,$i).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Re(this,Rn,W8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:k=>{k instanceof X1&&k.revert&&this.setState({...U(this,Vu),fetchStatus:"idle"}),r.abort()},onFail:(k,R)=>{ut(this,Wr,$i).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{ut(this,Wr,$i).call(this,{type:"pause"})},onContinue:()=>{ut(this,Wr,$i).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const k=await U(this,Rn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(_=(m=U(this,ys).config).onSuccess)==null||_.call(m,k,this),(y=(x=U(this,ys).config).onSettled)==null||y.call(x,k,this.state.error,this),k}catch(k){if(k instanceof X1){if(k.silent)return U(this,Rn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ut(this,Wr,$i).call(this,{type:"error",error:k}),(E=(w=U(this,ys).config).onError)==null||E.call(w,k,this),(T=(P=U(this,ys).config).onSettled)==null||T.call(P,this.state.data,k,this),k}finally{this.scheduleGc()}}},Fu=new WeakMap,ul=new WeakMap,Vu=new WeakMap,ys=new WeakMap,cl=new WeakMap,Rn=new WeakMap,gf=new WeakMap,dl=new WeakMap,Wr=new WeakSet,K8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$i=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,...Z8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...cE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Re(this,Vu,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),Hn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),U(this,ys).notify({query:this,type:"updated",action:e})})},L8);function Z8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:B8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function cE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dE(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 Cr,dt,vf,ar,fl,$u,qi,zo,yf,Hu,zu,hl,pl,Uo,Uu,yt,fd,Q1,J1,ey,ty,ny,ry,sy,q8,D8,eL=(D8=class extends bf{constructor(e,n){super();ze(this,yt);ze(this,Cr);ze(this,dt);ze(this,vf);ze(this,ar);ze(this,fl);ze(this,$u);ze(this,qi);ze(this,zo);ze(this,yf);ze(this,Hu);ze(this,zu);ze(this,hl);ze(this,pl);ze(this,Uo);ze(this,Uu,new Set);this.options=n,Re(this,Cr,e),Re(this,zo,null),Re(this,qi,Y1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,dt).addObserver(this),fE(U(this,dt),this.options)?ut(this,yt,fd).call(this):this.updateResult(),ut(this,yt,ty).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iy(U(this,dt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iy(U(this,dt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,yt,ny).call(this),ut(this,yt,ry).call(this),U(this,dt).removeObserver(this)}setOptions(e){const n=this.options,r=U(this,dt);if(this.options=U(this,Cr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Kr(this.options.enabled,U(this,dt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,yt,sy).call(this),U(this,dt).setOptions(this.options),n._defaulted&&!K1(this.options,n)&&U(this,Cr).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,dt),observer:this});const s=this.hasListeners();s&&hE(U(this,dt),r,this.options,n)&&ut(this,yt,fd).call(this),this.updateResult(),s&&(U(this,dt)!==r||Kr(this.options.enabled,U(this,dt))!==Kr(n.enabled,U(this,dt))||Qo(this.options.staleTime,U(this,dt))!==Qo(n.staleTime,U(this,dt)))&&ut(this,yt,Q1).call(this);const i=ut(this,yt,J1).call(this);s&&(U(this,dt)!==r||Kr(this.options.enabled,U(this,dt))!==Kr(n.enabled,U(this,dt))||i!==U(this,Uo))&&ut(this,yt,ey).call(this,i)}getOptimisticResult(e){const n=U(this,Cr).getQueryCache().build(U(this,Cr),e),r=this.createResult(n,e);return nL(this,r)&&(Re(this,ar,r),Re(this,$u,this.options),Re(this,fl,U(this,dt).state)),r}getCurrentResult(){return U(this,ar)}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&&U(this,qi).status==="pending"&&U(this,qi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){U(this,Uu).add(e)}getCurrentQuery(){return U(this,dt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=U(this,Cr).defaultQueryOptions(e),r=U(this,Cr).getQueryCache().build(U(this,Cr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ut(this,yt,fd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,ar)))}createResult(e,n){var M;const r=U(this,dt),s=this.options,i=U(this,ar),a=U(this,fl),u=U(this,$u),d=e!==r?e.state:U(this,vf),{state:h}=e;let p={...h},m=!1,_;if(n._optimisticResults){const D=this.hasListeners(),F=!D&&fE(e,n),N=D&&hE(e,r,n,s);(F||N)&&(p={...p,...Z8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:w}=p;_=p.data;let E=!1;if(n.placeholderData!==void 0&&_===void 0&&w==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(D=i.data,E=!0):D=typeof n.placeholderData=="function"?n.placeholderData((M=U(this,zu))==null?void 0:M.state.data,U(this,zu)):n.placeholderData,D!==void 0&&(w="success",_=q1(i==null?void 0:i.data,D,n),m=!0)}if(n.select&&_!==void 0&&!E)if(i&&_===(a==null?void 0:a.data)&&n.select===U(this,yf))_=U(this,Hu);else try{Re(this,yf,n.select),_=n.select(_),_=q1(i==null?void 0:i.data,_,n),Re(this,Hu,_),Re(this,zo,null)}catch(D){Re(this,zo,D)}U(this,zo)&&(x=U(this,zo),_=U(this,Hu),y=Date.now(),w="error");const P=p.fetchStatus==="fetching",T=w==="pending",k=w==="error",R=T&&P,L=_!==void 0,A={status:w,fetchStatus:p.fetchStatus,isPending:T,isSuccess:w==="success",isError:k,isInitialLoading:R,isLoading:R,data:_,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:P,isRefetching:P&&!T,isLoadingError:k&&!L,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&L,isStale:_2(e,n),refetch:this.refetch,promise:U(this,qi),isEnabled:Kr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=A.data!==void 0,F=A.status==="error"&&!D,N=q=>{F?q.reject(A.error):D&&q.resolve(A.data)},W=()=>{const q=Re(this,qi,A.promise=Y1());N(q)},Y=U(this,qi);switch(Y.status){case"pending":e.queryHash===r.queryHash&&N(Y);break;case"fulfilled":(F||A.data!==Y.value)&&W();break;case"rejected":(!F||A.error!==Y.reason)&&W();break}}return A}updateResult(){const e=U(this,ar),n=this.createResult(U(this,dt),this.options);if(Re(this,fl,U(this,dt).state),Re(this,$u,this.options),U(this,fl).data!==void 0&&Re(this,zu,U(this,dt)),K1(n,e))return;Re(this,ar,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!U(this,Uu).size)return!0;const a=new Set(i??U(this,Uu));return this.options.throwOnError&&a.add("error"),Object.keys(U(this,ar)).some(u=>{const c=u;return U(this,ar)[c]!==e[c]&&a.has(c)})};ut(this,yt,q8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,yt,ty).call(this)}},Cr=new WeakMap,dt=new WeakMap,vf=new WeakMap,ar=new WeakMap,fl=new WeakMap,$u=new WeakMap,qi=new WeakMap,zo=new WeakMap,yf=new WeakMap,Hu=new WeakMap,zu=new WeakMap,hl=new WeakMap,pl=new WeakMap,Uo=new WeakMap,Uu=new WeakMap,yt=new WeakSet,fd=function(e){ut(this,yt,sy).call(this);let n=U(this,dt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Tr)),n},Q1=function(){ut(this,yt,ny).call(this);const e=Qo(this.options.staleTime,U(this,dt));if(Fd.isServer()||U(this,ar).isStale||!G1(e))return;const r=$8(U(this,ar).dataUpdatedAt,e)+1;Re(this,hl,nl.setTimeout(()=>{U(this,ar).isStale||this.updateResult()},r))},J1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,dt)):this.options.refetchInterval)??!1},ey=function(e){ut(this,yt,ry).call(this),Re(this,Uo,e),!(Fd.isServer()||Kr(this.options.enabled,U(this,dt))===!1||!G1(U(this,Uo))||U(this,Uo)===0)&&Re(this,pl,nl.setInterval(()=>{(this.options.refetchIntervalInBackground||g2.isFocused())&&ut(this,yt,fd).call(this)},U(this,Uo)))},ty=function(){ut(this,yt,Q1).call(this),ut(this,yt,ey).call(this,ut(this,yt,J1).call(this))},ny=function(){U(this,hl)!==void 0&&(nl.clearTimeout(U(this,hl)),Re(this,hl,void 0))},ry=function(){U(this,pl)!==void 0&&(nl.clearInterval(U(this,pl)),Re(this,pl,void 0))},sy=function(){const e=U(this,Cr).getQueryCache().build(U(this,Cr),this.options);if(e===U(this,dt))return;const n=U(this,dt);Re(this,dt,e),Re(this,vf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},q8=function(e){Hn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(U(this,ar))}),U(this,Cr).getQueryCache().notify({query:U(this,dt),type:"observerResultsUpdated"})})},D8);function tL(t,e){return Kr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Kr(e.retryOnMount,t)===!1)}function fE(t,e){return tL(t,e)||t.state.data!==void 0&&iy(t,e,e.refetchOnMount)}function iy(t,e,n){if(Kr(e.enabled,t)!==!1&&Qo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&_2(t,e)}return!1}function hE(t,e,n,r){return(t!==e||Kr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&_2(t,n)}function _2(t,e){return Kr(e.enabled,t)!==!1&&t.isStaleByTime(Qo(e.staleTime,t))}function nL(t,e){return!K1(t.getCurrentResult(),e)}var _f,ai,Jn,ml,li,jo,N8,rL=(N8=class extends G8{constructor(e){super();ze(this,li);ze(this,_f);ze(this,ai);ze(this,Jn);ze(this,ml);Re(this,_f,e.client),this.mutationId=e.mutationId,Re(this,Jn,e.mutationCache),Re(this,ai,[]),this.state=e.state||sL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){U(this,ai).includes(e)||(U(this,ai).push(e),this.clearGcTimeout(),U(this,Jn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Re(this,ai,U(this,ai).filter(n=>n!==e)),this.scheduleGc(),U(this,Jn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){U(this,ai).length||(this.state.status==="pending"?this.scheduleGc():U(this,Jn).remove(this))}continue(){var e;return((e=U(this,ml))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,d,h,p,m,_,x,y,w,E,P,T,k,R,L,O;const n=()=>{ut(this,li,jo).call(this,{type:"continue"})},r={client:U(this,_f),meta:this.options.meta,mutationKey:this.options.mutationKey};Re(this,ml,W8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,M)=>{ut(this,li,jo).call(this,{type:"failed",failureCount:A,error:M})},onPause:()=>{ut(this,li,jo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Jn).canRun(this)}));const s=this.state.status==="pending",i=!U(this,ml).canStart();try{if(s)n();else{ut(this,li,jo).call(this,{type:"pending",variables:e,isPaused:i}),U(this,Jn).config.onMutate&&await U(this,Jn).config.onMutate(e,this,r);const M=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));M!==this.state.context&&ut(this,li,jo).call(this,{type:"pending",context:M,variables:e,isPaused:i})}const A=await U(this,ml).start();return await((d=(c=U(this,Jn).config).onSuccess)==null?void 0:d.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((_=(m=U(this,Jn).config).onSettled)==null?void 0:_.call(m,A,null,this.state.variables,this.state.context,this,r)),await((y=(x=this.options).onSettled)==null?void 0:y.call(x,A,null,e,this.state.context,r)),ut(this,li,jo).call(this,{type:"success",data:A}),A}catch(A){try{await((E=(w=U(this,Jn).config).onError)==null?void 0:E.call(w,A,e,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((T=(P=this.options).onError)==null?void 0:T.call(P,A,e,this.state.context,r))}catch(M){Promise.reject(M)}try{await((R=(k=U(this,Jn).config).onSettled)==null?void 0:R.call(k,void 0,A,this.state.variables,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((O=(L=this.options).onSettled)==null?void 0:O.call(L,void 0,A,e,this.state.context,r))}catch(M){Promise.reject(M)}throw ut(this,li,jo).call(this,{type:"error",error:A}),A}finally{U(this,Jn).runNext(this)}}},_f=new WeakMap,ai=new WeakMap,Jn=new WeakMap,ml=new WeakMap,li=new WeakSet,jo=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),Hn.batch(()=>{U(this,ai).forEach(r=>{r.onMutationUpdate(e)}),U(this,Jn).notify({mutation:this,type:"updated",action:e})})},N8);function sL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yi,zs,xf,j8,iL=(j8=class extends bf{constructor(e={}){super();ze(this,Yi);ze(this,zs);ze(this,xf);this.config=e,Re(this,Yi,new Set),Re(this,zs,new Map),Re(this,xf,0)}build(e,n,r){const s=new rL({client:e,mutationCache:this,mutationId:++zh(this,xf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){U(this,Yi).add(e);const n=Uh(e);if(typeof n=="string"){const r=U(this,zs).get(n);r?r.push(e):U(this,zs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(U(this,Yi).delete(e)){const n=Uh(e);if(typeof n=="string"){const r=U(this,zs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&U(this,zs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Uh(e);if(typeof n=="string"){const r=U(this,zs).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=Uh(e);if(typeof n=="string"){const s=(r=U(this,zs).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(){Hn.batch(()=>{U(this,Yi).forEach(e=>{this.notify({type:"removed",mutation:e})}),U(this,Yi).clear(),U(this,zs).clear()})}getAll(){return Array.from(U(this,Yi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oE(n,r))}findAll(e={}){return this.getAll().filter(n=>oE(e,n))}notify(e){Hn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Hn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Tr))))}},Yi=new WeakMap,zs=new WeakMap,xf=new WeakMap,j8);function Uh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var ui,F8,oL=(F8=class extends bf{constructor(e={}){super();ze(this,ui);this.config=e,Re(this,ui,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??v2(s,n);let a=this.get(i);return a||(a=new JO({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){U(this,ui).has(e.queryHash)||(U(this,ui).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=U(this,ui).get(e.queryHash);n&&(e.destroy(),n===e&&U(this,ui).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Hn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return U(this,ui).get(e)}getAll(){return[...U(this,ui).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>iE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>iE(e,r)):n}notify(e){Hn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Hn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Hn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ui=new WeakMap,F8),Jt,Bo,Wo,Bu,Wu,Go,Gu,Ku,V8,aL=(V8=class{constructor(t={}){ze(this,Jt);ze(this,Bo);ze(this,Wo);ze(this,Bu);ze(this,Wu);ze(this,Go);ze(this,Gu);ze(this,Ku);Re(this,Jt,t.queryCache||new oL),Re(this,Bo,t.mutationCache||new iL),Re(this,Wo,t.defaultOptions||{}),Re(this,Bu,new Map),Re(this,Wu,new Map),Re(this,Go,0)}mount(){zh(this,Go)._++,U(this,Go)===1&&(Re(this,Gu,g2.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,Jt).onFocus())})),Re(this,Ku,Jp.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,Jt).onOnline())})))}unmount(){var t,e;zh(this,Go)._--,U(this,Go)===0&&((t=U(this,Gu))==null||t.call(this),Re(this,Gu,void 0),(e=U(this,Ku))==null||e.call(this),Re(this,Ku,void 0))}isFetching(t){return U(this,Jt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return U(this,Bo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,Jt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=U(this,Jt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Qo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return U(this,Jt).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=U(this,Jt).get(r.queryHash),i=s==null?void 0:s.state.data,a=HO(e,i);if(a!==void 0)return U(this,Jt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Hn.batch(()=>U(this,Jt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,Jt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=U(this,Jt);Hn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=U(this,Jt);return Hn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Hn.batch(()=>U(this,Jt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Tr).catch(Tr)}invalidateQueries(t,e={}){return Hn.batch(()=>(U(this,Jt).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=Hn.batch(()=>U(this,Jt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,Jt).build(this,e);return n.isStaleByTime(Qo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Tr).catch(Tr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Tr).catch(Tr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Jp.isOnline()?U(this,Bo).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Jt)}getMutationCache(){return U(this,Bo)}getDefaultOptions(){return U(this,Wo)}setDefaultOptions(t){Re(this,Wo,t)}setQueryDefaults(t,e){U(this,Bu).set(jd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...U(this,Bu).values()],n={};return e.forEach(r=>{Zu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){U(this,Wu).set(jd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...U(this,Wu).values()],n={};return e.forEach(r=>{Zu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...U(this,Wo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=v2(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===y2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...U(this,Wo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){U(this,Jt).clear(),U(this,Bo).clear()}},Jt=new WeakMap,Bo=new WeakMap,Wo=new WeakMap,Bu=new WeakMap,Wu=new WeakMap,Go=new WeakMap,Gu=new WeakMap,Ku=new WeakMap,V8),Y8=g.createContext(void 0),X8=t=>{const e=g.useContext(Y8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},lL=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(Y8.Provider,{value:t,children:e})),Q8=g.createContext(!1),uL=()=>g.useContext(Q8);Q8.Provider;function cL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var dL=g.createContext(cL()),fL=()=>g.useContext(dL),hL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?U8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},pL=t=>{g.useEffect(()=>{t.clearReset()},[t])},mL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||U8(n,[t.error,r])),gL=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))}},vL=(t,e)=>t.isLoading&&t.isFetching&&!e,yL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,pE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function _L(t,e,n){var _,x,y,w;const r=uL(),s=fL(),i=X8(),a=i.defaultQueryOptions(t);(x=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||x.call(_,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,gL(a),hL(a,s,u),pL(s);const d=!i.getQueryCache().get(a.queryHash),[h]=g.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&c;if(g.useSyncExternalStore(g.useCallback(E=>{const P=m?h.subscribe(Hn.batchCalls(E)):Tr;return h.updateResult(),P},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),g.useEffect(()=>{h.setOptions(a)},[a,h]),yL(a,p))throw pE(a,h,s);if(mL({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((w=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,a,p),a.experimental_prefetchInRender&&!Fd.isServer()&&vL(p,r)){const E=d?pE(a,h,s):u==null?void 0:u.promise;E==null||E.catch(Tr).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function oy(t,e){return _L(t,eL)}var ne=typeof window<"u"?window:void 0,tr=typeof globalThis<"u"?globalThis:ne,ur=tr==null?void 0:tr.navigator,Ce=tr==null?void 0:tr.document,on=tr==null?void 0:tr.location,x2=tr==null?void 0:tr.fetch,ay=tr!=null&&tr.XMLHttpRequest&&"withCredentials"in new tr.XMLHttpRequest?tr.XMLHttpRequest:void 0,mE=tr==null?void 0:tr.AbortController,xL=tr==null?void 0:tr.CompressionStream,kr=ur==null?void 0:ur.userAgent;function J8(){return!(!ne||ne.navigator.onLine===!1)}var Yc=typeof globalThis<"u"?globalThis:ne;Yc&&typeof self>"u"&&(Yc.self=Yc),Yc&&typeof File>"u"&&(Yc.File=function(){});var $e=ne??{},vt={DEBUG:!1,LIB_VERSION:"0.2.2",LIB_NAME:"browser-common"};function gE(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(d){return void n(d)}u.done?e(c):Promise.resolve(c).then(r,s)}function tn(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){gE(i,r,s,a,u,"next",c)}function u(c){gE(i,r,s,a,u,"throw",c)}a(void 0)}))}}function ce(){return ce=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},ce.apply(null,arguments)}function e6(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 vE=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function yE(t){return typeof t=="string"||t}function _E(t){return typeof t=="string"?t:void 0}var Xc,wL=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Bi=(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})({}),xE=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),bL=["$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"],SL=["token"],t6="NativeGzipValidationError",ly=t=>t.length>=2&&t[0]===31&&t[1]===139,wE=(t,e)=>t===xE.GZipJS||e===xE.GZipJS||e==="gzip",bE=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Bh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=t6,e},EL=(function(){var t=tn((function*(e,n){18>e.size&&Bh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());ly(r)&&r[2]===8||Bh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(Xc)return Xc;Xc=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;Xc[h]=p>>>0}return Xc})(),c=4294967295,d=0;a.length>d;d++)c=u[255&(c^a[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&Bh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Bh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function uy(){return uy=tn((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var d=tn((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return d.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield EL(c,r),c}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),uy.apply(this,arguments)}var CL=["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"],SE=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return CL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ze(t,e){return t.indexOf(e)!==-1}var r0=function(t){return t.trim()},cy=function(t){return t.replace(/^\$/,"")};function n6(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 r6=Object.prototype,s6=r6.hasOwnProperty,s0=r6.toString,nt=Array.isArray||function(t){return s0.call(t)==="[object Array]"},Us=t=>typeof t=="function",Nt=t=>t===Object(t)&&!nt(t),Ko=t=>{if(Nt(t)){for(var e in t)if(s6.call(t,e))return!1;return!0}return!1},ge=t=>t===void 0,wt=t=>s0.call(t)=="[object String]",dy=t=>wt(t)&&t.trim().length===0,hr=t=>t===null,rt=t=>ge(t)||hr(t),Un=t=>s0.call(t)=="[object Number]"&&t==t,Hi=t=>Un(t)&&t>0,Bs=t=>s0.call(t)==="[object Boolean]",kL=t=>t instanceof FormData,PL=t=>Ze(bL,t),TL=t=>Ze(SL,t);function i6(t){return t===null||typeof t!="object"}function em(t,e){return{}.toString.call(t)==="[object "+e+"]"}function w2(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var RL=[!0,"true",1,"1","yes"],gv=t=>Ze(RL,t),AL=[!1,"false",0,"0","no"];function hi(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Un(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),hi(s||n,e,n,r))}class IL{constructor(e){this.$e={},this.ze=e.ze,this.Ze=hi(e.bucketSize,0,100,e.Ge),this.Qe=hi(e.refillRate,0,this.Ze,e.Ge),this.Je=hi(e.refillInterval,0,864e5,e.Ge)}Ke(e,n){var r=Math.floor((n-e.lastAccess)/this.Je);r>0&&(e.tokens=Math.min(e.tokens+r*this.Qe,this.Ze),e.lastAccess=e.lastAccess+r*this.Je)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.$e[s];return i?this.Ke(i,r):this.$e[s]=i={tokens:this.Ze,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.ze)==null||n.call(this,e)),i.tokens===0)}stop(){this.$e={}}}var Jr="Mobile",tm="iOS",no="Android",qu="Tablet",o6=no+" "+qu,a6="iPad",l6="Apple",u6=l6+" Watch",wd="Safari",Yu="BlackBerry",c6="Samsung",d6=c6+"Browser",f6=c6+" Internet",gl="Chrome",ML=gl+" OS",h6=gl+" "+tm,b2="Internet Explorer",p6=b2+" "+Jr,S2="Opera",OL=S2+" Mini",E2="Edge",m6="Microsoft "+E2,ku="Firefox",g6=ku+" "+tm,Vd="Nintendo",$d="PlayStation",Pu="Xbox",v6=no+" "+Jr,y6=Jr+" "+wd,hd="Windows",fy=hd+" Phone",EE="Nokia",hy="Ouya",_6="Generic",LL=_6+" "+Jr.toLowerCase(),x6=_6+" "+qu.toLowerCase(),py="Konqueror",w6="Oculus Browser",nm="Vivaldi",b6="Yandex",rm="Whale",my="DuckDuckGo",S6="Pale Moon",sm="Waterfox",bd="Brave",E6="Google Search App",zt="(\\d+(\\.\\d+)?)",vv=new RegExp("Version/"+zt),DL=new RegExp(Pu,"i"),NL=new RegExp($d+" \\w+","i"),jL=new RegExp(Vd+" \\w+","i"),C2=new RegExp(Yu+"|PlayBook|BB10","i"),FL={"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"},C6=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?bd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ze(t,"GSA/")?E6:Ze(t," OPR/")&&Ze(t,"Mini")?OL:Ze(t," OPR/")?S2:C2.test(t)?Yu:Ze(t,"IE"+Jr)||Ze(t,"WPDesktop")?p6:Ze(t,"OculusBrowser")?w6:Ze(t,d6)?f6:Ze(t,E2)||Ze(t,"Edg/")?m6:Ze(t,nm+"/")?nm:Ze(t,"YaBrowser/")?b6:Ze(t,rm+"/")?rm:Ze(t,my+"/")||Ze(t,"Ddg/")?my:Ze(t,"FBIOS")?"Facebook "+Jr:Ze(t,"UCWEB")||Ze(t,"UCBrowser")?"UC Browser":Ze(t,"CriOS")?h6:Ze(t,"CrMo")||Ze(t,gl)?gl:Ze(t,no)&&Ze(t,wd)?v6:Ze(t,"FxiOS")?g6:Ze(t.toLowerCase(),py.toLowerCase())?py:Ze(t,bd+"/")?bd:((i,a)=>a&&Ze(a,l6)||(function(u){return Ze(u,wd)&&!Ze(u,gl)&&!Ze(u,no)})(i))(t,e)?Ze(t,Jr)?y6:wd:Ze(t,"PaleMoon/")?S6:Ze(t,sm+"/")?sm:Ze(t,ku)?ku:Ze(t,"MSIE")||Ze(t,"Trident/")?b2:Ze(t,"Gecko")?ku:"")},VL={[p6]:[new RegExp("rv:"+zt)],[m6]:[new RegExp(E2+"?\\/"+zt)],[gl]:[new RegExp("("+gl+"|CrMo)\\/"+zt)],[h6]:[new RegExp("CriOS\\/"+zt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+zt)],[wd]:[vv],[y6]:[vv],[S2]:[new RegExp("(Opera|OPR)\\/"+zt)],[ku]:[new RegExp(ku+"\\/"+zt)],[g6]:[new RegExp("FxiOS\\/"+zt)],[py]:[new RegExp("Konqueror[:/]?"+zt,"i")],[Yu]:[new RegExp(Yu+" "+zt),vv],[v6]:[new RegExp("android\\s"+zt,"i")],[f6]:[new RegExp(d6+"\\/"+zt)],[w6]:[new RegExp("OculusBrowser\\/"+zt)],[nm]:[new RegExp(nm+"\\/"+zt)],[b6]:[new RegExp("YaBrowser\\/"+zt)],[rm]:[new RegExp(rm+"\\/"+zt)],[bd]:[new RegExp(bd+"\\/"+zt)],[my]:[new RegExp("(DuckDuckGo|Ddg)\\/"+zt)],[S6]:[new RegExp("PaleMoon\\/"+zt)],[sm]:[new RegExp(sm+"\\/"+zt)],[E6]:[new RegExp("GSA\\/"+zt)],[b2]:[new RegExp("(rv:|MSIE )"+zt)],Mozilla:[new RegExp("rv:"+zt)]},$L=function(t,e,n,r){var s=C6(t,e,n,r),i=VL[s];if(ge(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},CE=[[new RegExp(Pu+"; "+Pu+" (.*?)[);]","i"),t=>[Pu,t&&t[1]||""]],[new RegExp(Vd,"i"),[Vd,""]],[new RegExp($d,"i"),[$d,""]],[C2,[Yu,""]],[new RegExp(hd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[fy,""];if(new RegExp(Jr).test(e)&&!/IEMobile\b/.test(e))return[hd+" "+Jr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=FL[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[hd,r]}return[hd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[tm,[t[3],t[4],t[5]||"0"].join(".")]:[tm,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ge(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+no+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+no+")","i"),t=>t&&t[2]?[no,[t[2],t[3],t[4]||"0"].join(".")]:[no,""]],[/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/,[ML,""]],[/Linux|debian/i,["Linux",""]]],kE=function(t){return jL.test(t)?Vd:NL.test(t)?$d:DL.test(t)?Pu:new RegExp(hy,"i").test(t)?hy:new RegExp("("+fy+"|WPDesktop)","i").test(t)?fy:/iPad/.test(t)?a6:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?u6:C2.test(t)?Yu:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(EE,"i").test(t)?EE:/(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(Jr).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)?no:o6:new RegExp("(pda|"+Jr+")","i").test(t)?LL:new RegExp(qu,"i").test(t)&&!new RegExp(qu+" pc","i").test(t)?x6:""},HL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function PE(t,e){return typeof(n=t)=="string"&&HL.test(n)?t:e();var n}function ra(t){return t&&t.split("#")[0]}function Sp(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var zL=t=>t instanceof Error,k6={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}},UL=k6.info;function P6(t){if(Bs(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(nt(t))return{arrayValue:{values:t.map((e=>P6(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function im(t){var e=[];for(var n in t){var r=t[n];hr(r)||ge(r)||e.push({key:n,value:P6(r)})}return e}function BL(t,e){var n=k6[t.level||"info"]||UL,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),rt(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),rt(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=ce({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:im(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),ge(t.trace_flags)||(c.flags=t.trace_flags),c}function T6(t,e,n){return ce({},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 R6(t,e,n,r){return{resourceLogs:[{resource:{attributes:im(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let WL=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Te=e,this.Ge=n,this.Ye=r,this.Xe=s,this.et=i,this.tt=a,this.rt=null,this.it=0,this.nt=0,this.st=0,this.ot=0,this.ut=!1,this.ht=e.maxBufferSize,this.dt=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.ct=e.flushIntervalMs,this.vt=e.maxBatchRecordsPerPost,this.ft=e.rateCapWindowMs,this.yt=e.maxLogsPerInterval}reset(){this.bt(),this.rt=null,this.st=0,this.ot=0,this.ut=!1,this.it=0,this.nt=0,this.vt=this.Te.maxBatchRecordsPerPost}onReconnect(){this.nt=0,this._t()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.wt(t);if(e!==null)if(e.body){if(this.xt()){var n={record:BL(e,this.Ye())};this.Xe((()=>this.kt(n)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=nt(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for log:",a),null}return r}xt(){if(this.yt===void 0)return!0;var t=Date.now(),e=t-this.st;return this.ft>e&&e>=0||(this.st=t,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var t=this;return tn((function*(){if(!t._instance.isDisabled)return t.rt||(t.rt=t.St().finally((()=>{t.rt=null}))),t.rt}))()}St(){var t=this;return tn((function*(){var e;t.bt();var n=(e=t._instance.getPersistedProperty(Bi.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.it=0;var u=Math.min(n.length,t.vt),c=n.slice(0,u),d=R6(c.map((p=>p.record)),t.Ct(),(i=t.tt)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.Tt(d);if(h.kind==="too-large"&&c.length>1)t.vt=Math.max(1,Math.floor(c.length/2)),t.Ge.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.vt);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.Ge.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.Te.maxBatchRecordsPerPost>t.vt&&(t.vt=Math.min(t.Te.maxBatchRecordsPerPost,t.vt+1)),yield t.It(c.length),n=(a=t._instance.getPersistedProperty(Bi.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}It(t){var e=this;return tn((function*(){var n,r=Math.max(0,t-e.it),s=(n=e._instance.getPersistedProperty(Bi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Bi.LogsQueue,s.slice(r)),yield e.et()}))()}Ct(){return T6(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Bi.LogsQueue))!==null&&e!==void 0?e:[];this.dt>n.length||(n.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Bi.LogsQueue,n),this.ht>n.length?this.Mt():this._t()}}Mt(t){t===void 0&&(t=this.ct),this.Et||(this.Et=Sp((()=>{this.Et=void 0,this._t()}),t))}Rt(){var t=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,t)}Pt(){var t=this._instance.getPersistedProperty(Bi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return tn((function*(){e.bt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>Sp(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return tn((function*(){var n=!1,r=e.flush(),s=new Promise((i=>Sp((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(t=>{this.nt++,this.Ge.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Pt()&&this.Mt(this.Rt())}))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var yv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function TE(t){return String(t)+"000000"}function RE(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 GL=class{constructor(t,e,n){this._instance=t,this.Te=e,this.Ge=n,this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.At=0}count(t,e,n){e===void 0&&(e=1),this.Nt({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.Nt({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.Nt({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.rt,n=(function(){var s=tn((function*(){e&&(yield e.catch((()=>{}))),yield t.Dt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.rt===r&&(this.rt=null)}));return this.rt=r,r}drainWindow(){if(this.Ot.size===0)return null;var t=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(t)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.wt(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.Ge.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?ce({},e.attributes):void 0,r=RE(e.type,e.name,e.unit,n)}catch(a){return void this.Ge.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ot.get(r);if(!s){if(!this.jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ot.set(r,s)}var i=this.Lt.get(e.name);i===void 0?this.Lt.set(e.name,e.type):i===e.type||this.$t.has(e.name)||(this.$t.add(e.name),this.Ge.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,e.value),this.Mt()}else this.Ge.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(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(yv.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,yv)]+=1}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=nt(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for metric:",a),null}return r}Mt(){this.Et||(this.Et=Sp((()=>{this.Et=void 0,this.flush().catch((t=>{this.Ge.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var t=this;return tn((function*(){if(t.Ot.size!==0){var e=t.Ot;t.Ot=new Map,t.Ft=!1,t.Lt=new Map,t.$t=new Set;var n=t.At,r=yield t._instance.Bt(t.qt(e));if(n===t.At)switch(r.kind){case"ok":return;case"retry-later":return t.Ut(e),void t.Mt();case"too-large":return void t.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ge.error("Failed to send metrics batch:",r.error)}}}))()}qt(t){return e=this.zt(t),n=(function(i,a,u){return ce({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":u})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:im(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}zt(t){var e=TE(Date.now()),n=new Map;for(var r of t.values()){var s,i=RE(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=ce({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=im((s=r.attributes)!==null&&s!==void 0?s:{}),c=TE(r.windowStartMs);if(r.type==="count"){var d,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(m)}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:yv})}return Array.from(n.values())}Ut(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.Ot.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.jt()&&this.Ot.set(s,i)}}};var Wh,AE,_v;function KL(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return _v&&n.length===AE||(AE=n.length,_v=n.reduce(((r,s)=>{Wh||(Wh={});var i=Wh[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],d=c==null?void 0:c.filename,h=e[s];if(d&&h){r[d]=h,Wh[s]=[d,h];break}}return r}),{})),_v}}class ZL{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 tn((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&nt(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)),ce({},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 tn((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,ce({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:KL(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 ce({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Xu="?";function gy(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Xu:n,in_app:!0};return ge(r)||(i.lineno=r),ge(s)||(i.colno=s),i}var A6=(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]:Xu,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},qL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,YL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,XL=/\((\S*)(?::(\d+))(?::(\d+))\)/,QL=(t,e)=>{var n=qL.exec(t);if(n)return gy(e,n[1],Xu,+n[2],+n[3]);var r=YL.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=XL.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=A6(r[1]||Xu,r[2]);return gy(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},JL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,eD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tD=(t,e)=>{var n=JL.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=eD.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]||Xu,a=A6(i,s);return gy(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},IE=/\(error: (.*)\)/;class nD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=wt(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 em(e,"DOMException")}isDOMError(e){return em(e,"DOMError")}}class rD{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 sD{constructor(){}match(e){return em(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 iD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class oD{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(iD);return s&&(n=s[1],r=s[2]),[n,r]}}var aD=["fatal","error","warning","log","info","debug"];function I6(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 lD{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 w2(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: "+I6(e)}isSeverityLevel(e){return wt(e)&&!dy(e)&&aD.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(zL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class uD{match(e){return w2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+I6(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class cD{match(e){return i6(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 dD{match(e){return em(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!w2(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 i6(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 om="$message",am="$timestamp",fD=new Set([om,am]),xv={enabled:!0,max_bytes:32768};function lm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:xv.enabled,max_bytes:pD(t.max_bytes,xv.max_bytes)}:ce({},xv)}class hD{constructor(e){this.Vt=[],this.Wt=0,this.Te=lm(e)}setConfig(e){this.Te=lm(e),this.Zt()}add(e){var n=(function(s){var i;try{i=n6(s)}catch{return}try{var a=JSON.parse(i);if(!Nt(a))return;var u=a,c=u[om],d=u[am];return!wt(c)||c.trim().length===0||!wt(d)&&!Un(d)?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.Te.max_bytes||(this.Vt.push({step:n.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((e=>e.step))}clear(){this.Vt=[],this.Wt=0}size(){return this.Vt.length}Zt(){for(;this.Wt>this.Te.max_bytes&&this.Vt.length>0;){var e=this.Vt.shift();e&&(this.Wt-=e.bytes)}}}function pD(t,e){if(!Un(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var M6=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(ne&&(vt.DEBUG||ne.POSTHOG_DEBUG||n)&&!ge(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)=>M6(t+" "+s,i)};return r},xe=M6("[PostHog.js]"),$t=xe.createLogger,mD=$t("[ExternalScriptsLoader]"),wv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return mD.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Ce==null?void 0:Ce.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",(d=>{c.__posthog_loading_callback_fired=!0,n(void 0,d)})),c.onerror=d=>n(d),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var u=()=>{if(!Ce)return n("document not found");var c=Ce.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")Ce.head.appendChild(c);else{var d,h=Ce.querySelectorAll("body > script");h.length>0?(d=h[0].parentNode)==null||d.insertBefore(c,h[0]):Ce.body.appendChild(c)}};Ce!=null&&Ce.body?u():Ce==null||Ce.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)}wv(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");wv(t,a,n)}},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);wv(t,r,n)};vt.DEBUG=!1,vt.LIB_VERSION="1.407.3",vt.LIB_NAME="web";var O6="$people_distinct_id",um="$device_id",bv="$device_model",pd="__alias",md="__timers",vy="$autocapture_disabled_server_side",yy="$heatmaps_enabled_server_side",_y="$exception_capture_enabled_server_side",xy="$error_tracking_suppression_rules",wy="$error_tracking_capture_extension_exceptions",by="$web_vitals_enabled_server_side",k2="$dead_clicks_enabled_server_side",P2="$product_tours_enabled_server_side",Sy="$web_vitals_allowed_metrics",rl="$session_recording_remote_config",L6="$replay_sample_rate",D6="$replay_override_sampling",N6="$replay_override_linked_flag",j6="$replay_override_url_trigger",F6="$replay_override_event_trigger",_u="$sesid",T2="$session_is_sampled",el="$enabled_feature_flags",Ep="$active_feature_flags",gd="$early_access_features",Ey="$feature_flag_details",Cp="$feature_flag_payloads",Cy="$feature_flag_request_id",cm="$minimal_flag_called_events",zi="$override_feature_flags",pu="$override_feature_flag_payloads",qa="$stored_person_properties",Ya="$stored_group_properties",ky="$surveys",dm="$surveys_loaded_at",Py="$surveys_activated",kp="$surveys_activated_session",vd="ph_product_tours",Sd="$flag_call_reported",Ty="$flag_call_reported_session_id",Ry="$feature_flag_errors",Hd="$feature_flag_evaluated_at",Vs="$user_state",Ay="$client_session_props",Iy="$capture_rate_limit",My="$initial_campaign_params",Oy="$initial_referrer_info",fm="$initial_person_info",hm="$epp",Gh="$posthog_cookieless",V6="$cookieless_mode",$6="$sdk_debug_extensions_init_method",H6="$sdk_debug_extensions_init_time_ms",z6="$sdk_debug_recording_script_not_loaded",R2="PostHog loadExternalDependency extension not found.",Xa="on_reject",Xi="always",ru="anonymous",su="identified",Ly="identified_only",pm="visibilitychange",mm="beforeunload",mu="$pageview",Sv="$pageleave",Ev="$identify",ME="$groupidentify";function Kh(t,e){nt(t)&&t.forEach(e)}function bt(t,e){if(!rt(t))if(nt(t))t.forEach(e);else if(kL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)s6.call(t,n)&&e(t[n],n)}var It=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 Pp(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 OE=function(t){try{return t()}catch{return}},gD=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){xe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xe.critical(s)}}},A2=function(t){var e={};return bt(t,(function(n,r){(wt(n)&&n.length>0||Un(n))&&(e[r]=n)})),e},vD=["herokuapp.com","vercel.app","netlify.app"];function yD(t){var e=t==null?void 0:t.hostname;if(!wt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of vD)if(n===r)return!1;return!0}function Ut(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 U6(t){return t.name==="ph_toolbar_internal"}var B6=t=>{if(Ce){try{for(var e=t+"=",n=Ce.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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Un(t)&&isFinite(t)&&Math.floor(t)===t});class gm{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/256,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 gm(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 gm(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 _D{generate(){var e=this.generateOrAbort();if(!ge(e))return e;this.S=0;var n=this.generateOrAbort();if(ge(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return gm.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new xD}}var LE,W6=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&&!ge(ne.crypto)&&crypto.getRandomValues&&(W6=t=>crypto.getRandomValues(t));class xD{nextUint32(){return this.R.length>this.O||(W6(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Ki=()=>wD().toString(),wD=()=>(LE||(LE=new _D)).generate(),Qc="",bD=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qi={N:()=>!!Ce,D(t){xe.error("cookieStore error: "+t)},A:B6,F(t){var e;try{e=JSON.parse(Qi.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Ce)return!1;try{var i="",a="",u=(function(h,p){if(p){var m=(function(x,y){if(y===void 0&&(y=Ce),Qc)return Qc;if(!y||["localhost","127.0.0.1"].includes(x))return"";for(var w=x.split("."),E=Math.min(w.length,8),P="dmn_chk_"+Ki();!Qc&&E--;){var T=w.slice(E).join("."),k=P+"=1;domain=."+T+";path=/";y.cookie=k+";max-age=3",y.cookie.includes(P)&&(y.cookie=k+";max-age=0",Qc=T)}return Qc})(h);if(!m){var _=(x=>{var y=x.match(bD);return y?y[0]:""})(h);_!==m&&xe.info("Warning: cookie subdomain discovery mismatch",_,m),m=_}return m?"; domain=."+m:""}return""})(Ce.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&xe.warn("cookieStore warning: large cookie, len="+d.length),Ce.cookie=d,!0}catch{return!1}},P(t,e){if(Ce!=null&&Ce.cookie)try{Qi.q(t,"",-1,e)}catch{return}}},Cv=null,Ct={N(){if(!hr(Cv))return Cv;var t=!0;if(ge(ne))t=!1;else try{var e="__mplssupport__";Ct.q(e,"xyz"),Ct.A(e)!=='"xyz"'&&(t=!1),Ct.P(e)}catch{t=!1}return t||xe.error("localStorage unsupported; falling back to cookie store"),Cv=t,t},D(t){xe.error("localStorage error: "+t)},A(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){Ct.D(e)}return null},F(t){try{return JSON.parse(Ct.A(t))||{}}catch{}return null},q(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Ct.D(n)}return!1},P(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){Ct.D(e)}}},SD=[um,"distinct_id",_u,T2,hm,fm,Vs],Zh={},ED={N:()=>!0,D(t){xe.error("memoryStorage error: "+t)},A:t=>Zh[t]||null,F:t=>Zh[t]||null,q:(t,e)=>(Zh[t]=e,!0),P(t){delete Zh[t]}},Na=null,$n={N(){if(!hr(Na))return Na;if(Na=!0,ge(ne))Na=!1;else try{var t="__support__";$n.q(t,"xyz"),$n.A(t)!=='"xyz"'&&(Na=!1),$n.P(t)}catch{Na=!1}return Na},D(t){xe.error("sessionStorage error: ",t)},A(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){$n.D(e)}return null},F(t){try{return JSON.parse($n.A(t))||null}catch{}return null},q(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){$n.D(n)}return!1},P(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){$n.D(e)}}};class CD{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===Xi||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===Xa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Jt.q(this.Kt,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Jt.P(this.Kt,this.Te.cross_subdomain_cookie)}get Kt(){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 Qt(){var e=this.Jt.A(this.Kt);return gv(e)?1:Ze(AL,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,n=e==="localStorage"?Ct:Qi;if(!this.Yt||this.Yt!==n){this.Yt=n;var r=e==="localStorage"?Qi:Ct;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(gv(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[ur==null?void 0:ur.doNotTrack,ur==null?void 0:ur.msDoNotTrack,$e.doNotTrack].some((e=>gv(e)))}}function G6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Us(r))return e;try{var s=r(e);return wt(s)&&s?s:e}catch(i){return xe.error("Error in get_current_url, falling back to window.location.href",i),e}}var K6="__POSTHOG_TOOLBAR__",kD=1,PD=3,TD=11;function DE(t){return t instanceof Element&&(t.id===K6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function sa(t){return!!t&&t.nodeType===kD}function Yr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Z6(t){return!!t&&t.nodeType===PD}function q6(t){return!!t&&t.nodeType===TD&&sa(t.host)}var Y6=1e3;function I2(t){return t?r0(t).split(/\s+/):[]}function NE(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return ge(i)?void 0:G6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function vm(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 X6(t){return rt(t)?null:r0(t).split(/(\s+)/).filter((e=>Ed(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zd(t){var e="";return Ny(t)&&!tP(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;Z6(n)&&n.textContent&&(e+=(r=X6(n.textContent))!==null&&r!==void 0?r:"")})),r0(e)}function kv(t){var e;return ge(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var M2=["a","button","form","input","select","textarea","label"];function Dy(t,e){if(ge(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var d=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!d&&d.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 Q6(t){var e=t.parentNode;return!(!e||!sa(e))&&e}var RD=[".ph-no-autocapture","[data-ph-no-autocapture]"],J6=["next","previous","prev",">","<"],AD=[...J6,"+","-","−","–"],jE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,FE=[".ph-no-rageclick",".ph-no-capture"],ID=["","text","search","email","password","url","tel","number"];function VE(t,e){if(!ne||O2(t))return!1;var n,r,s,i,a;if(Bs(e)?(n=!!e&&FE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:FE,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||!sa(c))&&(!!Yr(c,"textarea")||(Yr(c,"input")?Ze(ID,(c.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var h=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=eP(t,!1).targetElementList;return!(function(c,d){if(c===!1||ge(c))return!1;var h;if(c===!0)h=J6;else{if(!nt(c))return!1;if(c.length>10)return xe.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 d.some((p=>{var m=p.safeText,_=p.ariaLabel;return h.some((x=>jE(m,x)||jE(_,x)))}))})(r,u.map((c=>{var d;return{safeText:zd(c).toLowerCase(),ariaLabel:((d=c.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!Dy(u,n)}var O2=t=>!t||Yr(t,"html")||!sa(t),eP=(t,e)=>{if(!ne||O2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Yr(s,"body");)if(q6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=Q6(s);if(!i)break;if(e||M2.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 Ny(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Yr(r,"body");r=r.parentNode){if(n++>=Y6||e.has(r))return!1;e.add(r);var s=vm(r);if(Ze(s,"ph-sensitive")||Ze(s,"ph-no-capture"))return!1}if(Ze(vm(t),"ph-include"))return!0;var i=t.type||"";if(wt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!wt(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 tP(t){return!!(Yr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yr(t,"select")||Yr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var nP="(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})",MD=new RegExp("^(?:"+nP+")$"),OD=new RegExp(nP),rP="\\d{3}-?\\d{2}-?\\d{4}",LD=new RegExp("^("+rP+")$"),DD=new RegExp("("+rP+")");function Ed(t,e){return e===void 0&&(e=!0),!(rt(t)||wt(t)&&(t=r0(t),(e?MD:OD).test((t||"").replace(/[- ]/g,""))||(e?LD:DD).test(t)))}function $E(t){var e=zd(t);return Ed(e=(e+" "+sP(t)).trim())?e:""}function sP(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=zd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+sP(n)).trim())}catch(i){xe.error("[AutoCapture]",i)}})),e}function HE(t){return t.replace(/"|\\"/g,'\\"')}function ND(t){var e=t.attr__class;if(e)return nt(e)?e:I2(e)}var qh=$t("[Dead Clicks]"),jD=()=>!0,FD=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(k2)),r=t.instance.config.capture_dead_clicks;return Bs(r)?r:!!Nt(r)||n};class zE{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[k2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(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?qh.error("failed to load script",s):e()}))}tr(){var e;if(Ce){if(!this.Xt&&(e=$e.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Nt(this.instance.config.capture_dead_clicks)?ce({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Xt=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Xt.start(Ce),qh.info("starting...")}}else qh.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,qh.info("stopping..."))}}var Pv=$t("[SegmentIntegration]"),iP="posthog-js";function oP(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,d=c===void 0||c;return h=>{var p,m,_,x,y;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var w=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=w,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,P=((p=h.exception)==null?void 0:p.values)||[],T=P.map((R=>ce({},R,{stacktrace:R.stacktrace?ce({},R.stacktrace,{type:"raw",frames:(R.stacktrace.frames||[]).map((L=>ce({},L,{platform:"web:javascript"})))}):void 0}))),k={$exception_message:((m=P[0])==null?void 0:m.value)||h.message,$exception_type:(_=P[0])==null?void 0:_.type,$exception_level:h.level,$exception_list:T,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((x=P[0])==null?void 0:x.value)||h.message,$sentry_exception_type:(y=P[0])==null?void 0:y.type,$sentry_tags:h.tags};return r&&s&&(k.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),d&&((E=t.exceptions)==null||E.sendExceptionEvent(k)),h}}class VD{constructor(e,n,r,s,i,a){this.name=iP,this.setupOnce=function(u){u(oP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class UE{constructor(e){this.rr=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(xe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,n){var r,s=this.ar(e,n);return this.ir={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.ar(e,(n=this.ir)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,n){var r=this.ir;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,d=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(ge(a)||ge(u)||ge(c)||ge(d)||ge(h)||ge(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?hi(u/a,0,1,xe):1,_=a>1?hi(c/a,0,1,xe):1,x=d>1?hi(h/d,0,1,xe):1,y=d>1?hi(p/d,0,1,xe):1;s=It(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:y})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Tv=["flags","surveys"],$D={[O6]:{exposure:"hidden"},[pd]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[md]:{exposure:"hidden"},[vy]:{exposure:"event"},[yy]:{exposure:"hidden"},[_y]:{exposure:"event"},[xy]:{exposure:"hidden"},[wy]:{exposure:"event"},[by]:{exposure:"event"},[k2]:{exposure:"event"},[P2]:{exposure:"hidden"},[Sy]:{exposure:"event"},[rl]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[_u]:{exposure:"hidden"},[T2]:{exposure:"event"},[L6]:{exposure:"event",shouldSkipFromEventProperties:t=>hr(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"},[el]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Nt(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[Ep]:{exposure:"event",storageGroup:"flags"},[gd]:{exposure:"hidden"},[Ey]:{exposure:"hidden",storageGroup:"flags"},[Cp]:{exposure:"event",storageGroup:"flags"},[Cy]:{exposure:"event",storageGroup:"flags",volatile:!0},[cm]:{exposure:"hidden",storageGroup:"flags"},[zi]:{exposure:"event"},[pu]:{exposure:"hidden"},[qa]:{exposure:"hidden"},[Ya]:{exposure:"hidden"},[ky]:{exposure:"hidden",storageGroup:"surveys"},[dm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Py]:{exposure:"event"},[kp]:{exposure:"hidden"},[vd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Sd]:{exposure:"hidden"},[Ty]:{exposure:"hidden"},[Ry]:{exposure:"hidden"},[Hd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Vs]:{exposure:"hidden"},[Ay]:{exposure:"hidden"},[Iy]:{exposure:"hidden"},[My]:{exposure:"hidden"},[Oy]:{exposure:"hidden"},[fm]:{exposure:"hidden"},[hm]:{exposure:"hidden"},[D6]:{exposure:"event"},[N6]:{exposure:"event"},[j6]:{exposure:"event"},[F6]:{exposure:"event"},[$6]:{exposure:"event"},[H6]:{exposure:"event"},[z6]:{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"}},HD=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ja=t=>{var e=$D[t];if(e)return e;for(var n of HD){var r=n[1];if(t.indexOf(n[0])===0)return r}},xu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return n6(t)}},ym=t=>{var e=Ce==null?void 0:Ce.createElement("a");return ge(e)?null:(e.href=t,e)},Qu=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(!nt(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{xe.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ud=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("&"),d=[],h=0;c.length>h;h++){var p=c[h].split("=");nt(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(c[h]))}var m=u;return a!=null&&(m+="?"+d.join("&")),s!=null&&(m+="#"+s),m},_m=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},aP=(t,e)=>t>=e&&J8(),lP=(t,e,n,r)=>{if(t===0){if(J8()){var s=e+1;return s===n&&r(),s}return e}return 0},Yh="https?://(.*)",Ju=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],zD=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ju],Bd="<masked>",UD=["li_fat_id"];function uP(t,e,n){if(!Ce)return{};var r,s=e?[...Ju,...n||[]]:[],i=cP(Ud(Ce.URL,s,Bd),t),a=(r={},bt(UD,(function(u){var c=B6(u);r[u]=c||null})),r);return It(a,i)}function cP(t,e){var n=zD.concat(e||[]),r={};return bt(n,(function(s){var i=Qu(t,s);r[s]=i||null})),r}function dP(t){var e=(function(i){return i?i.search(Yh+"google.([^/?]*)")===0?"google":i.search(Yh+"bing.com")===0?"bing":i.search(Yh+"yahoo.com")===0?"yahoo":i.search(Yh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!hr(e)){r.$search_engine=e;var s=Ce?Qu(Ce.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function BE(){return navigator.language||navigator.userLanguage}var xm="$direct";function fP(){return(Ce==null?void 0:Ce.referrer)||xm}function hP(t,e,n){n===void 0&&(n=!1);var r=t?[...Ju,...e||[]]:[],s=n?ra(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:fP().substring(0,1e3),u:i?Ud(i,r,Bd):void 0}}function pP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?ra(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==xm?xm:(n=ym(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=ym(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=cP(i);It(a,c)}if(r){var d=dP(r);It(a,d)}return a}function mP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function BD(){try{return new Date().getTimezoneOffset()}catch{return}}var WD={flags:Hd,surveys:dm},GD=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],iu="main";class Rv{constructor(e,n,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(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.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&xe.info("Persistence loaded",e.persistence,ce({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();Ut(ne,"beforeunload",s,{capture:!1}),Ut(ne,"pagehide",s,{capture:!1})}}mr(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Un(n)&&n>0?n:0}isDisabled(){return!!this.yr}pr(e){GD.indexOf(e.persistence.toLowerCase())===-1&&(xe.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=[...SD,...a];return ce({},Ct,{F(d){try{var h={};try{h=Qi.F(d)||{}}catch{}var p,m=JSON.parse(Ct.A(d)||"{}");if(u){var _={};for(var x in h){var y=h[x];hr(y)||y===""||(_[x]=y)}p=It(m,_)}else p=It(h,m);return Ct.q(d,p),p}catch{}return null},q(d,h,p,m,_,x){var y=Ct.q(d,h,void 0,void 0,x);try{var w={};c.forEach((E=>{h[E]&&(w[E]=h[E])})),Object.keys(w).length&&Qi.q(d,w,p,m,_,x)}catch(E){Ct.D(E)}return y},P(d,h){try{ne==null||ne.localStorage.removeItem(d),Qi.P(d,h)}catch(p){Ct.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&Ct.N()?(n=Ct,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&$n.N()?n=$n:i==="memory"?n=ED:i==="cookie"?n=Qi:r.N()?(n=r,s=!0):n=Qi,this.ur=s,n}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var n=e??this.Te.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Hd];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return bt(this.props,((n,r)=>{var s=ja(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===el?()=>this._r():()=>!1))return;s.transformToEventProperties&&It(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.yr){var e=this.Jt.F(this.vr);e&&(this.props=It({},e)),this.hr&&this.wr()}}wr(){for(var e of Tv){var n=Ct.F(this.br(e));if(n&&!Ko(n)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(n,e)),this.Tr(e,n)||It(this.props,n)}}}Sr(e){return Object.keys(this.props).some((n=>{var r;return((r=ja(n))==null?void 0:r.storageGroup)===e}))}Tr(e,n){var r=WD[e];if(!r)return!1;var s=n[r],i=this.props[r];return Un(s)&&Un(i)&&i>s}refreshKey(e){var n;if(!this.yr){var r=this.hr?(n=ja(e))==null?void 0:n.storageGroup:void 0,s=r?Ct.F(this.br(r)):this.Jt.F(this.vr);if(s&&e in s)this.Ir(e,s[e]);else{if(r){var i=this.Jt.F(this.vr);if(i&&e in i)return void this.Ir(e,i[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?ge(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Jt,this.vr,this.props,iu))}Pr(){var e=this.Fr(),n=e.main,r=e.groups;for(var s of(this.Or(this.Jt,this.vr,n,iu),Tv)){var i,a=r[s];(!Ko(a)||(i=this.lr[s])!=null&&i.persisted)&&this.Or(Ct,this.br(s),a,s)}}Fr(){var e={},n={flags:{},surveys:{}};return bt(this.props,((r,s)=>{var i,a=(i=ja(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Cr(e,n){if(n===iu)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=ja(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}Or(e,n,r,s){var i=this.kr(s);if(s===iu||i.dirty||ge(i.fingerprint)){var a;try{if((a=this.Cr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(i.dirty=!1,s!==iu&&(i.persisted=!0),ge(a)||(i.fingerprint=a)):this.Te.debug&&xe.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(ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Jt.P(this.vr,!1),this.Jt.P(this.vr,!0),!r&&this.dr)for(var s of Tv)Ct.P(this.br(s));r?delete this.lr[iu]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Nt(e)){ge(n)&&(n="None"),this.Lr=ge(r)?this.Nr:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Ir(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Nt(e)){this.Lr=ge(n)?this.Nr:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.Ir(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=uP(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ko(A2(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=Ce==null?void 0:Ce.referrer)?dP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:fP(),$referring_domain:Ce!=null&&Ce.referrer&&((e=ym(Ce.referrer))==null?void 0:e.host)||xm},void 0)}set_initial_person_info(){this.props[My]||this.props[Oy]||this.register_once({[fm]:hP(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};bt([Oy,My],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+cy(u)]=a}))}));var n=this.props[fm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=pP(s,i),u={};return bt(a,(function(c,d){u["$initial_"+cy(d)]=c})),u})(n,this.Te.disable_capture_url_hashes);It(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.Nr=this.Lr=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,d)=>{if(c.length!==d.length)return!1;var h=[...c].sort(),p=[...d].sort();return h.every(((m,_)=>m===p[_]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.pr(e):this.Jt,a=this.gr(e);if(s||a!==this.hr){var u=this.props;this.clear(),this.Jt=i,this.hr=a,this.props=u,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[md]||{};r[e]=n,this.Ir(md,r),this.save()}remove_event_timer(e){var n=this.props[md]||{},r=n[e];return ge(r)||(delete n[e],this.Ir(md,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Ir(e,n),this.save()}Ir(e,n){var r;this.props[e]=n,(r=ja(e))!=null&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var n,r=(n=ja(e))==null?void 0:n.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var lr={GZipJS:"gzip-js",Base64:"base64"},Jc={Activation:"events",Cancellation:"cancelEvents"},Av={Popover:"popover",API:"api",Widget:"widget"},Ji={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Iv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},jy={Popover:"popover",Inline:"inline"},KD={SHOWN:"product tour shown"},WE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},GE=$t("[RateLimiter]");class ZD{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=>{GE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void GE.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(Iy))!==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 d=1>c.tokens;return d||e||(c.tokens=Math.max(0,c.tokens-1)),!d||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=d,(s=this.instance.persistence)==null||s.set_property(Iy,c),{isRateLimited:d,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var ed=$t("[RemoteConfig]");class gP{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}qr(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()}jr(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 ed.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void ed.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return ed.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((n=>{this.Hr(n),this.Br()}));this.Hr(e),this.Br()}))}catch(e){ed.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&Ce&&Ce.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.zr=setInterval((()=>{this.refresh()}),n))}}Hr(e){var n;e||ed.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),(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 Es=Uint8Array,Ar=Uint16Array,ec=Uint32Array,L2=new Es([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]),D2=new Es([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]),KE=new Es([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vP=function(t,e){for(var n=new Ar(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new ec(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]},yP=vP(L2,2),Fy=yP[1];yP[0][28]=258,Fy[258]=28;for(var ZE=vP(D2,0)[1],_P=new Ar(32768),Ft=0;32768>Ft;++Ft){var ou=(43690&Ft)>>>1|(21845&Ft)<<1;_P[Ft]=((65280&(ou=(61680&(ou=(52428&ou)>>>2|(13107&ou)<<2))>>>4|(3855&ou)<<4))>>>8|(255&ou)<<8)>>>1}var Cd=function(t,e,n){for(var r=t.length,s=0,i=new Ar(e);r>s;++s)++i[t[s]-1];var a,u=new Ar(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new Ar(r),s=0;r>s;++s)a[s]=_P[u[t[s]-1]++]>>>15-t[s];return a},El=new Es(288);for(Ft=0;144>Ft;++Ft)El[Ft]=8;for(Ft=144;256>Ft;++Ft)El[Ft]=9;for(Ft=256;280>Ft;++Ft)El[Ft]=7;for(Ft=280;288>Ft;++Ft)El[Ft]=8;var wm=new Es(32);for(Ft=0;32>Ft;++Ft)wm[Ft]=5;var qD=Cd(El,9),YD=Cd(wm,5),xP=function(t){return(t/8>>0)+(7&t&&1)},wP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Ar?Ar:t instanceof ec?ec:Es)(n-e);return r.set(t.subarray(e,n)),r},Oi=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},td=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Mv=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 Es(0),0];if(s==1){var a=new Es(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(R,L){return R.f-L.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=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[d].f?d++:p++],c=n[d!=h&&n[p].f>n[d].f?d++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var _=new Ar(m+1),x=Vy(n[h-1],_,0);if(x>e){r=0;var y=0,w=x-e,E=1<<w;for(i.sort((function(R,L){return _[L.s]-_[R.s]||R.f-L.f}));s>r;++r){var P=i[r].s;if(e>=_[P])break;y+=E-(1<<x-_[P]),_[P]=e}for(y>>>=w;y>0;){var T=i[r].s;e>_[T]?y-=1<<e-_[T]++-1:++r}for(;r>=0&&y;--r){var k=i[r].s;_[k]==e&&(--_[k],++y)}x=e}return[new Es(_),x]},Vy=function(t,e,n){return t.s==-1?Math.max(Vy(t.l,e,n+1),Vy(t.r,e,n+1)):e[t.s]=n},qE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ar(++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]},nd=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},$y=function(t,e,n){var r=n.length,s=xP(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)},YE=function(t,e,n,r,s,i,a,u,c,d,h){Oi(e,h++,n),++s[256];for(var p=Mv(s,15),m=p[0],_=p[1],x=Mv(i,15),y=x[0],w=x[1],E=qE(m),P=E[0],T=E[1],k=qE(y),R=k[0],L=k[1],O=new Ar(19),A=0;P.length>A;++A)O[31&P[A]]++;for(A=0;R.length>A;++A)O[31&R[A]]++;for(var M=Mv(O,7),D=M[0],F=M[1],N=19;N>4&&!D[KE[N-1]];--N);var W,Y,q,B,K=d+5<<3,$=nd(s,El)+nd(i,wm)+a,J=nd(s,m)+nd(i,y)+a+14+3*N+nd(O,D)+(2*O[16]+3*O[17]+7*O[18]);if($>=K&&J>=K)return $y(e,h,t.subarray(c,c+d));if(Oi(e,h,1+($>J)),h+=2,$>J){W=Cd(m,_),Y=m,q=Cd(y,w),B=y;var H=Cd(D,F);for(Oi(e,h,T-257),Oi(e,h+5,L-1),Oi(e,h+10,N-4),h+=14,A=0;N>A;++A)Oi(e,h+3*A,D[KE[A]]);h+=3*N;for(var j=[P,R],X=0;2>X;++X){var te=j[X];for(A=0;te.length>A;++A)Oi(e,h,H[ie=31&te[A]]),h+=D[ie],ie>15&&(Oi(e,h,te[A]>>>5&127),h+=te[A]>>>12)}}else W=qD,Y=El,q=YD,B=wm;for(A=0;u>A;++A)if(r[A]>255){var ie;td(e,h,W[257+(ie=r[A]>>>18&31)]),h+=Y[ie+257],ie>7&&(Oi(e,h,r[A]>>>23&31),h+=L2[ie]);var ae=31&r[A];td(e,h,q[ae]),h+=B[ae],ae>3&&(td(e,h,r[A]>>>5&8191),h+=D2[ae])}else td(e,h,W[r[A]]),h+=Y[r[A]];return td(e,h,W[256]),h+Y[256]},XD=new ec([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),QD=(function(){for(var t=new ec(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Ov=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function JD(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var _=p,x=0;m.length>x;++x)_=QD[255&_^m[x]]^_>>>8;p=_},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,d=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,m,_,x,y,w){var E=p.length,P=new Es(x+E+5*(1+Math.floor(E/7e3))+y),T=P.subarray(x,P.length-y),k=0;if(!m||8>E)for(var R=0;E>=R;R+=65535){var L=R+65535;E>L?k=$y(T,k,p.subarray(R,L)):(T[R]=!0,k=$y(T,k,p.subarray(R,E)))}else{for(var O=XD[m-1],A=O>>>13,M=8191&O,D=(1<<_)-1,F=new Ar(32768),N=new Ar(D+1),W=Math.ceil(_/3),Y=2*W,q=function(ct){return(p[ct]^p[ct+1]<<W^p[ct+2]<<Y)&D},B=new ec(25e3),K=new Ar(288),$=new Ar(32),J=0,H=0,j=(R=0,0),X=0,te=0;E>R;++R){var ie=q(R),ae=32767&R,ue=N[ie];if(F[ae]=ue,N[ie]=ae,R>=X){var Se=E-R;if((J>7e3||j>24576)&&Se>423){k=YE(p,T,0,B,K,$,H,j,te,R-te,k),j=J=H=0,te=R;for(var oe=0;286>oe;++oe)K[oe]=0;for(oe=0;30>oe;++oe)$[oe]=0}var se=2,ye=0,be=M,je=ae-ue&32767;if(Se>2&&ie==q(R-je))for(var Te=Math.min(A,Se)-1,We=Math.min(32767,R),Rt=Math.min(258,Se);We>=je&&--be&&ae!=ue;){if(p[R+se]==p[R+se-je]){for(var Ye=0;Rt>Ye&&p[R+Ye]==p[R+Ye-je];++Ye);if(Ye>se){if(se=Ye,ye=je,Ye>Te)break;var we=Math.min(je,Ye-2),Mt=0;for(oe=0;we>oe;++oe){var Je=R-je+oe+32768&32767,He=Je-F[Je]+32768&32767;He>Mt&&(Mt=He,ue=Je)}}}je+=(ae=ue)-(ue=F[ae])+32768&32767}if(ye){B[j++]=268435456|Fy[se]<<18|ZE[ye];var tt=31&Fy[se],Ge=31&ZE[ye];H+=L2[tt]+D2[Ge],++K[257+tt],++$[Ge],X=R+se,++J}else B[j++]=p[R],++K[p[R]]}}k=YE(p,T,!0,B,K,$,H,j,te,R-te,k)}return wP(P,0,x+xP(k)+y)})(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=d.length;return(function(p,m){var _=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&Ov(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),_){p[3]=8;for(var x=0;_.length>=x;++x)p[x+10]=_.charCodeAt(x)}})(d,e),Ov(d,h-8,n.d()),Ov(d,h-4,r),d}var eN=!!ay||!!x2,bP="text/plain",Tp=!1,SP=(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:"")},N2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=ce({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),_=m[0],x=n&&(p=u[_])!==null&&p!==void 0?p:m[1];return delete u[_],_+"="+x})))!==null&&r!==void 0?r:[],d=(function(h,p){var m,_;p===void 0&&(p="&");var x=[];return bt(h,(function(y,w){ge(y)||ge(w)||w==="undefined"||(m=encodeURIComponent((E=>E instanceof File)(y)?y.name:y.toString()),_=encodeURIComponent(w),x[x.length]=_+"="+m)})),x.join(p)})(u);return d&&c.push(d),c.length>0?i+"?"+c.join("&"):i},Lv=t=>{if(t.Vr)return t.Vr;var e=t.data,n=t.compression;if(e){if(n===lr.GZipJS){var r=JD((function(u,c){var d=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new Es(u.length+(u.length>>>1)),p=0,m=function(w){h[p++]=w},_=0;d>_;++_){if(p+5>h.length){var x=new Es(p+8+(d-_<<1));x.set(h),h=x}var y=u.charCodeAt(_);128>y?m(y):2048>y?(m(192|y>>>6),m(128|63&y)):y>55295&&57344>y?(m(240|(y=65536+(1047552&y)|1023&u.charCodeAt(++_))>>>18),m(128|y>>>12&63),m(128|y>>>6&63),m(128|63&y)):(m(224|y>>>12),m(128|y>>>6&63),m(128|63&y))}return wP(h,0,p)})(xu(e)),{mtime:0});return{contentType:bP,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===lr.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,d)=>String.fromCharCode(parseInt(d,16)))))})(xu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:xu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=xu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},EP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:N2(t.url,{compression:lr.Base64}),encodedBody:Lv(ce({},t,{compression:lr.Base64,Vr:void 0}))}:{url:SP(t.url,"compression"),encodedBody:Lv(ce({},t,{compression:void 0,Vr:void 0}))};try{e=Lv(t)}catch(s){if(wE(t.compression,Qu(t.url,"compression")))return xe.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&wE(t.compression,Qu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?ly(new Uint8Array(n)):ArrayBuffer.isView(n)&&ly(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Tp=!0,r()):{url:t.url,encodedBody:e}},CP=t=>{try{return EP(t)}catch(e){return xe.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},tN=(function(){var t=tn((function*(e){var n=xu(e.data),r=yield(function(i,a,u){return uy.apply(this,arguments)})(n,vt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return ce({},e,{Vr:{contentType:bP,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),nN=/Failed to fetch|NetworkError|Load failed/i,kP=t=>{var e=CP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,u=s.estimatedSize,c=new Headers;bt(t.headers,(function(x,y){c.append(y,x)})),i&&c.append("Content-Type",i);var d=null,h=!1;if(mE){var p=new mE;d={signal:p.signal,timeout:setTimeout((()=>{var x,y;h=!0,p.abort((x=t.timeout,(y=new Error("PostHog request timed out"+(x?" after "+x+"ms":""))).name="AbortError",y))}),t.timeout)}}var m=x=>{h&&(x==null?void 0:x.name)==="AbortError"||(y=>(y==null?void 0:y.name)==="TypeError"&&nN.test((y==null?void 0:y.message)||""))(x)?xe.warn(x):xe.error(x),t.callback==null||t.callback({statusCode:0,error:x})};try{var _;x2(n,ce({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(u||0),body:a,signal:(_=d)==null?void 0:_.signal},t.fetchOptions)).then((x=>x.text().then((y=>{var w={statusCode:x.status,text:y};if(x.status===200)try{w.json=JSON.parse(y)}catch(E){xe.error(E)}t.callback==null||t.callback(w)})))).catch(m).finally((()=>d?clearTimeout(d.timeout):null))}catch(x){d&&clearTimeout(d.timeout),m(x)}}},Hy=t=>{try{var e,n=EP(t),r=n.url,s=n.encodedBody,i=s??{},a=i.body,u=i.estimatedSize;if(!a)return;var c=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(ur.sendBeacon(r,c))return;var d=nt(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(nt(d)&&d.length>1&&(u??0)>16384){var h=Math.ceil(d.length/2),p=m=>nt(t.data)?m:ce({},t.data,{batch:m});return Hy(ce({},t,{data:p(d.slice(0,h))})),void Hy(ce({},t,{data:p(d.slice(h))}))}xe.warn("Beacon of ~"+(u??0)+" bytes was rejected by the browser, falling back to fetch"),kP(ce({},t,{Wr:!0}))}catch(m){xe.warn("Beacon send failed",m)}},XE=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return N2(n===lr.GZipJS?SP(t,"compression"):t,ce({},s?{[s]:Date.now().toString()}:{},n===lr.GZipJS?{}:{compression:n}))},Rp=[];x2&&Rp.push({transport:"fetch",method:kP}),ay&&Rp.push({transport:"XHR",method(t){var e=CP(t);if(e){var n=new ay,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)}}}),ur!=null&&ur.sendBeacon&&Rp.push({transport:"sendBeacon",method:Hy});var zy=3e3;class rN{constructor(e,n){this.Zr=!0,this.Gr=[],this.Qr=hi((n==null?void 0:n.flush_interval_ms)||zy,250,5e3,xe.createLogger("flush interval"),zy),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ei():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ti(ce({},r,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var n=this.ei(),r=function(){var i=n[s],a=new Date().getTime();i.data&&nt(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.ti(i)};for(var s in n)r()}}),this.Qr))}ti(e){try{this.Jr(e)}catch(n){xe.error(n)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return bt(this.Gr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;ge(e[i])&&(e[i]=ce({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Gr=[],e}}var sN=["retriesPerformedSoFar"];class iN{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!ge(ne)&&"onLine"in ne.navigator&&(this.ni=ne.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ut(ne,"online",this.si),Ut(ne,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=e6(e,sN);Hi(n)&&(r.url=N2(r.url,{retry_count:n})),this._instance._send_request(ce({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.kt(ce({retriesPerformedSoFar:n},r));s.statusCode===0&&xe.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)}}))}kt(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(d+h*(d-c))})(n),s=Date.now()+r;this.Gr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),xe.warn(i),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),n=[],r=this.Gr.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Gr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,ge(ne)||(this.si&&(ne.removeEventListener("online",this.si),this.si=void 0),this.ai&&(ne.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var n=e.requestOptions;try{this._instance._send_request(ce({},n,{transport:"sendBeacon"}))}catch(r){xe.error(r)}}this.Gr=[]}}class oN{constructor(e){this.hi=()=>{var n,r,s,i;this.di||(this.di={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.di.lastScrollY=Math.ceil(u),this.di.maxScrollY=Math.max(u,(n=this.di.maxScrollY)!==null&&n!==void 0?n:0),this.di.maxScrollHeight=Math.max(c,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=d,this.di.maxContentY=Math.max(d,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(h,(i=this.di.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){Ut(ne,"scroll",this.hi,{capture:!0}),Ut(ne,"scrollend",this.hi,{capture:!0}),Ut(ne,"resize",this.hi)}scrollElement(){if(!this.ci)return ne==null?void 0:ne.document.documentElement;var e=nt(this.ci)?this.ci:[this.ci];for(var n of e){var r=ne==null?void 0:ne.document.querySelector(n);if(r)return r}}vi(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ci){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.vi("y")}scrollX(){return this.vi("x")}}var aN=t=>hP(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 QE{constructor(e,n,r,s){this.fi=i=>{var a=this.pi();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.gi(this._instance)};this.mi.register({[Ay]:u})}},this._instance=e,this.yi=n,this.mi=r,this.gi=s||aN,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Ay]}getSetOnceProps(){var e,n=(e=this.pi())==null?void 0:e.props;return n?"r"in n?pP(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(A2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+cy(r)]=n})),e}}class j2{on(e,n){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(n),()=>{this.bi[e]=this.bi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.bi[e]||[])r(n);for(var s of this.bi["*"]||[])s(e,n)}constructor(){this.bi={}}}var rd=$t("[SessionId]");class JE{on(e,n){return this.wi.on(e,n)}constructor(e,n,r){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new j2,this.Ti=(d,h)=>!(!Hi(d)||!Hi(h))&&Math.abs(d-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=n||Ki,this.Ri=r||Ki;var i=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*hi(this.Te.session_idle_timeout_seconds||1800,60,36e3,rd.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+i+"_window_id",this.Fi="ph_"+i+"_primary_window_exists",this.Li()){var a=$n.F(this.Oi),u=$n.F(this.Fi);a&&!u?this.Ii=a:$n.P(this.Oi),$n.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var c=(d=>{var h=this.Te.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.$i(this.Te.bootstrap.sessionID,new Date().getTime(),c)}catch(d){rd.error("Invalid sessionID in bootstrap",d)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ge(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ii),()=>{this.ki=this.ki.filter((n=>n!==e))}}Li(){return this.Te.persistence!=="memory"&&!this.mi.yr&&$n.N()}Ni(e){e!==this.Ii&&(this.Ii=e,this.Li()&&$n.q(this.Oi,e))}Di(){return this.Ii?this.Ii:this.Li()?$n.F(this.Oi):null}qi(e){var n=this.xi;return!hr(n)&&!hr(e)&&5e3>Math.abs(e-n)}$i(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Mi=e,i&&!s||i&&this.qi(n)||(this.xi=n,this.mi.register({[_u]:[n,e,r]}))}ji(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Hi(n)&&n>0}Hi(){this.ji()?this.mi.refreshKey(_u):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!hr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var n=this.Ui();n[1]===this.Mi&&n[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[_u]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],n=Hi(e)?e:0,r=Hi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Vi(e){return this.Hi(),this.Ti(e,this.zi())}Ui(){var e=this.mi.props[_u];return nt(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&ne&&(ne.removeEventListener(mm,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&$n.P(this.Fi)},Ut(ne,mm,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Te.cookieless_mode===Xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Ui(),i=s[1],a=s[2],u=this.zi(),c=this.Di(),d=Hi(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,m=!i,_=i,x=!m&&!e&&this.Ti(r,u);if(x){(x=this.Vi(r))||rd.info("cross-tab refresh kept the session alive",{sessionId:i});var y=this.Ui();i=y[1],a=y[2]}m||x||d?(i=this.Ei(),c=this.Ri(),rd.info("new session ID generated",{sessionId:i,windowId:c,changeReason:{noSessionId:m,activityTimeout:x,sessionPastMaximumLength:d}}),a=r,h=!0):(c||(c=this.Ri(),h=!0),(p=i!==_)&&(rd.info("adopted cross-tab session id",{sessionId:i,windowId:c}),h=!0));var w=Hi(u)&&e&&!d?u:r,E=Hi(a)?a:new Date().getTime();this.Ni(c),this.$i(i,w,E),e||this.Pi();var P={noSessionId:m,activityTimeout:x,sessionPastMaximumLength:d,crossTabAdoption:p};return h&&this.ki.forEach((T=>T(i,c,P))),{sessionId:i,windowId:c,sessionStartTimestamp:E,changeReason:h?P:void 0,lastActivityTimestamp:u}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var PP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&SE(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>SE(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function TP(){return(TP=tn((function*(){var t=ur==null?void 0:ur.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return wt(n)&&n.length>0?n:void 0}catch(r){return void xe.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var bm=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 eC(t,e,n){return xu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var RP={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=>bm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!bm(n,r))))),icontains:(t,e)=>e.map(Xh).some((n=>t.map(Xh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Xh).every((n=>t.map(Xh).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)))}))},Xh=t=>t.toLowerCase();function AP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(ge(s)||hr(s))return!1;var i=[String(s)],a=RP[r.operator];return!!a&&a(r.values,i)}))}var Uy="custom",tC="i.posthog.com",lN=/^\/static\//;class uN{constructor(e){this.Zi={},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("."+tC,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Zi[this.apiHost]||(this.Zi[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":Uy),this.Zi[this.apiHost]}Gi(e){if(lN.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.Gi(n);if(r)return""+r+n}if(this.region===Uy)return this.apiHost+n;var s=tC+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function IP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var _t=$t("[Surveys]"),MP="seenSurvey_",OP=t=>{try{var e=(n=>((r,s)=>""+MP+(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){_t.error("Failed to persist survey seen state",n)}},cN=[Av.Popover,Av.Widget,Av.API],dN={ignoreConditions:!1,ignoreDelay:!1,displayType:jy.Popover},fN=$t("[PostHog ExternalIntegrations]"),hN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class pN{constructor(e){this._instance=e}er(e,n){var r;(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return fN.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],d=r[1];!d||(i=$e.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.er(hN[c],(()=>{var h;(h=$e.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!d&&(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 kd={},Dv=0,Sm=()=>{},nC='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',sd="Surveys module not available",rC="sanitize_properties is deprecated. Use before_send instead",LP="Invalid value for property_denylist config: ",mN=["token","distinct_id",V6],gu="posthog",DP=!eN&&(kr==null?void 0:kr.indexOf("MSIE"))===-1&&(kr==null?void 0:kr.indexOf("Mozilla"))===-1,Nv=t=>{var e;return ce({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:yD(Ce==null?void 0:Ce.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Sm,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&&wt(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){xe.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:Ly,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:zy},error_tracking:{},_onCapture:Sm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:AD,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))},gN=[["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"]],sC=t=>{var e={};for(var n of gN){var r=n[0],s=n[1];ge(t[r])||(e[s]=t[r])}var i=It({},e,t),a=t.__preview_external_dependency_versioned_paths;return ge(a)||(ge(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),wt(a)&&ge(t.asset_host)&&(i.asset_host=a)),nt(t.property_blacklist)&&(ge(t.property_denylist)?i.property_denylist=t.property_blacklist:nt(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:xe.error(LP+t.property_denylist)),i};class vN{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){xe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class _s{Ji(e,n){if(e){var r=this.Ki.indexOf(e);r!==-1&&this.Ki.splice(r,1)}return this.Ki.push(n),n.initialize==null||n.initialize(),n}Yi(){return this.config.cookieless_mode===Xi||this.config.cookieless_mode===Xa&&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 vN,this.Xi=!1,this.version=vt.LIB_VERSION,this.en=new j2,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Nv(),this.SentryIntegration=VD,this.sentryIntegration=r=>(function(s,i){var a=oP(s,i);return{name:iP,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new oN(this),this.pageViewManager=new UE(this),this.rateLimiter=new ZD(this),this.requestRouter=new uN(this),this.consent=new CD(this),this.externalIntegrations=new pN(this);var n=(e=_s.__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=wt(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=wt(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>xe.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==gu){var s,i=(s=kd[r])!==null&&s!==void 0?s:new _s;return i._init(e,n,r),kd[r]=i,kd[gu][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=wt(e)?e.trim():"";if(!a)return xe.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=Nv(n.defaults),n.debug=this.an(n.debug),this.ln=n,this.un=[],n.person_profiles?this.nn=n.person_profiles:n.process_person&&(this.nn=n.process_person);var u=Nv(n.defaults),c=sC(n),d=It({},u,c,{name:r,token:a});Nt(u.rageclick)&&Nt(c.rageclick)&&(d.rageclick=It({},u.rageclick,c.rageclick)),Nt(u.session_recording)&&Nt(c.session_recording)&&(d.session_recording=It({},u.session_recording,c.session_recording)),this.set_config(d),this.config.on_xhr_error&&xe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:lr.GZipJS;var h=this.hn();this.persistence=new Rv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rv(ce({},this.config,{persistence:"sessionStorage"}),h,!1);var p=ce({},this.persistence.props),m=ce({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new rN((k=>this.cn(k)),this.config.request_queue_config),this.vn=new iN(this),this.__request_queue=[];var _=this.Yi();if(_||(this.sessionManager=new JE(this),this.sessionPropsManager=new QE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(xe.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(_)}),0)):(xe.info("Initializing extensions synchronously"),this.fn(_)),vt.DEBUG=vt.DEBUG||this.config.debug,vt.DEBUG&&xe.info("Starting in debug mode",{this:this,config:n,thisC:ce({},this.config),p,s:m}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=ce({},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,y=this.get_distinct_id(),w=this.persistence.get_property(Vs);if(n.bootstrap.isIdentifiedID&&y!=null&&y!==x&&w===ru)this.identify(x);else if(n.bootstrap.isIdentifiedID&&y!=null&&y!==x&&w===su)xe.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(Ki()),P=n.bootstrap.isIdentifiedID?E:x;this.persistence.set_property(Vs,n.bootstrap.isIdentifiedID?su:ru),this.register({distinct_id:x,$device_id:P})}}if(_)this.register_once({distinct_id:Gh,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(Ki());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(Vs,ru)}return Ut(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(k,R){var L=k.config.segment;if(!L)return R();(function(O,A){var M=O.config.segment;if(!M)return A();var D=N=>{var W=()=>N.anonymousId()||Ki();O.config.get_device_id=W,N.id()&&(O.register({distinct_id:N.id(),$device_id:W()}),O.persistence.set_property(Vs,su)),A()},F=M.user();"then"in F&&Us(F.then)?F.then(D):D(F)})(k,(()=>{L.register((O=>{typeof Promise<"u"&&Promise.resolve||Pv.warn("This browser does not have Promise support, and can not use the segment integration");var A=(M,D)=>{if(!D)return M;M.event.userId||M.event.anonymousId===O.get_distinct_id()||(Pv.info("No userId set, resetting PostHog"),O.reset()),M.event.userId&&M.event.userId!==O.get_distinct_id()&&(Pv.info("UserId set, identifying with PostHog"),O.identify(M.event.userId));var F=O.calculateEventProperties(D,M.event.properties);return M.event.properties=Object.assign({},F,M.event.properties),M};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:M=>A(M,M.event.event),page:M=>A(M,mu),identify:M=>A(M,Ev),screen:M=>A(M,"$screen")}})(k)).then((()=>{R()}))}))})(this,(()=>this.pn())):this.pn(),Us(this.config._onCapture)&&this.config._onCapture!==Sm&&(xe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(k=>this.config._onCapture(k.event,k)))),this.config.ip&&xe.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 TP.apply(this,arguments)})().then((k=>{k&&this.register({[bv]:k})})).catch(Sm),this}fn(e){var n,r,s,i,a,u,c,d,h=performance.now(),p=ce({},_s.__defaultExtensionClasses,this.config.__extensionClasses),m=[];p.featureFlags&&this.Ki.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ki.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ki.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ki.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.Ki.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||m.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ki.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.Ki.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.Ki.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.Ki.push(this.conversations=(u=this.conversations)!==null&&u!==void 0?u:new p.conversations(this)),p.productTours&&this.Ki.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ki.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ki.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,FD)),p.toolbar&&this.Ki.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ki.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ki.forEach((_=>{_.initialize&&m.push((()=>{_.initialize==null||_.initialize()}))})),m.push((()=>{if(this.gn){var _=this.gn;this.gn=void 0,this.Hr(_)}})),this.mn(m,h)}mn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){xe.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[$6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[H6]:s}),this.config.__preview_deferred_init_extensions&&xe.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!Ce||!Ce.body)return xe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ze(r.supportedCompression,lr.GZipJS)?lr.GZipJS:Ze(r.supportedCompression,lr.Base64)?lr.Base64:void 0),(n=r.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:Ly}),this.Ki.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(r){xe.critical("`loaded` function failed",r)}if(this.bn(),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.Yi())&&this._n()}),1),this.wn=new gP(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Kh(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_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.xn()&&this.capture(Sv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(i=this.vn)==null||i.unload()):this.xn()&&this.capture(Sv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?DP?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=ce({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ge(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=ce({},n);a.timeout=a.timeout||6e4;var u,c,d,h,p,m=(r=a.transport)!==null&&r!==void 0?r:"fetch";m==="sendBeacon"&&ge(a.compression)&&a.data&&(a.compression=lr.Base64),a.method==="POST"&&a.data&&(a.timestampMode==="capture-body"?a.data={api_key:(c=(p=(h=nt(u=a.data)?u:[u])[0])==null||(d=p.properties)==null?void 0:d.token)!==null&&c!==void 0?c:p==null?void 0:p.token,batch:h,sent_at:new Date().toISOString()}:a.timestampMode!=="body"||nt(a.data)||(a.data=ce({},a.data,{sent_at:new Date().toISOString()}))),a.url=XE(a.url,a.method,a.compression,a.timestampMode);var _=Rp.filter((y=>!a.disableTransport||!y.transport||!a.disableTransport.includes(y.transport))),x=(s=(i=(function(y,w){for(var E=0;y.length>E;E++)if(y[E].transport===m)return y[E]})(_))==null?void 0:i.method)!==null&&s!==void 0?s:_[0].method;if(!x)throw new Error("No available transport method");m!=="sendBeacon"&&a.data&&a.compression===lr.GZipJS&&xL&&typeof Promise<"u"&&!Tp?tN(a).then((y=>{x(y)})).catch((y=>{if(bE(y))return Tp=!0,void x(ce({},a,{compression:void 0,url:XE(n.url,n.method,void 0,n.timestampMode)}));(w=>{if(!w||typeof w!="object")return!1;var E="name"in w?String(w.name):"";return bE(w)||E===t6})(y)&&(Tp=!0),x(a)})):x(a)})(ce({},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}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){Dv++;try{var n,r=[],s=[],i=[];Kh(e,(u=>{if(u)if(nt(n=u[0]))i.push(u);else if(Us(u))try{u.call(this)}catch(c){xe.error("Error executing queued PostHog call",u,c)}else nt(u)&&n==="alias"?r.push(u):nt(u)&&n.indexOf("capture")!==-1&&Us(this[n])?i.push(u):s.push(u)}));var a=function(u,c){Kh(u,(function(d){try{if(nt(d[0])){var h=c;bt(d,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[d[0]].apply(c,d.slice(1))}catch(p){xe.error("Error executing queued PostHog call",d,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Dv--}}push(e){if(Dv>0&&nt(e)&&wt(e[0])){var n=_s.prototype[e[0]];Us(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.dn){if(this.is_capturing())if(!ge(e)&&wt(e)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||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&&!wt(n==null?void 0:n.$current_url)&&(xe.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.kn||xe.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,m=(r==null?void 0:r.timestamp)||p,_=PE(r==null?void 0:r.uuid,Ki),x={uuid:_,event:e,properties:this.calculateEventProperties(e,n||{},m,_)};e===mu&&this.config.__preview_capture_bot_pageviews&&d&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var y=e==="$feature_flag_called"&&x.properties.$feature_flag_has_experiment===!1&&this.get_property(cm)===!0;r!=null&&r.$set&&!y&&(x.$set=r==null?void 0:r.$set);var w=r==null?void 0:r.$unset;w&&(x.$unset=w);var E,P,T,k=y?void 0:this.Sn(r==null?void 0:r.$set_once,e!==ME,e===Ev);if(k&&(x.$set_once=k),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,u=N=>wt(N)?N.slice(0,i):N,c=new Set,x=(function N(W,Y){if(W!==Object(W))return u?u(W):W;if(!c.has(W)){var q;if(c.add(W),nt(W))q=[],Kh(W,(K=>{q.push(N(K))}));else{var B={};bt(W,((K,$)=>{c.has(K)||(B[$]=N(K))})),q=B}return q}})(a)),x.timestamp=m,ge(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),y&&(x.properties=(function(N,W){W===void 0&&(W=[]);var Y={},q=B=>{N[B]!==void 0&&(Y[B]=N[B])};return wL.forEach(q),W.forEach(q),Y})(x.properties,mN)),e===Ji.DISMISSED||e===Ji.SENT){var R=n==null?void 0:n[Iv.SURVEY_ID],L=n==null?void 0:n[Iv.SURVEY_ITERATION];OP({id:R,current_iteration:L}),x.$set=ce({},x.$set,{[(E={id:R,current_iteration:L},P=e===Ji.SENT?"responded":"dismissed",T="$survey_"+P+"/"+E.id,E.current_iteration&&E.current_iteration>0&&(T="$survey_"+P+"/"+E.id+"/"+E.current_iteration),T)]:!0})}else e===Ji.SHOWN&&(x.$set=ce({},x.$set,{[Iv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===KD.SHOWN){var O=n==null?void 0:n[WE.TOUR_TYPE];O&&(x.$set=ce({},x.$set,{[WE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=ce({},x.properties.$set,x.$set);if(Ko(A)||this.setPersonPropertiesForFlags(A),!rt(this.config.before_send)){var M=this.wt(x);if(!M)return;(x=M).uuid=PE(x.uuid,Ki)}this.en.emit("eventCaptured",x);var D=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),F={method:"POST",url:D,data:x,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D)?"query":"capture-body",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.cn(F):this.dn.enqueue(F),x}xe.critical("This capture call is ignored due to client rate limiting.")}}else xe.error("No event name provided to posthog.capture")}else xe.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=ce({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Yi()&&(u[V6]=!0),e==="$snapshot"){var c=ce({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!wt(u.distinct_id)&&!Un(u.distinct_id)||dy(u.distinct_id))&&xe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,h=(function(T,k,R,L){var O,A,M,D;if(L===void 0&&(L=!1),!kr)return{};var F,N=T?[...Ju,...k||[]]:[],W=(function(Te){for(var We=0;CE.length>We;We++){var Rt=CE[We],Ye=Rt[1],we=Rt[0].exec(Te),Mt=we&&(Us(Ye)?Ye(we,Te):Ye);if(Mt)return Mt}return["",""]})(kr),Y=W[0],q=W[1],B=(F=typeof navigator<"u"?navigator:void 0)!=null&&F.brave?{brave:!0}:{},K={};ge(R)||(K.detectGoogleSearchApp=R);var $={},J=(O=navigator)==null||(O=O.userAgentData)==null?void 0:O.platform,H=(A=navigator)==null?void 0:A.maxTouchPoints,j=ne==null||(M=ne.screen)==null?void 0:M.width,X=ne==null||(D=ne.screen)==null?void 0:D.height,te=ne==null?void 0:ne.devicePixelRatio;ge(J)||($.userAgentDataPlatform=J),ge(H)||($.maxTouchPoints=H),ge(j)||($.screenWidth=j),ge(X)||($.screenHeight=X),ge(te)||($.devicePixelRatio=te);var ie,ae,ue,Se,oe,se,ye,be,je=It(A2({$os:Y,$os_version:q,$browser:C6(kr,navigator.vendor,B,K),$device:kE(kr),$device_type:(ae=kr,ue=$,be=kE(ae),be===a6||be===o6||be==="Kobo"||be==="Kindle Fire"||be===x6?qu:be===Vd||be===Pu||be===$d||be===hy?"Console":be===u6?"Wearable":be?Jr:(ue==null?void 0:ue.userAgentDataPlatform)==="Android"&&((Se=ue==null?void 0:ue.maxTouchPoints)!==null&&Se!==void 0?Se:0)>0?600>Math.min((oe=ue==null?void 0:ue.screenWidth)!==null&&oe!==void 0?oe:0,(se=ue==null?void 0:ue.screenHeight)!==null&&se!==void 0?se:0)/((ye=ue==null?void 0:ue.devicePixelRatio)!==null&&ye!==void 0?ye:1)?Jr:qu:"Desktop"),$timezone:mP(),$timezone_offset:BD()}),{$current_url:Ud(L?ra(on==null?void 0:on.href):on==null?void 0:on.href,N,Bd),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:kr.length>1e3?kr.substring(0,997)+"...":kr,$browser_version:$L(kr,navigator.vendor,B,K),$browser_language:BE(),$browser_language_prefix:(ie=BE(),typeof ie=="string"?ie.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&&(je.$sdk_dist_channel=vt.SDK_DIST_CHANNEL),je})(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()),m=p.windowId;u.$session_id=p.sessionId,u.$window_id=m}this.sessionPropsManager&&It(u,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&It(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(_=this.vn)==null?void 0:_.length}catch(T){u.$sdk_debug_error_capturing_properties=String(T)}if(this.requestRouter.region===Uy&&(u.$lib_custom_api_host=this.config.api_host),d=e!==mu||i?e!==Sv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=It(u,d),e===mu&&Ce&&(u.title=Ce.title),!ge(a)){var x=r.getTime()-a;u.$duration=parseFloat((x/1e3).toFixed(3))}kr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),w=this.sessionPersistence.properties();bt(["$referrer","$referring_domain"],(T=>{T in y&&delete w[T]})),(u=It({},h,y,w,u)).$is_identified=this._isIdentified(),nt(this.config.property_denylist)?bt(this.config.property_denylist,(function(T){delete u[T]})):xe.error(LP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(xe.error(rC),u=E(u,e));var P=this.Cn();return u.$process_person_profile=P,P&&!i&&this.Tn("_calculate_event_properties"),u}Sn(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Cn()||this.Xi&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=It({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(xe.error(rC),u=c(u,"$set_once")),n&&(this.Xi=!0),Ko(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)}In(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,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}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.en.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:sd}),()=>{})}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:sd})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:sd})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=dN),(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:sd}}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:sd})}Mn(e){return!e||dy(e)?(xe.critical("Unique user id has not been set in posthog.identify"),!1):e===Gh?(xe.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())||(xe.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 xe.uninitializedWarning("posthog.identify");if(Un(e)&&(e=e.toString(),xe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.Tn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(um)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(pd)&&(this.unregister(pd),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Vs)||ru)===ru;e!==s&&a?(this.persistence.set_property(Vs,su),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(Ev,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.sn=eC(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(Sd))}}setPersonProperties(e,n){if((e||n)&&this.Tn("posthog.setPersonProperties")){var r=eC(this.get_distinct_id(),e,n);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.sn=r):xe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(nt(e)?e:[e]).filter((s=>wt(s)&&s.length>0));r.length!==0&&this.Tn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ce({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(ME,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else xe.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.Tn("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,d,h,p;if(xe.info("reset"),!this.__loaded)return xe.uninitializedWarning("posthog.reset");var m,_=this.get_property(um),x=this.get_property(bv),y=this.get_property(rl);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),ge(y)||(m=this.persistence)==null||m.register({[rl]:y}),(s=this.surveys)==null||s.reset(),(i=this.wn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(u=this.conversations)==null||u.reset(),(c=this.logs)==null||c.reset(),(d=this.metrics)==null||d.reset(),(h=this.persistence)==null||h.set_property(Vs,ru),(p=this.sessionManager)==null||p.resetSessionId(),this.sn=null,this.config.cookieless_mode===Xi)this.register_once({distinct_id:Gh,$device_id:null},"");else{var w=this.config.get_device_id(Ki());this.register_once({distinct_id:w,$device_id:e?w:_},""),e||ge(x)||this.register({[bv]: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 tn((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.dn)==null||i.unload(),(a=n.vn)==null||a.unload(),(u=n.featureFlags)==null||u.destroy()):xe.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.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}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(O6)?(xe.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(ge(n)&&(n=this.get_distinct_id()),e!==n?(this.In(pd,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(xe.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=ce({},this.config);if(Nt(e)){var r,s,i,a,u,c,d,h,p,m,_;It(this.config,sC(e));var x=this.hn();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rv(ce({},this.config,{persistence:"sessionStorage"}),x,!1);var y=this.an(this.config.debug);Bs(y)&&(this.config.debug=y),Bs(this.config.debug)&&(this.config.debug?(vt.DEBUG=!0,Ct.N()&&Ct.q("ph_debug",!0),xe.info("set_config",{config:e,oldConfig:n,newConfig:ce({},this.config)})):(vt.DEBUG=!1,Ct.N()&&Ct.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(),(d=this.heatmaps)==null||d.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.Pn(),(_=this.externalIntegrations)==null||_.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(ce({},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:_s.On}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:gu;return n!==gu&&(n=gu+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Vs))===su||((n=this.sessionPersistence)==null?void 0:n.get_property(Vs))===su}Cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Ly&&!this._isIdentified()&&Ko(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[pd])&&((n=this.persistence)==null||(n=n.props)==null||!n[hm]))}xn(){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.Cn()||this.Tn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Tn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Tn(e){return this.config.person_profiles==="never"?(xe.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(hm,!0),!0)}hn(){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!==Xa)}Pn(){var e,n,r,s,i=this.hn();return((e=this.persistence)==null?void 0:e.yr)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.yr)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Xi){if(this.Yi()){var r,s,i,a,u;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new JE(this),this.pageViewManager=new UE(this),this.persistence&&(this.sessionPropsManager=new QE(this,this.sessionManager,this.persistence));var c,d=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=_s.__defaultExtensionClasses)==null?void 0:u.sessionRecording;d&&(this.sessionRecording=this.Ji(this.sessionRecording,new d(this)),this.yn&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.yn)))}var h,p;this.consent.optInOut(!0),this.Pn(),this.bn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Xa&&((h=this.surveys)==null||h.loadIfEnabled()),(ge(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._n()}else xe.warn(nC)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Xi?(this.config.cookieless_mode===Xa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Xa&&(this.register({distinct_id:Gh,$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._n(),this.bn())):xe.warn(nC)}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===Xi||(this.config.cookieless_mode===Xa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return ur?PP(ur,this.config.custom_blocked_useragents):void 0}_n(){Ce&&(Ce.visibilityState==="visible"?this.tn||(this.tn=!0,this.capture(mu,{title:Ce.title},{send_instantly:!0}),this.rn&&(Ce.removeEventListener(pm,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),Ut(Ce,pm,this.rn)))}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}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(xe.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):(function(n,r,s,i,a){var u=r in n&&!rt(n[r]),c=s in n&&!rt(n[s]);return u?n[r]:!!c&&(a&&a.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,xe)}wt(e){var n;if(rt(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(TL),s=nt(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),rt(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return PL(e.event)?xe.warn(u+". This can cause unexpected behavior."):xe.info(u),null}i.properties&&!Ko(i.properties)||xe.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&rt(i.properties[c]))return xe.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.ir)==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)})}an(e){var n=Bs(e)&&!e,r=Ct.N()&&Ct.A("ph_debug")==="true";return!n&&(!!r||e)}}_s.__defaultExtensionClasses={},_s.On=(()=>{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]]=gD(t.prototype[e[n]])})(_s,["identify"]);class iC{constructor(e){this.disabled=e===!1;var n=Nt(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 jv="$copy_autocapture",Fv=$t("[AutoCapture]");function Vv(t,e){return e.length>t?e.slice(0,t)+"...":e}function yN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!sa(e));return e}function _N(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!sa(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!Yr(m,"body")&&Y6>h.length;)if(q6(m.parentNode)){var _=m.parentNode.host;if(p.has(_))break;p.add(_),h.push(_),m=_}else{if(!sa(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var x,y,w=[],E={},P=!1,T=!1;if(bt(h,(A=>{var M=Ny(A);if(Yr(A,"a")){var D=A.getAttribute("href");P=!!(M&&D&&Ed(D))&&(d?ra(D):D)}Ze(vm(A),"ph-no-capture")&&(T=!0),w.push((function(N,W,Y,q,B){B===void 0&&(B=!1);var K=N.tagName.toLowerCase(),$={tag_name:K};M2.indexOf(K)>-1&&!Y&&($.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?Vv(1024,$E(N)):Vv(1024,zd(N)));var J=vm(N);J.length>0&&($.classes=J.filter((function(te){return te!==""}))),bt(N.attributes,(function(te){var ie;if((!tP(N)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(q==null||!q.includes(te.name))&&!W&&Ed(te.value)&&(!wt(ie=te.name)||ie.substring(0,10)!=="_ngcontent"&&ie.substring(0,7)!=="_nghost")){var ae=te.value;te.name==="class"&&(ae=I2(ae).join(" ")),$["attr__"+te.name]=Vv(1024,te.name==="href"&&B?ra(ae):ae)}}));for(var H=1,j=1,X=N;X=yN(X);)H++,X.tagName===N.tagName&&j++;return $.nth_child=H,$.nth_of_type=j,$})(A,i,a,u,d));var F=(function(N){if(!Ny(N))return{};var W={};return bt(N.attributes,(function(Y){if(Y.name&&Y.name.indexOf("data-ph-capture-attribute")===0){var q=Y.name.replace("data-ph-capture-attribute-",""),B=Y.value;q&&B&&Ed(B)&&(W[q]=B)}})),W})(A);It(E,F)})),T)return{props:{},explicitNoCapture:T};if(a||(w[0].$el_text=Yr(t,"a")||Yr(t,"button")?$E(t):zd(t)),P){var k,R;w[0].attr__href=P;var L=(k=ym(P))==null?void 0:k.host,O=ne==null||(R=ne.location)==null?void 0:R.host;L&&O&&L!==O&&(x=P)}return{props:It({$event_type:s.type,$ce_version:1},c?{}:{$elements:w},{$elements_chain:(y=w,(function(A){return A.map((M=>{var D,F,N="";if(M.tag_name&&(N+=M.tag_name),M.attr_class)for(var W of(M.attr_class.sort(),M.attr_class))N+="."+W.replace(/"/g,"");var Y=ce({},M.text?{text:M.text}:{},{"nth-child":(D=M.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(F=M.nth_of_type)!==null&&F!==void 0?F:0},M.href?{href:M.href}:{},M.attr_id?{attr_id:M.attr_id}:{},M.attributes),q={};return Pp(Y).sort(((B,K)=>B[0].localeCompare(K[0]))).forEach((B=>{var K=B[1];return q[HE(B[0].toString())]=HE(K.toString())})),(N+=":")+Pp(q).map((B=>B[0]+'="'+B[1]+'"')).join("")})).join(";")})((function(A){return A.map((M=>{var D,F,N={text:(D=M.$el_text)==null?void 0:D.slice(0,400),tag_name:M.tag_name,href:(F=M.attr__href)==null?void 0:F.slice(0,2048),attr_class:ND(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return Pp(M).filter((W=>W[0].indexOf("attr__")===0)).forEach((W=>N.attributes[W[0]]=W[1])),N}))})(y)))},(n=w[0])!=null&&n.$el_text?{$el_text:(r=w[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},E)}}var id=$t("[ExceptionAutocapture]"),oC=()=>{},xN=$t("[TracingHeaders]"),Fa=$t("[Web Vitals]"),aC=9e5,lC="disabled",uC="lazy_loading",od="awaiting_config",Qh="missing_config";$t("[SessionRecording]"),$t("[SessionRecording]");var By="[SessionRecording]",Li=$t(By),wN=$t("[Heatmaps]");function $v(t){return Nt(t)&&"clientX"in t&&"clientY"in t&&Un(t.clientX)&&Un(t.clientY)}var Hv=$t("[Product Tours]"),zv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(P2))},bN=["$set_once","$set"],ti=$t("[SiteApps]"),cC="Error while initializing PostHog app with config id ";function au(t,e,n){if(rt(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 SN{constructor(e){this.Fn=new j2,this.Ln=(n,r)=>this.$n(n,r)&&this.An(n,r)&&this.Nn(n,r)&&this.Dn(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.qn=new Set,this.jn=new Set}init(){var e,n;ge((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(!ge((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.jn)==null||u.add(a),(c=a.steps)==null||c.forEach((d=>{var h;(h=this.qn)==null||h.add((d==null?void 0:d.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.qn.has(e)||this.qn.has(n.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach((s=>{this.Hn(n,s)&&this.Fn.emit("actionCaptured",s.name)}))}Bn(e){this.onAction("actionCaptured",(n=>e(n)))}Hn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,n){return this.Fn.on(e,n)}An(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"||!au(s,n.url,n.url_matching||"contains"))return!1}return!0}Nn(e,n){return!!this.Un(e,n)&&!!this.zn(e,n)&&!!this.Vn(e,n)}Un(e,n){var r;if(n==null||!n.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some((u=>au(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&au((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}zn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some((d=>au(d.text,n.text,n.text_matching||"exact")||au(d.$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(d){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!rt(h=m.exec(d));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((d=>au(d,a,u))))}Vn(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}Wn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,n){return n==null||!n.properties||n.properties.length===0||AP(n.properties.reduce(((r,s)=>{var i=nt(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 EN{constructor(e){var n;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.Kn(r)))}Yn(e,n){return!!e&&AP(e.propertyFilters,n==null?void 0:n.properties)}Xn(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}es(e,n,r){var s=(r===Jc.Activation?this.Gn:this.Qn).get(e),i=[];return this.ts((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((d=>d.name===e));return this.Yn(c,n)}))}register(e){var n;ge((n=this._instance)==null?void 0:n._addCaptureHook)||(this.rs(e),this.ns(e))}ns(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.ss==null&&(this.ss=new SN(this._instance),this.ss.init(),this.ss.Bn((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.ss)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var h=this.Jn.get(d.name);h&&h.push(r.id),this.Jn.set(d.name,h||[r.id])}})))})))}rs(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.Gn=this.Xn(e,Jc.Activation),this.Qn=this.Xn(e,Jc.Cancellation))}onEvent(e,n){var r,s,i=this.os(),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.ls(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.us([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.hs(a)}if(this.Qn.has(e)){var c=this.es(e,n,Jc.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.us(c.map((h=>h.id))),c.forEach((h=>this.ds(h.id))))}if(this.Gn.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Gn.get(e)});var d=this.es(e,n,Jc.Activation);this.cs(d.map((h=>h.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((r=>r!==e));var n=this.vs();n.includes(e)||(this.fs([...n,e]),this.ps())}us(e){var n=new Set(e);this.Zn=this.Zn.filter((i=>!n.has(i)));var r=this.gs(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.fs(s),s.length===0&&this.ys())}gs(){var e,n=this.bs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}vs(){var e,n,r=this.gs();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this._s()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}ps(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.ws(n)}ys(){this.xs()}Kn(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class CN extends EN{constructor(e){super(e)}bs(){return Py}_s(){return kp}Cs(){return Ji.SHOWN}ts(e){var n;(n=this._instance)==null||n.getSurveys(e)}ds(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}os(){return _t}fs(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Py]:e})}ws(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[kp]:e})}xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(kp)}ks(){return!1}ls(e,n){var r;this.ts((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return IP(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===Ji.SHOWN?"consume":"ignore":e===Ji.SHOWN?"persist":e===Ji.DISMISSED||e===Ji.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Jh="SDK is not enabled or survey functionality is not yet loaded",dC="Disabled. Not loading surveys.",kN=ne!=null&&ne.location?_m(ne.location.hash,"__posthog")||_m(location.hash,"state"):null,fC="_postHogToolbarParams",hC=$t("[Toolbar]"),fn=$t("[FeatureFlags]"),Va=$t("[FeatureFlags]",{debugEnabled:!0}),Uv=`" failed. Feature flags didn't load in time.`,pC=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},mC=t=>{var e={};for(var n of Pp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Di=$t("[Error tracking]"),gC="Refusing to render web experiment since the viewer is a likely bot",PN={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>bm(e,t),not_regex:(t,e)=>!bm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Qn{get Te(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Qn.Ts("retrieved web experiments from the server"),n.Is=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.Is&&(Qn.Ts("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.Is)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);wt(u)&&i.variants[u]&&n.Ms(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];Qn.Es(d,n._instance)&&n.Ms(i.name,c,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Qn.Ts(gC);else if(!this.Te.disable_web_experiments){if(rt(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Qn.Ts("applying feature flags",e),e.forEach((n=>{var r;if(this.Is&&(r=this.Is)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.Is)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.Ms(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Qn.getWindowLocation();if(e!=null&&e.search){var n=Qu(e==null?void 0:e.search,"__experiment_id"),r=Qu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Qn.Ts("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.Rs(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Te.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.Te.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Rs(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Qn.Ts("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ms(s[0].name,n,s[0].variants[n].transforms))}static Es(e,n){return!rt(e.conditions)&&Qn.Ps(e,n)&&Qn.Os(e)}static Ps(e,n){var r;if(rt(e.conditions)||rt((r=e.conditions)==null?void 0:r.url))return!0;var s=Qn.getWindowLocation();if(s){var i,a,u,c=G6(n,s.href);return(i=e.conditions)==null||!i.url||PN[(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 Os(e){var n;if(rt(e.conditions)||rt((n=e.conditions)==null?void 0:n.utm))return!0;var r=uP();if(r.utm_source){var s,i,a,u,c,d,h,p,m=(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,_=(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||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,y=(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 m&&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];xe.info("[WebExperiments] "+e,r)}Ms(e,n,r){this._is_bot()?Qn.Ts(gC):n!=="control"?r.forEach((s=>{if(s.selector){var i;Qn.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)}))}})):Qn.Ts("Control variants leave the page unmodified.")}_is_bot(){return ur&&this._instance?PP(ur,this.Te.custom_blocked_useragents):void 0}}var gs=$t("[Conversations]"),$a="Conversations not available yet.",vC="console",i0={featureFlags:class{constructor(t){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],ne&&Ut(ne,"online",this.Bs)}destroy(){ne==null||ne.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(t){return this._instance.get_property(t)}Vs(){var t,e;return(t=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,fn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var t,e=(t=this.Te.evaluation_contexts)!==null&&t!==void 0?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(fn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||fn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!ge(t)){if(nt(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||fn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));fn.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((d=>!!r[d])).reduce(((d,h)=>(d[h]=r[h]||!1,d)),{}),c=Object.keys(a).filter((d=>u[d])).reduce(((d,h)=>(a[h]&&(d[h]=a[h]),d)),{});this.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.zs(el))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.zs(Cp))!==null&&s!==void 0?s:{},u=ce({},i,t),c=ce({},a,e),d={};for(var h of Object.entries(u)){var p=h[0],m=h[1];d[p]={key:p,enabled:yE(m),variant:_E(m),reason:void 0,metadata:ge(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.receivedFeatureFlags({flags:d})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.zs(Ey),e=this.zs(zi),n=this.zs(pu);if(!n&&!e)return t||{};var r=It({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],d=e==null?void 0:e[i],h=ge(d)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!d,p=ge(d)?c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[i],_=ce({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(_.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(_.original_variant=c==null?void 0:c.variant),m&&(_.metadata=ce({},c==null?void 0:c.metadata,{payload:m,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=_}return this.Fs||(fn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:yE(r),variant:_E(r),payload:vE(e[n])}}))}getFlagVariants(){var t=this.zs(el),e=this.zs(zi);if(!e)return t||{};for(var n=It({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(fn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Fs=!0),n}getFlagPayloads(){var t=this.zs(Cp),e=this.zs(pu);if(!e)return t||{};for(var n=It({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(fn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Fs=!0),n}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.en.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.As=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var n=this.Te.token,r=this.zs(um),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ce({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.zs(qa)||{},{$lib:vt.LIB_NAME,$lib_version:vt.LIB_VERSION}),group_properties:this.zs(Ya),timezone:mP()};hr(r)||ge(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var i=this.Qs();ge(i)||(s.flag_keys=i);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.Te.disable_compression?void 0:lr.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:c=>{var d,h,p,m=!0;if(this.Xs(c.statusCode),c.statusCode===200&&(this.Ns||(this.$anon_distinct_id=void 0),m=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!m;var _=[];c.error?c.error instanceof Error?_.push(c.error.name==="AbortError"?"timeout":"connection_error"):_.push("unknown_error"):c.statusCode!==200&&_.push("api_error_"+c.statusCode),(d=c.json)!=null&&d.errorsWhileComputingFlags&&_.push("errors_while_computing_flags");var x,y=!((h=c.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));y&&_.push("quota_limited"),(p=this.mi)==null||p.register({[Ry]:_}),y?fn.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:{},m,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return aP(this.Hs,3)}Xs(t){this.Hs=lP(t,this.Hs,3,(()=>fn.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.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){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 fn.warn('getFeatureFlag for key "'+t+Uv)}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.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),u=this.zs(Cy)||void 0,c=this.zs(Hd)||void 0,d=this.zs(Sd)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),m=this.zs(Ty);p&&p!==m&&(d={},(h=this.mi)==null||h.register({[Sd]:d,[Ty]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in d)||!d[t].includes(a))){var _,x,y,w,E,P,T,k,R,L,O;nt(d[t])?d[t].push(a):d[t]=[a],(_=this.mi)==null||_.register({[Sd]:d});var A=this.getFeatureFlagDetails(t),M=[...(x=this.zs(Ry))!==null&&x!==void 0?x:[]];ge(s)&&M.push("flag_missing");var D={$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:((y=this.Te.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[t])||null,$feature_flag_bootstrapped_payload:((w=this.Te.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[t])||null,$used_bootstrap_value:!this.Ds};ge(A==null||(E=A.metadata)==null?void 0:E.has_experiment)||(D.$feature_flag_has_experiment=A.metadata.has_experiment),ge(A==null||(P=A.metadata)==null?void 0:P.version)||(D.$feature_flag_version=A.metadata.version);var F,N=(T=A==null||(k=A.reason)==null?void 0:k.description)!==null&&T!==void 0?T:A==null||(R=A.reason)==null?void 0:R.code;N&&(D.$feature_flag_reason=N),A!=null&&(L=A.metadata)!=null&&L.id&&(D.$feature_flag_id=A.metadata.id),ge(A==null?void 0:A.original_variant)&&ge(A==null?void 0:A.original_enabled)||(D.$feature_flag_original_response=ge(A.original_variant)?A.original_enabled:A.original_variant),A!=null&&(O=A.metadata)!=null&&O.original_payload&&(D.$feature_flag_original_payload=A==null||(F=A.metadata)==null?void 0:F.original_payload),M.length&&(D.$feature_flag_error=M.join(",")),this._instance.capture("$feature_flag_called",D)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:vE(i)}}}else fn.warn('getFeatureFlagResult for key "'+t+Uv)}getRemoteConfigPayload(t,e){var n=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:n,person_properties:{$lib:vt.LIB_NAME,$lib_version:vt.LIB_VERSION}};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();ge(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:lr.Base64,timestampMode:"body",timeout:this.Te.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.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return fn.warn('isFeatureEnabled for key "'+t+Uv),e.defaultValue;var n=this.getFeatureFlag(t,e);return ge(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.mi){this.Ls=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,u,c,d,h,p){c===void 0&&(c={}),d===void 0&&(d={}),h===void 0&&(h={});var m=(A=>{var M=A.flags;return M?(A.featureFlags=Object.fromEntries(Object.keys(M).map((D=>{var F;return[D,(F=M[D].variant)!==null&&F!==void 0?F:M[D].enabled]}))),A.featureFlagPayloads=Object.fromEntries(Object.keys(M).filter((D=>M[D].enabled)).filter((D=>{var F;return(F=M[D].metadata)==null?void 0:F.payload})).map((D=>{var F;return[D,(F=M[D].metadata)==null?void 0:F.payload]})))):A.featureFlags&&fn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A})(a),_=m.flags,x=m.featureFlags,y=m.featureFlagPayloads;if(x){var w=a.requestId,E=a.evaluatedAt;if(nt(x)){fn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var P={};if(x)for(var T=0;x.length>T;T++)P[x[T]]=!0;u&&u.register({[Ep]:x,[el]:P,[cm]:!1})}else{var k=x,R=y,L=_;if(p!=null&&p.partialResponse)k=ce({},c,k),R=ce({},d,R),L=ce({},h,L);else if(a.errorsWhileComputingFlags)if(_){var O=new Set(Object.keys(_).filter((A=>{var M;return!((M=_[A])!=null&&M.failed)})));k=ce({},c,Object.fromEntries(Object.entries(k).filter((A=>O.has(A[0]))))),R=ce({},d,Object.fromEntries(Object.entries(R||{}).filter((A=>O.has(A[0]))))),L=ce({},h,Object.fromEntries(Object.entries(L||{}).filter((A=>O.has(A[0])))))}else k=ce({},c,k),R=ce({},d,R),L=ce({},h,L);u&&u.register(ce({[Ep]:Object.keys(mC(k)),[el]:k||{},[Cp]:R||{},[Ey]:L||{},[cm]:a.minimalFlagCalledEvents===!0},w?{[Cy]:w}:{},E?{[Hd]:E}:{}))}}})(t,this.mi,r,s,i,n),e||(this.js=!1),this.eo(e)}}override(t,e){e===void 0&&(e=!1),fn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return fn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(zi),this.mi.unregister(pu),this.eo(),Va.info("All overrides cleared");if(nt(t)){var e=pC(t);return this.mi.register({[zi]:e}),this.eo(),Va.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.Fs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.mi.unregister(zi),Va.info("Flag overrides cleared");else if(r.flags){if(nt(r.flags)){var s=pC(r.flags);this.mi.register({[zi]:s})}else this.mi.register({[zi]:r.flags});Va.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(pu),Va.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[pu]:r.payloads}),Va.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(t&&typeof t=="object")return this.mi.register({[zi]:t}),this.eo(),Va.info("Flag overrides set",{flags:t});fn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ls){var e=this.ro(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){fn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.zs(gd)||[]).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=ce({},this.getFlagVariants(),{[t]:e});(r=this.mi)==null||r.register({[Ep]:Object.keys(mC(u)),[el]:u}),this.eo()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.zs(gd),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.Te.token+s),method:"GET",timestampMode:"query",callback:i=>{var a,u;if(i.json){var c=i.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(gd),(u=this.mi)==null||u.register({[gd]:c}),t(c)}}})}ro(){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)),{})}}eo(t){var e=this.ro(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){fn.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(qa)||{},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({[qa]:ce({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=ce({},this.zs(qa)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[qa]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(qa),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Ya)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=ce({},n[r],t[r]),delete t[r]})),this._instance.register({[Ya]:ce({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Ya)||{};this._instance.register({[Ya]:ce({},e,{[t]:{}})})}else this._instance.unregister(Ya)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},TN={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.io)==null||!t.isStarted)}get status(){var t,e;return this.no===od||this.no===Qh?this.no:(t=(e=this.io)==null?void 0:e.status)!==null&&t!==void 0?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=lC,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw Li.error("started without valid sessionManager"),new Error(By+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Xi)throw new Error(By+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!((t=this._instance.get_property(rl))==null||!t.enabled),n=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.oo||(e=this.io)==null||!e.isStarted){var n=!ge(Object.assign)&&!ge(Array.from);this.oo&&n?(this.ao(t),Li.info("starting")):(this.no=lC,this.stopRecording())}}ao(t){var e,n,r;this.oo&&(this.no!==od&&this.no!==Qh&&(this.no=uC),$e!=null&&(e=$e.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=$e.__PosthogExtensions__)!=null&&n.initSessionRecording?this.lo(t):(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.uo,(s=>{if(s)return Li.error("could not load recorder",s);this.lo(t)})))}stopRecording(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.stop()}ho(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.discard()}do(){var t,e;(t=this.mi)==null||t.unregister(T2),(e=this.mi)==null||e.unregister(L6)}co(t,e){if(rt(t))return null;var n,r=Un(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Li.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}vo(t){if(this.mi){var e,n,r=this.mi,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.co((i=this.Te.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.co(a==null?void 0:a.sampleRate,"remote config sampleRate"),d=u??c;rt(d)&&this.do();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[rl]:ce({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:ce({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:d,minimumDurationMilliseconds:ge(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.so)==null||e.call(this),this.so=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===od&&(this.no=Qh,Li.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.io)!=null&&n.log?this.io.log(t,e):Li.warn("log called before recorder was ready")}get uo(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(rl);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}fo(){var t,e,n=this._instance.get_property(rl);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Li.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}lo(t){var e,n;if((e=$e.__PosthogExtensions__)==null||!e.initSessionRecording)return Li.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[z6]:!0});if(this.io||(this.io=(n=$e.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo())return this.no===Qh||this.no===od?void 0:(this.no=od,Li.info("persisted remote config is stale, requesting fresh config before starting"),void new gP(this._instance).load());this.no=uC,this.io.start(t)}onRRwebEmit(t){var e;(e=this.io)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||(e=this.mi)==null||e.register({[N6]:!0}),(t=this.io)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||(e=this.mi)==null||e.register({[D6]:!0}),(t=this.io)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.io||(n=this.mi)==null||n.register({[t==="url"?j6:F6]:!0}),(e=this.io)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.io)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.io)==null||!n.tryAddCustomEvent(t,e))}}},RN={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new iC(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,n=Nt(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}wo(){if(this.isBrowserSupported()){if(ne&&Ce){var t=n=>{n=n||(ne==null?void 0:ne.event);try{this.xo(n)}catch(r){Fv.error("Failed to capture event",r)}};if(Ut(Ce,"submit",t,{capture:!0}),Ut(Ce,"change",t,{capture:!0}),Ut(Ce,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=n=>{n=n||(ne==null?void 0:ne.event);try{this.xo(n,jv)}catch(r){Fv.error("Failed to capture copy/cut event",r)}};Ut(Ce,"copy",e,{capture:!0}),Ut(Ce,"cut",e,{capture:!0})}}}else Fv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var n=e.autocapture_opt_out;Bs(n)&&(this.instance.persistence&&this.instance.persistence.register({[vy]:n}),this.mo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,n=[];return(e=this._o)==null||e.forEach((r=>{var s=Ce==null?void 0:Ce.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[vy],r=this.mo,s=this.instance.Ur()&&!this.yo;if(hr(r)&&!Bs(n)&&!s)return!1;var i=(e=this.mo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}xo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=kv(t);Z6(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())&&VE(r,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var s=e===jv;if(r&&(function(p,m,_,x,y,w){var E;if(!ne||O2(p)||_!=null&&_.url_allowlist&&!NE(_.url_allowlist,w)||_!=null&&_.url_ignorelist&&NE(_.url_ignorelist,w))return!1;if(_!=null&&_.dom_event_allowlist){var P=_.dom_event_allowlist;if(P&&!P.some((A=>m.type===A)))return!1}var T=eP(p,x),k=T.parentIsUsefulElement,R=T.targetElementList;if(!(function(A,M){var D=M==null?void 0:M.element_allowlist;if(ge(D))return!0;var F,N=function(Y){if(D.some((q=>Y.tagName.toLowerCase()===q)))return{v:!0}};for(var W of A)if(F=N(W))return F.v;return!1})(R,_)||!Dy(R,_==null?void 0:_.css_selector_allowlist)||Dy(R,(E=_==null?void 0:_.css_selector_ignorelist)!==null&&E!==void 0?E:RD))return!1;try{var L=ne.getComputedStyle(p);if(L&&L.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var O=p.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(y||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(y||["change","click"]).indexOf(m.type)>=0;default:return k?(y||["click"]).indexOf(m.type)>=0:(y||["click"]).indexOf(m.type)>=0&&(M2.indexOf(O)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var i=_N(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,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===jv){var c,d=X6(ne==null||(c=ne.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Us(Ce==null?void 0:Ce.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(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&&(xe.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,xe.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.Co("pushState"),this.Co("replaceState"),this.To())}Co(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 oC;var a={next:r[s]},u=i((function(){for(var c=arguments.length,d=new Array(c),h=0;c>h;h++)d[h]=arguments[h];return a.next.apply(this,d)}));return Us(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];Us(c)&&c.__posthog_layer__;){var d=c.__posthog_layer__;if(d.next===u)return void(d.next=a.next);c=d.next}else r[s]=a.next}}catch{return oC}})(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.ko&&this.isEnabled&&this._instance.capture(mu,{navigation_type:t}),this.ko=n}catch(r){xe.error("Error capturing "+t+" pageview",r)}}To(){if(!this.So){var t=()=>{this.Io("popstate")};Ut(ne,"popstate",t),this.So=()=>{ne&&ne.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=t,this.Mo=!((e=this.instance.persistence)==null||!e.props[yy]),this.rageclicks=new iC(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Nt(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return rt(this.Te.capture_heatmaps)?rt(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.po)return;wN.info("starting..."),this.Ro(),this.ke()}else{var t;clearInterval((t=this.Eo)!==null&&t!==void 0?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[yy]:n}),this.Mo=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){$v(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=(Ce==null?void 0:Ce.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){ne&&Ce&&(this.Fo=this.oi.bind(this),Ut(ne,mm,this.Fo),this.Lo=t=>this.pe(t||(ne==null?void 0:ne.event)),Ut(Ce,"click",this.Lo,{capture:!0}),this.$o=t=>this.Ao(t||(ne==null?void 0:ne.event)),Ut(Ce,"mousemove",this.$o,{capture:!0}),this.No=new zE(this.instance,jD,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),Ut(Ce,pm,this.Do),this.po=!0)}Po(){var t;ne&&Ce&&(this.Fo&&ne.removeEventListener(mm,this.Fo),this.Lo&&Ce.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&Ce.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&Ce.removeEventListener(pm,this.Do),clearTimeout(this.qo),(t=this.No)==null||t.stop(),this.po=!1)}jo(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 d=a;d&&sa(d)&&!Yr(d,"body");){if(d===c)return!1;var h=void 0;try{var p,m,_;h=(p=(m=(_=d.ownerDocument)==null?void 0:_.defaultView)!==null&&m!==void 0?m:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(Ze(u,h))return!0;d=Q6(d)}return!1})(kv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}pe(t,e){var n;if(e===void 0&&(e="click"),!DE(t.target)&&$v(t)){var r=this.jo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&VE(kv(t),this.instance.config.rageclick)&&this.Nt(ce({},r,{type:"rageclick"})),this.Nt(r)}}Ao(t){!DE(t.target)&&$v(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(t,"mousemove"))}),500))}Nt(t){if(ne){var e=this.Te.disable_capture_url_hashes?ra(ne.location.href):ne.location.href,n=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...Ju,...n||[]]:[],s=Ud(e,r,Bd);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}oi(){this.R&&!Ko(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zE,webVitalsAutocapture:class{constructor(t){var e;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>ce({},n,{["$web_vitals_"+r.name+"_event"]:ce({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.zo();if(!ge(s))if(rt(n==null?void 0:n.name)||rt(n==null?void 0:n.value))Fa.error("Invalid metric received",n);else if(!this.Vo||this.Vo>n.value){this.R.url!==s&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),ge(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=ge(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=ce({},n,{$current_url:s,timestamp:Date.now()});ge(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else Fa.error("Ignoring metric with value >= "+this.Vo,n)},this.Wo=()=>{if(!this.po){var n,r,s,i,a=$e.__PosthogExtensions__;if(!ge(a)&&!ge(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.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uo.bind(this)),this.po=!0):Fa.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Mo=!((e=this._instance.persistence)==null||!e.props[by]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Nt(this.Zo)?(t=this.Zo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return rt(n)?((e=this._instance.persistence)==null?void 0:e.props[Sy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Nt(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Nt(this.Zo)?this.Zo.web_vitals_attribution:void 0;return t!=null&&t}get Vo(){var t=Nt(this.Zo)&&Un(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:aC;return t>0&&6e4>=t?aC:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Fa.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Nt(this.Zo)?this.Zo.web_vitals:Bs(this.Zo)?this.Zo:void 0;return Bs(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Fa.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=Nt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Nt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[by]:n}),this._instance.persistence.register({[Sy]:r})),this.Mo=n,this.startIfEnabled()}}}er(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?Fa.error("failed to load script",r):t()}))}zo(){var t=ne?this._instance.config.disable_capture_url_hashes?ra(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?[...Ju,...e||[]]:[];return Ud(t,n,Bd)}Fa.error("Could not determine current URL")}}},AN={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var n;if(ne&&this.isEnabled&&(n=$e.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=r(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=s(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=i(this.captureException.bind(this)))}catch(a){id.error("failed to start",a),this.Ko()}}},this._instance=t,this.Yo=!((e=this._instance.persistence)==null||!e.props[_y]),this.Xo=new IL(ce({},(function(n){var r,s,i,a;return n===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}})(this._instance.config.error_tracking),{refillInterval:1e4,Ge:id})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Nt(t)?e=ce({},e,t):(ge(t)?this.Yo:t)&&(e=ce({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(id.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(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 id.error("failed to load script",r);t()}))}Ko(){var t,e,n;(t=this.Go)==null||t.call(this),this.Go=void 0,(e=this.Qo)==null||e.call(this),this.Qo=void 0,(n=this.Jo)==null||n.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[_y]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}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.Xo.consumeRateLimit(s)?id.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.ta=[],this.ra=new ZL([new nD,new dD,new sD,new rD,new uD,new lD,new oD,new cD],(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 d=[],h=u.split(`
|
|
18
|
+
`),p=c;h.length>p;p++){var m=h[p];if(1024>=m.length){var _=IE.test(m)?m.replace(IE,"$1"):m;if(!_.match(/\S*Error: /)){for(var x of i){var y=x(_,r);if(y){d.push(y);break}}if(d.length>=50)break}}}return(function(w){if(!w.length)return[];var E=Array.from(w);return E.reverse(),E.slice(0,50).map((P=>{return ce({},P,{filename:P.filename||(T=E,T[T.length-1]||{}).filename,function:P.function||Xu});var T}))})(d)}})("web:javascript",QL,tD)),this._instance=t,this.ta=(e=(n=this._instance.persistence)==null?void 0:n.get_property(xy))!==null&&e!==void 0?e:[],this.ia=lm(this.na()),this.sa=new hD(this.ia)}onConfigChange(){this.ia=lm(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ta=i,this._instance.persistence&&this._instance.persistence.register({[xy]:this.ta,[wy]:a})}}}get oa(){var t,e=!!this._instance.get_property(wy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!wt(t)||t.trim().length===0)return void Di.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)=>fD.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.aa(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Di.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(ce({[om]:t,[am]:new Date().toISOString()},r))}catch(i){Di.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void Di.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void Di.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void Di.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.ia.enabled&&rt(t.$exception_steps)?this.va(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.sa.clear(),r}catch(s){return Di.error("Failed to capture exception event. Dropping this exception.",s),void this.sa.clear()}}catch(s){return void Di.error("Failed to process exception event. Ignoring this exception.",s)}}va(t){try{var e=this.sa.getAttachable();return e.length===0?t:ce({},t,{$exception_steps:e})}catch(n){return Di.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ha(t){this.ia.enabled&&this.sa.add({[om]:t,[am]:new Date().toISOString()})}aa(t){return Nt(t)?ce({},t):{}}na(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ua(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return wt(s)&&s.length>0&&n.$exception_types.push(s),wt(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.ta.some((n=>{var r=n.values.map((s=>{var i,a=RP[s.operator],u=nt(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)}))}da(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://")))}ca(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}la(t){return!rt(t)&&nt(t)}}},IN=ce({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.mi&&this.mi.register({[P2]:!!e.productTours}),!zv(this._instance))return!this.fa&&rt((n=this.mi)==null?void 0:n.props[vd])||Hv.info("product tours disabled; stopping and clearing cached tours"),(r=this.fa)==null||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&zv(this._instance)&&this.er((()=>this.ga()))}er(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?Hv.error("Could not load product tours script",r):t()}))}ga(){var t;!this.fa&&(t=$e.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.fa=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!nt(this.pa)||e){var n=this.mi;if(n){var r=n.props[vd];if(nt(r)&&!e)return this.pa=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",timestampMode:"query",callback:s=>{if(zv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return Hv.error(a),void t([],{isLoaded:!1,error:a})}var u=nt(s.json.product_tours)?s.json.product_tours:[];this.pa=u,n&&n.register({[vd]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){rt(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.fa)==null||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.er((()=>{var e;this.ga(),(e=this.fa)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.fa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.fa)==null||t.nextStep()}previousStep(){var t;(t=this.fa)==null||t.previousStep()}clearCache(){var t;this.pa=null,(t=this.mi)==null||t.unregister(vd)}resetTour(t){var e;(e=this.fa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.fa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.fa)==null||e.cancelPendingTour(t)}}},i0),MN={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var n=this.globalsForEvent(e);this.ya.push(n),this.ya.length>1e3&&(this.ya=this.ya.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.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];c[m]={id:d[m],type:m,properties:p[1]}}var _=t.$set_once,x=t.$set;return{event:ce({},e6(t,bN),{properties:ce({},t.properties,x?{$set:ce({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},_?{$set_once:ce({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},_)}:{}),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}}wa(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)||(ti.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)||(ti.error("prepare_external_dependency_script returned null"),null):t}xa(){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=Ce==null?void 0:Ce.defaultView,d=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!d)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],p=this,m=new WeakSet,_=(w,E,P)=>{if(w!=null&&w[E]){var T=w[E];w[E]=P(T),h.push((()=>{w[E]=T}))}},x=w=>{if(m.has(w))return w;var E=p.wa(w);return E&&m.add(E),E},y=w=>w.map((E=>typeof E=="string"?E:x(E))).filter((E=>!hr(E)));return _(d,"appendChild",(w=>function(E){var P=x(E);return P?w.call(this,P):E})),_(d,"insertBefore",(w=>function(E,P){var T=x(E);return T?w.call(this,T,P):E})),_(d,"replaceChild",(w=>function(E,P){var T=x(E);return T?w.call(this,T,P):P})),[(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((w=>{_(w,"append",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,y(T))})),_(w,"prepend",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,y(T))}))})),[(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((w=>{_(w,"before",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,y(T))})),_(w,"after",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,y(T))})),_(w,"replaceWith",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];var R=y(T);return T.length&&!R.length?void 0:E.apply(this,R)}))})),_((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(w=>function(E,P){var T=x(P);return T?w.call(this,E,T):null})),this.ka=()=>{h.forEach((w=>w())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,this.ma===0&&((e=this.ka)==null||e.call(this)))}}Ca(t,e){e===void 0&&(e=!0);var n=this.xa();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.ya.length&&(ti.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEach((u=>this.Ca((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this._a)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,ti.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.Ca((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){ti.error(cC+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){ti.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}Ta(){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)}Ia(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Ca((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){ti.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.Ta(),void this._instance.on("eventCaptured",(c=>this.Ia(c)))):void ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this._a)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var c,d=u.id,h=u.url;$e["__$$ph_site_app_"+d]=s._instance,(c=$e.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,h,(p=>{if(p)return ti.error(cC+d,p)}))};for(var u of i.siteApps)a()}else ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ON={tracingHeaders:class{constructor(t){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,n,r=this.Pa();r?(ge(this.Ma)&&(this.Ma=(e=$e.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ge(this.Ea)&&(this.Ea=(n=$e.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}er(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 xN.error("failed to load script",r);t()}))}Oa(){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}Pa(){var t=this.Oa();return nt(t)?(nt(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(nt(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;(t=this.Ma)==null||t.call(this),(e=this.Ea)==null||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},LN=ce({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return _t.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(rt(e))return _t.warn("Flags not loaded yet. Not loading surveys.");var n=nt(e);this.Fa=n?e.length>0:e,_t.info("flags response received, isSurveysEnabled: "+this.Fa),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(MP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.La)_t.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)_t.info(dC);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())_t.info("Not loading surveys in cookieless mode without consent.");else{var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){if(!ge(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var n=t.generateSurveys;if(n)return void this.Da(n,e);var r=t.loadExternalDependency;if(!r)return void this.qa(R2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.qa("Could not load surveys script",s):this.Da(t.generateSurveys,e)}))}catch(s){throw this.qa("Error initializing surveys",s),s}finally{this.La=!1}}}else _t.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new CN(this._instance),_t.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){_t.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return _t.info(dC),t([]);var n,r=this._instance.get_property(ky);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Aa?this.Aa.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Aa=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var i;this.Aa=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;_t.error(u),this.Na=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.Na=null;var d,h=s.json.surveys||[],p=h.filter((_=>(function(x){return!(!x.start_date||x.end_date)})(_)&&(IP(_)||(function(x){var y;return!((y=x.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)})(_))));p.length>0&&((d=this._surveyEventReceiver)==null||d.register(p)),(i=this._instance.persistence)==null||i.register({[ky]:h,[dm]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var t=this._instance.get_property(dm);return Un(t)&&Date.now()-t>3e5}Ua(){return Un(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};OP(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){_t.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!rt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);_t.warn("init was not called")}za(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}Va(t){if(rt(this._surveyManager))return{eligible:!1,reason:Jh};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wa(t){if(rt(this._surveyManager))return{eligible:!1,reason:Jh};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(rt(this._surveyManager))return _t.warn("init was not called"),{visible:!1,disabledReason:Jh};var e=this.Wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return rt(this._surveyManager)?(_t.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Jh})):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.Wa(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(rt(this._surveyManager))_t.warn("init was not called");else{var s=typeof t=="string"?this.za(t):t;if(s!=null&&s.id)if(cN.includes(s.type)){var i=Ce==null?void 0:Ce.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(_t.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;_t.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),_t.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);_t.warn("Survey element not found")}else _t.warn("Surveys of type "+s.type+" cannot be rendered in the app");else _t.warn("Survey not found")}}displaySurvey(t,e){var n;if(rt(this._surveyManager))_t.warn("init was not called");else{var r=this.za(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=ce({},r,{appearance:ce({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==jy.Popover&&e.initialResponses&&_t.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.Va(r);if(!i.eligible)return void _t.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==jy.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else _t.warn("Survey not found")}}cancelPendingSurvey(t){rt(this._surveyManager)?_t.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},i0),DN={toolbar:class{constructor(t){this.instance=t}Za(t){$e.ph_toolbar_state=t}Ga(){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),U6(this.instance.config)||!ne||!Ce)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=kN||_m(t.hash,"__posthog")||_m(t.hash,"state"),i=s?OE((()=>JSON.parse(atob(decodeURIComponent(s)))))||OE((()=>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(fC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Qa(t){var e=$e.ph_load_toolbar||$e.ph_load_editor;!rt(e)&&Us(e)?e(t,this.instance):hC.warn("No toolbar load function found")}loadToolbar(t){var e=!(Ce==null||!Ce.getElementById(K6));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ce({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(fC,JSON.stringify(ce({},r,{source:void 0}))),this.Ga()===2)this.Qa(r);else if(this.Ga()===0){var s;this.Za(1),(s=$e.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return hC.error("[Toolbar] Failed to load",i),void this.Za(0);this.Za(2),this.Qa(r)})),Ut(ne,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(r)}))}return!0}Ja(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)}}},NN=ce({experiments:Qn},i0),jN={conversations:class{constructor(t){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;rt(e)||(Bs(e)?this.Ka=e:(this.Ka=e.enabled,this.Xa=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||U6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!ge(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var e=t.initConversations;if(e)return this.el(e),void(this.Ya=!1);var n=t.loadExternalDependency;if(!n)return void this.tl(R2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.tl("Could not load conversations script",r):this.el(t.initConversations),this.Ya=!1}))}catch(r){this.tl("Error initializing conversations",r),this.Ya=!1}}else gs.error("Conversations enabled but missing token in remote config.")}}el(t){if(this.Xa)try{this._conversationsManager=t(this.Xa,this._instance),gs.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else gs.error("Cannot complete initialization: remote config is null")}tl(t,e){gs.error(t,e),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():gs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ka===!0&&!hr(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 tn((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(gs.warn($a),null)}))()}getMessages(t,e){var n=this;return tn((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(gs.warn($a),null)}))()}markAsRead(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(gs.warn($a),null)}))()}getTickets(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(gs.warn($a),null)}))()}requestRestoreLink(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(gs.warn($a),null)}))()}restoreFromToken(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(gs.warn($a),null)}))()}restoreFromUrlToken(){var t=this;return tn((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(gs.warn($a),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}En(){var t;(t=this._conversationsManager)==null||t.setIdentity()}Rn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},FN={logs:class{constructor(t){var e;this.rl=!1,this.il=!1,this.Ge=$t("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var n,r;this.Hs=0,(n=this.ol)==null||n.onReconnect(),(r=this.al)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.rl=!0),ne&&Ut(ne,"online",this.sl)}ll(t,e,n,r){var s,i=(function(a,u){var c,d,h,p,m,_,x,y=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,w=(d=a==null?void 0:a.maxBufferSize)!==null&&d!==void 0?d:100,E=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,P=ge(E)?Math.max(w,2048):Math.max(w,E),T=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=T==null?void 0:T["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(_=T==null?void 0:T["service.version"])!==null&&_!==void 0?_:a==null?void 0:a.serviceVersion,environment:(x=T==null?void 0:T["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:T,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:y,maxBufferSize:w,maxQueueSize:P,maxBatchRecordsPerPost:100,rateCapWindowMs:y,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new WL(this.ul(t,e),i,this.Ge,(()=>this.hl()),(a=>a()),void 0,r),i]}dl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.ol||this.cl!==e){var n;(n=this.ol)==null||n.reset(),this.cl=e;var r=this.ll((()=>this.Gr),(s=>{this.Gr=s}));this.ol=r[0],this.vl=r[1]}return this.ol}fl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.al||this.pl!==e){var n;(n=this.al)==null||n.reset(),this.pl=e;var r=this.ll((()=>this.nl),(s=>{this.nl=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},vC);this.al=r[0],this.gl=r[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!rt(n)&&n&&(this.rl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.ol)==null||t.reset(),this.nl=[],(e=this.al)==null||e.reset(),this.Hs=0}captureLog(t){this.dl().captureLog(t)}le(t){this.fl().captureLog(t)}get logger(){return this.ml||(this.ml={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.ml}flushLogs(t){t?this.yl(t):(this.ol&&this.ol.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))),this.al&&this.al.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.rl&&!this.il){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.Ge.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(R2)}else this.Ge.error("PostHog Extensions not found.")}}ul(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Bi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Bi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},Tt:r=>this.Tt(r),getLibraryId:()=>vt.LIB_NAME,getLibraryVersion:()=>vt.LIB_VERSION}}Tt(t){return new Promise((e=>{if(aP(this.Hs,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.bl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this._l(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)})}}})}}))}_l(t){(t!==0||this._instance.__loaded)&&(this.Hs=lP(t,this.Hs,3,(()=>this.Ge.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."))))}yl(t){this.Gr.length>0&&this.wl(t,this.Gr,this.vl,vt.LIB_NAME,(e=>{this.Gr=e})),this.nl.length>0&&this.wl(t,this.nl,this.gl,vC,(e=>{this.nl=e}))}wl(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=R6(i,T6(n,vt.LIB_NAME,vt.LIB_VERSION),r,vt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.bl(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){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,rt(s)||(e.sessionStartTimestamp=s),rt(i)||(e.lastActivityTimestamp=i)}if($e!=null&&(t=$e.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ra($e.location.href):$e.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},VN={metrics:class{constructor(t){this.Ge=$t("[metrics]"),this._instance=t}initialize(){}dl(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.ol&&this.cl===n||((e=this.ol)==null||e.reset(),this.cl=n,this.ol=new GL(this.ul(),(function(r){var s,i,a,u,c,d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(a=d==null?void 0:d["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(u=r==null?void 0:r.flushIntervalMs)!==null&&u!==void 0?u:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(n),this.Ge)),this.ol}count(t,e,n){e===void 0&&(e=1),this.dl().count(t,e,n)}gauge(t,e,n){this.dl().gauge(t,e,n)}histogram(t,e,n){this.dl().histogram(t,e,n)}flush(t){if(!this.ol)return Promise.resolve();if(t){var e=this.ol.drainWindow();return e&&this.Bt(e,t),Promise.resolve()}return this.ol.flush().catch((n=>this.Ge.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.ol)==null||t.reset()}ul(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Bt:n=>e.Bt(n),getLibraryId:()=>vt.LIB_NAME,getLibraryVersion:()=>vt.LIB_VERSION}}Bt(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(ce({method:"POST",url:this.xl(),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)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},$N=ce({},i0,TN,RN,AN,IN,MN,LN,ON,DN,NN,jN,FN,VN);_s.__defaultExtensionClasses=ce({},$N);var Ee=(function(){vt.SDK_DIST_CHANNEL="npm";var t=kd[gu]=new _s;return(function(){function e(){e.done||(e.done=!0,DP=!1,bt(kd,(function(n){n._dom_loaded()})))}Ce!=null&&Ce.addEventListener?Ce.readyState==="complete"?e():Ut(Ce,"DOMContentLoaded",e,{capture:!1}):ne&&xe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),NP;function HN(t){NP=t}function Wy(){return NP}var F2=g.createContext({get client(){return Wy()},bootstrap:void 0});function jP(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)||!jP(t[u],e[u],n))return!1}return!0}function zN(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 d=Wy();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."),d},[s,i,JSON.stringify(a)]);return g.useEffect(function(){if(!(s||!i)){var d=Wy(),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&&!jP(a,h.options)&&d.set_config(a),u.current={apiKey:i,options:a??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.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 Bv=function(t){return typeof t=="function"},o0=function(){var t=g.useContext(F2).client;return t},Gy=function(t,e){return Gy=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])},Gy(t,e)};function UN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Gy(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var BN={componentStack:null,exceptionEvent:null,error:null},WN={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},GN=(function(t){UN(e,t);function e(n){var r=t.call(this,n)||this;return r.state=BN,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Bv(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 Bv(r)?r():r;var a=Bv(s)?ve.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ve.isValidElement(a)?a:(console.warn(WN.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},e.contextType=F2,e})(ve.Component);HN(Ee);var ep={},Wv={exports:{}},Er={},Gv={exports:{}},Kv={};/**
|
|
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 yC;function KN(){return yC||(yC=1,(function(t){function e($,J){var H=$.length;$.push(J);e:for(;0<H;){var j=H-1>>>1,X=$[j];if(0<s(X,J))$[j]=J,$[H]=X,H=j;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var J=$[0],H=$.pop();if(H!==J){$[0]=H;e:for(var j=0,X=$.length,te=X>>>1;j<te;){var ie=2*(j+1)-1,ae=$[ie],ue=ie+1,Se=$[ue];if(0>s(ae,H))ue<X&&0>s(Se,ae)?($[j]=Se,$[ue]=H,j=ue):($[j]=ae,$[ie]=H,j=ie);else if(ue<X&&0>s(Se,H))$[j]=Se,$[ue]=H,j=ue;else break e}}return J}function s($,J){var H=$.sortIndex-J.sortIndex;return H!==0?H:$.id-J.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=[],d=[],h=1,p=null,m=3,_=!1,x=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T($){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=$)r(d),J.sortIndex=J.expirationTime,e(c,J);else break;J=n(d)}}function k($){if(y=!1,T($),!x)if(n(c)!==null)x=!0,B(R);else{var J=n(d);J!==null&&K(k,J.startTime-$)}}function R($,J){x=!1,y&&(y=!1,E(A),A=-1),_=!0;var H=m;try{for(T(J),p=n(c);p!==null&&(!(p.expirationTime>J)||$&&!F());){var j=p.callback;if(typeof j=="function"){p.callback=null,m=p.priorityLevel;var X=j(p.expirationTime<=J);J=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(c)&&r(c),T(J)}else r(c);p=n(c)}if(p!==null)var te=!0;else{var ie=n(d);ie!==null&&K(k,ie.startTime-J),te=!1}return te}finally{p=null,m=H,_=!1}}var L=!1,O=null,A=-1,M=5,D=-1;function F(){return!(t.unstable_now()-D<M)}function N(){if(O!==null){var $=t.unstable_now();D=$;var J=!0;try{J=O(!0,$)}finally{J?W():(L=!1,O=null)}}else L=!1}var W;if(typeof P=="function")W=function(){P(N)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,q=Y.port2;Y.port1.onmessage=N,W=function(){q.postMessage(null)}}else W=function(){w(N,0)};function B($){O=$,L||(L=!0,W())}function K($,J){A=w(function(){$(t.unstable_now())},J)}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||_||(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"):M=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var H=m;m=J;try{return $()}finally{m=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,J){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=m;m=$;try{return J()}finally{m=H}},t.unstable_scheduleCallback=function($,J,H){var j=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?j+H:j):H=j,$){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=H+X,$={id:h++,callback:J,priorityLevel:$,startTime:H,expirationTime:X,sortIndex:-1},H>j?($.sortIndex=H,e(d,$),n(c)===null&&$===n(d)&&(y?(E(A),A=-1):y=!0,K(k,H-j))):($.sortIndex=X,e(c,$),x||_||(x=!0,B(R))),$},t.unstable_shouldYield=F,t.unstable_wrapCallback=function($){var J=m;return function(){var H=m;m=J;try{return $.apply(this,arguments)}finally{m=H}}}})(Kv)),Kv}var _C;function ZN(){return _C||(_C=1,Gv.exports=KN()),Gv.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 xC;function qN(){if(xC)return Er;xC=1;var t=m2(),e=ZN();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);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,d=/^[: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 m(o){return c.call(p,o)?!0:c.call(h,o)?!1:d.test(o)?p[o]=!0:(h[o]=!0,!1)}function _(o,l,f,v){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,f,v){if(l===null||typeof l>"u"||_(o,l,f,v))return!0;if(v)return!1;if(f!==null)switch(f.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 y(o,l,f,v,b,C,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=b,this.mustUseProperty=f,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=I}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new y(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new y(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new y(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new y(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){w[o]=new y(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new y(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new y(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new y(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new y(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(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,P);w[l]=new y(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,P);w[l]=new y(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,P);w[l]=new y(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!0,!0)});function T(o,l,f,v){var b=w.hasOwnProperty(l)?w[l]:null;(b!==null?b.type!==0:v||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,f,b,v)&&(f=null),v||b===null?m(l)&&(f===null?o.removeAttribute(l):o.setAttribute(l,""+f)):b.mustUseProperty?o[b.propertyName]=f===null?b.type===3?!1:"":f:(l=b.attributeName,v=b.attributeNamespace,f===null?o.removeAttribute(l):(b=b.type,f=b===3||b===4&&f===!0?"":""+f,v?o.setAttributeNS(v,l,f):o.setAttribute(l,f))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),L=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),F=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),$=Symbol.iterator;function J(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,j;function X(o){if(j===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);j=l&&l[1]||""}return`
|
|
35
|
+
`+j+o}var te=!1;function ie(o,l){if(!o||te)return"";te=!0;var f=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 v=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){v=re}o.call(l.prototype)}else{try{throw Error()}catch(re){v=re}o()}}catch(re){if(re&&v&&typeof re.stack=="string"){for(var b=re.stack.split(`
|
|
36
|
+
`),C=v.stack.split(`
|
|
37
|
+
`),I=b.length-1,V=C.length-1;1<=I&&0<=V&&b[I]!==C[V];)V--;for(;1<=I&&0<=V;I--,V--)if(b[I]!==C[V]){if(I!==1||V!==1)do if(I--,V--,0>V||b[I]!==C[V]){var G=`
|
|
38
|
+
`+b[I].replace(" at new "," at ");return o.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",o.displayName)),G}while(1<=I&&0<=V);break}}}finally{te=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?X(o):""}function ae(o){switch(o.tag){case 5:return X(o.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return o=ie(o.type,!1),o;case 11:return o=ie(o.type.render,!1),o;case 1:return o=ie(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 O:return"Fragment";case L:return"Portal";case M:return"Profiler";case A:return"StrictMode";case W:return"Suspense";case Y:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case F:return(o.displayName||"Context")+".Consumer";case D:return(o._context.displayName||"Context")+".Provider";case N: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 Se(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 oe(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function se(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ye(o){var l=se(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),v=""+o[l];if(!o.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,C=f.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(I){v=""+I,C.call(this,I)}}),Object.defineProperty(o,l,{enumerable:f.enumerable}),{getValue:function(){return v},setValue:function(I){v=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function be(o){o._valueTracker||(o._valueTracker=ye(o))}function je(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var f=l.getValue(),v="";return o&&(v=se(o)?o.checked?"true":"false":o.value),o=v,o!==f?(l.setValue(o),!0):!1}function Te(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 We(o,l){var f=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function Rt(o,l){var f=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;f=oe(l.value!=null?l.value:f),o._wrapperState={initialChecked:v,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ye(o,l){l=l.checked,l!=null&&T(o,"checked",l,!1)}function we(o,l){Ye(o,l);var f=oe(l.value),v=l.type;if(f!=null)v==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(v==="submit"||v==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Je(o,l.type,f):l.hasOwnProperty("defaultValue")&&Je(o,l.type,oe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Mt(o,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,f||l===o.value||(o.value=l),o.defaultValue=l}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function Je(o,l,f){(l!=="number"||Te(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var He=Array.isArray;function tt(o,l,f,v){if(o=o.options,l){l={};for(var b=0;b<f.length;b++)l["$"+f[b]]=!0;for(f=0;f<o.length;f++)b=l.hasOwnProperty("$"+o[f].value),o[f].selected!==b&&(o[f].selected=b),b&&v&&(o[f].defaultSelected=!0)}else{for(f=""+oe(f),l=null,b=0;b<o.length;b++){if(o[b].value===f){o[b].selected=!0,v&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function Ge(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function ct(o,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(He(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}o._wrapperState={initialValue:oe(f)}}function vn(o,l){var f=oe(l.value),v=oe(l.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),l.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),v!=null&&(o.defaultValue=""+v)}function Sn(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function St(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 rr(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?St(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var En,is=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,v,b){MSApp.execUnsafeLocalFunction(function(){return o(l,f,v,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(En=En||document.createElement("div"),En.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=En.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function rn(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var mr={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},Zs=["Webkit","ms","Moz","O"];Object.keys(mr).forEach(function(o){Zs.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),mr[l]=mr[o]})});function Al(o,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||mr.hasOwnProperty(o)&&mr[o]?(""+l).trim():l+"px"}function Ln(o,l){o=o.style;for(var f in l)if(l.hasOwnProperty(f)){var v=f.indexOf("--")===0,b=Al(f,l[f],v);f==="float"&&(f="cssFloat"),v?o.setProperty(f,b):o[f]=b}}var Si=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 Ps(o,l){if(l){if(Si[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 qs(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 os=null;function yn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var mo=null,Fr=null,as=null;function Ei(o){if(o=Lc(o)){if(typeof mo!="function")throw Error(n(280));var l=o.stateNode;l&&(l=rh(l),mo(o.stateNode,o.type,l))}}function qe(o){Fr?as?as.push(o):as=[o]:Fr=o}function Ot(){if(Fr){var o=Fr,l=as;if(as=Fr=null,Ei(o),l)for(o=0;o<l.length;o++)Ei(l[o])}}function Wt(o,l){return o(l)}function Cn(){}var Vr=!1;function Xt(o,l,f){if(Vr)return o(l,f);Vr=!0;try{return Wt(o,l,f)}finally{Vr=!1,(Fr!==null||as!==null)&&(Cn(),Ot())}}function un(o,l){var f=o.stateNode;if(f===null)return null;var v=rh(f);if(v===null)return null;f=v[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":(v=!v.disabled)||(o=o.type,v=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!v;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var Ys=!1;if(u)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){Ys=!0}}),window.addEventListener("test",cn,cn),window.removeEventListener("test",cn,cn)}catch{Ys=!1}function Gn(o,l,f,v,b,C,I,V,G){var re=Array.prototype.slice.call(arguments,3);try{l.apply(f,re)}catch(fe){this.onError(fe)}}var Ts=!1,gr=null,xa=!1,gc=null,Df={onError:function(o){Ts=!0,gr=o}};function O0(o,l,f,v,b,C,I,V,G){Ts=!1,gr=null,Gn.apply(Df,arguments)}function L0(o,l,f,v,b,C,I,V,G){if(O0.apply(this,arguments),Ts){if(Ts){var re=gr;Ts=!1,gr=null}else throw Error(n(198));xa||(xa=!0,gc=re)}}function Rs(o){var l=o,f=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(f=l.return),o=l.return;while(o)}return l.tag===3?f:null}function Nf(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 jf(o){if(Rs(o)!==o)throw Error(n(188))}function D0(o){var l=o.alternate;if(!l){if(l=Rs(o),l===null)throw Error(n(188));return l!==o?null:o}for(var f=o,v=l;;){var b=f.return;if(b===null)break;var C=b.alternate;if(C===null){if(v=b.return,v!==null){f=v;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===f)return jf(b),o;if(C===v)return jf(b),l;C=C.sibling}throw Error(n(188))}if(f.return!==v.return)f=b,v=C;else{for(var I=!1,V=b.child;V;){if(V===f){I=!0,f=b,v=C;break}if(V===v){I=!0,v=b,f=C;break}V=V.sibling}if(!I){for(V=C.child;V;){if(V===f){I=!0,f=C,v=b;break}if(V===v){I=!0,v=C,f=b;break}V=V.sibling}if(!I)throw Error(n(189))}}if(f.alternate!==v)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?o:l}function Ff(o){return o=D0(o),o!==null?Il(o):null}function Il(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Il(o);if(l!==null)return l;o=o.sibling}return null}var Ml=e.unstable_scheduleCallback,vc=e.unstable_cancelCallback,N0=e.unstable_shouldYield,Iw=e.unstable_requestPaint,xt=e.unstable_now,Vf=e.unstable_getCurrentPriorityLevel,wa=e.unstable_ImmediatePriority,$f=e.unstable_UserBlockingPriority,ba=e.unstable_NormalPriority,Ol=e.unstable_LowPriority,Ll=e.unstable_IdlePriority,Sa=null,$r=null;function Hf(o){if($r&&typeof $r.onCommitFiberRoot=="function")try{$r.onCommitFiberRoot(Sa,o,void 0,(o.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:Ae,z=Math.log,le=Math.LN2;function Ae(o){return o>>>=0,o===0?32:31-(z(o)/le|0)|0}var he=64,pe=4194304;function ke(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 Ke(o,l){var f=o.pendingLanes;if(f===0)return 0;var v=0,b=o.suspendedLanes,C=o.pingedLanes,I=f&268435455;if(I!==0){var V=I&~b;V!==0?v=ke(V):(C&=I,C!==0&&(v=ke(C)))}else I=f&~b,I!==0?v=ke(I):C!==0&&(v=ke(C));if(v===0)return 0;if(l!==0&&l!==v&&(l&b)===0&&(b=v&-v,C=l&-l,b>=C||b===16&&(C&4194240)!==0))return l;if((v&4)!==0&&(v|=f&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=v;0<l;)f=31-vr(l),b=1<<f,v|=o[f],l&=~b;return v}function Pe(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 sr(o,l){for(var f=o.suspendedLanes,v=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var I=31-vr(C),V=1<<I,G=b[I];G===-1?((V&f)===0||(V&v)!==0)&&(b[I]=Pe(V,l)):G<=l&&(o.expiredLanes|=V),C&=~V}}function Kn(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function As(){var o=he;return he<<=1,(he&4194240)===0&&(he=64),o}function ls(o){for(var l=[],f=0;31>f;f++)l.push(o);return l}function yr(o,l,f){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-vr(l),o[l]=f}function Dn(o,l){var f=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 v=o.eventTimes;for(o=o.expirationTimes;0<f;){var b=31-vr(f),C=1<<b;l[b]=0,v[b]=-1,o[b]=-1,f&=~C}}function us(o,l){var f=o.entangledLanes|=l;for(o=o.entanglements;f;){var v=31-vr(f),b=1<<v;b&l|o[v]&l&&(o[v]|=l),f&=~b}}var lt=0;function Mw(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Ow,j0,Lw,Dw,Nw,F0=!1,zf=[],go=null,vo=null,yo=null,yc=new Map,_c=new Map,_o=[],QI="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 jw(o,l){switch(o){case"focusin":case"focusout":go=null;break;case"dragenter":case"dragleave":vo=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":yc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":_c.delete(l.pointerId)}}function xc(o,l,f,v,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:f,eventSystemFlags:v,nativeEvent:C,targetContainers:[b]},l!==null&&(l=Lc(l),l!==null&&j0(l)),o):(o.eventSystemFlags|=v,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function JI(o,l,f,v,b){switch(l){case"focusin":return go=xc(go,o,l,f,v,b),!0;case"dragenter":return vo=xc(vo,o,l,f,v,b),!0;case"mouseover":return yo=xc(yo,o,l,f,v,b),!0;case"pointerover":var C=b.pointerId;return yc.set(C,xc(yc.get(C)||null,o,l,f,v,b)),!0;case"gotpointercapture":return C=b.pointerId,_c.set(C,xc(_c.get(C)||null,o,l,f,v,b)),!0}return!1}function Fw(o){var l=Ea(o.target);if(l!==null){var f=Rs(l);if(f!==null){if(l=f.tag,l===13){if(l=Nf(f),l!==null){o.blockedOn=l,Nw(o.priority,function(){Lw(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Uf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=$0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var v=new f.constructor(f.type,f);os=v,f.target.dispatchEvent(v),os=null}else return l=Lc(f),l!==null&&j0(l),o.blockedOn=f,!1;l.shift()}return!0}function Vw(o,l,f){Uf(o)&&f.delete(l)}function eM(){F0=!1,go!==null&&Uf(go)&&(go=null),vo!==null&&Uf(vo)&&(vo=null),yo!==null&&Uf(yo)&&(yo=null),yc.forEach(Vw),_c.forEach(Vw)}function wc(o,l){o.blockedOn===l&&(o.blockedOn=null,F0||(F0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eM)))}function bc(o){function l(b){return wc(b,o)}if(0<zf.length){wc(zf[0],o);for(var f=1;f<zf.length;f++){var v=zf[f];v.blockedOn===o&&(v.blockedOn=null)}}for(go!==null&&wc(go,o),vo!==null&&wc(vo,o),yo!==null&&wc(yo,o),yc.forEach(l),_c.forEach(l),f=0;f<_o.length;f++)v=_o[f],v.blockedOn===o&&(v.blockedOn=null);for(;0<_o.length&&(f=_o[0],f.blockedOn===null);)Fw(f),f.blockedOn===null&&_o.shift()}var Dl=k.ReactCurrentBatchConfig,Bf=!0;function tM(o,l,f,v){var b=lt,C=Dl.transition;Dl.transition=null;try{lt=1,V0(o,l,f,v)}finally{lt=b,Dl.transition=C}}function nM(o,l,f,v){var b=lt,C=Dl.transition;Dl.transition=null;try{lt=4,V0(o,l,f,v)}finally{lt=b,Dl.transition=C}}function V0(o,l,f,v){if(Bf){var b=$0(o,l,f,v);if(b===null)rg(o,l,v,Wf,f),jw(o,v);else if(JI(b,o,l,f,v))v.stopPropagation();else if(jw(o,v),l&4&&-1<QI.indexOf(o)){for(;b!==null;){var C=Lc(b);if(C!==null&&Ow(C),C=$0(o,l,f,v),C===null&&rg(o,l,v,Wf,f),C===b)break;b=C}b!==null&&v.stopPropagation()}else rg(o,l,v,null,f)}}var Wf=null;function $0(o,l,f,v){if(Wf=null,o=yn(v),o=Ea(o),o!==null)if(l=Rs(o),l===null)o=null;else if(f=l.tag,f===13){if(o=Nf(l),o!==null)return o;o=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Wf=o,null}function $w(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(Vf()){case wa:return 1;case $f:return 4;case ba:case Ol:return 16;case Ll:return 536870912;default:return 16}default:return 16}}var xo=null,H0=null,Gf=null;function Hw(){if(Gf)return Gf;var o,l=H0,f=l.length,v,b="value"in xo?xo.value:xo.textContent,C=b.length;for(o=0;o<f&&l[o]===b[o];o++);var I=f-o;for(v=1;v<=I&&l[f-v]===b[C-v];v++);return Gf=b.slice(o,1<v?1-v:void 0)}function Kf(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 Zf(){return!0}function zw(){return!1}function Hr(o){function l(f,v,b,C,I){this._reactName=f,this._targetInst=b,this.type=v,this.nativeEvent=C,this.target=I,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Zf:zw,this.isPropagationStopped=zw,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Zf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),l}var Nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},z0=Hr(Nl),Sc=H({},Nl,{view:0,detail:0}),rM=Hr(Sc),U0,B0,Ec,qf=H({},Sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:G0,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!==Ec&&(Ec&&o.type==="mousemove"?(U0=o.screenX-Ec.screenX,B0=o.screenY-Ec.screenY):B0=U0=0,Ec=o),U0)},movementY:function(o){return"movementY"in o?o.movementY:B0}}),Uw=Hr(qf),sM=H({},qf,{dataTransfer:0}),iM=Hr(sM),oM=H({},Sc,{relatedTarget:0}),W0=Hr(oM),aM=H({},Nl,{animationName:0,elapsedTime:0,pseudoElement:0}),lM=Hr(aM),uM=H({},Nl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),cM=Hr(uM),dM=H({},Nl,{data:0}),Bw=Hr(dM),fM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hM={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 mM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=pM[o])?!!l[o]:!1}function G0(){return mM}var gM=H({},Sc,{key:function(o){if(o.key){var l=fM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Kf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?hM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:G0,charCode:function(o){return o.type==="keypress"?Kf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Kf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),vM=Hr(gM),yM=H({},qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ww=Hr(yM),_M=H({},Sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:G0}),xM=Hr(_M),wM=H({},Nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),bM=Hr(wM),SM=H({},qf,{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}),EM=Hr(SM),CM=[9,13,27,32],K0=u&&"CompositionEvent"in window,Cc=null;u&&"documentMode"in document&&(Cc=document.documentMode);var kM=u&&"TextEvent"in window&&!Cc,Gw=u&&(!K0||Cc&&8<Cc&&11>=Cc),Kw=" ",Zw=!1;function qw(o,l){switch(o){case"keyup":return CM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var jl=!1;function PM(o,l){switch(o){case"compositionend":return Yw(l);case"keypress":return l.which!==32?null:(Zw=!0,Kw);case"textInput":return o=l.data,o===Kw&&Zw?null:o;default:return null}}function TM(o,l){if(jl)return o==="compositionend"||!K0&&qw(o,l)?(o=Hw(),Gf=H0=xo=null,jl=!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 Gw&&l.locale!=="ko"?null:l.data;default:return null}}var RM={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 Xw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!RM[o.type]:l==="textarea"}function Qw(o,l,f,v){qe(v),l=eh(l,"onChange"),0<l.length&&(f=new z0("onChange","change",null,f,v),o.push({event:f,listeners:l}))}var kc=null,Pc=null;function AM(o){gb(o,0)}function Yf(o){var l=zl(o);if(je(l))return o}function IM(o,l){if(o==="change")return l}var Jw=!1;if(u){var Z0;if(u){var q0="oninput"in document;if(!q0){var eb=document.createElement("div");eb.setAttribute("oninput","return;"),q0=typeof eb.oninput=="function"}Z0=q0}else Z0=!1;Jw=Z0&&(!document.documentMode||9<document.documentMode)}function tb(){kc&&(kc.detachEvent("onpropertychange",nb),Pc=kc=null)}function nb(o){if(o.propertyName==="value"&&Yf(Pc)){var l=[];Qw(l,Pc,o,yn(o)),Xt(AM,l)}}function MM(o,l,f){o==="focusin"?(tb(),kc=l,Pc=f,kc.attachEvent("onpropertychange",nb)):o==="focusout"&&tb()}function OM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Yf(Pc)}function LM(o,l){if(o==="click")return Yf(l)}function DM(o,l){if(o==="input"||o==="change")return Yf(l)}function NM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Is=typeof Object.is=="function"?Object.is:NM;function Tc(o,l){if(Is(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var f=Object.keys(o),v=Object.keys(l);if(f.length!==v.length)return!1;for(v=0;v<f.length;v++){var b=f[v];if(!c.call(l,b)||!Is(o[b],l[b]))return!1}return!0}function rb(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function sb(o,l){var f=rb(o);o=0;for(var v;f;){if(f.nodeType===3){if(v=o+f.textContent.length,o<=l&&v>=l)return{node:f,offset:l-o};o=v}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=rb(f)}}function ib(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?ib(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function ob(){for(var o=window,l=Te();l instanceof o.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)o=l.contentWindow;else break;l=Te(o.document)}return l}function Y0(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 jM(o){var l=ob(),f=o.focusedElem,v=o.selectionRange;if(l!==f&&f&&f.ownerDocument&&ib(f.ownerDocument.documentElement,f)){if(v!==null&&Y0(f)){if(l=v.start,o=v.end,o===void 0&&(o=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(o,f.value.length);else if(o=(l=f.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=f.textContent.length,C=Math.min(v.start,b);v=v.end===void 0?C:Math.min(v.end,b),!o.extend&&C>v&&(b=v,v=C,C=b),b=sb(f,C);var I=sb(f,v);b&&I&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),o.removeAllRanges(),C>v?(o.addRange(l),o.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),o.addRange(l)))}}for(l=[],o=f;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)o=l[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var FM=u&&"documentMode"in document&&11>=document.documentMode,Fl=null,X0=null,Rc=null,Q0=!1;function ab(o,l,f){var v=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Q0||Fl==null||Fl!==Te(v)||(v=Fl,"selectionStart"in v&&Y0(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Rc&&Tc(Rc,v)||(Rc=v,v=eh(X0,"onSelect"),0<v.length&&(l=new z0("onSelect","select",null,l,f),o.push({event:l,listeners:v}),l.target=Fl)))}function Xf(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Vl={animationend:Xf("Animation","AnimationEnd"),animationiteration:Xf("Animation","AnimationIteration"),animationstart:Xf("Animation","AnimationStart"),transitionend:Xf("Transition","TransitionEnd")},J0={},lb={};u&&(lb=document.createElement("div").style,"AnimationEvent"in window||(delete Vl.animationend.animation,delete Vl.animationiteration.animation,delete Vl.animationstart.animation),"TransitionEvent"in window||delete Vl.transitionend.transition);function Qf(o){if(J0[o])return J0[o];if(!Vl[o])return o;var l=Vl[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in lb)return J0[o]=l[f];return o}var ub=Qf("animationend"),cb=Qf("animationiteration"),db=Qf("animationstart"),fb=Qf("transitionend"),hb=new Map,pb="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 wo(o,l){hb.set(o,l),i(l,[o])}for(var eg=0;eg<pb.length;eg++){var tg=pb[eg],VM=tg.toLowerCase(),$M=tg[0].toUpperCase()+tg.slice(1);wo(VM,"on"+$M)}wo(ub,"onAnimationEnd"),wo(cb,"onAnimationIteration"),wo(db,"onAnimationStart"),wo("dblclick","onDoubleClick"),wo("focusin","onFocus"),wo("focusout","onBlur"),wo(fb,"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 Ac="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(" "),HM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ac));function mb(o,l,f){var v=o.type||"unknown-event";o.currentTarget=f,L0(v,l,void 0,o),o.currentTarget=null}function gb(o,l){l=(l&4)!==0;for(var f=0;f<o.length;f++){var v=o[f],b=v.event;v=v.listeners;e:{var C=void 0;if(l)for(var I=v.length-1;0<=I;I--){var V=v[I],G=V.instance,re=V.currentTarget;if(V=V.listener,G!==C&&b.isPropagationStopped())break e;mb(b,V,re),C=G}else for(I=0;I<v.length;I++){if(V=v[I],G=V.instance,re=V.currentTarget,V=V.listener,G!==C&&b.isPropagationStopped())break e;mb(b,V,re),C=G}}}if(xa)throw o=gc,xa=!1,gc=null,o}function Lt(o,l){var f=l[ug];f===void 0&&(f=l[ug]=new Set);var v=o+"__bubble";f.has(v)||(vb(l,o,2,!1),f.add(v))}function ng(o,l,f){var v=0;l&&(v|=4),vb(f,o,v,l)}var Jf="_reactListening"+Math.random().toString(36).slice(2);function Ic(o){if(!o[Jf]){o[Jf]=!0,r.forEach(function(f){f!=="selectionchange"&&(HM.has(f)||ng(f,!1,o),ng(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Jf]||(l[Jf]=!0,ng("selectionchange",!1,l))}}function vb(o,l,f,v){switch($w(l)){case 1:var b=tM;break;case 4:b=nM;break;default:b=V0}f=b.bind(null,l,f,o),b=void 0,!Ys||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),v?b!==void 0?o.addEventListener(l,f,{capture:!0,passive:b}):o.addEventListener(l,f,!0):b!==void 0?o.addEventListener(l,f,{passive:b}):o.addEventListener(l,f,!1)}function rg(o,l,f,v,b){var C=v;if((l&1)===0&&(l&2)===0&&v!==null)e:for(;;){if(v===null)return;var I=v.tag;if(I===3||I===4){var V=v.stateNode.containerInfo;if(V===b||V.nodeType===8&&V.parentNode===b)break;if(I===4)for(I=v.return;I!==null;){var G=I.tag;if((G===3||G===4)&&(G=I.stateNode.containerInfo,G===b||G.nodeType===8&&G.parentNode===b))return;I=I.return}for(;V!==null;){if(I=Ea(V),I===null)return;if(G=I.tag,G===5||G===6){v=C=I;continue e}V=V.parentNode}}v=v.return}Xt(function(){var re=C,fe=yn(f),me=[];e:{var de=hb.get(o);if(de!==void 0){var Ie=z0,De=o;switch(o){case"keypress":if(Kf(f)===0)break e;case"keydown":case"keyup":Ie=vM;break;case"focusin":De="focus",Ie=W0;break;case"focusout":De="blur",Ie=W0;break;case"beforeblur":case"afterblur":Ie=W0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=Uw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=iM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=xM;break;case ub:case cb:case db:Ie=lM;break;case fb:Ie=bM;break;case"scroll":Ie=rM;break;case"wheel":Ie=EM;break;case"copy":case"cut":case"paste":Ie=cM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=Ww}var Fe=(l&4)!==0,sn=!Fe&&o==="scroll",Q=Fe?de!==null?de+"Capture":null:de;Fe=[];for(var Z=re,ee;Z!==null;){ee=Z;var _e=ee.stateNode;if(ee.tag===5&&_e!==null&&(ee=_e,Q!==null&&(_e=un(Z,Q),_e!=null&&Fe.push(Mc(Z,_e,ee)))),sn)break;Z=Z.return}0<Fe.length&&(de=new Ie(de,De,null,f,fe),me.push({event:de,listeners:Fe}))}}if((l&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",Ie=o==="mouseout"||o==="pointerout",de&&f!==os&&(De=f.relatedTarget||f.fromElement)&&(Ea(De)||De[Ci]))break e;if((Ie||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Ie?(De=f.relatedTarget||f.toElement,Ie=re,De=De?Ea(De):null,De!==null&&(sn=Rs(De),De!==sn||De.tag!==5&&De.tag!==6)&&(De=null)):(Ie=null,De=re),Ie!==De)){if(Fe=Uw,_e="onMouseLeave",Q="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=Ww,_e="onPointerLeave",Q="onPointerEnter",Z="pointer"),sn=Ie==null?de:zl(Ie),ee=De==null?de:zl(De),de=new Fe(_e,Z+"leave",Ie,f,fe),de.target=sn,de.relatedTarget=ee,_e=null,Ea(fe)===re&&(Fe=new Fe(Q,Z+"enter",De,f,fe),Fe.target=ee,Fe.relatedTarget=sn,_e=Fe),sn=_e,Ie&&De)t:{for(Fe=Ie,Q=De,Z=0,ee=Fe;ee;ee=$l(ee))Z++;for(ee=0,_e=Q;_e;_e=$l(_e))ee++;for(;0<Z-ee;)Fe=$l(Fe),Z--;for(;0<ee-Z;)Q=$l(Q),ee--;for(;Z--;){if(Fe===Q||Q!==null&&Fe===Q.alternate)break t;Fe=$l(Fe),Q=$l(Q)}Fe=null}else Fe=null;Ie!==null&&yb(me,de,Ie,Fe,!1),De!==null&&sn!==null&&yb(me,sn,De,Fe,!0)}}e:{if(de=re?zl(re):window,Ie=de.nodeName&&de.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&de.type==="file")var Ve=IM;else if(Xw(de))if(Jw)Ve=DM;else{Ve=OM;var Ue=MM}else(Ie=de.nodeName)&&Ie.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Ve=LM);if(Ve&&(Ve=Ve(o,re))){Qw(me,Ve,f,fe);break e}Ue&&Ue(o,de,re),o==="focusout"&&(Ue=de._wrapperState)&&Ue.controlled&&de.type==="number"&&Je(de,"number",de.value)}switch(Ue=re?zl(re):window,o){case"focusin":(Xw(Ue)||Ue.contentEditable==="true")&&(Fl=Ue,X0=re,Rc=null);break;case"focusout":Rc=X0=Fl=null;break;case"mousedown":Q0=!0;break;case"contextmenu":case"mouseup":case"dragend":Q0=!1,ab(me,f,fe);break;case"selectionchange":if(FM)break;case"keydown":case"keyup":ab(me,f,fe)}var Be;if(K0)e:{switch(o){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else jl?qw(o,f)&&(Xe="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Xe="onCompositionStart");Xe&&(Gw&&f.locale!=="ko"&&(jl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&jl&&(Be=Hw()):(xo=fe,H0="value"in xo?xo.value:xo.textContent,jl=!0)),Ue=eh(re,Xe),0<Ue.length&&(Xe=new Bw(Xe,o,null,f,fe),me.push({event:Xe,listeners:Ue}),Be?Xe.data=Be:(Be=Yw(f),Be!==null&&(Xe.data=Be)))),(Be=kM?PM(o,f):TM(o,f))&&(re=eh(re,"onBeforeInput"),0<re.length&&(fe=new Bw("onBeforeInput","beforeinput",null,f,fe),me.push({event:fe,listeners:re}),fe.data=Be))}gb(me,l)})}function Mc(o,l,f){return{instance:o,listener:l,currentTarget:f}}function eh(o,l){for(var f=l+"Capture",v=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=un(o,f),C!=null&&v.unshift(Mc(o,C,b)),C=un(o,l),C!=null&&v.push(Mc(o,C,b))),o=o.return}return v}function $l(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function yb(o,l,f,v,b){for(var C=l._reactName,I=[];f!==null&&f!==v;){var V=f,G=V.alternate,re=V.stateNode;if(G!==null&&G===v)break;V.tag===5&&re!==null&&(V=re,b?(G=un(f,C),G!=null&&I.unshift(Mc(f,G,V))):b||(G=un(f,C),G!=null&&I.push(Mc(f,G,V)))),f=f.return}I.length!==0&&o.push({event:l,listeners:I})}var zM=/\r\n?/g,UM=/\u0000|\uFFFD/g;function _b(o){return(typeof o=="string"?o:""+o).replace(zM,`
|
|
39
|
+
`).replace(UM,"")}function th(o,l,f){if(l=_b(l),_b(o)!==l&&f)throw Error(n(425))}function nh(){}var sg=null,ig=null;function og(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 ag=typeof setTimeout=="function"?setTimeout:void 0,BM=typeof clearTimeout=="function"?clearTimeout:void 0,xb=typeof Promise=="function"?Promise:void 0,WM=typeof queueMicrotask=="function"?queueMicrotask:typeof xb<"u"?function(o){return xb.resolve(null).then(o).catch(GM)}:ag;function GM(o){setTimeout(function(){throw o})}function lg(o,l){var f=l,v=0;do{var b=f.nextSibling;if(o.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"){if(v===0){o.removeChild(b),bc(l);return}v--}else f!=="$"&&f!=="$?"&&f!=="$!"||v++;f=b}while(f);bc(l)}function bo(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 wb(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return o;l--}else f==="/$"&&l++}o=o.previousSibling}return null}var Hl=Math.random().toString(36).slice(2),Xs="__reactFiber$"+Hl,Oc="__reactProps$"+Hl,Ci="__reactContainer$"+Hl,ug="__reactEvents$"+Hl,KM="__reactListeners$"+Hl,ZM="__reactHandles$"+Hl;function Ea(o){var l=o[Xs];if(l)return l;for(var f=o.parentNode;f;){if(l=f[Ci]||f[Xs]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(o=wb(o);o!==null;){if(f=o[Xs])return f;o=wb(o)}return l}o=f,f=o.parentNode}return null}function Lc(o){return o=o[Xs]||o[Ci],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function zl(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function rh(o){return o[Oc]||null}var cg=[],Ul=-1;function So(o){return{current:o}}function Dt(o){0>Ul||(o.current=cg[Ul],cg[Ul]=null,Ul--)}function At(o,l){Ul++,cg[Ul]=o.current,o.current=l}var Eo={},Zn=So(Eo),_r=So(!1),Ca=Eo;function Bl(o,l){var f=o.type.contextTypes;if(!f)return Eo;var v=o.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in f)b[C]=l[C];return v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=b),b}function xr(o){return o=o.childContextTypes,o!=null}function sh(){Dt(_r),Dt(Zn)}function bb(o,l,f){if(Zn.current!==Eo)throw Error(n(168));At(Zn,l),At(_r,f)}function Sb(o,l,f){var v=o.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return f;v=v.getChildContext();for(var b in v)if(!(b in l))throw Error(n(108,Se(o)||"Unknown",b));return H({},f,v)}function ih(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Eo,Ca=Zn.current,At(Zn,o),At(_r,_r.current),!0}function Eb(o,l,f){var v=o.stateNode;if(!v)throw Error(n(169));f?(o=Sb(o,l,Ca),v.__reactInternalMemoizedMergedChildContext=o,Dt(_r),Dt(Zn),At(Zn,o)):Dt(_r),At(_r,f)}var ki=null,oh=!1,dg=!1;function Cb(o){ki===null?ki=[o]:ki.push(o)}function qM(o){oh=!0,Cb(o)}function Co(){if(!dg&&ki!==null){dg=!0;var o=0,l=lt;try{var f=ki;for(lt=1;o<f.length;o++){var v=f[o];do v=v(!0);while(v!==null)}ki=null,oh=!1}catch(b){throw ki!==null&&(ki=ki.slice(o+1)),Ml(wa,Co),b}finally{lt=l,dg=!1}}return null}var Wl=[],Gl=0,ah=null,lh=0,cs=[],ds=0,ka=null,Pi=1,Ti="";function Pa(o,l){Wl[Gl++]=lh,Wl[Gl++]=ah,ah=o,lh=l}function kb(o,l,f){cs[ds++]=Pi,cs[ds++]=Ti,cs[ds++]=ka,ka=o;var v=Pi;o=Ti;var b=32-vr(v)-1;v&=~(1<<b),f+=1;var C=32-vr(l)+b;if(30<C){var I=b-b%5;C=(v&(1<<I)-1).toString(32),v>>=I,b-=I,Pi=1<<32-vr(l)+b|f<<b|v,Ti=C+o}else Pi=1<<C|f<<b|v,Ti=o}function fg(o){o.return!==null&&(Pa(o,1),kb(o,1,0))}function hg(o){for(;o===ah;)ah=Wl[--Gl],Wl[Gl]=null,lh=Wl[--Gl],Wl[Gl]=null;for(;o===ka;)ka=cs[--ds],cs[ds]=null,Ti=cs[--ds],cs[ds]=null,Pi=cs[--ds],cs[ds]=null}var zr=null,Ur=null,Ht=!1,Ms=null;function Pb(o,l){var f=ms(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=o,l=o.deletions,l===null?(o.deletions=[f],o.flags|=16):l.push(f)}function Tb(o,l){switch(o.tag){case 5:var f=o.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,zr=o,Ur=bo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,zr=o,Ur=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=ka!==null?{id:Pi,overflow:Ti}:null,o.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=ms(18,null,null,0),f.stateNode=l,f.return=o,o.child=f,zr=o,Ur=null,!0):!1;default:return!1}}function pg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function mg(o){if(Ht){var l=Ur;if(l){var f=l;if(!Tb(o,l)){if(pg(o))throw Error(n(418));l=bo(f.nextSibling);var v=zr;l&&Tb(o,l)?Pb(v,f):(o.flags=o.flags&-4097|2,Ht=!1,zr=o)}}else{if(pg(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ht=!1,zr=o}}}function Rb(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;zr=o}function uh(o){if(o!==zr)return!1;if(!Ht)return Rb(o),Ht=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!og(o.type,o.memoizedProps)),l&&(l=Ur)){if(pg(o))throw Ab(),Error(n(418));for(;l;)Pb(o,l),l=bo(l.nextSibling)}if(Rb(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 f=o.data;if(f==="/$"){if(l===0){Ur=bo(o.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}o=o.nextSibling}Ur=null}}else Ur=zr?bo(o.stateNode.nextSibling):null;return!0}function Ab(){for(var o=Ur;o;)o=bo(o.nextSibling)}function Kl(){Ur=zr=null,Ht=!1}function gg(o){Ms===null?Ms=[o]:Ms.push(o)}var YM=k.ReactCurrentBatchConfig;function Dc(o,l,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var v=f.stateNode}if(!v)throw Error(n(147,o));var b=v,C=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(I){var V=b.refs;I===null?delete V[C]:V[C]=I},l._stringRef=C,l)}if(typeof o!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,o))}return o}function ch(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Ib(o){var l=o._init;return l(o._payload)}function Mb(o){function l(Q,Z){if(o){var ee=Q.deletions;ee===null?(Q.deletions=[Z],Q.flags|=16):ee.push(Z)}}function f(Q,Z){if(!o)return null;for(;Z!==null;)l(Q,Z),Z=Z.sibling;return null}function v(Q,Z){for(Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function b(Q,Z){return Q=Oo(Q,Z),Q.index=0,Q.sibling=null,Q}function C(Q,Z,ee){return Q.index=ee,o?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<Z?(Q.flags|=2,Z):ee):(Q.flags|=2,Z)):(Q.flags|=1048576,Z)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,Z,ee,_e){return Z===null||Z.tag!==6?(Z=av(ee,Q.mode,_e),Z.return=Q,Z):(Z=b(Z,ee),Z.return=Q,Z)}function G(Q,Z,ee,_e){var Ve=ee.type;return Ve===O?fe(Q,Z,ee.props.children,_e,ee.key):Z!==null&&(Z.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Ib(Ve)===Z.type)?(_e=b(Z,ee.props),_e.ref=Dc(Q,Z,ee),_e.return=Q,_e):(_e=Lh(ee.type,ee.key,ee.props,null,Q.mode,_e),_e.ref=Dc(Q,Z,ee),_e.return=Q,_e)}function re(Q,Z,ee,_e){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ee.containerInfo||Z.stateNode.implementation!==ee.implementation?(Z=lv(ee,Q.mode,_e),Z.return=Q,Z):(Z=b(Z,ee.children||[]),Z.return=Q,Z)}function fe(Q,Z,ee,_e,Ve){return Z===null||Z.tag!==7?(Z=Da(ee,Q.mode,_e,Ve),Z.return=Q,Z):(Z=b(Z,ee),Z.return=Q,Z)}function me(Q,Z,ee){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=av(""+Z,Q.mode,ee),Z.return=Q,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:return ee=Lh(Z.type,Z.key,Z.props,null,Q.mode,ee),ee.ref=Dc(Q,null,Z),ee.return=Q,ee;case L:return Z=lv(Z,Q.mode,ee),Z.return=Q,Z;case B:var _e=Z._init;return me(Q,_e(Z._payload),ee)}if(He(Z)||J(Z))return Z=Da(Z,Q.mode,ee,null),Z.return=Q,Z;ch(Q,Z)}return null}function de(Q,Z,ee,_e){var Ve=Z!==null?Z.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ve!==null?null:V(Q,Z,""+ee,_e);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:return ee.key===Ve?G(Q,Z,ee,_e):null;case L:return ee.key===Ve?re(Q,Z,ee,_e):null;case B:return Ve=ee._init,de(Q,Z,Ve(ee._payload),_e)}if(He(ee)||J(ee))return Ve!==null?null:fe(Q,Z,ee,_e,null);ch(Q,ee)}return null}function Ie(Q,Z,ee,_e,Ve){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return Q=Q.get(ee)||null,V(Z,Q,""+_e,Ve);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case R:return Q=Q.get(_e.key===null?ee:_e.key)||null,G(Z,Q,_e,Ve);case L:return Q=Q.get(_e.key===null?ee:_e.key)||null,re(Z,Q,_e,Ve);case B:var Ue=_e._init;return Ie(Q,Z,ee,Ue(_e._payload),Ve)}if(He(_e)||J(_e))return Q=Q.get(ee)||null,fe(Z,Q,_e,Ve,null);ch(Z,_e)}return null}function De(Q,Z,ee,_e){for(var Ve=null,Ue=null,Be=Z,Xe=Z=0,Tn=null;Be!==null&&Xe<ee.length;Xe++){Be.index>Xe?(Tn=Be,Be=null):Tn=Be.sibling;var pt=de(Q,Be,ee[Xe],_e);if(pt===null){Be===null&&(Be=Tn);break}o&&Be&&pt.alternate===null&&l(Q,Be),Z=C(pt,Z,Xe),Ue===null?Ve=pt:Ue.sibling=pt,Ue=pt,Be=Tn}if(Xe===ee.length)return f(Q,Be),Ht&&Pa(Q,Xe),Ve;if(Be===null){for(;Xe<ee.length;Xe++)Be=me(Q,ee[Xe],_e),Be!==null&&(Z=C(Be,Z,Xe),Ue===null?Ve=Be:Ue.sibling=Be,Ue=Be);return Ht&&Pa(Q,Xe),Ve}for(Be=v(Q,Be);Xe<ee.length;Xe++)Tn=Ie(Be,Q,Xe,ee[Xe],_e),Tn!==null&&(o&&Tn.alternate!==null&&Be.delete(Tn.key===null?Xe:Tn.key),Z=C(Tn,Z,Xe),Ue===null?Ve=Tn:Ue.sibling=Tn,Ue=Tn);return o&&Be.forEach(function(Lo){return l(Q,Lo)}),Ht&&Pa(Q,Xe),Ve}function Fe(Q,Z,ee,_e){var Ve=J(ee);if(typeof Ve!="function")throw Error(n(150));if(ee=Ve.call(ee),ee==null)throw Error(n(151));for(var Ue=Ve=null,Be=Z,Xe=Z=0,Tn=null,pt=ee.next();Be!==null&&!pt.done;Xe++,pt=ee.next()){Be.index>Xe?(Tn=Be,Be=null):Tn=Be.sibling;var Lo=de(Q,Be,pt.value,_e);if(Lo===null){Be===null&&(Be=Tn);break}o&&Be&&Lo.alternate===null&&l(Q,Be),Z=C(Lo,Z,Xe),Ue===null?Ve=Lo:Ue.sibling=Lo,Ue=Lo,Be=Tn}if(pt.done)return f(Q,Be),Ht&&Pa(Q,Xe),Ve;if(Be===null){for(;!pt.done;Xe++,pt=ee.next())pt=me(Q,pt.value,_e),pt!==null&&(Z=C(pt,Z,Xe),Ue===null?Ve=pt:Ue.sibling=pt,Ue=pt);return Ht&&Pa(Q,Xe),Ve}for(Be=v(Q,Be);!pt.done;Xe++,pt=ee.next())pt=Ie(Be,Q,Xe,pt.value,_e),pt!==null&&(o&&pt.alternate!==null&&Be.delete(pt.key===null?Xe:pt.key),Z=C(pt,Z,Xe),Ue===null?Ve=pt:Ue.sibling=pt,Ue=pt);return o&&Be.forEach(function(RO){return l(Q,RO)}),Ht&&Pa(Q,Xe),Ve}function sn(Q,Z,ee,_e){if(typeof ee=="object"&&ee!==null&&ee.type===O&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:e:{for(var Ve=ee.key,Ue=Z;Ue!==null;){if(Ue.key===Ve){if(Ve=ee.type,Ve===O){if(Ue.tag===7){f(Q,Ue.sibling),Z=b(Ue,ee.props.children),Z.return=Q,Q=Z;break e}}else if(Ue.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Ib(Ve)===Ue.type){f(Q,Ue.sibling),Z=b(Ue,ee.props),Z.ref=Dc(Q,Ue,ee),Z.return=Q,Q=Z;break e}f(Q,Ue);break}else l(Q,Ue);Ue=Ue.sibling}ee.type===O?(Z=Da(ee.props.children,Q.mode,_e,ee.key),Z.return=Q,Q=Z):(_e=Lh(ee.type,ee.key,ee.props,null,Q.mode,_e),_e.ref=Dc(Q,Z,ee),_e.return=Q,Q=_e)}return I(Q);case L:e:{for(Ue=ee.key;Z!==null;){if(Z.key===Ue)if(Z.tag===4&&Z.stateNode.containerInfo===ee.containerInfo&&Z.stateNode.implementation===ee.implementation){f(Q,Z.sibling),Z=b(Z,ee.children||[]),Z.return=Q,Q=Z;break e}else{f(Q,Z);break}else l(Q,Z);Z=Z.sibling}Z=lv(ee,Q.mode,_e),Z.return=Q,Q=Z}return I(Q);case B:return Ue=ee._init,sn(Q,Z,Ue(ee._payload),_e)}if(He(ee))return De(Q,Z,ee,_e);if(J(ee))return Fe(Q,Z,ee,_e);ch(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,Z!==null&&Z.tag===6?(f(Q,Z.sibling),Z=b(Z,ee),Z.return=Q,Q=Z):(f(Q,Z),Z=av(ee,Q.mode,_e),Z.return=Q,Q=Z),I(Q)):f(Q,Z)}return sn}var Zl=Mb(!0),Ob=Mb(!1),dh=So(null),fh=null,ql=null,vg=null;function yg(){vg=ql=fh=null}function _g(o){var l=dh.current;Dt(dh),o._currentValue=l}function xg(o,l,f){for(;o!==null;){var v=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),o===f)break;o=o.return}}function Yl(o,l){fh=o,vg=ql=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(wr=!0),o.firstContext=null)}function fs(o){var l=o._currentValue;if(vg!==o)if(o={context:o,memoizedValue:l,next:null},ql===null){if(fh===null)throw Error(n(308));ql=o,fh.dependencies={lanes:0,firstContext:o}}else ql=ql.next=o;return l}var Ta=null;function wg(o){Ta===null?Ta=[o]:Ta.push(o)}function Lb(o,l,f,v){var b=l.interleaved;return b===null?(f.next=f,wg(l)):(f.next=b.next,b.next=f),l.interleaved=f,Ri(o,v)}function Ri(o,l){o.lanes|=l;var f=o.alternate;for(f!==null&&(f.lanes|=l),f=o,o=o.return;o!==null;)o.childLanes|=l,f=o.alternate,f!==null&&(f.childLanes|=l),f=o,o=o.return;return f.tag===3?f.stateNode:null}var ko=!1;function bg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Db(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 Ai(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Po(o,l,f){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(ht&2)!==0){var b=v.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),v.pending=l,Ri(o,f)}return b=v.interleaved,b===null?(l.next=l,wg(v)):(l.next=b.next,b.next=l),v.interleaved=l,Ri(o,f)}function hh(o,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var v=l.lanes;v&=o.pendingLanes,f|=v,l.lanes=f,us(o,f)}}function Nb(o,l){var f=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,f===v)){var b=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var I={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?b=C=I:C=C.next=I,f=f.next}while(f!==null);C===null?b=C=l:C=C.next=l}else b=C=l;f={baseState:v.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:v.shared,effects:v.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=l:o.next=l,f.lastBaseUpdate=l}function ph(o,l,f,v){var b=o.updateQueue;ko=!1;var C=b.firstBaseUpdate,I=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var G=V,re=G.next;G.next=null,I===null?C=re:I.next=re,I=G;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,V=fe.lastBaseUpdate,V!==I&&(V===null?fe.firstBaseUpdate=re:V.next=re,fe.lastBaseUpdate=G))}if(C!==null){var me=b.baseState;I=0,fe=re=G=null,V=C;do{var de=V.lane,Ie=V.eventTime;if((v&de)===de){fe!==null&&(fe=fe.next={eventTime:Ie,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var De=o,Fe=V;switch(de=l,Ie=f,Fe.tag){case 1:if(De=Fe.payload,typeof De=="function"){me=De.call(Ie,me,de);break e}me=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Fe.payload,de=typeof De=="function"?De.call(Ie,me,de):De,de==null)break e;me=H({},me,de);break e;case 2:ko=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,de=b.effects,de===null?b.effects=[V]:de.push(V))}else Ie={eventTime:Ie,lane:de,tag:V.tag,payload:V.payload,callback:V.callback,next:null},fe===null?(re=fe=Ie,G=me):fe=fe.next=Ie,I|=de;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;de=V,V=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);if(fe===null&&(G=me),b.baseState=G,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,l=b.shared.interleaved,l!==null){b=l;do I|=b.lane,b=b.next;while(b!==l)}else C===null&&(b.shared.lanes=0);Ia|=I,o.lanes=I,o.memoizedState=me}}function jb(o,l,f){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var v=o[l],b=v.callback;if(b!==null){if(v.callback=null,v=f,typeof b!="function")throw Error(n(191,b));b.call(v)}}}var Nc={},Qs=So(Nc),jc=So(Nc),Fc=So(Nc);function Ra(o){if(o===Nc)throw Error(n(174));return o}function Sg(o,l){switch(At(Fc,l),At(jc,o),At(Qs,Nc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:rr(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=rr(l,o)}Dt(Qs),At(Qs,l)}function Xl(){Dt(Qs),Dt(jc),Dt(Fc)}function Fb(o){Ra(Fc.current);var l=Ra(Qs.current),f=rr(l,o.type);l!==f&&(At(jc,o),At(Qs,f))}function Eg(o){jc.current===o&&(Dt(Qs),Dt(jc))}var Gt=So(0);function mh(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.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 Cg=[];function kg(){for(var o=0;o<Cg.length;o++)Cg[o]._workInProgressVersionPrimary=null;Cg.length=0}var gh=k.ReactCurrentDispatcher,Pg=k.ReactCurrentBatchConfig,Aa=0,Kt=null,_n=null,kn=null,vh=!1,Vc=!1,$c=0,XM=0;function qn(){throw Error(n(321))}function Tg(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Is(o[f],l[f]))return!1;return!0}function Rg(o,l,f,v,b,C){if(Aa=C,Kt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,gh.current=o===null||o.memoizedState===null?tO:nO,o=f(v,b),Vc){C=0;do{if(Vc=!1,$c=0,25<=C)throw Error(n(301));C+=1,kn=_n=null,l.updateQueue=null,gh.current=rO,o=f(v,b)}while(Vc)}if(gh.current=xh,l=_n!==null&&_n.next!==null,Aa=0,kn=_n=Kt=null,vh=!1,l)throw Error(n(300));return o}function Ag(){var o=$c!==0;return $c=0,o}function Js(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kn===null?Kt.memoizedState=kn=o:kn=kn.next=o,kn}function hs(){if(_n===null){var o=Kt.alternate;o=o!==null?o.memoizedState:null}else o=_n.next;var l=kn===null?Kt.memoizedState:kn.next;if(l!==null)kn=l,_n=o;else{if(o===null)throw Error(n(310));_n=o,o={memoizedState:_n.memoizedState,baseState:_n.baseState,baseQueue:_n.baseQueue,queue:_n.queue,next:null},kn===null?Kt.memoizedState=kn=o:kn=kn.next=o}return kn}function Hc(o,l){return typeof l=="function"?l(o):l}function Ig(o){var l=hs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var v=_n,b=v.baseQueue,C=f.pending;if(C!==null){if(b!==null){var I=b.next;b.next=C.next,C.next=I}v.baseQueue=b=C,f.pending=null}if(b!==null){C=b.next,v=v.baseState;var V=I=null,G=null,re=C;do{var fe=re.lane;if((Aa&fe)===fe)G!==null&&(G=G.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),v=re.hasEagerState?re.eagerState:o(v,re.action);else{var me={lane:fe,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};G===null?(V=G=me,I=v):G=G.next=me,Kt.lanes|=fe,Ia|=fe}re=re.next}while(re!==null&&re!==C);G===null?I=v:G.next=V,Is(v,l.memoizedState)||(wr=!0),l.memoizedState=v,l.baseState=I,l.baseQueue=G,f.lastRenderedState=v}if(o=f.interleaved,o!==null){b=o;do C=b.lane,Kt.lanes|=C,Ia|=C,b=b.next;while(b!==o)}else b===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Mg(o){var l=hs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var v=f.dispatch,b=f.pending,C=l.memoizedState;if(b!==null){f.pending=null;var I=b=b.next;do C=o(C,I.action),I=I.next;while(I!==b);Is(C,l.memoizedState)||(wr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),f.lastRenderedState=C}return[C,v]}function Vb(){}function $b(o,l){var f=Kt,v=hs(),b=l(),C=!Is(v.memoizedState,b);if(C&&(v.memoizedState=b,wr=!0),v=v.queue,Og(Ub.bind(null,f,v,o),[o]),v.getSnapshot!==l||C||kn!==null&&kn.memoizedState.tag&1){if(f.flags|=2048,zc(9,zb.bind(null,f,v,b,l),void 0,null),Pn===null)throw Error(n(349));(Aa&30)!==0||Hb(f,l,b)}return b}function Hb(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Kt.updateQueue,l===null?(l={lastEffect:null,stores:null},Kt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function zb(o,l,f,v){l.value=f,l.getSnapshot=v,Bb(l)&&Wb(o)}function Ub(o,l,f){return f(function(){Bb(l)&&Wb(o)})}function Bb(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Is(o,f)}catch{return!0}}function Wb(o){var l=Ri(o,1);l!==null&&Ns(l,o,1,-1)}function Gb(o){var l=Js();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hc,lastRenderedState:o},l.queue=o,o=o.dispatch=eO.bind(null,Kt,o),[l.memoizedState,o]}function zc(o,l,f,v){return o={tag:o,create:l,destroy:f,deps:v,next:null},l=Kt.updateQueue,l===null?(l={lastEffect:null,stores:null},Kt.updateQueue=l,l.lastEffect=o.next=o):(f=l.lastEffect,f===null?l.lastEffect=o.next=o:(v=f.next,f.next=o,o.next=v,l.lastEffect=o)),o}function Kb(){return hs().memoizedState}function yh(o,l,f,v){var b=Js();Kt.flags|=o,b.memoizedState=zc(1|l,f,void 0,v===void 0?null:v)}function _h(o,l,f,v){var b=hs();v=v===void 0?null:v;var C=void 0;if(_n!==null){var I=_n.memoizedState;if(C=I.destroy,v!==null&&Tg(v,I.deps)){b.memoizedState=zc(l,f,C,v);return}}Kt.flags|=o,b.memoizedState=zc(1|l,f,C,v)}function Zb(o,l){return yh(8390656,8,o,l)}function Og(o,l){return _h(2048,8,o,l)}function qb(o,l){return _h(4,2,o,l)}function Yb(o,l){return _h(4,4,o,l)}function Xb(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 Qb(o,l,f){return f=f!=null?f.concat([o]):null,_h(4,4,Xb.bind(null,l,o),f)}function Lg(){}function Jb(o,l){var f=hs();l=l===void 0?null:l;var v=f.memoizedState;return v!==null&&l!==null&&Tg(l,v[1])?v[0]:(f.memoizedState=[o,l],o)}function eS(o,l){var f=hs();l=l===void 0?null:l;var v=f.memoizedState;return v!==null&&l!==null&&Tg(l,v[1])?v[0]:(o=o(),f.memoizedState=[o,l],o)}function tS(o,l,f){return(Aa&21)===0?(o.baseState&&(o.baseState=!1,wr=!0),o.memoizedState=f):(Is(f,l)||(f=As(),Kt.lanes|=f,Ia|=f,o.baseState=!0),l)}function QM(o,l){var f=lt;lt=f!==0&&4>f?f:4,o(!0);var v=Pg.transition;Pg.transition={};try{o(!1),l()}finally{lt=f,Pg.transition=v}}function nS(){return hs().memoizedState}function JM(o,l,f){var v=Io(o);if(f={lane:v,action:f,hasEagerState:!1,eagerState:null,next:null},rS(o))sS(l,f);else if(f=Lb(o,l,f,v),f!==null){var b=or();Ns(f,o,v,b),iS(f,l,v)}}function eO(o,l,f){var v=Io(o),b={lane:v,action:f,hasEagerState:!1,eagerState:null,next:null};if(rS(o))sS(l,b);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var I=l.lastRenderedState,V=C(I,f);if(b.hasEagerState=!0,b.eagerState=V,Is(V,I)){var G=l.interleaved;G===null?(b.next=b,wg(l)):(b.next=G.next,G.next=b),l.interleaved=b;return}}catch{}finally{}f=Lb(o,l,b,v),f!==null&&(b=or(),Ns(f,o,v,b),iS(f,l,v))}}function rS(o){var l=o.alternate;return o===Kt||l!==null&&l===Kt}function sS(o,l){Vc=vh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function iS(o,l,f){if((f&4194240)!==0){var v=l.lanes;v&=o.pendingLanes,f|=v,l.lanes=f,us(o,f)}}var xh={readContext:fs,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},tO={readContext:fs,useCallback:function(o,l){return Js().memoizedState=[o,l===void 0?null:l],o},useContext:fs,useEffect:Zb,useImperativeHandle:function(o,l,f){return f=f!=null?f.concat([o]):null,yh(4194308,4,Xb.bind(null,l,o),f)},useLayoutEffect:function(o,l){return yh(4194308,4,o,l)},useInsertionEffect:function(o,l){return yh(4,2,o,l)},useMemo:function(o,l){var f=Js();return l=l===void 0?null:l,o=o(),f.memoizedState=[o,l],o},useReducer:function(o,l,f){var v=Js();return l=f!==void 0?f(l):l,v.memoizedState=v.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},v.queue=o,o=o.dispatch=JM.bind(null,Kt,o),[v.memoizedState,o]},useRef:function(o){var l=Js();return o={current:o},l.memoizedState=o},useState:Gb,useDebugValue:Lg,useDeferredValue:function(o){return Js().memoizedState=o},useTransition:function(){var o=Gb(!1),l=o[0];return o=QM.bind(null,o[1]),Js().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,f){var v=Kt,b=Js();if(Ht){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),Pn===null)throw Error(n(349));(Aa&30)!==0||Hb(v,l,f)}b.memoizedState=f;var C={value:f,getSnapshot:l};return b.queue=C,Zb(Ub.bind(null,v,C,o),[o]),v.flags|=2048,zc(9,zb.bind(null,v,C,f,l),void 0,null),f},useId:function(){var o=Js(),l=Pn.identifierPrefix;if(Ht){var f=Ti,v=Pi;f=(v&~(1<<32-vr(v)-1)).toString(32)+f,l=":"+l+"R"+f,f=$c++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=XM++,l=":"+l+"r"+f.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},nO={readContext:fs,useCallback:Jb,useContext:fs,useEffect:Og,useImperativeHandle:Qb,useInsertionEffect:qb,useLayoutEffect:Yb,useMemo:eS,useReducer:Ig,useRef:Kb,useState:function(){return Ig(Hc)},useDebugValue:Lg,useDeferredValue:function(o){var l=hs();return tS(l,_n.memoizedState,o)},useTransition:function(){var o=Ig(Hc)[0],l=hs().memoizedState;return[o,l]},useMutableSource:Vb,useSyncExternalStore:$b,useId:nS,unstable_isNewReconciler:!1},rO={readContext:fs,useCallback:Jb,useContext:fs,useEffect:Og,useImperativeHandle:Qb,useInsertionEffect:qb,useLayoutEffect:Yb,useMemo:eS,useReducer:Mg,useRef:Kb,useState:function(){return Mg(Hc)},useDebugValue:Lg,useDeferredValue:function(o){var l=hs();return _n===null?l.memoizedState=o:tS(l,_n.memoizedState,o)},useTransition:function(){var o=Mg(Hc)[0],l=hs().memoizedState;return[o,l]},useMutableSource:Vb,useSyncExternalStore:$b,useId:nS,unstable_isNewReconciler:!1};function Os(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var f in o)l[f]===void 0&&(l[f]=o[f]);return l}return l}function Dg(o,l,f,v){l=o.memoizedState,f=f(v,l),f=f==null?l:H({},l,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var wh={isMounted:function(o){return(o=o._reactInternals)?Rs(o)===o:!1},enqueueSetState:function(o,l,f){o=o._reactInternals;var v=or(),b=Io(o),C=Ai(v,b);C.payload=l,f!=null&&(C.callback=f),l=Po(o,C,b),l!==null&&(Ns(l,o,b,v),hh(l,o,b))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var v=or(),b=Io(o),C=Ai(v,b);C.tag=1,C.payload=l,f!=null&&(C.callback=f),l=Po(o,C,b),l!==null&&(Ns(l,o,b,v),hh(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=or(),v=Io(o),b=Ai(f,v);b.tag=2,l!=null&&(b.callback=l),l=Po(o,b,v),l!==null&&(Ns(l,o,v,f),hh(l,o,v))}};function oS(o,l,f,v,b,C,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(v,C,I):l.prototype&&l.prototype.isPureReactComponent?!Tc(f,v)||!Tc(b,C):!0}function aS(o,l,f){var v=!1,b=Eo,C=l.contextType;return typeof C=="object"&&C!==null?C=fs(C):(b=xr(l)?Ca:Zn.current,v=l.contextTypes,C=(v=v!=null)?Bl(o,b):Eo),l=new l(f,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=wh,o.stateNode=l,l._reactInternals=o,v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),l}function lS(o,l,f,v){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,v),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,v),l.state!==o&&wh.enqueueReplaceState(l,l.state,null)}function Ng(o,l,f,v){var b=o.stateNode;b.props=f,b.state=o.memoizedState,b.refs={},bg(o);var C=l.contextType;typeof C=="object"&&C!==null?b.context=fs(C):(C=xr(l)?Ca:Zn.current,b.context=Bl(o,C)),b.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Dg(o,l,C,f),b.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&wh.enqueueReplaceState(b,b.state,null),ph(o,f,b,v),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Ql(o,l){try{var f="",v=l;do f+=ae(v),v=v.return;while(v);var b=f}catch(C){b=`
|
|
40
|
+
Error generating stack: `+C.message+`
|
|
41
|
+
`+C.stack}return{value:o,source:l,stack:b,digest:null}}function jg(o,l,f){return{value:o,source:null,stack:f??null,digest:l??null}}function Fg(o,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var sO=typeof WeakMap=="function"?WeakMap:Map;function uS(o,l,f){f=Ai(-1,f),f.tag=3,f.payload={element:null};var v=l.value;return f.callback=function(){Th||(Th=!0,Jg=v),Fg(o,l)},f}function cS(o,l,f){f=Ai(-1,f),f.tag=3;var v=o.type.getDerivedStateFromError;if(typeof v=="function"){var b=l.value;f.payload=function(){return v(b)},f.callback=function(){Fg(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){Fg(o,l),typeof v!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),f}function dS(o,l,f){var v=o.pingCache;if(v===null){v=o.pingCache=new sO;var b=new Set;v.set(l,b)}else b=v.get(l),b===void 0&&(b=new Set,v.set(l,b));b.has(f)||(b.add(f),o=yO.bind(null,o,l,f),l.then(o,o))}function fS(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 hS(o,l,f,v,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Ai(-1,1),l.tag=2,Po(f,l,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var iO=k.ReactCurrentOwner,wr=!1;function ir(o,l,f,v){l.child=o===null?Ob(l,null,f,v):Zl(l,o.child,f,v)}function pS(o,l,f,v,b){f=f.render;var C=l.ref;return Yl(l,b),v=Rg(o,l,f,v,C,b),f=Ag(),o!==null&&!wr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ii(o,l,b)):(Ht&&f&&fg(l),l.flags|=1,ir(o,l,v,b),l.child)}function mS(o,l,f,v,b){if(o===null){var C=f.type;return typeof C=="function"&&!ov(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=C,gS(o,l,C,v,b)):(o=Lh(f.type,null,v,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,(o.lanes&b)===0){var I=C.memoizedProps;if(f=f.compare,f=f!==null?f:Tc,f(I,v)&&o.ref===l.ref)return Ii(o,l,b)}return l.flags|=1,o=Oo(C,v),o.ref=l.ref,o.return=l,l.child=o}function gS(o,l,f,v,b){if(o!==null){var C=o.memoizedProps;if(Tc(C,v)&&o.ref===l.ref)if(wr=!1,l.pendingProps=v=C,(o.lanes&b)!==0)(o.flags&131072)!==0&&(wr=!0);else return l.lanes=o.lanes,Ii(o,l,b)}return Vg(o,l,f,v,b)}function vS(o,l,f){var v=l.pendingProps,b=v.children,C=o!==null?o.memoizedState:null;if(v.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},At(eu,Br),Br|=f;else{if((f&1073741824)===0)return o=C!==null?C.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,At(eu,Br),Br|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=C!==null?C.baseLanes:f,At(eu,Br),Br|=v}else C!==null?(v=C.baseLanes|f,l.memoizedState=null):v=f,At(eu,Br),Br|=v;return ir(o,l,b,f),l.child}function yS(o,l){var f=l.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function Vg(o,l,f,v,b){var C=xr(f)?Ca:Zn.current;return C=Bl(l,C),Yl(l,b),f=Rg(o,l,f,v,C,b),v=Ag(),o!==null&&!wr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ii(o,l,b)):(Ht&&v&&fg(l),l.flags|=1,ir(o,l,f,b),l.child)}function _S(o,l,f,v,b){if(xr(f)){var C=!0;ih(l)}else C=!1;if(Yl(l,b),l.stateNode===null)Sh(o,l),aS(l,f,v),Ng(l,f,v,b),v=!0;else if(o===null){var I=l.stateNode,V=l.memoizedProps;I.props=V;var G=I.context,re=f.contextType;typeof re=="object"&&re!==null?re=fs(re):(re=xr(f)?Ca:Zn.current,re=Bl(l,re));var fe=f.getDerivedStateFromProps,me=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";me||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==v||G!==re)&&lS(l,I,v,re),ko=!1;var de=l.memoizedState;I.state=de,ph(l,v,I,b),G=l.memoizedState,V!==v||de!==G||_r.current||ko?(typeof fe=="function"&&(Dg(l,f,fe,v),G=l.memoizedState),(V=ko||oS(l,f,V,v,de,G,re))?(me||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=v,l.memoizedState=G),I.props=v,I.state=G,I.context=re,v=V):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),v=!1)}else{I=l.stateNode,Db(o,l),V=l.memoizedProps,re=l.type===l.elementType?V:Os(l.type,V),I.props=re,me=l.pendingProps,de=I.context,G=f.contextType,typeof G=="object"&&G!==null?G=fs(G):(G=xr(f)?Ca:Zn.current,G=Bl(l,G));var Ie=f.getDerivedStateFromProps;(fe=typeof Ie=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==me||de!==G)&&lS(l,I,v,G),ko=!1,de=l.memoizedState,I.state=de,ph(l,v,I,b);var De=l.memoizedState;V!==me||de!==De||_r.current||ko?(typeof Ie=="function"&&(Dg(l,f,Ie,v),De=l.memoizedState),(re=ko||oS(l,f,re,v,de,De,G)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(v,De,G),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(v,De,G)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),l.memoizedProps=v,l.memoizedState=De),I.props=v,I.state=De,I.context=G,v=re):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),v=!1)}return $g(o,l,f,v,C,b)}function $g(o,l,f,v,b,C){yS(o,l);var I=(l.flags&128)!==0;if(!v&&!I)return b&&Eb(l,f,!1),Ii(o,l,C);v=l.stateNode,iO.current=l;var V=I&&typeof f.getDerivedStateFromError!="function"?null:v.render();return l.flags|=1,o!==null&&I?(l.child=Zl(l,o.child,null,C),l.child=Zl(l,null,V,C)):ir(o,l,V,C),l.memoizedState=v.state,b&&Eb(l,f,!0),l.child}function xS(o){var l=o.stateNode;l.pendingContext?bb(o,l.pendingContext,l.pendingContext!==l.context):l.context&&bb(o,l.context,!1),Sg(o,l.containerInfo)}function wS(o,l,f,v,b){return Kl(),gg(b),l.flags|=256,ir(o,l,f,v),l.child}var Hg={dehydrated:null,treeContext:null,retryLane:0};function zg(o){return{baseLanes:o,cachePool:null,transitions:null}}function bS(o,l,f){var v=l.pendingProps,b=Gt.current,C=!1,I=(l.flags&128)!==0,V;if((V=I)||(V=o!==null&&o.memoizedState===null?!1:(b&2)!==0),V?(C=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),At(Gt,b&1),o===null)return mg(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):(I=v.children,o=v.fallback,C?(v=l.mode,C=l.child,I={mode:"hidden",children:I},(v&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=I):C=Dh(I,v,0,null),o=Da(o,v,f,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=zg(f),l.memoizedState=Hg,o):Ug(l,I));if(b=o.memoizedState,b!==null&&(V=b.dehydrated,V!==null))return oO(o,l,I,v,V,b,f);if(C){C=v.fallback,I=l.mode,b=o.child,V=b.sibling;var G={mode:"hidden",children:v.children};return(I&1)===0&&l.child!==b?(v=l.child,v.childLanes=0,v.pendingProps=G,l.deletions=null):(v=Oo(b,G),v.subtreeFlags=b.subtreeFlags&14680064),V!==null?C=Oo(V,C):(C=Da(C,I,f,null),C.flags|=2),C.return=l,v.return=l,v.sibling=C,l.child=v,v=C,C=l.child,I=o.child.memoizedState,I=I===null?zg(f):{baseLanes:I.baseLanes|f,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=o.childLanes&~f,l.memoizedState=Hg,v}return C=o.child,o=C.sibling,v=Oo(C,{mode:"visible",children:v.children}),(l.mode&1)===0&&(v.lanes=f),v.return=l,v.sibling=null,o!==null&&(f=l.deletions,f===null?(l.deletions=[o],l.flags|=16):f.push(o)),l.child=v,l.memoizedState=null,v}function Ug(o,l){return l=Dh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function bh(o,l,f,v){return v!==null&&gg(v),Zl(l,o.child,null,f),o=Ug(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function oO(o,l,f,v,b,C,I){if(f)return l.flags&256?(l.flags&=-257,v=jg(Error(n(422))),bh(o,l,I,v)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=v.fallback,b=l.mode,v=Dh({mode:"visible",children:v.children},b,0,null),C=Da(C,b,I,null),C.flags|=2,v.return=l,C.return=l,v.sibling=C,l.child=v,(l.mode&1)!==0&&Zl(l,o.child,null,I),l.child.memoizedState=zg(I),l.memoizedState=Hg,C);if((l.mode&1)===0)return bh(o,l,I,null);if(b.data==="$!"){if(v=b.nextSibling&&b.nextSibling.dataset,v)var V=v.dgst;return v=V,C=Error(n(419)),v=jg(C,v,void 0),bh(o,l,I,v)}if(V=(I&o.childLanes)!==0,wr||V){if(v=Pn,v!==null){switch(I&-I){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(v.suspendedLanes|I))!==0?0:b,b!==0&&b!==C.retryLane&&(C.retryLane=b,Ri(o,b),Ns(v,o,b,-1))}return iv(),v=jg(Error(n(421))),bh(o,l,I,v)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=_O.bind(null,o),b._reactRetry=l,null):(o=C.treeContext,Ur=bo(b.nextSibling),zr=l,Ht=!0,Ms=null,o!==null&&(cs[ds++]=Pi,cs[ds++]=Ti,cs[ds++]=ka,Pi=o.id,Ti=o.overflow,ka=l),l=Ug(l,v.children),l.flags|=4096,l)}function SS(o,l,f){o.lanes|=l;var v=o.alternate;v!==null&&(v.lanes|=l),xg(o.return,l,f)}function Bg(o,l,f,v,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:v,tail:f,tailMode:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=v,C.tail=f,C.tailMode=b)}function ES(o,l,f){var v=l.pendingProps,b=v.revealOrder,C=v.tail;if(ir(o,l,v.children,f),v=Gt.current,(v&2)!==0)v=v&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&&SS(o,f,l);else if(o.tag===19)SS(o,f,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}v&=1}if(At(Gt,v),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(f=l.child,b=null;f!==null;)o=f.alternate,o!==null&&mh(o)===null&&(b=f),f=f.sibling;f=b,f===null?(b=l.child,l.child=null):(b=f.sibling,f.sibling=null),Bg(l,!1,b,f,C);break;case"backwards":for(f=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&mh(o)===null){l.child=b;break}o=b.sibling,b.sibling=f,f=b,b=o}Bg(l,!0,f,null,C);break;case"together":Bg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Sh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ii(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),Ia|=l.lanes,(f&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,f=Oo(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=Oo(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function aO(o,l,f){switch(l.tag){case 3:xS(l),Kl();break;case 5:Fb(l);break;case 1:xr(l.type)&&ih(l);break;case 4:Sg(l,l.stateNode.containerInfo);break;case 10:var v=l.type._context,b=l.memoizedProps.value;At(dh,v._currentValue),v._currentValue=b;break;case 13:if(v=l.memoizedState,v!==null)return v.dehydrated!==null?(At(Gt,Gt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?bS(o,l,f):(At(Gt,Gt.current&1),o=Ii(o,l,f),o!==null?o.sibling:null);At(Gt,Gt.current&1);break;case 19:if(v=(f&l.childLanes)!==0,(o.flags&128)!==0){if(v)return ES(o,l,f);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),At(Gt,Gt.current),v)break;return null;case 22:case 23:return l.lanes=0,vS(o,l,f)}return Ii(o,l,f)}var CS,Wg,kS,PS;CS=function(o,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Wg=function(){},kS=function(o,l,f,v){var b=o.memoizedProps;if(b!==v){o=l.stateNode,Ra(Qs.current);var C=null;switch(f){case"input":b=We(o,b),v=We(o,v),C=[];break;case"select":b=H({},b,{value:void 0}),v=H({},v,{value:void 0}),C=[];break;case"textarea":b=Ge(o,b),v=Ge(o,v),C=[];break;default:typeof b.onClick!="function"&&typeof v.onClick=="function"&&(o.onclick=nh)}Ps(f,v);var I;f=null;for(re in b)if(!v.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var V=b[re];for(I in V)V.hasOwnProperty(I)&&(f||(f={}),f[I]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in v){var G=v[re];if(V=b!=null?b[re]:void 0,v.hasOwnProperty(re)&&G!==V&&(G!=null||V!=null))if(re==="style")if(V){for(I in V)!V.hasOwnProperty(I)||G&&G.hasOwnProperty(I)||(f||(f={}),f[I]="");for(I in G)G.hasOwnProperty(I)&&V[I]!==G[I]&&(f||(f={}),f[I]=G[I])}else f||(C||(C=[]),C.push(re,f)),f=G;else re==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,V=V?V.__html:void 0,G!=null&&V!==G&&(C=C||[]).push(re,G)):re==="children"?typeof G!="string"&&typeof G!="number"||(C=C||[]).push(re,""+G):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(G!=null&&re==="onScroll"&&Lt("scroll",o),C||V===G||(C=[])):(C=C||[]).push(re,G))}f&&(C=C||[]).push("style",f);var re=C;(l.updateQueue=re)&&(l.flags|=4)}},PS=function(o,l,f,v){f!==v&&(l.flags|=4)};function Uc(o,l){if(!Ht)switch(o.tailMode){case"hidden":l=o.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:v.sibling=null}}function Yn(o){var l=o.alternate!==null&&o.alternate.child===o.child,f=0,v=0;if(l)for(var b=o.child;b!==null;)f|=b.lanes|b.childLanes,v|=b.subtreeFlags&14680064,v|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)f|=b.lanes|b.childLanes,v|=b.subtreeFlags,v|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=v,o.childLanes=f,l}function lO(o,l,f){var v=l.pendingProps;switch(hg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yn(l),null;case 1:return xr(l.type)&&sh(),Yn(l),null;case 3:return v=l.stateNode,Xl(),Dt(_r),Dt(Zn),kg(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(o===null||o.child===null)&&(uh(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ms!==null&&(nv(Ms),Ms=null))),Wg(o,l),Yn(l),null;case 5:Eg(l);var b=Ra(Fc.current);if(f=l.type,o!==null&&l.stateNode!=null)kS(o,l,f,v,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!v){if(l.stateNode===null)throw Error(n(166));return Yn(l),null}if(o=Ra(Qs.current),uh(l)){v=l.stateNode,f=l.type;var C=l.memoizedProps;switch(v[Xs]=l,v[Oc]=C,o=(l.mode&1)!==0,f){case"dialog":Lt("cancel",v),Lt("close",v);break;case"iframe":case"object":case"embed":Lt("load",v);break;case"video":case"audio":for(b=0;b<Ac.length;b++)Lt(Ac[b],v);break;case"source":Lt("error",v);break;case"img":case"image":case"link":Lt("error",v),Lt("load",v);break;case"details":Lt("toggle",v);break;case"input":Rt(v,C),Lt("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!C.multiple},Lt("invalid",v);break;case"textarea":ct(v,C),Lt("invalid",v)}Ps(f,C),b=null;for(var I in C)if(C.hasOwnProperty(I)){var V=C[I];I==="children"?typeof V=="string"?v.textContent!==V&&(C.suppressHydrationWarning!==!0&&th(v.textContent,V,o),b=["children",V]):typeof V=="number"&&v.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&th(v.textContent,V,o),b=["children",""+V]):s.hasOwnProperty(I)&&V!=null&&I==="onScroll"&&Lt("scroll",v)}switch(f){case"input":be(v),Mt(v,C,!0);break;case"textarea":be(v),Sn(v);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(v.onclick=nh)}v=b,l.updateQueue=v,v!==null&&(l.flags|=4)}else{I=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=St(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof v.is=="string"?o=I.createElement(f,{is:v.is}):(o=I.createElement(f),f==="select"&&(I=o,v.multiple?I.multiple=!0:v.size&&(I.size=v.size))):o=I.createElementNS(o,f),o[Xs]=l,o[Oc]=v,CS(o,l,!1,!1),l.stateNode=o;e:{switch(I=qs(f,v),f){case"dialog":Lt("cancel",o),Lt("close",o),b=v;break;case"iframe":case"object":case"embed":Lt("load",o),b=v;break;case"video":case"audio":for(b=0;b<Ac.length;b++)Lt(Ac[b],o);b=v;break;case"source":Lt("error",o),b=v;break;case"img":case"image":case"link":Lt("error",o),Lt("load",o),b=v;break;case"details":Lt("toggle",o),b=v;break;case"input":Rt(o,v),b=We(o,v),Lt("invalid",o);break;case"option":b=v;break;case"select":o._wrapperState={wasMultiple:!!v.multiple},b=H({},v,{value:void 0}),Lt("invalid",o);break;case"textarea":ct(o,v),b=Ge(o,v),Lt("invalid",o);break;default:b=v}Ps(f,b),V=b;for(C in V)if(V.hasOwnProperty(C)){var G=V[C];C==="style"?Ln(o,G):C==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&is(o,G)):C==="children"?typeof G=="string"?(f!=="textarea"||G!=="")&&rn(o,G):typeof G=="number"&&rn(o,""+G):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?G!=null&&C==="onScroll"&&Lt("scroll",o):G!=null&&T(o,C,G,I))}switch(f){case"input":be(o),Mt(o,v,!1);break;case"textarea":be(o),Sn(o);break;case"option":v.value!=null&&o.setAttribute("value",""+oe(v.value));break;case"select":o.multiple=!!v.multiple,C=v.value,C!=null?tt(o,!!v.multiple,C,!1):v.defaultValue!=null&&tt(o,!!v.multiple,v.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=nh)}switch(f){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}}v&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Yn(l),null;case 6:if(o&&l.stateNode!=null)PS(o,l,o.memoizedProps,v);else{if(typeof v!="string"&&l.stateNode===null)throw Error(n(166));if(f=Ra(Fc.current),Ra(Qs.current),uh(l)){if(v=l.stateNode,f=l.memoizedProps,v[Xs]=l,(C=v.nodeValue!==f)&&(o=zr,o!==null))switch(o.tag){case 3:th(v.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&th(v.nodeValue,f,(o.mode&1)!==0)}C&&(l.flags|=4)}else v=(f.nodeType===9?f:f.ownerDocument).createTextNode(v),v[Xs]=l,l.stateNode=v}return Yn(l),null;case 13:if(Dt(Gt),v=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ht&&Ur!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Ab(),Kl(),l.flags|=98560,C=!1;else if(C=uh(l),v!==null&&v.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Xs]=l}else Kl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Yn(l),C=!1}else Ms!==null&&(nv(Ms),Ms=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(v=v!==null,v!==(o!==null&&o.memoizedState!==null)&&v&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Gt.current&1)!==0?xn===0&&(xn=3):iv())),l.updateQueue!==null&&(l.flags|=4),Yn(l),null);case 4:return Xl(),Wg(o,l),o===null&&Ic(l.stateNode.containerInfo),Yn(l),null;case 10:return _g(l.type._context),Yn(l),null;case 17:return xr(l.type)&&sh(),Yn(l),null;case 19:if(Dt(Gt),C=l.memoizedState,C===null)return Yn(l),null;if(v=(l.flags&128)!==0,I=C.rendering,I===null)if(v)Uc(C,!1);else{if(xn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=mh(o),I!==null){for(l.flags|=128,Uc(C,!1),v=I.updateQueue,v!==null&&(l.updateQueue=v,l.flags|=4),l.subtreeFlags=0,v=f,f=l.child;f!==null;)C=f,o=v,C.flags&=14680066,I=C.alternate,I===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=I.childLanes,C.lanes=I.lanes,C.child=I.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=I.memoizedProps,C.memoizedState=I.memoizedState,C.updateQueue=I.updateQueue,C.type=I.type,o=I.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),f=f.sibling;return At(Gt,Gt.current&1|2),l.child}o=o.sibling}C.tail!==null&&xt()>tu&&(l.flags|=128,v=!0,Uc(C,!1),l.lanes=4194304)}else{if(!v)if(o=mh(I),o!==null){if(l.flags|=128,v=!0,f=o.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),Uc(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!Ht)return Yn(l),null}else 2*xt()-C.renderingStartTime>tu&&f!==1073741824&&(l.flags|=128,v=!0,Uc(C,!1),l.lanes=4194304);C.isBackwards?(I.sibling=l.child,l.child=I):(f=C.last,f!==null?f.sibling=I:l.child=I,C.last=I)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=xt(),l.sibling=null,f=Gt.current,At(Gt,v?f&1|2:f&1),l):(Yn(l),null);case 22:case 23:return sv(),v=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==v&&(l.flags|=8192),v&&(l.mode&1)!==0?(Br&1073741824)!==0&&(Yn(l),l.subtreeFlags&6&&(l.flags|=8192)):Yn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function uO(o,l){switch(hg(l),l.tag){case 1:return xr(l.type)&&sh(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Xl(),Dt(_r),Dt(Zn),kg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Eg(l),null;case 13:if(Dt(Gt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Kl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Dt(Gt),null;case 4:return Xl(),null;case 10:return _g(l.type._context),null;case 22:case 23:return sv(),null;case 24:return null;default:return null}}var Eh=!1,Xn=!1,cO=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Jl(o,l){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(v){Qt(o,l,v)}else f.current=null}function Gg(o,l,f){try{f()}catch(v){Qt(o,l,v)}}var TS=!1;function dO(o,l){if(sg=Bf,o=ob(),Y0(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var v=f.getSelection&&f.getSelection();if(v&&v.rangeCount!==0){f=v.anchorNode;var b=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var I=0,V=-1,G=-1,re=0,fe=0,me=o,de=null;t:for(;;){for(var Ie;me!==f||b!==0&&me.nodeType!==3||(V=I+b),me!==C||v!==0&&me.nodeType!==3||(G=I+v),me.nodeType===3&&(I+=me.nodeValue.length),(Ie=me.firstChild)!==null;)de=me,me=Ie;for(;;){if(me===o)break t;if(de===f&&++re===b&&(V=I),de===C&&++fe===v&&(G=I),(Ie=me.nextSibling)!==null)break;me=de,de=me.parentNode}me=Ie}f=V===-1||G===-1?null:{start:V,end:G}}else f=null}f=f||{start:0,end:0}}else f=null;for(ig={focusedElem:o,selectionRange:f},Bf=!1,Oe=l;Oe!==null;)if(l=Oe,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Oe=o;else for(;Oe!==null;){l=Oe;try{var De=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Fe=De.memoizedProps,sn=De.memoizedState,Q=l.stateNode,Z=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Fe:Os(l.type,Fe),sn);Q.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var ee=l.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){Qt(l,l.return,_e)}if(o=l.sibling,o!==null){o.return=l.return,Oe=o;break}Oe=l.return}return De=TS,TS=!1,De}function Bc(o,l,f){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var b=v=v.next;do{if((b.tag&o)===o){var C=b.destroy;b.destroy=void 0,C!==void 0&&Gg(l,f,C)}b=b.next}while(b!==v)}}function Ch(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&o)===o){var v=f.create;f.destroy=v()}f=f.next}while(f!==l)}}function Kg(o){var l=o.ref;if(l!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof l=="function"?l(o):l.current=o}}function RS(o){var l=o.alternate;l!==null&&(o.alternate=null,RS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Xs],delete l[Oc],delete l[ug],delete l[KM],delete l[ZM])),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 AS(o){return o.tag===5||o.tag===3||o.tag===4}function IS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||AS(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 Zg(o,l,f){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(o,l):f.insertBefore(o,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(o,f)):(l=f,l.appendChild(o)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=nh));else if(v!==4&&(o=o.child,o!==null))for(Zg(o,l,f),o=o.sibling;o!==null;)Zg(o,l,f),o=o.sibling}function qg(o,l,f){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?f.insertBefore(o,l):f.appendChild(o);else if(v!==4&&(o=o.child,o!==null))for(qg(o,l,f),o=o.sibling;o!==null;)qg(o,l,f),o=o.sibling}var Nn=null,Ls=!1;function To(o,l,f){for(f=f.child;f!==null;)MS(o,l,f),f=f.sibling}function MS(o,l,f){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(Sa,f)}catch{}switch(f.tag){case 5:Xn||Jl(f,l);case 6:var v=Nn,b=Ls;Nn=null,To(o,l,f),Nn=v,Ls=b,Nn!==null&&(Ls?(o=Nn,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):Nn.removeChild(f.stateNode));break;case 18:Nn!==null&&(Ls?(o=Nn,f=f.stateNode,o.nodeType===8?lg(o.parentNode,f):o.nodeType===1&&lg(o,f),bc(o)):lg(Nn,f.stateNode));break;case 4:v=Nn,b=Ls,Nn=f.stateNode.containerInfo,Ls=!0,To(o,l,f),Nn=v,Ls=b;break;case 0:case 11:case 14:case 15:if(!Xn&&(v=f.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){b=v=v.next;do{var C=b,I=C.destroy;C=C.tag,I!==void 0&&((C&2)!==0||(C&4)!==0)&&Gg(f,l,I),b=b.next}while(b!==v)}To(o,l,f);break;case 1:if(!Xn&&(Jl(f,l),v=f.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=f.memoizedProps,v.state=f.memoizedState,v.componentWillUnmount()}catch(V){Qt(f,l,V)}To(o,l,f);break;case 21:To(o,l,f);break;case 22:f.mode&1?(Xn=(v=Xn)||f.memoizedState!==null,To(o,l,f),Xn=v):To(o,l,f);break;default:To(o,l,f)}}function OS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new cO),l.forEach(function(v){var b=xO.bind(null,o,v);f.has(v)||(f.add(v),v.then(b,b))})}}function Ds(o,l){var f=l.deletions;if(f!==null)for(var v=0;v<f.length;v++){var b=f[v];try{var C=o,I=l,V=I;e:for(;V!==null;){switch(V.tag){case 5:Nn=V.stateNode,Ls=!1;break e;case 3:Nn=V.stateNode.containerInfo,Ls=!0;break e;case 4:Nn=V.stateNode.containerInfo,Ls=!0;break e}V=V.return}if(Nn===null)throw Error(n(160));MS(C,I,b),Nn=null,Ls=!1;var G=b.alternate;G!==null&&(G.return=null),b.return=null}catch(re){Qt(b,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)LS(l,o),l=l.sibling}function LS(o,l){var f=o.alternate,v=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Ds(l,o),ei(o),v&4){try{Bc(3,o,o.return),Ch(3,o)}catch(Fe){Qt(o,o.return,Fe)}try{Bc(5,o,o.return)}catch(Fe){Qt(o,o.return,Fe)}}break;case 1:Ds(l,o),ei(o),v&512&&f!==null&&Jl(f,f.return);break;case 5:if(Ds(l,o),ei(o),v&512&&f!==null&&Jl(f,f.return),o.flags&32){var b=o.stateNode;try{rn(b,"")}catch(Fe){Qt(o,o.return,Fe)}}if(v&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,I=f!==null?f.memoizedProps:C,V=o.type,G=o.updateQueue;if(o.updateQueue=null,G!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&Ye(b,C),qs(V,I);var re=qs(V,C);for(I=0;I<G.length;I+=2){var fe=G[I],me=G[I+1];fe==="style"?Ln(b,me):fe==="dangerouslySetInnerHTML"?is(b,me):fe==="children"?rn(b,me):T(b,fe,me,re)}switch(V){case"input":we(b,C);break;case"textarea":vn(b,C);break;case"select":var de=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var Ie=C.value;Ie!=null?tt(b,!!C.multiple,Ie,!1):de!==!!C.multiple&&(C.defaultValue!=null?tt(b,!!C.multiple,C.defaultValue,!0):tt(b,!!C.multiple,C.multiple?[]:"",!1))}b[Oc]=C}catch(Fe){Qt(o,o.return,Fe)}}break;case 6:if(Ds(l,o),ei(o),v&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(Fe){Qt(o,o.return,Fe)}}break;case 3:if(Ds(l,o),ei(o),v&4&&f!==null&&f.memoizedState.isDehydrated)try{bc(l.containerInfo)}catch(Fe){Qt(o,o.return,Fe)}break;case 4:Ds(l,o),ei(o);break;case 13:Ds(l,o),ei(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(Qg=xt())),v&4&&OS(o);break;case 22:if(fe=f!==null&&f.memoizedState!==null,o.mode&1?(Xn=(re=Xn)||fe,Ds(l,o),Xn=re):Ds(l,o),ei(o),v&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!fe&&(o.mode&1)!==0)for(Oe=o,fe=o.child;fe!==null;){for(me=Oe=fe;Oe!==null;){switch(de=Oe,Ie=de.child,de.tag){case 0:case 11:case 14:case 15:Bc(4,de,de.return);break;case 1:Jl(de,de.return);var De=de.stateNode;if(typeof De.componentWillUnmount=="function"){v=de,f=de.return;try{l=v,De.props=l.memoizedProps,De.state=l.memoizedState,De.componentWillUnmount()}catch(Fe){Qt(v,f,Fe)}}break;case 5:Jl(de,de.return);break;case 22:if(de.memoizedState!==null){jS(me);continue}}Ie!==null?(Ie.return=de,Oe=Ie):jS(me)}fe=fe.sibling}e:for(fe=null,me=o;;){if(me.tag===5){if(fe===null){fe=me;try{b=me.stateNode,re?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=me.stateNode,G=me.memoizedProps.style,I=G!=null&&G.hasOwnProperty("display")?G.display:null,V.style.display=Al("display",I))}catch(Fe){Qt(o,o.return,Fe)}}}else if(me.tag===6){if(fe===null)try{me.stateNode.nodeValue=re?"":me.memoizedProps}catch(Fe){Qt(o,o.return,Fe)}}else if((me.tag!==22&&me.tag!==23||me.memoizedState===null||me===o)&&me.child!==null){me.child.return=me,me=me.child;continue}if(me===o)break e;for(;me.sibling===null;){if(me.return===null||me.return===o)break e;fe===me&&(fe=null),me=me.return}fe===me&&(fe=null),me.sibling.return=me.return,me=me.sibling}}break;case 19:Ds(l,o),ei(o),v&4&&OS(o);break;case 21:break;default:Ds(l,o),ei(o)}}function ei(o){var l=o.flags;if(l&2){try{e:{for(var f=o.return;f!==null;){if(AS(f)){var v=f;break e}f=f.return}throw Error(n(160))}switch(v.tag){case 5:var b=v.stateNode;v.flags&32&&(rn(b,""),v.flags&=-33);var C=IS(o);qg(o,C,b);break;case 3:case 4:var I=v.stateNode.containerInfo,V=IS(o);Zg(o,V,I);break;default:throw Error(n(161))}}catch(G){Qt(o,o.return,G)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function fO(o,l,f){Oe=o,DS(o)}function DS(o,l,f){for(var v=(o.mode&1)!==0;Oe!==null;){var b=Oe,C=b.child;if(b.tag===22&&v){var I=b.memoizedState!==null||Eh;if(!I){var V=b.alternate,G=V!==null&&V.memoizedState!==null||Xn;V=Eh;var re=Xn;if(Eh=I,(Xn=G)&&!re)for(Oe=b;Oe!==null;)I=Oe,G=I.child,I.tag===22&&I.memoizedState!==null?FS(b):G!==null?(G.return=I,Oe=G):FS(b);for(;C!==null;)Oe=C,DS(C),C=C.sibling;Oe=b,Eh=V,Xn=re}NS(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,Oe=C):NS(o)}}function NS(o){for(;Oe!==null;){var l=Oe;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Xn||Ch(5,l);break;case 1:var v=l.stateNode;if(l.flags&4&&!Xn)if(f===null)v.componentDidMount();else{var b=l.elementType===l.type?f.memoizedProps:Os(l.type,f.memoizedProps);v.componentDidUpdate(b,f.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&jb(l,C,v);break;case 3:var I=l.updateQueue;if(I!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}jb(l,I,f)}break;case 5:var V=l.stateNode;if(f===null&&l.flags&4){f=V;var G=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&f.focus();break;case"img":G.src&&(f.src=G.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 fe=re.memoizedState;if(fe!==null){var me=fe.dehydrated;me!==null&&bc(me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xn||l.flags&512&&Kg(l)}catch(de){Qt(l,l.return,de)}}if(l===o){Oe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Oe=f;break}Oe=l.return}}function jS(o){for(;Oe!==null;){var l=Oe;if(l===o){Oe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Oe=f;break}Oe=l.return}}function FS(o){for(;Oe!==null;){var l=Oe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{Ch(4,l)}catch(G){Qt(l,f,G)}break;case 1:var v=l.stateNode;if(typeof v.componentDidMount=="function"){var b=l.return;try{v.componentDidMount()}catch(G){Qt(l,b,G)}}var C=l.return;try{Kg(l)}catch(G){Qt(l,C,G)}break;case 5:var I=l.return;try{Kg(l)}catch(G){Qt(l,I,G)}}}catch(G){Qt(l,l.return,G)}if(l===o){Oe=null;break}var V=l.sibling;if(V!==null){V.return=l.return,Oe=V;break}Oe=l.return}}var hO=Math.ceil,kh=k.ReactCurrentDispatcher,Yg=k.ReactCurrentOwner,ps=k.ReactCurrentBatchConfig,ht=0,Pn=null,dn=null,jn=0,Br=0,eu=So(0),xn=0,Wc=null,Ia=0,Ph=0,Xg=0,Gc=null,br=null,Qg=0,tu=1/0,Mi=null,Th=!1,Jg=null,Ro=null,Rh=!1,Ao=null,Ah=0,Kc=0,ev=null,Ih=-1,Mh=0;function or(){return(ht&6)!==0?xt():Ih!==-1?Ih:Ih=xt()}function Io(o){return(o.mode&1)===0?1:(ht&2)!==0&&jn!==0?jn&-jn:YM.transition!==null?(Mh===0&&(Mh=As()),Mh):(o=lt,o!==0||(o=window.event,o=o===void 0?16:$w(o.type)),o)}function Ns(o,l,f,v){if(50<Kc)throw Kc=0,ev=null,Error(n(185));yr(o,f,v),((ht&2)===0||o!==Pn)&&(o===Pn&&((ht&2)===0&&(Ph|=f),xn===4&&Mo(o,jn)),Sr(o,v),f===1&&ht===0&&(l.mode&1)===0&&(tu=xt()+500,oh&&Co()))}function Sr(o,l){var f=o.callbackNode;sr(o,l);var v=Ke(o,o===Pn?jn:0);if(v===0)f!==null&&vc(f),o.callbackNode=null,o.callbackPriority=0;else if(l=v&-v,o.callbackPriority!==l){if(f!=null&&vc(f),l===1)o.tag===0?qM($S.bind(null,o)):Cb($S.bind(null,o)),WM(function(){(ht&6)===0&&Co()}),f=null;else{switch(Mw(v)){case 1:f=wa;break;case 4:f=$f;break;case 16:f=ba;break;case 536870912:f=Ll;break;default:f=ba}f=ZS(f,VS.bind(null,o))}o.callbackPriority=l,o.callbackNode=f}}function VS(o,l){if(Ih=-1,Mh=0,(ht&6)!==0)throw Error(n(327));var f=o.callbackNode;if(nu()&&o.callbackNode!==f)return null;var v=Ke(o,o===Pn?jn:0);if(v===0)return null;if((v&30)!==0||(v&o.expiredLanes)!==0||l)l=Oh(o,v);else{l=v;var b=ht;ht|=2;var C=zS();(Pn!==o||jn!==l)&&(Mi=null,tu=xt()+500,Oa(o,l));do try{gO();break}catch(V){HS(o,V)}while(!0);yg(),kh.current=C,ht=b,dn!==null?l=0:(Pn=null,jn=0,l=xn)}if(l!==0){if(l===2&&(b=Kn(o),b!==0&&(v=b,l=tv(o,b))),l===1)throw f=Wc,Oa(o,0),Mo(o,v),Sr(o,xt()),f;if(l===6)Mo(o,v);else{if(b=o.current.alternate,(v&30)===0&&!pO(b)&&(l=Oh(o,v),l===2&&(C=Kn(o),C!==0&&(v=C,l=tv(o,C))),l===1))throw f=Wc,Oa(o,0),Mo(o,v),Sr(o,xt()),f;switch(o.finishedWork=b,o.finishedLanes=v,l){case 0:case 1:throw Error(n(345));case 2:La(o,br,Mi);break;case 3:if(Mo(o,v),(v&130023424)===v&&(l=Qg+500-xt(),10<l)){if(Ke(o,0)!==0)break;if(b=o.suspendedLanes,(b&v)!==v){or(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=ag(La.bind(null,o,br,Mi),l);break}La(o,br,Mi);break;case 4:if(Mo(o,v),(v&4194240)===v)break;for(l=o.eventTimes,b=-1;0<v;){var I=31-vr(v);C=1<<I,I=l[I],I>b&&(b=I),v&=~C}if(v=b,v=xt()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*hO(v/1960))-v,10<v){o.timeoutHandle=ag(La.bind(null,o,br,Mi),v);break}La(o,br,Mi);break;case 5:La(o,br,Mi);break;default:throw Error(n(329))}}}return Sr(o,xt()),o.callbackNode===f?VS.bind(null,o):null}function tv(o,l){var f=Gc;return o.current.memoizedState.isDehydrated&&(Oa(o,l).flags|=256),o=Oh(o,l),o!==2&&(l=br,br=f,l!==null&&nv(l)),o}function nv(o){br===null?br=o:br.push.apply(br,o)}function pO(o){for(var l=o;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var v=0;v<f.length;v++){var b=f[v],C=b.getSnapshot;b=b.value;try{if(!Is(C(),b))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;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 Mo(o,l){for(l&=~Xg,l&=~Ph,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var f=31-vr(l),v=1<<f;o[f]=-1,l&=~v}}function $S(o){if((ht&6)!==0)throw Error(n(327));nu();var l=Ke(o,0);if((l&1)===0)return Sr(o,xt()),null;var f=Oh(o,l);if(o.tag!==0&&f===2){var v=Kn(o);v!==0&&(l=v,f=tv(o,v))}if(f===1)throw f=Wc,Oa(o,0),Mo(o,l),Sr(o,xt()),f;if(f===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,La(o,br,Mi),Sr(o,xt()),null}function rv(o,l){var f=ht;ht|=1;try{return o(l)}finally{ht=f,ht===0&&(tu=xt()+500,oh&&Co())}}function Ma(o){Ao!==null&&Ao.tag===0&&(ht&6)===0&&nu();var l=ht;ht|=1;var f=ps.transition,v=lt;try{if(ps.transition=null,lt=1,o)return o()}finally{lt=v,ps.transition=f,ht=l,(ht&6)===0&&Co()}}function sv(){Br=eu.current,Dt(eu)}function Oa(o,l){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,BM(f)),dn!==null)for(f=dn.return;f!==null;){var v=f;switch(hg(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&sh();break;case 3:Xl(),Dt(_r),Dt(Zn),kg();break;case 5:Eg(v);break;case 4:Xl();break;case 13:Dt(Gt);break;case 19:Dt(Gt);break;case 10:_g(v.type._context);break;case 22:case 23:sv()}f=f.return}if(Pn=o,dn=o=Oo(o.current,null),jn=Br=l,xn=0,Wc=null,Xg=Ph=Ia=0,br=Gc=null,Ta!==null){for(l=0;l<Ta.length;l++)if(f=Ta[l],v=f.interleaved,v!==null){f.interleaved=null;var b=v.next,C=f.pending;if(C!==null){var I=C.next;C.next=b,v.next=I}f.pending=v}Ta=null}return o}function HS(o,l){do{var f=dn;try{if(yg(),gh.current=xh,vh){for(var v=Kt.memoizedState;v!==null;){var b=v.queue;b!==null&&(b.pending=null),v=v.next}vh=!1}if(Aa=0,kn=_n=Kt=null,Vc=!1,$c=0,Yg.current=null,f===null||f.return===null){xn=1,Wc=l,dn=null;break}e:{var C=o,I=f.return,V=f,G=l;if(l=jn,V.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var re=G,fe=V,me=fe.tag;if((fe.mode&1)===0&&(me===0||me===11||me===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Ie=fS(I);if(Ie!==null){Ie.flags&=-257,hS(Ie,I,V,C,l),Ie.mode&1&&dS(C,re,l),l=Ie,G=re;var De=l.updateQueue;if(De===null){var Fe=new Set;Fe.add(G),l.updateQueue=Fe}else De.add(G);break e}else{if((l&1)===0){dS(C,re,l),iv();break e}G=Error(n(426))}}else if(Ht&&V.mode&1){var sn=fS(I);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),hS(sn,I,V,C,l),gg(Ql(G,V));break e}}C=G=Ql(G,V),xn!==4&&(xn=2),Gc===null?Gc=[C]:Gc.push(C),C=I;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=uS(C,G,l);Nb(C,Q);break e;case 1:V=G;var Z=C.type,ee=C.stateNode;if((C.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Ro===null||!Ro.has(ee)))){C.flags|=65536,l&=-l,C.lanes|=l;var _e=cS(C,V,l);Nb(C,_e);break e}}C=C.return}while(C!==null)}BS(f)}catch(Ve){l=Ve,dn===f&&f!==null&&(dn=f=f.return);continue}break}while(!0)}function zS(){var o=kh.current;return kh.current=xh,o===null?xh:o}function iv(){(xn===0||xn===3||xn===2)&&(xn=4),Pn===null||(Ia&268435455)===0&&(Ph&268435455)===0||Mo(Pn,jn)}function Oh(o,l){var f=ht;ht|=2;var v=zS();(Pn!==o||jn!==l)&&(Mi=null,Oa(o,l));do try{mO();break}catch(b){HS(o,b)}while(!0);if(yg(),ht=f,kh.current=v,dn!==null)throw Error(n(261));return Pn=null,jn=0,xn}function mO(){for(;dn!==null;)US(dn)}function gO(){for(;dn!==null&&!N0();)US(dn)}function US(o){var l=KS(o.alternate,o,Br);o.memoizedProps=o.pendingProps,l===null?BS(o):dn=l,Yg.current=null}function BS(o){var l=o;do{var f=l.alternate;if(o=l.return,(l.flags&32768)===0){if(f=lO(f,l,Br),f!==null){dn=f;return}}else{if(f=uO(f,l),f!==null){f.flags&=32767,dn=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{xn=6,dn=null;return}}if(l=l.sibling,l!==null){dn=l;return}dn=l=o}while(l!==null);xn===0&&(xn=5)}function La(o,l,f){var v=lt,b=ps.transition;try{ps.transition=null,lt=1,vO(o,l,f,v)}finally{ps.transition=b,lt=v}return null}function vO(o,l,f,v){do nu();while(Ao!==null);if((ht&6)!==0)throw Error(n(327));f=o.finishedWork;var b=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=f.lanes|f.childLanes;if(Dn(o,C),o===Pn&&(dn=Pn=null,jn=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Rh||(Rh=!0,ZS(ba,function(){return nu(),null})),C=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||C){C=ps.transition,ps.transition=null;var I=lt;lt=1;var V=ht;ht|=4,Yg.current=null,dO(o,f),LS(f,o),jM(ig),Bf=!!sg,ig=sg=null,o.current=f,fO(f),Iw(),ht=V,lt=I,ps.transition=C}else o.current=f;if(Rh&&(Rh=!1,Ao=o,Ah=b),C=o.pendingLanes,C===0&&(Ro=null),Hf(f.stateNode),Sr(o,xt()),l!==null)for(v=o.onRecoverableError,f=0;f<l.length;f++)b=l[f],v(b.value,{componentStack:b.stack,digest:b.digest});if(Th)throw Th=!1,o=Jg,Jg=null,o;return(Ah&1)!==0&&o.tag!==0&&nu(),C=o.pendingLanes,(C&1)!==0?o===ev?Kc++:(Kc=0,ev=o):Kc=0,Co(),null}function nu(){if(Ao!==null){var o=Mw(Ah),l=ps.transition,f=lt;try{if(ps.transition=null,lt=16>o?16:o,Ao===null)var v=!1;else{if(o=Ao,Ao=null,Ah=0,(ht&6)!==0)throw Error(n(331));var b=ht;for(ht|=4,Oe=o.current;Oe!==null;){var C=Oe,I=C.child;if((Oe.flags&16)!==0){var V=C.deletions;if(V!==null){for(var G=0;G<V.length;G++){var re=V[G];for(Oe=re;Oe!==null;){var fe=Oe;switch(fe.tag){case 0:case 11:case 15:Bc(8,fe,C)}var me=fe.child;if(me!==null)me.return=fe,Oe=me;else for(;Oe!==null;){fe=Oe;var de=fe.sibling,Ie=fe.return;if(RS(fe),fe===re){Oe=null;break}if(de!==null){de.return=Ie,Oe=de;break}Oe=Ie}}}var De=C.alternate;if(De!==null){var Fe=De.child;if(Fe!==null){De.child=null;do{var sn=Fe.sibling;Fe.sibling=null,Fe=sn}while(Fe!==null)}}Oe=C}}if((C.subtreeFlags&2064)!==0&&I!==null)I.return=C,Oe=I;else e:for(;Oe!==null;){if(C=Oe,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Bc(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Oe=Q;break e}Oe=C.return}}var Z=o.current;for(Oe=Z;Oe!==null;){I=Oe;var ee=I.child;if((I.subtreeFlags&2064)!==0&&ee!==null)ee.return=I,Oe=ee;else e:for(I=Z;Oe!==null;){if(V=Oe,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Ch(9,V)}}catch(Ve){Qt(V,V.return,Ve)}if(V===I){Oe=null;break e}var _e=V.sibling;if(_e!==null){_e.return=V.return,Oe=_e;break e}Oe=V.return}}if(ht=b,Co(),$r&&typeof $r.onPostCommitFiberRoot=="function")try{$r.onPostCommitFiberRoot(Sa,o)}catch{}v=!0}return v}finally{lt=f,ps.transition=l}}return!1}function WS(o,l,f){l=Ql(f,l),l=uS(o,l,1),o=Po(o,l,1),l=or(),o!==null&&(yr(o,1,l),Sr(o,l))}function Qt(o,l,f){if(o.tag===3)WS(o,o,f);else for(;l!==null;){if(l.tag===3){WS(l,o,f);break}else if(l.tag===1){var v=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ro===null||!Ro.has(v))){o=Ql(f,o),o=cS(l,o,1),l=Po(l,o,1),o=or(),l!==null&&(yr(l,1,o),Sr(l,o));break}}l=l.return}}function yO(o,l,f){var v=o.pingCache;v!==null&&v.delete(l),l=or(),o.pingedLanes|=o.suspendedLanes&f,Pn===o&&(jn&f)===f&&(xn===4||xn===3&&(jn&130023424)===jn&&500>xt()-Qg?Oa(o,0):Xg|=f),Sr(o,l)}function GS(o,l){l===0&&((o.mode&1)===0?l=1:(l=pe,pe<<=1,(pe&130023424)===0&&(pe=4194304)));var f=or();o=Ri(o,l),o!==null&&(yr(o,l,f),Sr(o,f))}function _O(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),GS(o,f)}function xO(o,l){var f=0;switch(o.tag){case 13:var v=o.stateNode,b=o.memoizedState;b!==null&&(f=b.retryLane);break;case 19:v=o.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),GS(o,f)}var KS;KS=function(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps||_r.current)wr=!0;else{if((o.lanes&f)===0&&(l.flags&128)===0)return wr=!1,aO(o,l,f);wr=(o.flags&131072)!==0}else wr=!1,Ht&&(l.flags&1048576)!==0&&kb(l,lh,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;Sh(o,l),o=l.pendingProps;var b=Bl(l,Zn.current);Yl(l,f),b=Rg(null,l,v,o,b,f);var C=Ag();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,xr(v)?(C=!0,ih(l)):C=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,bg(l),b.updater=wh,l.stateNode=b,b._reactInternals=l,Ng(l,v,o,f),l=$g(null,l,v,!0,C,f)):(l.tag=0,Ht&&C&&fg(l),ir(null,l,b,f),l=l.child),l;case 16:v=l.elementType;e:{switch(Sh(o,l),o=l.pendingProps,b=v._init,v=b(v._payload),l.type=v,b=l.tag=bO(v),o=Os(v,o),b){case 0:l=Vg(null,l,v,o,f);break e;case 1:l=_S(null,l,v,o,f);break e;case 11:l=pS(null,l,v,o,f);break e;case 14:l=mS(null,l,v,Os(v.type,o),f);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),Vg(o,l,v,b,f);case 1:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),_S(o,l,v,b,f);case 3:e:{if(xS(l),o===null)throw Error(n(387));v=l.pendingProps,C=l.memoizedState,b=C.element,Db(o,l),ph(l,v,null,f);var I=l.memoizedState;if(v=I.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){b=Ql(Error(n(423)),l),l=wS(o,l,v,f,b);break e}else if(v!==b){b=Ql(Error(n(424)),l),l=wS(o,l,v,f,b);break e}else for(Ur=bo(l.stateNode.containerInfo.firstChild),zr=l,Ht=!0,Ms=null,f=Ob(l,null,v,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Kl(),v===b){l=Ii(o,l,f);break e}ir(o,l,v,f)}l=l.child}return l;case 5:return Fb(l),o===null&&mg(l),v=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,I=b.children,og(v,b)?I=null:C!==null&&og(v,C)&&(l.flags|=32),yS(o,l),ir(o,l,I,f),l.child;case 6:return o===null&&mg(l),null;case 13:return bS(o,l,f);case 4:return Sg(l,l.stateNode.containerInfo),v=l.pendingProps,o===null?l.child=Zl(l,null,v,f):ir(o,l,v,f),l.child;case 11:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),pS(o,l,v,b,f);case 7:return ir(o,l,l.pendingProps,f),l.child;case 8:return ir(o,l,l.pendingProps.children,f),l.child;case 12:return ir(o,l,l.pendingProps.children,f),l.child;case 10:e:{if(v=l.type._context,b=l.pendingProps,C=l.memoizedProps,I=b.value,At(dh,v._currentValue),v._currentValue=I,C!==null)if(Is(C.value,I)){if(C.children===b.children&&!_r.current){l=Ii(o,l,f);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var V=C.dependencies;if(V!==null){I=C.child;for(var G=V.firstContext;G!==null;){if(G.context===v){if(C.tag===1){G=Ai(-1,f&-f),G.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?G.next=G:(G.next=fe.next,fe.next=G),re.pending=G}}C.lanes|=f,G=C.alternate,G!==null&&(G.lanes|=f),xg(C.return,f,l),V.lanes|=f;break}G=G.next}}else if(C.tag===10)I=C.type===l.type?null:C.child;else if(C.tag===18){if(I=C.return,I===null)throw Error(n(341));I.lanes|=f,V=I.alternate,V!==null&&(V.lanes|=f),xg(I,f,l),I=C.sibling}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===l){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}ir(o,l,b.children,f),l=l.child}return l;case 9:return b=l.type,v=l.pendingProps.children,Yl(l,f),b=fs(b),v=v(b),l.flags|=1,ir(o,l,v,f),l.child;case 14:return v=l.type,b=Os(v,l.pendingProps),b=Os(v.type,b),mS(o,l,v,b,f);case 15:return gS(o,l,l.type,l.pendingProps,f);case 17:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),Sh(o,l),l.tag=1,xr(v)?(o=!0,ih(l)):o=!1,Yl(l,f),aS(l,v,b),Ng(l,v,b,f),$g(null,l,v,!0,o,f);case 19:return ES(o,l,f);case 22:return vS(o,l,f)}throw Error(n(156,l.tag))};function ZS(o,l){return Ml(o,l)}function wO(o,l,f,v){this.tag=o,this.key=f,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=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ms(o,l,f,v){return new wO(o,l,f,v)}function ov(o){return o=o.prototype,!(!o||!o.isReactComponent)}function bO(o){if(typeof o=="function")return ov(o)?1:0;if(o!=null){if(o=o.$$typeof,o===N)return 11;if(o===q)return 14}return 2}function Oo(o,l){var f=o.alternate;return f===null?(f=ms(o.tag,l,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=l,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,l=o.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function Lh(o,l,f,v,b,C){var I=2;if(v=o,typeof o=="function")ov(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case O:return Da(f.children,b,C,l);case A:I=8,b|=8;break;case M:return o=ms(12,f,l,b|2),o.elementType=M,o.lanes=C,o;case W:return o=ms(13,f,l,b),o.elementType=W,o.lanes=C,o;case Y:return o=ms(19,f,l,b),o.elementType=Y,o.lanes=C,o;case K:return Dh(f,b,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case D:I=10;break e;case F:I=9;break e;case N:I=11;break e;case q:I=14;break e;case B:I=16,v=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ms(I,f,l,b),l.elementType=o,l.type=v,l.lanes=C,l}function Da(o,l,f,v){return o=ms(7,o,v,l),o.lanes=f,o}function Dh(o,l,f,v){return o=ms(22,o,v,l),o.elementType=K,o.lanes=f,o.stateNode={isHidden:!1},o}function av(o,l,f){return o=ms(6,o,null,l),o.lanes=f,o}function lv(o,l,f){return l=ms(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function SO(o,l,f,v,b){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=ls(0),this.expirationTimes=ls(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ls(0),this.identifierPrefix=v,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function uv(o,l,f,v,b,C,I,V,G){return o=new SO(o,l,f,V,G),l===1?(l=1,C===!0&&(l|=8)):l=0,C=ms(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:v,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},bg(C),o}function EO(o,l,f){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:v==null?null:""+v,children:o,containerInfo:l,implementation:f}}function qS(o){if(!o)return Eo;o=o._reactInternals;e:{if(Rs(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(xr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var f=o.type;if(xr(f))return Sb(o,f,l)}return l}function YS(o,l,f,v,b,C,I,V,G){return o=uv(f,v,!0,o,b,C,I,V,G),o.context=qS(null),f=o.current,v=or(),b=Io(f),C=Ai(v,b),C.callback=l??null,Po(f,C,b),o.current.lanes=b,yr(o,b,v),Sr(o,v),o}function Nh(o,l,f,v){var b=l.current,C=or(),I=Io(b);return f=qS(f),l.context===null?l.context=f:l.pendingContext=f,l=Ai(C,I),l.payload={element:o},v=v===void 0?null:v,v!==null&&(l.callback=v),o=Po(b,l,I),o!==null&&(Ns(o,b,I,C),hh(o,b,I)),I}function jh(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 XS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function cv(o,l){XS(o,l),(o=o.alternate)&&XS(o,l)}function CO(){return null}var QS=typeof reportError=="function"?reportError:function(o){console.error(o)};function dv(o){this._internalRoot=o}Fh.prototype.render=dv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Nh(o,l,null,null)},Fh.prototype.unmount=dv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Ma(function(){Nh(null,o,null,null)}),l[Ci]=null}};function Fh(o){this._internalRoot=o}Fh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Dw();o={blockedOn:null,target:o,priority:l};for(var f=0;f<_o.length&&l!==0&&l<_o[f].priority;f++);_o.splice(f,0,o),f===0&&Fw(o)}};function fv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Vh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function JS(){}function kO(o,l,f,v,b){if(b){if(typeof v=="function"){var C=v;v=function(){var re=jh(I);C.call(re)}}var I=YS(l,v,o,0,null,!1,!1,"",JS);return o._reactRootContainer=I,o[Ci]=I.current,Ic(o.nodeType===8?o.parentNode:o),Ma(),I}for(;b=o.lastChild;)o.removeChild(b);if(typeof v=="function"){var V=v;v=function(){var re=jh(G);V.call(re)}}var G=uv(o,0,!1,null,null,!1,!1,"",JS);return o._reactRootContainer=G,o[Ci]=G.current,Ic(o.nodeType===8?o.parentNode:o),Ma(function(){Nh(l,G,f,v)}),G}function $h(o,l,f,v,b){var C=f._reactRootContainer;if(C){var I=C;if(typeof b=="function"){var V=b;b=function(){var G=jh(I);V.call(G)}}Nh(l,I,o,b)}else I=kO(f,l,o,b,v);return jh(I)}Ow=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var f=ke(l.pendingLanes);f!==0&&(us(l,f|1),Sr(l,xt()),(ht&6)===0&&(tu=xt()+500,Co()))}break;case 13:Ma(function(){var v=Ri(o,1);if(v!==null){var b=or();Ns(v,o,1,b)}}),cv(o,1)}},j0=function(o){if(o.tag===13){var l=Ri(o,134217728);if(l!==null){var f=or();Ns(l,o,134217728,f)}cv(o,134217728)}},Lw=function(o){if(o.tag===13){var l=Io(o),f=Ri(o,l);if(f!==null){var v=or();Ns(f,o,l,v)}cv(o,l)}},Dw=function(){return lt},Nw=function(o,l){var f=lt;try{return lt=o,l()}finally{lt=f}},mo=function(o,l,f){switch(l){case"input":if(we(o,f),l=f.name,f.type==="radio"&&l!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var v=f[l];if(v!==o&&v.form===o.form){var b=rh(v);if(!b)throw Error(n(90));je(v),we(v,b)}}}break;case"textarea":vn(o,f);break;case"select":l=f.value,l!=null&&tt(o,!!f.multiple,l,!1)}},Wt=rv,Cn=Ma;var PO={usingClientEntryPoint:!1,Events:[Lc,zl,rh,qe,Ot,rv]},Zc={findFiberByHostInstance:Ea,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},TO={bundleType:Zc.bundleType,version:Zc.version,rendererPackageName:Zc.rendererPackageName,rendererConfig:Zc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Ff(o),o===null?null:o.stateNode},findFiberByHostInstance:Zc.findFiberByHostInstance||CO,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 Hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hh.isDisabled&&Hh.supportsFiber)try{Sa=Hh.inject(TO),$r=Hh}catch{}}return Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PO,Er.createPortal=function(o,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fv(l))throw Error(n(200));return EO(o,l,null,f)},Er.createRoot=function(o,l){if(!fv(o))throw Error(n(299));var f=!1,v="",b=QS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=uv(o,1,!1,null,null,f,!1,v,b),o[Ci]=l.current,Ic(o.nodeType===8?o.parentNode:o),new dv(l)},Er.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=Ff(l),o=o===null?null:o.stateNode,o},Er.flushSync=function(o){return Ma(o)},Er.hydrate=function(o,l,f){if(!Vh(l))throw Error(n(200));return $h(null,o,l,!0,f)},Er.hydrateRoot=function(o,l,f){if(!fv(o))throw Error(n(405));var v=f!=null&&f.hydratedSources||null,b=!1,C="",I=QS;if(f!=null&&(f.unstable_strictMode===!0&&(b=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),l=YS(l,null,o,1,f??null,b,!1,C,I),o[Ci]=l.current,Ic(o),v)for(o=0;o<v.length;o++)f=v[o],b=f._getVersion,b=b(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,b]:l.mutableSourceEagerHydrationData.push(f,b);return new Fh(l)},Er.render=function(o,l,f){if(!Vh(l))throw Error(n(200));return $h(null,o,l,!1,f)},Er.unmountComponentAtNode=function(o){if(!Vh(o))throw Error(n(40));return o._reactRootContainer?(Ma(function(){$h(null,null,o,!1,function(){o._reactRootContainer=null,o[Ci]=null})}),!0):!1},Er.unstable_batchedUpdates=rv,Er.unstable_renderSubtreeIntoContainer=function(o,l,f,v){if(!Vh(f))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return $h(o,l,f,!1,v)},Er.version="18.3.1-next-f1338f8080-20240426",Er}var wC;function FP(){if(wC)return Wv.exports;wC=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(),Wv.exports=qN(),Wv.exports}var bC;function YN(){if(bC)return ep;bC=1;var t=FP();return ep.createRoot=t.createRoot,ep.hydrateRoot=t.hydrateRoot,ep}var XN=YN();const QN=n0(XN),eo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function VP(t){return"init"in t}function Ky(t){return typeof t.write=="function"}function JN(t){return!!t.onMount}function SC(t){return"v"in t||"e"in t}function Em(t){if("e"in t)throw t.e;if((eo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Cm(t){return typeof(t==null?void 0:t.then)=="function"}function e9(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 $P(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function HP(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 t9(t){return!!t.INTERNAL_onInit}const n9=(t,e,n,...r)=>n.read(...r),r9=(t,e,n,...r)=>n.write(...r),s9=(t,e,n)=>n.INTERNAL_onInit(e),i9=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},o9=(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),t9(n)&&u(t,e,n)}return i},a9=(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 d=[],h=p=>{try{p()}catch(m){d.push(m)}};do{u.f&&h(u.f);const p=new Set;for(const m of s){const _=(n=r.get(m))==null?void 0:n.l;if(_)for(const x of _)p.add(x)}s.clear();for(const m of a)p.add(m);a.clear();for(const m of i)p.add(m);i.clear();for(const m of p)h(m);s.size&&c(t,e)}while(s.size||a.size||i.size);if(d.length)throw new AggregateError(d)},l9=(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=[],d=[],h=new WeakSet,p=new WeakSet,m=[],_=[];for(const x of s)m.push(x),_.push(i(t,e,x));for(;m.length;){const x=m.length-1,y=m[x],w=_[x];if(p.has(y)){m.pop(),_.pop();continue}if(h.has(y)){if(r.get(y)===w.n)c.push(y),d.push(w);else if((eo?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");p.add(y),m.pop(),_.pop();continue}h.add(y);for(const E of HP(y,w,n))h.has(E)||(m.push(E),_.push(i(t,e,E)))}for(let x=c.length-1;x>=0;--x){const y=c[x],w=d[x];let E=!1;for(const P of w.d.keys())if(P!==y&&s.has(P)){E=!0;break}E&&(r.set(y,w.n),a(t,e,y),u(t,e,y)),r.delete(y)}},Zy=new WeakSet,u9=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],d=t[7],h=t[11],p=t[12],m=t[13],_=t[14],x=t[16],y=t[17],w=t[20],E=t[26],P=t[28],T=h(t,e,n),k=P[0];if(SC(T)){if(i.has(n)&&a.get(n)!==T.n||T.m===k)return T.m=k,T;let q=!1;for(const[B,K]of T.d)if(_(t,e,B).n!==K){q=!0;break}if(!q)return T.m=k,T}let R=!0;const L=new Set(T.d.keys()),O=()=>{for(const q of L)T.d.delete(q)},A=()=>{if(i.has(n)){const q=!u.size;y(t,e,n),q&&(m(t,e),p(t,e))}},M=q=>{var B;if(q===n){const $=h(t,e,q);if(!SC($))if(VP(q))w(t,e,q,q.init);else throw new Error("no atom init");return Em($)}const K=_(t,e,q);try{return Em(K)}finally{L.delete(q),T.d.set(q,K.n),Cm(T.v)&&$P(n,T.v,K),i.has(n)&&((B=i.get(q))==null||B.t.add(n)),R||A()}};let D,F;const N={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(eo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(eo?"production":void 0)!=="production"&&!Ky(n)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&Ky(n)&&(F=(...q)=>{if((eo?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return x(t,e,n,q)}finally{m(t,e),p(t,e)}}),F}},W=T.n,Y=a.get(n)===W;try{(eo?"production":void 0)!=="production"&&Zy.delete(e);const q=d(t,e,n,M,N);if((eo?"production":void 0)!=="production"&&Zy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,q),Cm(q)){E(t,e,q,()=>D==null?void 0:D.abort());const B=()=>{O(),A()};q.then(B,B)}else O();return(r=c.r)==null||r.call(c,n),T.m=k,T}catch(q){if(e9(q))throw q;return delete T.v,T.e=q,++T.n,T.m=k,T}finally{R=!1,T.n!==W&&Y&&(a.set(n,T.n),u.add(n),(s=c.c)==null||s.call(c,n))}},c9=(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 d of HP(u,c,r)){const h=i(t,e,d);s.get(d)!==h.n&&(s.set(d,h.n),a.push(d))}}},d9=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],d=t[13],h=t[14],p=t[15],m=t[16],_=t[17],x=t[20],y=t[28];let w=!0;const E=T=>Em(h(t,e,T)),P=(T,...k)=>{var R;const L=u(t,e,T);try{if(T===n){if(!VP(T))throw new Error("atom not writable");(eo?"production":void 0)!=="production"&&Zy.add(e);const O=L.n,A=k[0];x(t,e,T,A),_(t,e,T),O!==L.n&&(++y[0],s.add(T),p(t,e,T),(R=i.c)==null||R.call(i,T));return}else return m(t,e,T,k)}finally{w||(d(t,e),c(t,e))}};try{return a(t,e,n,E,P,...r)}finally{w=!1}},f9=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],d=t[18],h=t[19],p=u(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[_,x]of p.d)if(!m.d.has(_)){const y=u(t,e,_);d(t,e,_).t.add(n),m.d.add(_),x!==y.n&&(i.add(_),c(t,e,_),(r=a.c)==null||r.call(a,_))}for(const _ of m.d)if(!p.d.has(_)){m.d.delete(_);const x=h(t,e,_);x==null||x.t.delete(n)}}},h9=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],d=t[12],h=t[13],p=t[14],m=t[16],_=t[18],x=c(t,e,n);let y=s.get(n);if(!y){p(t,e,n);for(const w of x.d.keys())_(t,e,w).t.add(n);if(y={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,y),Ky(n)&&JN(n)){const w=()=>{let E=!0;const P=(...T)=>{try{return m(t,e,n,T)}finally{E||(h(t,e),d(t,e))}};try{const T=u(t,e,n,P);T&&(y.u=()=>{E=!0;try{T()}finally{E=!1}})}finally{E=!1}};i.add(w)}(r=a.m)==null||r.call(a,n)}return y},p9=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],d=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const _ of p.t)if((r=i.get(_))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const _ of h.d.keys()){const x=d(t,e,_);x==null||x.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},m9=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(Cm(r))for(const d of a.d.keys())$P(n,r,s(t,e,d));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,Cm(c)&&i(t,e,c))},g9=(t,e,n)=>{const r=t[14];return Em(r(t,e,n))},v9=(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))}},y9=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],d=a(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),u(t,e,n),i(t,e),s(t,e)}},_9=(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)},x9=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},zP=new WeakMap;function w9(t){const e=zP.get(t);if((eo?"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 b9(...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,{},n9,r9,s9,i9,o9,a9,l9,u9,c9,d9,f9,h9,p9,m9,g9,v9,y9,void 0,new WeakMap,_9,x9,[0]].map((a,u)=>t[u]||a);zP.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const UP={};let S9=0;function st(t,e){const n=`atom${++S9}`,r={toString(){return(UP?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=E9,r.write=C9),e&&(r.write=e),r}function E9(t){return t(this)}function C9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function k9(){return b9()}let ad;function P9(){return ad||(ad=k9(),(UP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ad),globalThis.__JOTAI_DEFAULT_STORE__!==ad&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ad}const T9={},R9=g.createContext(void 0);function V2(t){return g.useContext(R9)||P9()}const qy=t=>typeof(t==null?void 0:t.then)=="function",Yy=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},A9=ve.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Yy(t),t)}),Zv=new WeakMap,EC=(t,e,n)=>{const r=w9(t),s=r[26];let i=Zv.get(e);return i||(i=new Promise((a,u)=>{let c=e;const d=m=>_=>{c===m&&a(_)},h=m=>_=>{c===m&&u(_)},p=()=>{try{const m=n();qy(m)?(Zv.set(m,i),c=m,m.then(d(m),h(m)),s(r,t,m,p)):a(m)}catch(m){u(m)}};e.then(d(e),h(e)),s(r,t,e,p)}),Zv.set(e,i)),i};function Qe(t,e){const{delay:n,unstable_promiseStatus:r=!ve.use}={},s=V2(),[[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 d=i;if((a!==s||u!==t)&&(c(),d=s.get(t)),g.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);qy(p)&&Yy(EC(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(d),qy(d)){const h=EC(s,d,()=>s.get(t));return r&&Yy(h),A9(h)}return d}function at(t,e){const n=V2();return g.useCallback((...s)=>{if((T9?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function BP(t,e){return[Qe(t),at(t)]}const $2=g.createContext({});function H2(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const I9=typeof window<"u",z2=I9?g.useLayoutEffect:g.useEffect,a0=g.createContext(null);function U2(t,e){t.indexOf(e)===-1&&t.push(e)}function km(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const vi=(t,e,n)=>n>e?e:n<t?t:n;let B2=()=>{};const ia={},WP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),GP=t=>typeof t=="object"&&t!==null,KP=t=>/^0[^.\s]+$/u.test(t);function ZP(t){let e;return()=>(e===void 0&&(e=t()),e)}const Cs=t=>t,Sf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Wd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class W2{constructor(){this.subscriptions=[]}add(e){return U2(this.subscriptions,e),()=>km(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 es=t=>t*1e3,ws=t=>t/1e3,qP=(t,e)=>e?t*(1e3/e):0,YP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,M9=1e-7,O9=12;function L9(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=YP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>M9&&++u<O9);return a}function Ef(t,e,n,r){if(t===e&&n===r)return Cs;const s=i=>L9(i,0,1,t,n);return i=>i===0||i===1?i:YP(s(i),e,r)}const XP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,QP=t=>e=>1-t(1-e),JP=Ef(.33,1.53,.69,.99),G2=QP(JP),e3=XP(G2),t3=t=>t>=1?1:(t*=2)<1?.5*G2(t):.5*(2-Math.pow(2,-10*(t-1))),K2=t=>1-Math.sin(Math.acos(t)),n3=QP(K2),r3=XP(K2),D9=Ef(.42,0,1,1),N9=Ef(0,0,.58,1),s3=Ef(.42,0,.58,1),j9=t=>Array.isArray(t)&&typeof t[0]!="number",i3=t=>Array.isArray(t)&&typeof t[0]=="number",F9={linear:Cs,easeIn:D9,easeInOut:s3,easeOut:N9,circIn:K2,circInOut:r3,circOut:n3,backIn:G2,backInOut:e3,backOut:JP,anticipate:t3},V9=t=>typeof t=="string",CC=t=>{if(i3(t)){B2(t.length===4);const[e,n,r,s]=t;return Ef(e,n,r,s)}else if(V9(t))return F9[t];return t},tp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $9(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(d){i.has(d)&&(c.schedule(d),t()),d(a)}const c={schedule:(d,h=!1,p=!1)=>{const _=p&&r?e:n;return h&&i.add(d),_.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(a=d,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(d))}};return c}const H9=40;function o3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=tp.reduce((T,k)=>(T[k]=$9(i),T),{}),{setup:u,read:c,resolveKeyframes:d,preUpdate:h,update:p,preRender:m,render:_,postRender:x}=a,y=()=>{const T=ia.useManualTiming,k=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,H9),1)),s.timestamp=k,s.isProcessing=!0,u.process(s),c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),_.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},w=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:tp.reduce((T,k)=>{const R=a[k];return T[k]=(L,O=!1,A=!1)=>(n||w(),R.schedule(L,O,A)),T},{}),cancel:T=>{for(let k=0;k<tp.length;k++)a[tp[k]].cancel(T)},state:s,steps:a}}const{schedule:Tt,cancel:oa,state:Vn,steps:qv}=o3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cs,!0);let Ap;function z9(){Ap=void 0}const cr={now:()=>(Ap===void 0&&cr.set(Vn.isProcessing||ia.useManualTiming?Vn.timestamp:performance.now()),Ap),set:t=>{Ap=t,queueMicrotask(z9)}},a3=t=>e=>typeof e=="string"&&e.startsWith(t),l3=a3("--"),U9=a3("var(--"),Z2=t=>U9(t)?B9.test(t.split("/*")[0].trim()):!1,B9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function kC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const lc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Gd={...lc,transform:t=>vi(0,1,t)},np={...lc,default:1},Pd=t=>Math.round(t*1e5)/1e5,q2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function W9(t){return t==null}const G9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y2=(t,e)=>n=>!!(typeof n=="string"&&G9.test(n)&&n.startsWith(t)||e&&!W9(n)&&Object.prototype.hasOwnProperty.call(n,e)),u3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(q2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},K9=t=>vi(0,255,t),Yv={...lc,transform:t=>Math.round(K9(t))},sl={test:Y2("rgb","red"),parse:u3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Yv.transform(t)+", "+Yv.transform(e)+", "+Yv.transform(n)+", "+Pd(Gd.transform(r))+")"};function Z9(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 Xy={test:Y2("#"),parse:Z9,transform:sl.transform},Cf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ui=Cf("deg"),gi=Cf("%"),Ne=Cf("px"),q9=Cf("vh"),Y9=Cf("vw"),PC={...gi,parse:t=>gi.parse(t)/100,transform:t=>gi.transform(t*100)},wu={test:Y2("hsl","hue"),parse:u3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+gi.transform(Pd(e))+", "+gi.transform(Pd(n))+", "+Pd(Gd.transform(r))+")"},mn={test:t=>sl.test(t)||Xy.test(t)||wu.test(t),parse:t=>sl.test(t)?sl.parse(t):wu.test(t)?wu.parse(t):Xy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?sl.transform(t):wu.transform(t),getAnimatableNone:t=>{const e=mn.parse(t);return e.alpha=0,mn.transform(e)}},X9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Q9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(q2))==null?void 0:e.length)||0)+(((n=t.match(X9))==null?void 0:n.length)||0)>0}const c3="number",d3="color",J9="var",ej="var(",TC="${}",tj=/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 tc(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(tj,c=>(mn.test(c)?(r.color.push(i),s.push(d3),n.push(mn.parse(c))):c.startsWith(ej)?(r.var.push(i),s.push(J9),n.push(c)):(r.number.push(i),s.push(c3),n.push(parseFloat(c))),++i,TC)).split(TC);return{values:n,split:u,indexes:r,types:s}}function nj(t){return tc(t).values}function f3({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===c3?s+=Pd(r[i]):a===d3?s+=mn.transform(r[i]):s+=r[i]}return s}}function rj(t){return f3(tc(t))}const sj=t=>typeof t=="number"?0:mn.test(t)?mn.getAnimatableNone(t):t,ij=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:sj(t);function oj(t){const e=tc(t);return f3(e)(e.values.map((r,s)=>ij(r,e.split[s])))}const Ws={test:Q9,parse:nj,createTransformer:rj,getAnimatableNone:oj};function Xv(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 aj({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=Xv(c,u,t+1/3),i=Xv(c,u,t),a=Xv(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Pm(t,e){return n=>n>0?e:t}const Pt=(t,e,n)=>t+(e-t)*n,Qv=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},lj=[Xy,sl,wu],uj=t=>lj.find(e=>e.test(t));function RC(t){const e=uj(t);if(!e)return!1;let n=e.parse(t);return e===wu&&(n=aj(n)),n}const AC=(t,e)=>{const n=RC(t),r=RC(e);if(!n||!r)return Pm(t,e);const s={...n};return i=>(s.red=Qv(n.red,r.red,i),s.green=Qv(n.green,r.green,i),s.blue=Qv(n.blue,r.blue,i),s.alpha=Pt(n.alpha,r.alpha,i),sl.transform(s))},Qy=new Set(["none","hidden"]);function cj(t,e){return Qy.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function dj(t,e){return n=>Pt(t,e,n)}function X2(t){return typeof t=="number"?dj:typeof t=="string"?Z2(t)?Pm:mn.test(t)?AC:pj:Array.isArray(t)?h3:typeof t=="object"?mn.test(t)?AC:fj:Pm}function h3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>X2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function fj(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=X2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function hj(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 pj=(t,e)=>{const n=Ws.createTransformer(e),r=tc(t),s=tc(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?Qy.has(t)&&!s.values.length||Qy.has(e)&&!r.values.length?cj(t,e):Sf(h3(hj(r,s),s.values),n):Pm(t,e)};function p3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Pt(t,e,n):X2(t)(t,e)}const mj=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Tt.update(e,n),stop:()=>oa(e),now:()=>Vn.isProcessing?Vn.timestamp:cr.now()}},m3=(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)})`},Tm=2e4;function Q2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Tm;)e+=n,r=t.next(e);return e>=Tm?1/0:e}function gj(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Q2(r),Tm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:ws(s)}}const en={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 Jy(t,e){return t*Math.sqrt(1-e*e)}const vj=12;function yj(t,e,n){let r=n;for(let s=1;s<vj;s++)r=r-t(r)/e(r);return r}const Jv=.001;function _j({duration:t=en.duration,bounce:e=en.bounce,velocity:n=en.velocity,mass:r=en.mass}){let s,i,a=1-e;a=vi(en.minDamping,en.maxDamping,a),t=vi(en.minDuration,en.maxDuration,ws(t)),a<1?(s=d=>{const h=d*a,p=h*t,m=h-n,_=Jy(d,a),x=Math.exp(-p);return Jv-m/_*x},i=d=>{const p=d*a*t,m=p*n+n,_=Math.pow(a,2)*Math.pow(d,2)*t,x=Math.exp(-p),y=Jy(Math.pow(d,2),a);return(-s(d)+Jv>0?-1:1)*((m-_)*x)/y}):(s=d=>{const h=Math.exp(-d*t),p=(d-n)*t+1;return-Jv+h*p},i=d=>{const h=Math.exp(-d*t),p=(n-d)*(t*t);return h*p});const u=5/t,c=yj(s,i,u);if(t=es(t),isNaN(c))return{stiffness:en.stiffness,damping:en.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:t}}}const xj=["duration","bounce"],wj=["stiffness","damping","mass"];function IC(t,e){return e.some(n=>t[n]!==void 0)}function bj(t){let e={velocity:en.velocity,stiffness:en.stiffness,damping:en.damping,mass:en.mass,isResolvedFromDuration:!1,...t};if(!IC(t,wj)&&IC(t,xj))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*vi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:en.mass,stiffness:s,damping:i}}else{const n=_j({...t,velocity:0});e={...e,...n,mass:en.mass},e.isResolvedFromDuration=!0}return e}function Rm(t=en.visualDuration,e=en.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:d,mass:h,duration:p,velocity:m,isResolvedFromDuration:_}=bj({...n,velocity:-ws(n.velocity||0)}),x=m||0,y=d/(2*Math.sqrt(c*h)),w=a-i,E=ws(Math.sqrt(c/h)),P=Math.abs(w)<5;r||(r=P?en.restSpeed.granular:en.restSpeed.default),s||(s=P?en.restDelta.granular:en.restDelta.default);let T,k,R,L,O,A;if(y<1)R=Jy(E,y),L=(x+y*E*w)/R,T=D=>{const F=Math.exp(-y*E*D);return a-F*(L*Math.sin(R*D)+w*Math.cos(R*D))},O=y*E*L+w*R,A=y*E*w-L*R,k=D=>Math.exp(-y*E*D)*(O*Math.sin(R*D)+A*Math.cos(R*D));else if(y===1){T=F=>a-Math.exp(-E*F)*(w+(x+E*w)*F);const D=x+E*w;k=F=>Math.exp(-E*F)*(E*D*F-x)}else{const D=E*Math.sqrt(y*y-1);T=Y=>{const q=Math.exp(-y*E*Y),B=Math.min(D*Y,300);return a-q*((x+y*E*w)*Math.sinh(B)+D*w*Math.cosh(B))/D};const F=(x+y*E*w)/D,N=y*E*F-w*D,W=y*E*w-F*D;k=Y=>{const q=Math.exp(-y*E*Y),B=Math.min(D*Y,300);return q*(N*Math.sinh(B)+W*Math.cosh(B))}}const M={calculatedDuration:_&&p||null,velocity:D=>es(k(D)),next:D=>{if(!_&&y<1){const N=Math.exp(-y*E*D),W=Math.sin(R*D),Y=Math.cos(R*D),q=a-N*(L*W+w*Y),B=es(N*(O*W+A*Y));return u.done=Math.abs(B)<=r&&Math.abs(a-q)<=s,u.value=u.done?a:q,u}const F=T(D);if(_)u.done=D>=p;else{const N=es(k(D));u.done=Math.abs(N)<=r&&Math.abs(a-F)<=s}return u.value=u.done?a:F,u},toString:()=>{const D=Math.min(Q2(M),Tm),F=m3(N=>M.next(D*N).value,D,30);return D+"ms "+F},toTransition:()=>{}};return M}Rm.applyToOptions=t=>{const e=gj(t,100,Rm);return t.ease=e.ease,t.duration=es(e.duration),t.type="keyframes",t};const Sj=5;function g3(t,e,n){const r=Math.max(e-Sj,0);return qP(n-t(r),e-r)}function e_({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:d=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},_=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 y=n*e;const w=p+y,E=a===void 0?w:a(w);E!==w&&(y=E-p);const P=A=>-y*Math.exp(-A/r),T=A=>E+P(A),k=A=>{const M=P(A),D=T(A);m.done=Math.abs(M)<=d,m.value=m.done?E:D};let R,L;const O=A=>{_(m.value)&&(R=A,L=Rm({keyframes:[m.value,x(m.value)],velocity:g3(T,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:h}))};return O(0),{calculatedDuration:null,next:A=>{let M=!1;return!L&&R===void 0&&(M=!0,k(A),O(A)),R!==void 0&&A>=R?L.next(A-R):(!M&&k(A),m)}}}function Ej(t,e,n){const r=[],s=n||ia.mix||p3,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]||Cs:e;u=Sf(c,u)}r.push(u)}return r}function Cj(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(B2(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=Ej(e,r,s),c=u.length,d=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 m=Wd(t[p],t[p+1],h);return u[p](m)};return n?h=>d(vi(t[0],t[i-1],h)):d}function kj(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Wd(0,e,r);t.push(Pt(n,1,s))}}function Pj(t){const e=[0];return kj(e,t.length-1),e}function Tj(t,e){return t.map(n=>n*e)}function Rj(t,e){return t.map(()=>e||s3).splice(0,t.length-1)}function Td({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=j9(r)?r.map(CC):CC(r),i={done:!1,value:e[0]},a=Tj(n&&n.length===e.length?n:Pj(e),t),u=Cj(a,e,{ease:Array.isArray(s)?s:Rj(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const Aj=t=>t!==null;function l0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(Aj),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const Ij={decay:e_,inertia:e_,tween:Td,keyframes:Td,spring:Rm};function v3(t){typeof t.type=="string"&&(t.type=Ij[t.type])}class J2{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 Mj=t=>t/100;class Am extends J2{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!==cr.now()&&this.tick(cr.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;v3(e);const{type:n=Td,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||Td;c!==Td&&typeof u[0]!="number"&&(this.mixKeyframes=Sf(Mj,p3(u[0],u[1])),u=[0,100]);const d=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=Q2(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}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:d=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:_,type:x,onUpdate:y,finalKeyframe:w}=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-d*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,k=r;if(p){const A=Math.min(this.currentTime,s)/u;let M=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(m==="reverse"?(D=1-D,_&&(D-=_/u)):m==="mirror"&&(k=a)),T=vi(0,1,D)*u}let R;P?(this.delayState.value=h[0],R=this.delayState):R=k.next(T),i&&!P&&(R.value=i(R.value));let{done:L}=R;!P&&c!==null&&(L=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return O&&x!==e_&&(R.value=l0(h,this.options,w,this.speed)),y&&y(R.value),O&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return ws(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ws(e)}get time(){return ws(this.currentTime)}set time(e){e=es(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 g3(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(cr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ws(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=mj,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(cr.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 Oj(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const il=t=>t*180/Math.PI,t_=t=>{const e=il(Math.atan2(t[1],t[0]));return n_(e)},Lj={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:t_,rotateZ:t_,skewX:t=>il(Math.atan(t[1])),skewY:t=>il(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},n_=t=>(t=t%360,t<0&&(t+=360),t),MC=t_,OC=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),LC=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Dj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:OC,scaleY:LC,scale:t=>(OC(t)+LC(t))/2,rotateX:t=>n_(il(Math.atan2(t[6],t[5]))),rotateY:t=>n_(il(Math.atan2(-t[2],t[0]))),rotateZ:MC,rotate:MC,skewX:t=>il(Math.atan(t[4])),skewY:t=>il(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function r_(t){return t.includes("scale")?1:0}function s_(t,e){if(!t||t==="none")return r_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Dj,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Lj,s=u}if(!s)return r_(e);const i=r[e],a=s[1].split(",").map(jj);return typeof i=="function"?i(a):a[i]}const Nj=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return s_(n,e)};function jj(t){return parseFloat(t.trim())}const uc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cc=new Set([...uc,"pathRotation"]),DC=t=>t===lc||t===Ne,Fj=new Set(["x","y","z"]),Vj=uc.filter(t=>!Fj.has(t));function $j(t){const e=[];return Vj.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Zo={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})=>s_(e,"x"),y:(t,{transform:e})=>s_(e,"y")};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const vl=new Set;let i_=!1,o_=!1,a_=!1;function y3(){if(o_){const t=Array.from(vl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=$j(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)})}o_=!1,i_=!1,vl.forEach(t=>t.complete(a_)),vl.clear()}function _3(){vl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(o_=!0)})}function Hj(){a_=!0,_3(),y3(),a_=!1}class ex{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?(vl.add(this),i_||(i_=!0,Tt.read(_3),Tt.resolveKeyframes(y3))):(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])}Oj(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vl.delete(this)}cancel(){this.state==="scheduled"&&(vl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zj=t=>t.startsWith("--");function x3(t,e,n){zj(e)?t.style.setProperty(e,n):t.style[e]=n}const Uj={};function w3(t,e){const n=ZP(t);return()=>Uj[e]??n()}const Bj=w3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),b3=w3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,NC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yd([0,.65,.55,1]),circOut:yd([.55,0,1,.45]),backIn:yd([.31,.01,.66,-.59]),backOut:yd([.33,1.53,.69,.99])};function S3(t,e){if(t)return typeof t=="function"?b3()?m3(t,e):"ease-out":i3(t)?yd(t):Array.isArray(t)?t.map(n=>S3(n,e)||NC.easeOut):NC[t]}function Wj(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},d=void 0){const h={[e]:n};c&&(h.offset=c);const p=S3(u,s);Array.isArray(p)&&(h.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(h,m)}function E3(t){return typeof t=="function"&&"applyToOptions"in t}function Gj({type:t,...e}){return E3(t)&&b3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class C3 extends J2{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,B2(typeof e.type!="string");const d=Gj(e);this.animation=Wj(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=l0(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),x3(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 ws(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ws(e)}get time(){return ws(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=es(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&&Bj()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Cs):s(this)}}const k3={anticipate:t3,backInOut:e3,circInOut:r3};function Kj(t){return t in k3}function Zj(t){typeof t.ease=="string"&&Kj(t.ease)&&(t.ease=k3[t.ease])}const e1=10;class qj extends C3{constructor(e){Zj(e),v3(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 Am({...a,autoplay:!1}),c=Math.max(e1,cr.now()-this.startTime),d=vi(0,e1,c-e1),h=u.sample(c).value,{name:p}=this.options;i&&p&&x3(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-d)).value,h,d),u.stop()}}const jC=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ws.test(t)||t==="0")&&!t.startsWith("url("));function Yj(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 Xj(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=jC(s,e),u=jC(i,e);return!a||!u?!1:Yj(t)||(n==="spring"||E3(n))&&r}function l_(t){t.duration=0,t.type="keyframes"}const P3=new Set(["opacity","clipPath","filter","transform"]),Qj=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Jj(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Qj.test(t[e]))return!0;return!1}const e7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),t7=ZP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function n7(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:d,transformTemplate:h}=e.owner.getProps();return t7()&&n&&(P3.has(n)||e7.has(n)&&Jj(u))&&(n!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const r7=40;class s7 extends J2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:d,element:h,...p}){var x;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=cr.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:d,element:h,...p},_=(h==null?void 0:h.KeyframeResolver)||ex;this.keyframeResolver=new _(u,(y,w,E)=>this.onKeyframesResolved(y,w,m,!E),c,d,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var E,P;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:d,onUpdate:h}=r;this.resolvedAt=cr.now();let p=!0;Xj(e,i,a,u)||(p=!1,(ia.instantAnimations||!c)&&(h==null||h(l0(e,r,n))),e[0]=e[e.length-1],l_(r),r.repeat=0);const _={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>r7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!d&&n7(_),y=(P=(E=_.motionValue)==null?void 0:E.owner)==null?void 0:P.current;let w;if(x)try{w=new qj({..._,element:y})}catch{w=new Am(_)}else w=new Am(_);w.finished.then(()=>{this.notifyFinished()}).catch(Cs),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}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(),Hj()),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 T3(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,h)=>d.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 FC=30,i7=t=>!isNaN(parseFloat(t));class o7{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=cr.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=cr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=i7(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 W2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Tt.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=cr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>FC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,FC);return qP(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 nc(t,e){return new o7(t,e)}function R3(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function tx(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?R3(n,t):n}const a7={type:"spring",stiffness:500,damping:25,restSpeed:10},l7=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),u7={type:"keyframes",duration:.8},c7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},d7=(t,{keyframes:e})=>e.length>2?u7:cc.has(t)?t.startsWith("scale")?l7(e[1]):a7:c7,f7=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function h7(t){for(const e in t)if(!f7.has(e))return!0;return!1}const nx=(t,e,n,r={},s,i)=>a=>{const u=tx(r,t)||{},c=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-es(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-d,onUpdate:m=>{e.set(m),u.onUpdate&&u.onUpdate(m)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};h7(u)||Object.assign(h,d7(t,h)),h.duration&&(h.duration=es(h.duration)),h.repeatDelay&&(h.repeatDelay=es(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(l_(h),h.delay===0&&(p=!0)),(ia.instantAnimations||ia.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,l_(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const m=l0(h.keyframes,u);if(m!==void 0){Tt.update(()=>{h.onUpdate(m),h.onComplete()});return}}return u.isSync?new Am(h):new s7(h)},p7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function m7(t){const e=p7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function A3(t,e,n=1){const[r,s]=m7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return WP(a)?parseFloat(a):a}return Z2(s)?A3(s,e,n+1):s}function VC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function rx(t,e,n,r){if(typeof e=="function"){const[s,i]=VC(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]=VC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function yl(t,e,n){const r=t.getProps();return rx(r,e,n!==void 0?n:r.custom,t)}const I3=new Set(["width","height","top","left","right","bottom",...uc]),u_=t=>Array.isArray(t);function g7(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nc(n))}function v7(t){return u_(t)?t[t.length-1]||0:t}function y7(t,e){const n=yl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=v7(i[a]);g7(t,a,u)}}const zn=t=>!!(t&&t.getVelocity);function _7(t){return!!(zn(t)&&t.add)}function c_(t,e){const n=t.getValue("willChange");if(_7(n))return n.add(e);if(!n&&ia.WillChange){const r=new ia.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function sx(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const x7="framerAppearId",M3="data-"+sx(x7);function O3(t){return t.props[M3]}function w7({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function L3(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?R3(i,c):c;const d=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],_=i==null?void 0:i.path;_&&_.animateVisualElement(t,u,i,n,p);for(const x in u){const y=t.getValue(x,t.latestValues[x]??null),w=u[x];if(w===void 0||m&&w7(m,x))continue;const E={delay:n,...tx(i||{},x)};h&&(E.skipAnimations=!0);const P=y.get();if(P!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===P&&!E.velocity){Tt.update(()=>y.set(w));continue}let T=!1;if(window.MotionHandoffAnimation){const L=O3(t);if(L){const O=window.MotionHandoffAnimation(L,x,Tt);O!==null&&(E.startTime=O,T=!0)}}c_(t,x);const k=d??t.shouldReduceMotion;y.start(nx(x,y,w,k&&I3.has(x)?{type:!1}:E,t,T));const R=y.animation;R&&p.push(R)}if(a){const x=()=>Tt.update(()=>{a&&y7(t,a)});p.length?Promise.all(p).then(x):x()}return p}function d_(t,e,n={}){var c;const r=yl(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(L3(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return b7(t,e,d,h,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,h]=u==="beforeChildren"?[i,a]:[a,i];return d().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function b7(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(d_(c,e,{...a,delay:n+(typeof r=="function"?0:r)+T3(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function S7(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>d_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=d_(t,e,n);else{const s=typeof e=="function"?yl(t,e,n.custom):e;r=Promise.all(L3(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const E7={test:t=>t==="auto",parse:t=>t},D3=t=>e=>e.test(t),N3=[lc,Ne,gi,Ui,Y9,q9,E7],$C=t=>N3.find(D3(t));function C7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||KP(t):!0}const k7=new Set(["brightness","contrast","saturate","opacity"]);function P7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(q2)||[];if(!r)return t;const s=n.replace(r,"");let i=k7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const T7=/\b([a-z-]*)\(.*?\)/gu,f_={...Ws,getAnimatableNone:t=>{const e=t.match(T7);return e?e.map(P7).join(" "):t}},h_={...Ws,getAnimatableNone:t=>{const e=Ws.parse(t);return Ws.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},HC={...lc,transform:Math.round},R7={rotate:Ui,pathRotation:Ui,rotateX:Ui,rotateY:Ui,rotateZ:Ui,scale:np,scaleX:np,scaleY:np,scaleZ:np,skew:Ui,skewX:Ui,skewY:Ui,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Gd,originX:PC,originY:PC,originZ:Ne},Im={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,...R7,zIndex:HC,fillOpacity:Gd,strokeOpacity:Gd,numOctaves:HC},A7={...Im,color:mn,backgroundColor:mn,outlineColor:mn,fill:mn,stroke:mn,borderColor:mn,borderTopColor:mn,borderRightColor:mn,borderBottomColor:mn,borderLeftColor:mn,filter:f_,WebkitFilter:f_,mask:h_,WebkitMask:h_},j3=t=>A7[t],I7=new Set([f_,h_]);function F3(t,e){let n=j3(t);return I7.has(n)||(n=Ws),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const M7=new Set(["auto","none","0"]);function O7(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!M7.has(i)&&tc(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=F3(n,s)}class L7 extends ex{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(),Z2(p))){const m=A3(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!I3.has(r)||e.length!==2)return;const[s,i]=e,a=$C(s),u=$C(i),c=kC(s),d=kC(i);if(c!==d&&Zo[r]){this.needsMeasurement=!0;return}if(a!==u)if(DC(a)&&DC(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else Zo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||C7(e[s]))&&r.push(s);r.length&&O7(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=Zo[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]=Zo[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,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const ix=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function V3(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 p_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ip(t){return GP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:ox}=o3(queueMicrotask,!1),$s={x:!1,y:!1};function $3(){return $s.x||$s.y}function D7(t){return t==="x"||t==="y"?$s[t]?null:($s[t]=!0,()=>{$s[t]=!1}):$s.x||$s.y?null:($s.x=$s.y=!0,()=>{$s.x=$s.y=!1})}function H3(t,e){const n=V3(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function N7(t){return!(t.pointerType==="touch"||$3())}function j7(t,e,n={}){const[r,s,i]=H3(t,n);return r.forEach(a=>{let u=!1,c=!1,d;const h=()=>{a.removeEventListener("pointerleave",x)},p=w=>{d&&(d(w),d=void 0),h()},m=w=>{u=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,p(w))},_=()=>{u=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=w=>{if(w.pointerType!=="touch"){if(u){c=!0;return}p(w)}},y=w=>{if(!N7(w))return;c=!1;const E=e(a,w);typeof E=="function"&&(d=E,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",y,s),a.addEventListener("pointerdown",_,s)}),i}const z3=(t,e)=>e?t===e?!0:z3(t,e.parentElement):!1,ax=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,F7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function V7(t){return F7.has(t.tagName)||t.isContentEditable===!0}const $7=new Set(["INPUT","SELECT","TEXTAREA"]);function H7(t){return $7.has(t.tagName)||t.isContentEditable===!0}const Mp=new WeakSet;function zC(t){return e=>{e.key==="Enter"&&t(e)}}function t1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const z7=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=zC(()=>{if(Mp.has(n))return;t1(n,"down");const s=zC(()=>{t1(n,"up")}),i=()=>t1(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 UC(t){return ax(t)&&!$3()}const BC=new WeakSet;function U7(t,e,n={}){const[r,s,i]=H3(t,n),a=u=>{const c=u.currentTarget;if(!UC(u)||BC.has(u))return;Mp.add(c),n.stopPropagation&&BC.add(u);const d=e(c,u),h={...s,capture:!0},p=(x,y)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",_,h),Mp.has(c)&&Mp.delete(c),UC(x)&&typeof d=="function"&&d(x,{success:y})},m=x=>{p(x,c===window||c===document||n.useGlobalTarget||z3(c,x.target))},_=x=>{p(x,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",_,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),Ip(u)&&(u.addEventListener("focus",d=>z7(d,s)),!V7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function lx(t){return GP(t)&&"ownerSVGElement"in t}const Op=new WeakMap;let Fo;const U3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:lx(r)&&"getBBox"in r?r.getBBox()[e]:r[n],B7=U3("inline","width","offsetWidth"),W7=U3("block","height","offsetHeight");function G7({target:t,borderBoxSize:e}){var n;(n=Op.get(t))==null||n.forEach(r=>{r(t,{get width(){return B7(t,e)},get height(){return W7(t,e)}})})}function K7(t){t.forEach(G7)}function Z7(){typeof ResizeObserver>"u"||(Fo=new ResizeObserver(K7))}function q7(t,e){Fo||Z7();const n=V3(t);return n.forEach(r=>{let s=Op.get(r);s||(s=new Set,Op.set(r,s)),s.add(e),Fo==null||Fo.observe(r)}),()=>{n.forEach(r=>{const s=Op.get(r);s==null||s.delete(e),s!=null&&s.size||Fo==null||Fo.unobserve(r)})}}const Lp=new Set;let bu;function Y7(){bu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Lp.forEach(e=>e(t))},window.addEventListener("resize",bu)}function X7(t){return Lp.add(t),bu||Y7(),()=>{Lp.delete(t),!Lp.size&&typeof bu=="function"&&(window.removeEventListener("resize",bu),bu=void 0)}}function WC(t,e){return typeof t=="function"?X7(t):q7(t,e)}function Q7(t){return lx(t)&&t.tagName==="svg"}const J7=[...N3,mn,Ws],eF=t=>J7.find(D3(t)),GC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:GC(),y:GC()}),KC=()=>({min:0,max:0}),bn=()=>({x:KC(),y:KC()}),tF=new WeakMap;function u0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Kd(t){return typeof t=="string"||Array.isArray(t)}const ux=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cx=["initial",...ux];function c0(t){return u0(t.animate)||cx.some(e=>Kd(t[e]))}function B3(t){return!!(c0(t)||t.variants)}function nF(t,e,n){for(const r in e){const s=e[r],i=n[r];if(zn(s))t.addValue(r,s);else if(zn(i))t.addValue(r,nc(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,nc(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Mm={current:null},dx={current:!1},rF=typeof window<"u";function W3(){if(dx.current=!0,!!rF)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Mm.current=t.matches;t.addEventListener("change",e),e()}else Mm.current=!1}const ZC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Om={};function G3(t){Om=t}function sF(){return Om}class iF{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=ex,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 _=cr.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,Tt.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},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=c0(n),this.isVariantNode=B3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const _ in m){const x=m[_];d[_]!==void 0&&zn(x)&&x.set(d[_])}}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,tF.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:(dx.current||W3(),this.shouldReduceMotion=Mm.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(),oa(this.notifyUpdate),oa(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&&P3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:d,duration:h}=n.accelerate,p=new C3({element:this.current,name:e,keyframes:u,times:c,ease:d,duration:es(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=cc.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Tt.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 Om){const n=Om[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):bn()}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<ZC.length;r++){const s=ZC[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=nF(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=nc(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"&&(WP(r)||KP(r))?r=parseFloat(r):!eF(r)&&Ws.test(n)&&(r=F3(e,n)),this.setBaseTarget(e,zn(r)?r.get():r)),zn(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=rx(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&&!zn(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 W2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ox.render(this.render)}}class K3 extends iF{constructor(){super(...arguments),this.KeyframeResolver=L7}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;zn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ha{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Z3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function oF({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function aF(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 n1(t){return t===void 0||t===1}function m_({scale:t,scaleX:e,scaleY:n}){return!n1(t)||!n1(e)||!n1(n)}function Qa(t){return m_(t)||q3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function q3(t){return qC(t.x)||qC(t.y)}function qC(t){return t&&t!=="0%"}function Lm(t,e,n){const r=t-n,s=e*r;return n+s}function YC(t,e,n,r,s){return s!==void 0&&(t=Lm(t,s,r)),Lm(t,n,r)+e}function g_(t,e=0,n=1,r,s){t.min=YC(t.min,e,n,r,s),t.max=YC(t.max,e,n,r,s)}function Y3(t,{x:e,y:n}){g_(t.x,e.translate,e.scale,e.originPoint),g_(t.y,n.translate,n.scale,n.originPoint)}const XC=.999999999999,QC=1.0000000000001;function lF(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:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ci(t.x,-i.scroll.offset.x),ci(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,Y3(t,a)),r&&Qa(i.latestValues)&&Dp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<QC&&e.x>XC&&(e.x=1),e.y<QC&&e.y>XC&&(e.y=1)}function ci(t,e){t.min+=e,t.max+=e}function JC(t,e,n,r,s=.5){const i=Pt(t.min,t.max,s);g_(t,e,n,i,r)}function e4(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Dp(t,e,n){const r=n??t;JC(t.x,e4(e.x,r.x),e.scaleX,e.scale,e.originX),JC(t.y,e4(e.y,r.y),e.scaleY,e.scale,e.originY)}function X3(t,e){return Z3(aF(t.getBoundingClientRect(),e))}function uF(t,e,n){const r=X3(t,n),{scroll:s}=e;return s&&(ci(r.x,s.offset.x),ci(r.y,s.offset.y)),r}const cF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dF=uc.length;function fF(t,e,n){let r="",s=!0;for(let a=0;a<dF;a++){const u=uc[a],c=t[u];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);d=u.startsWith("scale")?h===1:h===0}if(!d||n){const h=p_(c,Im[u]);if(!d){s=!1;const p=cF[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${p_(i,Im.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function fx(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const d=e[c];if(cc.has(c)){a=!0;continue}else if(l3(c)){s[c]=d;continue}else{const h=p_(d,Im[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=fF(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:d="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${d} ${h}`}}function Q3(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 t4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ld={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ne.test(t))t=parseFloat(t);else return t;const n=t4(t,e.target.x),r=t4(t,e.target.y);return`${n}% ${r}%`}},hF={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ws.parse(t);if(s.length>5)return r;const i=Ws.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 d=Pt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=d),typeof s[3+a]=="number"&&(s[3+a]/=d),i(s)}},v_={borderRadius:{...ld,applyTo:[...ix]},borderTopLeftRadius:ld,borderTopRightRadius:ld,borderBottomLeftRadius:ld,borderBottomRightRadius:ld,boxShadow:hF};function J3(t,{layout:e,layoutId:n}){return cc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!v_[t]||t==="opacity")}function hx(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)(zn(r[u])||s&&zn(s[u])||J3(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 mF extends K3{constructor(){super(...arguments),this.type="html",this.renderInstance=Q3}readValueFromInstance(e,n){var r;if(cc.has(n))return(r=this.projection)!=null&&r.isProjecting?r_(n):Nj(e,n);{const s=pF(e),i=(l3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return X3(e,n)}build(e,n,r){fx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return hx(e,n,r)}}const gF={offset:"stroke-dashoffset",array:"stroke-dasharray"},vF={offset:"strokeDashoffset",array:"strokeDasharray"};function yF(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?gF:vF;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const _F=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,d,h){if(fx(t,u,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m}=t;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const _ of _F)p[_]!==void 0&&(m[_]=p[_],delete p[_]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&yF(p,s,i,a,!1)}const tT=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"]),nT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function xF(t,e,n,r){Q3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(tT.has(s)?s:sx(s),e.attrs[s])}function rT(t,e,n){const r=hx(t,e,n);for(const s in t)if(zn(t[s])||zn(e[s])){const i=uc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class wF extends K3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(cc.has(n)){const r=j3(n);return r&&r.default||0}return n=tT.has(n)?n:sx(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return rT(e,n,r)}build(e,n,r){eT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){xF(e,n,r,s)}mount(e){this.isSVGTag=nT(e.tagName),super.mount(e)}}const bF=cx.length;function sT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?sT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<bF;n++){const r=cx[n],s=t.props[r];(Kd(s)||s===!1)&&(e[r]=s)}return e}function iT(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 SF=[...ux].reverse(),EF=ux.length;function CF(t){return e=>Promise.all(e.map(({animation:n,options:r})=>S7(t,n,r)))}function kF(t){let e=CF(t),n=n4(),r=!0,s=!1;const i=d=>(h,p)=>{var _;const m=yl(t,p,d==="exit"?(_=t.presenceContext)==null?void 0:_.custom:void 0);if(m){const{transition:x,transitionEnd:y,...w}=m;h={...h,...w,...y}}return h};function a(d){e=d(t)}function u(d){const{props:h}=t,p=sT(t.parent)||{},m=[],_=new Set;let x={},y=1/0;for(let E=0;E<EF;E++){const P=SF[E],T=n[P],k=h[P]!==void 0?h[P]:p[P],R=Kd(k),L=P===d?T.isActive:null;L===!1&&(y=E);let O=k===p[P]&&k!==h[P]&&R;if(O&&(r||s)&&t.manuallyAnimateOnMount&&(O=!1),T.protectedKeys={...x},!T.isActive&&L===null||!k&&!T.prevProp||u0(k)||typeof k=="boolean")continue;if(P==="exit"&&T.isActive&&L!==!0){T.prevResolvedValues&&(x={...x,...T.prevResolvedValues});continue}const A=PF(T.prevProp,k);let M=A||P===d&&T.isActive&&!O&&R||E>y&&R,D=!1;const F=Array.isArray(k)?k:[k];let N=F.reduce(i(P),{});L===!1&&(N={});const{prevResolvedValues:W={}}=T,Y={...W,...N},q=$=>{M=!0,_.has($)&&(D=!0,_.delete($)),T.needsAnimating[$]=!0;const J=t.getValue($);J&&(J.liveStyle=!1)};for(const $ in Y){const J=N[$],H=W[$];if(x.hasOwnProperty($))continue;let j=!1;u_(J)&&u_(H)?j=!iT(J,H)||A:j=J!==H,j?J!=null?q($):_.add($):J!==void 0&&_.has($)?q($):T.protectedKeys[$]=!0}T.prevProp=k,T.prevResolvedValues=N,T.isActive&&(x={...x,...N}),(r||s)&&t.blockInitialAnimation&&(M=!1);const B=O&&A;M&&(!B||D)&&m.push(...F.map($=>{const J={type:P};if(typeof $=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,j=yl(H,$);if(H.enteringChildren&&j){const{delayChildren:X}=j.transition||{};J.delay=T3(H.enteringChildren,t,X)}}return{animation:$,options:J}}))}if(_.size){const E={};if(typeof h.initial!="boolean"){const P=yl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);P&&P.transition&&(E.transition=P.transition)}_.forEach(P=>{const T=t.getBaseTarget(P),k=t.getValue(P);k&&(k.liveStyle=!0),E[P]=T??null}),m.push({animation:E})}let w=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function c(d,h){var m;if(n[d].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(_=>{var x;return(x=_.animationState)==null?void 0:x.setActive(d,h)}),n[d].isActive=h;const p=u(d);for(const _ in n)n[_].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=n4(),s=!0}}}function PF(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!iT(e,t):!1}function Ha(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function n4(){return{animate:Ha(!0),whileInView:Ha(),whileHover:Ha(),whileTap:Ha(),whileDrag:Ha(),whileFocus:Ha(),exit:Ha()}}function y_(t,e){t.min=e.min,t.max=e.max}function js(t,e){y_(t.x,e.x),y_(t.y,e.y)}function r4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const oT=1e-4,TF=1-oT,RF=1+oT,aT=.01,AF=0-aT,IF=0+aT;function dr(t){return t.max-t.min}function MF(t,e,n){return Math.abs(t-e)<=n}function s4(t,e,n,r=.5){t.origin=r,t.originPoint=Pt(e.min,e.max,t.origin),t.scale=dr(n)/dr(e),t.translate=Pt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=TF&&t.scale<=RF||isNaN(t.scale))&&(t.scale=1),(t.translate>=AF&&t.translate<=IF||isNaN(t.translate))&&(t.translate=0)}function Rd(t,e,n,r){s4(t.x,e.x,n.x,r?r.originX:void 0),s4(t.y,e.y,n.y,r?r.originY:void 0)}function i4(t,e,n,r=0){const s=r?Pt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+dr(e)}function OF(t,e,n,r){i4(t.x,e.x,n.x,r==null?void 0:r.x),i4(t.y,e.y,n.y,r==null?void 0:r.y)}function o4(t,e,n,r=0){const s=r?Pt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+dr(e)}function Dm(t,e,n,r){o4(t.x,e.x,n.x,r==null?void 0:r.x),o4(t.y,e.y,n.y,r==null?void 0:r.y)}function a4(t,e,n,r,s){return t-=e,t=Lm(t,1/n,r),s!==void 0&&(t=Lm(t,1/s,r)),t}function LF(t,e=0,n=1,r=.5,s,i=t,a=t){if(gi.test(e)&&(e=parseFloat(e),e=Pt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=Pt(i.min,i.max,r);t===i&&(u-=e),t.min=a4(t.min,e,n,u,s),t.max=a4(t.max,e,n,u,s)}function l4(t,e,[n,r,s],i,a){LF(t,e[n],e[r],e[s],e.scale,i,a)}const DF=["x","scaleX","originX"],NF=["y","scaleY","originY"];function u4(t,e,n,r){l4(t.x,e,DF,n?n.x:void 0,r?r.x:void 0),l4(t.y,e,NF,n?n.y:void 0,r?r.y:void 0)}function c4(t){return t.translate===0&&t.scale===1}function lT(t){return c4(t.x)&&c4(t.y)}function d4(t,e){return t.min===e.min&&t.max===e.max}function jF(t,e){return d4(t.x,e.x)&&d4(t.y,e.y)}function f4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function uT(t,e){return f4(t.x,e.x)&&f4(t.y,e.y)}function h4(t){return dr(t.x)/dr(t.y)}function p4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ii(t){return[t("x"),t("y")]}function FF(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:d,rotate:h,pathRotation:p,rotateX:m,rotateY:_,skewX:x,skewY:y}=n;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),_&&(r+=`rotateY(${_}deg) `),x&&(r+=`skewX(${x}deg) `),y&&(r+=`skewY(${y}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 VF=ix.length,m4=t=>typeof t=="string"?parseFloat(t):t,g4=t=>typeof t=="number"||Ne.test(t);function $F(t,e,n,r,s,i){s?(t.opacity=Pt(0,n.opacity??1,HF(r)),t.opacityExit=Pt(e.opacity??1,0,zF(r))):i&&(t.opacity=Pt(e.opacity??1,n.opacity??1,r));for(let a=0;a<VF;a++){const u=ix[a];let c=v4(e,u),d=v4(n,u);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||g4(c)===g4(d)?(t[u]=Math.max(Pt(m4(c),m4(d),r),0),(gi.test(d)||gi.test(c))&&(t[u]+="%")):t[u]=d}(e.rotate||n.rotate)&&(t.rotate=Pt(e.rotate||0,n.rotate||0,r))}function v4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const HF=cT(0,.5,n3),zF=cT(.5,.95,Cs);function cT(t,e,n){return r=>r<t?0:r>e?1:n(Wd(t,e,r))}function UF(t,e,n){const r=zn(t)?t:nc(t);return r.start(nx("",r,e,n)),r.animation}function Zd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const BF=(t,e)=>t.depth-e.depth;class WF{constructor(){this.children=[],this.isDirty=!1}add(e){U2(this.children,e),this.isDirty=!0}remove(e){km(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(BF),this.isDirty=!1,this.children.forEach(e)}}function GF(t,e){const n=cr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(oa(r),t(i-e))};return Tt.setup(r,!0),()=>oa(r)}function Np(t){return zn(t)?t.get():t}class KF{constructor(){this.members=[]}add(e){U2(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&&(km(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(km(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 jp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},r1=["","X","Y","Z"],ZF=1e3;let qF=0;function s1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function dT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=O3(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Tt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&dT(r)}function fT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=qF++,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(QF),this.nodes.forEach(sV),this.nodes.forEach(iV),this.nodes.forEach(JF)},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 WF)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new W2),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=lx(a)&&!Q7(a),this.instance=a;const{layoutId:u,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.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 m=()=>this.root.updateBlockedByResize=!1;Tt.read(()=>{p=window.innerWidth}),t(a,()=>{const _=window.innerWidth;_!==p&&(p=_,this.root.updateBlockedByResize=!0,h&&h(),h=GF(m,250),jp.hasAnimatedSinceResize&&(jp.hasAnimatedSinceResize=!1,this.nodes.forEach(x4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||cV,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=d.getProps(),E=!this.targetLayout||!uT(this.targetLayout,_),P=!p&&m;if(this.options.layoutRoot||this.resumeFrom||P||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...tx(x,"layout"),onPlay:y,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,P,T.path)}else p||x4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}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(),oa(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(oV),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&&dT(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 d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(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(tV),this.nodes.forEach(y4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(_4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nV),this.nodes.forEach(rV),this.nodes.forEach(YF),this.nodes.forEach(XF)):this.nodes.forEach(_4),this.clearAllSnapshots();const u=cr.now();Vn.delta=vi(0,1e3/60,u-Vn.timestamp),Vn.timestamp=u,Vn.isProcessing=!0,qv.update.process(Vn),qv.preRender.process(Vn),qv.render.process(Vn),Vn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ox.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eV),this.sharedNodes.forEach(aV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!dr(this.snapshot.measuredBox.x)&&!dr(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=bn()),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&&!lT(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;a&&this.instance&&(u||Qa(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),dV(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:a}=this.options;if(!a)return bn();const u=a.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(fV))){const{scroll:h}=this.root;h&&(ci(u.x,h.offset.x),ci(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=bn();if(js(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&js(u,a),ci(u.x,p.offset.x),ci(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const d=c||bn();js(d,a);for(let m=0;m<this.path.length;m++){const _=this.path[m];!u&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(ci(d.x,-_.scroll.offset.x),ci(d.y,-_.scroll.offset.y)),Qa(_.latestValues)&&Dp(d,_.latestValues,(h=_.layout)==null?void 0:h.layoutBox)}return Qa(this.latestValues)&&Dp(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(a){var c;const u=bn();js(u,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!Qa(h.latestValues))continue;let p;h.instance&&(m_(h.latestValues)&&h.updateSnapshot(),p=bn(),js(p,h.measurePageBox())),u4(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return Qa(this.latestValues)&&u4(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!==Vn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var _;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||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=Vn.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bn(),this.targetWithTransforms=bn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):js(this.target,this.layout.layoutBox),Y3(this.target,this.targetDelta)):js(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||m_(this.parent.latestValues)||q3(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=bn(),this.relativeTargetOrigin=bn(),Dm(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),js(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===Vn.timestamp&&(c=!1),c)return;const{layout:d,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||!(d||h))return;js(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;lF(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=bn());const{target:_}=a;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(r4(this.prevProjectionDelta.x,this.projectionDelta.x),r4(this.prevProjectionDelta.y,this.projectionDelta.y)),Rd(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!p4(this.projectionDelta.x,this.prevProjectionDelta.x)||!p4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}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=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(a,u=!1,c){const d=this.snapshot,h=d?d.latestValues:{},p={...this.latestValues},m=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const _=bn(),x=d?d.source:void 0,y=this.layout?this.layout.source:void 0,w=x!==y,E=this.getStack(),P=!E||E.members.length<=1,T=!!(w&&!P&&this.options.crossfade===!0&&!this.path.some(uV));this.animationProgress=0;let k;const R=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=L=>{const O=L/1e3,A=R==null?void 0:R(O);A?(m.x.translate=A.x,m.x.scale=Pt(a.x.scale,1,O),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=A.y,m.y.scale=Pt(a.y.scale,1,O),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(w4(m.x,a.x,O),w4(m.y,a.y,O)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Dm(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lV(this.relativeTarget,this.relativeTargetOrigin,_,O),k&&jF(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=bn()),js(k,this.relativeTarget)),w&&(this.animationValues=p,$F(p,h,this.latestValues,O,T,P)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,d;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(oa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{jp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nc(0)),this.motionValue.jump(0,!1),this.currentAnimation=UF(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(ZF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:d,latestValues:h}=a;if(!(!u||!c||!d)){if(this!==a&&this.layout&&d&&hT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||bn();const p=dr(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=dr(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}js(u,c),Dp(u,h),Rd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new KF),this.sharedNodes.get(a).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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 d=this.getStack();d&&d.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 d={};c.z&&s1("z",a,d,this.animationValues);for(let h=0;h<r1.length;h++)s1(`rotate${r1[h]}`,a,d,this.animationValues),s1(`skew${r1[h]}`,a,d,this.animationValues);a.render();for(const h in d)a.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[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=Np(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Np(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Qa(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=FF(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:m,y:_}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${_.origin*100}% 0`,d.animationValues?a.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in v_){if(h[x]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:E}=v_[x],P=p==="none"?h[x]:y(h[x],d);if(w){const T=w.length;for(let k=0;k<T;k++)a[w[k]]=P}else E?this.options.visualElement.renderState.vars[x]=P:a[x]=P}this.options.layoutId&&(a.pointerEvents=d===this?Np(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(y4),this.root.sharedNodes.clear()}}}function YF(t){t.updateLayout()}function XF(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")ii(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=dr(m);m.min=r[p].min,m.max=m.min+_});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";y_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else hT(i,e.layoutBox,r)&&ii(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=dr(r[p]);m.max=m.min+_,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+_)});const u=Su();Rd(u,r,e.layoutBox);const c=Su();a?Rd(c,t.applyTransform(s,!0),e.measuredBox):Rd(c,r,e.layoutBox);const d=!lT(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:_}=p;if(m&&_){const x=t.options.layoutAnchor||void 0,y=bn();Dm(y,e.layoutBox,m.layoutBox,x);const w=bn();Dm(w,r,_.layoutBox,x),uT(y,w)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=y,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function QF(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 JF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eV(t){t.clearSnapshot()}function y4(t){t.clearMeasurements()}function tV(t){t.isLayoutDirty=!0,t.updateLayout()}function _4(t){t.isLayoutDirty=!1}function nV(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function rV(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function x4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function sV(t){t.resolveTargetDelta()}function iV(t){t.calcProjection()}function oV(t){t.resetSkewAndRotation()}function aV(t){t.removeLeadSnapshot()}function w4(t,e,n){t.translate=Pt(e.translate,0,n),t.scale=Pt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function b4(t,e,n,r){t.min=Pt(e.min,n.min,r),t.max=Pt(e.max,n.max,r)}function lV(t,e,n,r){b4(t.x,e.x,n.x,r),b4(t.y,e.y,n.y,r)}function uV(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cV={duration:.45,ease:[.4,0,.1,1]},S4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),E4=S4("applewebkit/")&&!S4("chrome/")?Math.round:Cs;function C4(t){t.min=E4(t.min),t.max=E4(t.max)}function dV(t){C4(t.x),C4(t.y)}function hT(t,e,n){return t==="position"||t==="preserve-aspect"&&!MF(h4(e),h4(n),.2)}function fV(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const hV=fT({attachResizeListener:(t,e)=>Zd(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}),i1={current:void 0},pT=fT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!i1.current){const t=new hV({});t.mount(window),t.setOptions({layoutScroll:!0}),i1.current=t}return i1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),px=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function k4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function pV(...t){return e=>{let n=!1;const r=t.map(s=>{const i=k4(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():k4(t[s],null)}}}}function mV(...t){return g.useCallback(pV(...t),t)}class gV extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ip(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Ip(r)&&r.offsetWidth||0,i=Ip(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 vV({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;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:d}=g.useContext(px),h=((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref),p=mV(u,h);return g.useInsertionEffect(()=>{const{width:_,height:x,top:y,left:w,right:E,bottom:P,direction:T}=c.current;if(e||i===!1||!u.current||!_||!x)return;const k=T==="rtl",R=n==="left"?k?`right: ${E}`:`left: ${w}`:k?`left: ${w}`:`right: ${E}`,L=r==="bottom"?`bottom: ${P}`:`top: ${y}`;u.current.dataset.motionPopId=a;const O=document.createElement("style");d&&(O.nonce=d);const A=s??document.head;return A.appendChild(O),O.sheet&&O.sheet.insertRule(`
|
|
63
|
+
[data-motion-pop-id="${a}"] {
|
|
64
|
+
position: absolute !important;
|
|
65
|
+
width: ${_}px !important;
|
|
66
|
+
height: ${x}px !important;
|
|
67
|
+
${R}px !important;
|
|
68
|
+
${L}px !important;
|
|
69
|
+
}
|
|
70
|
+
`),()=>{var M;(M=u.current)==null||M.removeAttribute("data-motion-pop-id"),A.contains(O)&&A.removeChild(O)}},[e]),S.jsx(gV,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:p})})}const yV=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:d})=>{const h=H2(_V),p=g.useId(),m=g.useRef(n),_=g.useRef(r);z2(()=>{m.current=n,_.current=r});let x=!0,y=g.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:w=>{h.set(w,!0);for(const E of h.values())if(!E)return;r&&r()},register:w=>(h.set(w,!1),()=>{var E;h.delete(w),!m.current&&!h.size&&((E=_.current)==null||E.call(_))})}),[n,h,r]);return i&&x&&(y={...y}),g.useMemo(()=>{h.forEach((w,E)=>h.set(E,!1))},[n]),g.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(vV,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:d,children:t}),S.jsx(a0.Provider,{value:y,children:t})};function _V(){return new Map}function mT(t=!0){const e=g.useContext(a0);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 rp=t=>t.key||"";function P4(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const ro=({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:d})=>{const[h,p]=mT(a),m=g.useMemo(()=>P4(t),[t]),_=a&&!h?[]:m.map(rp),x=g.useRef(!0),y=g.useRef(m),w=H2(()=>new Map),E=g.useRef(new Set),[P,T]=g.useState(m),[k,R]=g.useState(m);z2(()=>{x.current=!1,y.current=m;for(let A=0;A<k.length;A++){const M=rp(k[A]);_.includes(M)?(w.delete(M),E.current.delete(M)):w.get(M)!==!0&&w.set(M,!1)}},[k,_.length,_.join("-")]);const L=[];if(m!==P){let A=[...m];for(let M=0;M<k.length;M++){const D=k[M],F=rp(D);_.includes(F)||(A.splice(M,0,D),L.push(D))}return i==="wait"&&L.length&&(A=L),R(P4(A)),T(m),null}const{forceRender:O}=g.useContext($2);return S.jsx(S.Fragment,{children:k.map(A=>{const M=rp(A),D=a&&!h?!1:m===k||_.includes(M),F=()=>{if(E.current.has(M))return;if(w.has(M))E.current.add(M),w.set(M,!0);else return;let N=!0;w.forEach(W=>{W||(N=!1)}),N&&(O==null||O(),R(y.current),a&&(p==null||p()),r&&r())};return S.jsx(yV,{isPresent:D,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:F,anchorX:u,anchorY:c,children:A},M)})})},gT=g.createContext({strict:!1}),T4={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 R4=!1;function xV(){if(R4)return;const t={};for(const e in T4)t[e]={isEnabled:n=>T4[e].some(r=>!!n[r])};G3(t),R4=!0}function vT(){return xV(),sF()}function wV(t){const e=vT();for(const n in t)e[n]={...e[n],...t[n]};G3(e)}const bV=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 Nm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||bV.has(t)}let yT=t=>!Nm(t);function SV(t){typeof t=="function"&&(yT=e=>e.startsWith("on")?!Nm(e):t(e))}try{SV(require("@emotion/is-prop-valid").default)}catch{}function EV(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||zn(t[s])||(yT(s)||n===!0&&Nm(s)||!e&&!Nm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const d0=g.createContext({});function CV(t,e){if(c0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Kd(n)?n:void 0,animate:Kd(r)?r:void 0}}return t.inherit!==!1?e:{}}function kV(t){const{initial:e,animate:n}=CV(t,g.useContext(d0));return g.useMemo(()=>({initial:e,animate:n}),[A4(e),A4(n)])}function A4(t){return Array.isArray(t)?t.join(" "):t}const mx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _T(t,e,n){for(const r in e)!zn(e[r])&&!J3(r,n)&&(t[r]=e[r])}function PV({transformTemplate:t},e){return g.useMemo(()=>{const n=mx();return fx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function TV(t,e){const n=t.style||{},r={};return _T(r,n,t),Object.assign(r,PV(t,e)),r}function RV(t,e){const n={},r=TV(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 xT=()=>({...mx(),attrs:{}});function AV(t,e,n,r){const s=g.useMemo(()=>{const i=xT();return eT(i,e,nT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};_T(i,t.style,t),s.style={...i,...s.style}}return s}const IV=["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 gx(t){return typeof t!="string"||t.includes("-")?!1:!!(IV.indexOf(t)>-1||/[A-Z]/u.test(t))}function MV(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??gx(t)?AV:RV)(e,r,s,t),d=EV(e,typeof t=="string",i),h=t!==g.Fragment?{...d,...c,ref:n}:{},{children:p}=e,m=g.useMemo(()=>zn(p)?p.get():p,[p]);return g.createElement(t,{...h,children:m})}function OV({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:LV(n,r,s,t),renderState:e()}}function LV(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Np(i[m]);let{initial:a,animate:u}=t;const c=c0(t),d=B3(t);e&&d&&!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"&&!u0(p)){const m=Array.isArray(p)?p:[p];for(let _=0;_<m.length;_++){const x=rx(t,m[_]);if(x){const{transitionEnd:y,transition:w,...E}=x;for(const P in E){let T=E[P];if(Array.isArray(T)){const k=h?T.length-1:0;T=T[k]}T!==null&&(s[P]=T)}for(const P in y)s[P]=y[P]}}}return s}const wT=t=>(e,n)=>{const r=g.useContext(d0),s=g.useContext(a0),i=()=>OV(t,e,r,s);return n?i():H2(i)},DV=wT({scrapeMotionValuesFromProps:hx,createRenderState:mx}),NV=wT({scrapeMotionValuesFromProps:rT,createRenderState:xT}),jV=Symbol.for("motionComponentSymbol");function FV(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 bT=g.createContext({});function vu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function VV(t,e,n,r,s,i){var T,k;const{visualElement:a}=g.useContext(d0),u=g.useContext(gT),c=g.useContext(a0),d=g.useContext(px),h=d.reducedMotion,p=d.skipAnimations,m=g.useRef(null),_=g.useRef(!1);r=r||u.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),_.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,y=g.useContext(bT);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&$V(m.current,n,s,y);const w=g.useRef(!1);g.useInsertionEffect(()=>{x&&w.current&&x.update(n,c)});const E=n[M3],P=g.useRef(!!E&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,E))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,E)));return z2(()=>{_.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),P.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!P.current&&x.animationState&&x.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,E)}),P.current=!1),x.enteringChildren=void 0)}),x}function $V(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ST(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&vu(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:d,layoutAnchor:h})}function ST(t){if(t)return t.options.allowProjection!==!1?t.projection:ST(t.parent)}function o1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&wV(r);const i=n?n==="svg":gx(t),a=i?NV:DV;function u(d,h){let p;const m={...g.useContext(px),...d,layoutId:HV(d)},{isStatic:_}=m,x=kV(d),y=a(d,_);if(!_&&typeof window<"u"){zV();const w=UV(m);p=w.MeasureLayout,x.visualElement=VV(t,y,m,s,w.ProjectionNode,i)}return S.jsxs(d0.Provider,{value:x,children:[p&&x.visualElement?S.jsx(p,{visualElement:x.visualElement,...m}):null,MV(t,d,FV(y,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[jV]=t,c}function HV({layoutId:t}){const e=g.useContext($2).id;return e&&t!==void 0?e+"-"+t:t}function zV(t,e){g.useContext(gT).strict}function UV(t){const e=vT(),{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 BV(t,e){if(typeof Proxy>"u")return o1;const n=new Map,r=(i,a)=>o1(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,o1(a,void 0,t,e)),n.get(a))})}const WV=(t,e)=>e.isSVG??gx(t)?new wF(e):new mF(e,{allowProjection:t!==g.Fragment});class GV extends ha{constructor(e){super(e),e.animationState||(e.animationState=kF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();u0(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 KV=0;class ZV extends ha{constructor(){super(...arguments),this.id=KV++,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=yl(this.node,a,u);if(c){const{transition:d,transitionEnd:h,...p}=c;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}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 qV={animation:{Feature:GV},exit:{Feature:ZV}};function kf(t){return{point:{x:t.pageX,y:t.pageY}}}const YV=t=>e=>ax(e)&&t(e,kf(e));function Ad(t,e,n,r){return Zd(t,e,YV(n),r)}const ET=({current:t})=>t?t.ownerDocument.defaultView:null,I4=(t,e)=>Math.abs(t-e);function XV(t,e){const n=I4(t.x,e.x),r=I4(t.y,e.y);return Math.sqrt(n**2+r**2)}const M4=new Set(["auto","scroll"]);class CT{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=sp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=a1(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=XV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:E}=x,{timestamp:P}=Vn;this.history.push({...E,timestamp:P});const{onStart:T,onMove:k}=this.handlers;y||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=sp(y,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:w,onSessionEnd:E,resumeAnimation:P}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&P&&P(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=a1(x.type==="pointercancel"?this.lastMoveEventInfo:sp(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,T),E&&E(x,T)},!ax(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=kf(e),d=sp(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=Vn;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,a1(d,this.history));const _={passive:!0,capture:!0};this.removeListeners=Sf(Ad(this.contextWindow,"pointermove",this.handlePointerMove,_),Ad(this.contextWindow,"pointerup",this.handlePointerUp,_),Ad(this.contextWindow,"pointercancel",this.handlePointerUp,_)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(M4.has(r.overflowX)||M4.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),Tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),oa(this.updatePoint)}}function sp(t,e){return e?{point:e(t.point)}:t}function O4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function a1({point:t},e){return{point:t,delta:O4(t,kT(e)),offset:O4(t,QV(e)),velocity:JV(e,.1)}}function QV(t){return t[0]}function kT(t){return t[t.length-1]}function JV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=kT(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>es(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>es(e)*2&&(r=t[1]);const i=ws(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 e$(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Pt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Pt(n,t,r.max):Math.min(t,n)),t}function L4(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 t$(t,{top:e,left:n,bottom:r,right:s}){return{x:L4(t.x,n,s),y:L4(t.y,e,r)}}function D4(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 n$(t,e){return{x:D4(t.x,e.x),y:D4(t.y,e.y)}}function r$(t,e){let n=.5;const r=dr(t),s=dr(e);return s>r?n=Wd(e.min,e.max-r,t.min):r>s&&(n=Wd(t.min,t.max-s,e.min)),vi(0,1,n)}function s$(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 __=.35;function i$(t=__){return t===!1?t=0:t===!0&&(t=__),{x:N4(t,"left","right"),y:N4(t,"top","bottom")}}function N4(t,e,n){return{min:j4(t,e),max:j4(t,n)}}function j4(t,e){return typeof t=="number"?t:t[e]||0}const o$=new WeakMap;class a${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=bn(),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(kf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:_,dragPropagation:x,onDragStart:y}=this.getProps();if(_&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=D7(_),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ii(E=>{let P=this.getAxisMotionValue(E).get()||0;if(gi.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[E];k&&(P=dr(k)*(parseFloat(P)/100))}}this.originPoint[E]=P}),y&&Tt.update(()=>y(p,m),!1,!0),c_(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:_,dragDirectionLock:x,onDirectionLock:y,onDrag:w}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:E}=m;if(x&&this.currentDirection===null){this.currentDirection=u$(E),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,E),this.updateAxis("y",m.point,E),this.visualElement.render(),w&&Tt.update(()=>w(p,m),!1,!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new CT(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:ET(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&&Tt.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||!ip(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=e$(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&&vu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=t$(r.layoutBox,e):this.constraints=!1,this.elastic=i$(n),s!==this.constraints&&!vu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&ii(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=s$(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!vu(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=uF(r,s.root,this.visualElement.getTransformPagePoint());let a=n$(s.layout.layoutBox,i);if(n){const u=n(oF(a));this.hasMutatedConstraints=!!u,u&&(a=Z3(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},d=ii(h=>{if(!ip(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,_=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(d).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return c_(this.visualElement,e),r.start(nx(e,r,0,n,this.visualElement,!1))}stopAnimation(){ii(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){ii(n=>{const{drag:r}=this.getProps();if(!ip(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]-Pt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!vu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ii(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=r$({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(),ii(a=>{if(!ip(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:d}=this.constraints[a];u.set(Pt(c,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;o$.set(this.visualElement,this);const e=this.visualElement.current,n=Ad(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,_=m!==e&&H7(m);h&&p&&!_&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();vu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=l$(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Tt.read(s);const u=Zd(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(ii(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[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=__,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function F4(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function l$(t,e,n){const r=WC(t,F4(n)),s=WC(e,F4(n));return()=>{r(),s()}}function ip(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function u$(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class c$ extends ha{constructor(e){super(e),this.removeGroupControls=Cs,this.removeListeners=Cs,this.controls=new a$(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cs}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 l1=t=>(e,n)=>{t&&Tt.update(()=>t(e,n),!1,!0)};class d$ extends ha{constructor(){super(...arguments),this.removePointerDownListener=Cs}onPointerDown(e){this.session=new CT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ET(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:l1(e),onStart:l1(n),onMove:l1(r),onEnd:(i,a)=>{delete this.session,s&&Tt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Ad(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 u1=!1;class f$ 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),u1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jp.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}),u1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Tt.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(),ox.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;u1=!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 PT(t){const[e,n]=mT(),r=g.useContext($2);return S.jsx(f$,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(bT),isPresent:e,safeToRemove:n})}const h$={pan:{Feature:d$},drag:{Feature:c$,ProjectionNode:pT,MeasureLayout:PT}};function V4(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&&Tt.postRender(()=>i(e,kf(e)))}class p$ extends ha{mount(){const{current:e}=this.node;e&&(this.unmount=j7(e,(n,r)=>(V4(this.node,r,"Start"),s=>V4(this.node,s,"End"))))}unmount(){}}class m$ extends ha{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=Sf(Zd(this.node.current,"focus",()=>this.onFocus()),Zd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $4(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&&Tt.postRender(()=>i(e,kf(e)))}class g$ extends ha{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=U7(e,(s,i)=>($4(this.node,i,"Start"),(a,{success:u})=>$4(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const x_=new WeakMap,c1=new WeakMap,v$=t=>{const e=x_.get(t.target);e&&e(t)},y$=t=>{t.forEach(v$)};function _$({root:t,...e}){const n=t||document;c1.has(n)||c1.set(n,{});const r=c1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(y$,{root:t,...e})),r[s]}function x$(t,e,n){const r=_$(e);return x_.set(t,n),r.observe(t),()=>{x_.delete(t),r.unobserve(t)}}const w$={some:0,all:1};class b$ extends ha{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:w$[s]},u=d=>{const{isIntersecting:h}=d;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:m}=this.node.getProps(),_=h?p:m;_&&_(d)};this.stopObserver=x$(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(S$(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function S$({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const E$={inView:{Feature:b$},tap:{Feature:g$},focus:{Feature:m$},hover:{Feature:p$}},C$={layout:{ProjectionNode:pT,MeasureLayout:PT}},k$={...qV,...E$,...h$,...C$},so=BV(k$,WV);function P$(){!dx.current&&W3();const[t]=g.useState(Mm.current);return t}const _l=so;var f0=FP();const T$=n0(f0);function R$(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 A$=t=>{switch(t){case"success":return O$;case"info":return D$;case"warning":return L$;case"error":return N$;default:return null}},I$=Array(12).fill(0),M$=({visible:t,className:e})=>ve.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},I$.map((n,r)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),O$=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"})),L$=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"})),D$=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"})),N$=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"})),j$=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"})),F$=()=>{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 w_=1;class V${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:w_++,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 d=>{if(a=["resolve",d],ve.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(H$(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...x})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,_=typeof h=="object"&&!ve.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,..._})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>u.then(()=>a[0]==="reject"?h(a[1]):d(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)||w_++;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 Pr=new V$,$$=(t,e)=>{const n=(e==null?void 0:e.id)||w_++;return Pr.addToast({title:t,...e,id:n}),n},H$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",z$=$$,U$=()=>Pr.toasts,B$=()=>Pr.getActiveToasts(),mt=Object.assign(z$,{success:Pr.success,info:Pr.info,warning:Pr.warning,error:Pr.error,custom:Pr.custom,message:Pr.message,promise:Pr.promise,dismiss:Pr.dismiss,loading:Pr.loading},{getHistory:U$,getToasts:B$});R$("[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 op(t){return t.label!==void 0}const W$=3,G$="24px",K$="16px",H4=4e3,Z$=356,q$=14,Y$=45,X$=200;function ni(...t){return t.filter(Boolean).join(" ")}function Q$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const J$=t=>{var e,n,r,s,i,a,u,c,d;const{invert:h,toast:p,unstyled:m,interacting:_,setHeights:x,visibleToasts:y,heights:w,index:E,toasts:P,expanded:T,removeToast:k,defaultRichColors:R,closeButton:L,style:O,cancelButtonStyle:A,actionButtonStyle:M,className:D="",descriptionClassName:F="",duration:N,position:W,gap:Y,expandByDefault:q,classNames:B,icons:K,closeButtonAriaLabel:$="Close toast"}=t,[J,H]=ve.useState(null),[j,X]=ve.useState(null),[te,ie]=ve.useState(!1),[ae,ue]=ve.useState(!1),[Se,oe]=ve.useState(!1),[se,ye]=ve.useState(!1),[be,je]=ve.useState(!1),[Te,We]=ve.useState(0),[Rt,Ye]=ve.useState(0),we=ve.useRef(p.duration||N||H4),Mt=ve.useRef(null),Je=ve.useRef(null),He=E===0,tt=E+1<=y,Ge=p.type,ct=p.dismissible!==!1,vn=p.className||"",Sn=p.descriptionClassName||"",St=ve.useMemo(()=>w.findIndex(qe=>qe.toastId===p.id)||0,[w,p.id]),rr=ve.useMemo(()=>{var qe;return(qe=p.closeButton)!=null?qe:L},[p.closeButton,L]),En=ve.useMemo(()=>p.duration||N||H4,[p.duration,N]),is=ve.useRef(0),rn=ve.useRef(0),mr=ve.useRef(0),Zs=ve.useRef(null),[Al,Ln]=W.split("-"),Si=ve.useMemo(()=>w.reduce((qe,Ot,Wt)=>Wt>=St?qe:qe+Ot.height,0),[w,St]),Ps=F$(),qs=p.invert||h,os=Ge==="loading";rn.current=ve.useMemo(()=>St*Y+Si,[St,Si]),ve.useEffect(()=>{we.current=En},[En]),ve.useEffect(()=>{ie(!0)},[]),ve.useEffect(()=>{const qe=Je.current;if(qe){const Ot=qe.getBoundingClientRect().height;return Ye(Ot),x(Wt=>[{toastId:p.id,height:Ot,position:p.position},...Wt]),()=>x(Wt=>Wt.filter(Cn=>Cn.toastId!==p.id))}},[x,p.id]),ve.useLayoutEffect(()=>{if(!te)return;const qe=Je.current,Ot=qe.style.height;qe.style.height="auto";const Wt=qe.getBoundingClientRect().height;qe.style.height=Ot,Ye(Wt),x(Cn=>Cn.find(Xt=>Xt.toastId===p.id)?Cn.map(Xt=>Xt.toastId===p.id?{...Xt,height:Wt}:Xt):[{toastId:p.id,height:Wt,position:p.position},...Cn])},[te,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const yn=ve.useCallback(()=>{ue(!0),We(rn.current),x(qe=>qe.filter(Ot=>Ot.toastId!==p.id)),setTimeout(()=>{k(p)},X$)},[p,k,x,rn]);ve.useEffect(()=>{if(p.promise&&Ge==="loading"||p.duration===1/0||p.type==="loading")return;let qe;return T||_||Ps?(()=>{if(mr.current<is.current){const Cn=new Date().getTime()-is.current;we.current=we.current-Cn}mr.current=new Date().getTime()})():(()=>{we.current!==1/0&&(is.current=new Date().getTime(),qe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),yn()},we.current))})(),()=>clearTimeout(qe)},[T,_,p,Ge,Ps,yn]),ve.useEffect(()=>{p.delete&&(yn(),p.onDismiss==null||p.onDismiss.call(p,p))},[yn,p.delete]);function mo(){var qe;if(K!=null&&K.loading){var Ot;return ve.createElement("div",{className:ni(B==null?void 0:B.loader,p==null||(Ot=p.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Ge==="loading"},K.loading)}return ve.createElement(M$,{className:ni(B==null?void 0:B.loader,p==null||(qe=p.classNames)==null?void 0:qe.loader),visible:Ge==="loading"})}const Fr=p.icon||(K==null?void 0:K[Ge])||A$(Ge);var as,Ei;return ve.createElement("li",{tabIndex:0,ref:Je,className:ni(D,vn,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[Ge],p==null||(n=p.classNames)==null?void 0:n[Ge]),"data-sonner-toast":"","data-rich-colors":(as=p.richColors)!=null?as:R,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":te,"data-promise":!!p.promise,"data-swiped":be,"data-removed":ae,"data-visible":tt,"data-y-position":Al,"data-x-position":Ln,"data-index":E,"data-front":He,"data-swiping":Se,"data-dismissible":ct,"data-type":Ge,"data-invert":qs,"data-swipe-out":se,"data-swipe-direction":j,"data-expanded":!!(T||q&&te),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":P.length-E,"--offset":`${ae?Te:rn.current}px`,"--initial-height":q?"auto":`${Rt}px`,...O,...p.style},onDragEnd:()=>{oe(!1),H(null),Zs.current=null},onPointerDown:qe=>{qe.button!==2&&(os||!ct||(Mt.current=new Date,We(rn.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(oe(!0),Zs.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,Ot,Wt;if(se||!ct)return;Zs.current=null;const Cn=Number(((qe=Je.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Vr=Number(((Ot=Je.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xt=new Date().getTime()-((Wt=Mt.current)==null?void 0:Wt.getTime()),un=J==="x"?Cn:Vr,Ys=Math.abs(un)/Xt;if(Math.abs(un)>=Y$||Ys>.11){We(rn.current),p.onDismiss==null||p.onDismiss.call(p,p),X(J==="x"?Cn>0?"right":"left":Vr>0?"down":"up"),yn(),ye(!0);return}else{var cn,Gn;(cn=Je.current)==null||cn.style.setProperty("--swipe-amount-x","0px"),(Gn=Je.current)==null||Gn.style.setProperty("--swipe-amount-y","0px")}je(!1),oe(!1),H(null)},onPointerMove:qe=>{var Ot,Wt,Cn;if(!Zs.current||!ct||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const Xt=qe.clientY-Zs.current.y,un=qe.clientX-Zs.current.x;var Ys;const cn=(Ys=t.swipeDirections)!=null?Ys:Q$(W);!J&&(Math.abs(un)>1||Math.abs(Xt)>1)&&H(Math.abs(un)>Math.abs(Xt)?"x":"y");let Gn={x:0,y:0};const Ts=gr=>1/(1.5+Math.abs(gr)/20);if(J==="y"){if(cn.includes("top")||cn.includes("bottom"))if(cn.includes("top")&&Xt<0||cn.includes("bottom")&&Xt>0)Gn.y=Xt;else{const gr=Xt*Ts(Xt);Gn.y=Math.abs(gr)<Math.abs(Xt)?gr:Xt}}else if(J==="x"&&(cn.includes("left")||cn.includes("right")))if(cn.includes("left")&&un<0||cn.includes("right")&&un>0)Gn.x=un;else{const gr=un*Ts(un);Gn.x=Math.abs(gr)<Math.abs(un)?gr:un}(Math.abs(Gn.x)>0||Math.abs(Gn.y)>0)&&je(!0),(Wt=Je.current)==null||Wt.style.setProperty("--swipe-amount-x",`${Gn.x}px`),(Cn=Je.current)==null||Cn.style.setProperty("--swipe-amount-y",`${Gn.y}px`)}},rr&&!p.jsx&&Ge!=="loading"?ve.createElement("button",{"aria-label":$,"data-disabled":os,"data-close-button":!0,onClick:os||!ct?()=>{}:()=>{yn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ni(B==null?void 0:B.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Ei=K==null?void 0:K.close)!=null?Ei:j$):null,(Ge||p.icon||p.promise)&&p.icon!==null&&((K==null?void 0:K[Ge])!==null||p.icon)?ve.createElement("div",{"data-icon":"",className:ni(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||mo():null,p.type!=="loading"?Fr:null):null,ve.createElement("div",{"data-content":"",className:ni(B==null?void 0:B.content,p==null||(i=p.classNames)==null?void 0:i.content)},ve.createElement("div",{"data-title":"",className:ni(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:ni(F,Sn,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&&op(p.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:qe=>{op(p.cancel)&&ct&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,qe),yn())},className:ni(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&&op(p.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:qe=>{op(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,qe),!qe.defaultPrevented&&yn())},className:ni(B==null?void 0:B.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function z4(){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 eH(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?K$:G$;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=u:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(u)}),n}const tH=ve.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:d,offset:h,mobileOffset:p,theme:m="light",richColors:_,duration:x,style:y,visibleToasts:w=W$,toastOptions:E,dir:P=z4(),gap:T=q$,icons:k,containerAriaLabel:R="Notifications"}=e,[L,O]=ve.useState([]),A=ve.useMemo(()=>r?L.filter(te=>te.toasterId===r):L.filter(te=>!te.toasterId),[L,r]),M=ve.useMemo(()=>Array.from(new Set([i].concat(A.filter(te=>te.position).map(te=>te.position)))),[A,i]),[D,F]=ve.useState([]),[N,W]=ve.useState(!1),[Y,q]=ve.useState(!1),[B,K]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ve.useRef(null),J=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ve.useRef(null),j=ve.useRef(!1),X=ve.useCallback(te=>{O(ie=>{var ae;return(ae=ie.find(ue=>ue.id===te.id))!=null&&ae.delete||Pr.dismiss(te.id),ie.filter(({id:ue})=>ue!==te.id)})},[]);return ve.useEffect(()=>Pr.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{O(ie=>ie.map(ae=>ae.id===te.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{T$.flushSync(()=>{O(ie=>{const ae=ie.findIndex(ue=>ue.id===te.id);return ae!==-1?[...ie.slice(0,ae),{...ie[ae],...te},...ie.slice(ae+1)]:[te,...ie]})})})}),[L]),ve.useEffect(()=>{if(m!=="system"){K(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:ie})=>{K(ie?"dark":"light")})}catch{te.addListener(({matches:ae})=>{try{K(ae?"dark":"light")}catch(ue){console.error(ue)}})}},[m]),ve.useEffect(()=>{L.length<=1&&W(!1)},[L]),ve.useEffect(()=>{const te=ie=>{var ae;if(a.every(oe=>ie[oe]||ie.code===oe)){var Se;W(!0),(Se=$.current)==null||Se.focus()}ie.code==="Escape"&&(document.activeElement===$.current||(ae=$.current)!=null&&ae.contains(document.activeElement))&&W(!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,j.current=!1)}},[$.current]),ve.createElement("section",{ref:n,"aria-label":`${R} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((te,ie)=>{var ae;const[ue,Se]=te.split("-");return A.length?ve.createElement("ol",{key:te,dir:P==="auto"?z4():P,tabIndex:-1,ref:$,className:d,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ue,"data-x-position":Se,style:{"--front-toast-height":`${((ae=D[0])==null?void 0:ae.height)||0}px`,"--width":`${Z$}px`,"--gap":`${T}px`,...y,...eH(h,p)},onBlur:oe=>{j.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(j.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||j.current||(j.current=!0,H.current=oe.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Y||W(!1)},onDragEnd:()=>W(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},A.filter(oe=>!oe.position&&ie===0||oe.position===te).map((oe,se)=>{var ye,be;return ve.createElement(J$,{key:oe.id,icons:k,index:se,toast:oe,defaultRichColors:_,duration:(ye=E==null?void 0:E.duration)!=null?ye:x,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:w,closeButton:(be=E==null?void 0:E.closeButton)!=null?be:c,interacting:Y,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:X,toasts:A.filter(je=>je.position==oe.position),heights:D.filter(je=>je.position==oe.position),setHeights:F,expandByDefault:u,gap:T,expanded:N,swipeDirections:e.swipeDirections})})):null}))});var nH=Object.defineProperty,dc=(t,e)=>nH(t,"name",{value:e,configurable:!0}),TT=!!(typeof window<"u"&&window.document&&window.document.createElement);function jt(t,e,{checkForDefaultPrevented:n=!0}={}){return dc(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}dc(jt,"composeEventHandlers");function rH(t){var e;if(!TT)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}dc(rH,"getOwnerWindow");function b_(t){if(!TT)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}dc(b_,"getOwnerDocument");function RT(t,e=!1){const{activeElement:n}=b_(t);if(!(n!=null&&n.nodeName))return null;if(AT(n)&&n.contentDocument)return RT(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=b_(n).getElementById(r);if(s)return s}}return n}dc(RT,"getActiveElement");function AT(t){return t.tagName==="IFRAME"}dc(AT,"isFrame");var sH=Object.defineProperty,vx=(t,e)=>sH(t,"name",{value:e,configurable:!0});function S_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}vx(S_,"setRef");function IT(...t){return e=>{let n=!1;const r=t.map(s=>{const i=S_(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():S_(t[s],null)}}}}vx(IT,"composeRefs");function Vt(...t){return g.useCallback(IT(...t),t)}vx(Vt,"useComposedRefs");var iH=Object.defineProperty,xs=(t,e)=>iH(t,"name",{value:e,configurable:!0});function oH(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=xs(i=>{const{children:a,...u}=i,c=g.useMemo(()=>u,Object.values(u));return S.jsx(n.Provider,{value:c,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:u=!1}=a,c=g.useContext(n);if(c)return c;if(e!==void 0)return e;if(!u)throw new Error(`\`${i}\` must be used within \`${t}\``)}return xs(s,"useContext"),[r,s]}xs(oH,"createContext");function wi(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 d=xs(p=>{var E;const{scope:m,children:_,...x}=p,y=((E=m==null?void 0:m[t])==null?void 0:E[c])||u,w=g.useMemo(()=>x,Object.values(x));return S.jsx(y.Provider,{value:w,children:_})},"Provider");d.displayName=i+"Provider";function h(p,m,_={}){var E;const{optional:x=!1}=_,y=((E=m==null?void 0:m[t])==null?void 0:E[c])||u,w=g.useContext(y);if(w)return w;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return xs(h,"useContext"),[d,h]}xs(r,"createContext");const s=xs(()=>{const i=n.map(a=>g.createContext(a));return xs(function(u){const c=(u==null?void 0:u[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])},"useScope")},"createScope");return s.scopeName=t,[r,MT(s,...e)]}xs(wi,"createContextScope");function MT(...t){const e=t[0];if(t.length===1)return e;const n=xs(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return xs(function(i){const a=r.reduce((u,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...u,...p}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}xs(MT,"composeContextScopes");var Ir=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},aH=Object.defineProperty,lH=(t,e)=>aH(t,"name",{value:e,configurable:!0}),uH=wf[" useId ".trim().toString()]||(()=>{}),cH=0;function Jo(t){const[e,n]=g.useState(uH());return Ir(()=>{t||n(r=>r??String(cH++))},[t]),t||(e?`radix-${e}`:"")}lH(Jo,"useId");var dH=Object.defineProperty,fH=(t,e)=>dH(t,"name",{value:e,configurable:!0}),U4=wf[" useEffectEvent ".trim().toString()],B4=wf[" useInsertionEffect ".trim().toString()];function OT(t){if(typeof U4=="function")return U4(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof B4=="function"?B4(()=>{e.current=t}):Ir(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}fH(OT,"useEffectEvent");var hH=Object.defineProperty,Pf=(t,e)=>hH(t,"name",{value:e,configurable:!0}),pH=wf[" useInsertionEffect ".trim().toString()]||Ir;function pa({prop:t,defaultProp:e,onChange:n=Pf(()=>{},"onChange"),caller:r}){const[s,i,a]=LT({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s,d=g.useCallback(h=>{var p;if(u){const m=DT(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[u,t,i,a]);return[c,d]}Pf(pa,"useControllableState");function LT({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return pH(()=>{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]}Pf(LT,"useUncontrolledState");function DT(t){return typeof t=="function"}Pf(DT,"isFunction");var W4=Symbol("RADIX:SYNC_STATE");function mH(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:u}=e,c=s!==void 0,d=OT(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=g.useReducer((w,E)=>{if(E.type===W4)return{...w,state:E.state};const P=t(w,E);return c&&!Object.is(P.state,w.state)&&d(P.state),P},...h),_=p.state,x=g.useRef(_);g.useEffect(()=>{x.current!==_&&(x.current=_,c||d(_))},[_,x,c]);const y=g.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return g.useEffect(()=>{c&&!Object.is(s,p.state)&&m({type:W4,state:s})},[s,p.state,c]),[y,m]}Pf(mH,"useControllableStateReducer");var gH=Object.defineProperty,Gs=(t,e)=>gH(t,"name",{value:e,configurable:!0});function aa(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];E_(s)&&typeof ap=="function"&&(s=ap(s._payload)),g.Children.forEach(s,m=>{var _;if($T(m)){u=!0;const x=m;let y="child"in x.props?x.props.child:x.props.children;E_(y)&&typeof ap=="function"&&(y=ap(y._payload)),a=vH(x,y),c.push((_=a==null?void 0:a.props)==null?void 0:_.children)}else c.push(m)}),a?a=g.cloneElement(a,void 0,c):!u&&g.Children.count(s)===1&&g.isValidElement(s)&&(a=s);const d=a?VT(a):void 0,h=Vt(r,d);if(!a){if(s||s===0)throw new Error(u?xH(t):_H(t));return s}const p=FT(i,a.props??{});return a.type!==g.Fragment&&(p.ref=r?h:d),g.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Gs(aa,"createSlot");var NT=Symbol.for("radix.slottable");function jT(t){const e=Gs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=NT,e}Gs(jT,"createSlottable");var vH=Gs((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},"getSlottableElementFromSlottable");function FT(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}}Gs(FT,"mergeProps");function VT(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)}Gs(VT,"getElementRef");function $T(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===NT}Gs($T,"isSlottable");var yH=Symbol.for("react.lazy");function E_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===yH&&"_payload"in t&&HT(t._payload)}Gs(E_,"isLazyComponent");function HT(t){return typeof t=="object"&&t!==null&&"then"in t}Gs(HT,"isPromiseLike");var _H=Gs(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),xH=Gs(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ap=wf[" use ".trim().toString()],wH=Object.defineProperty,bH=(t,e)=>wH(t,"name",{value:e,configurable:!0}),SH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=SH.reduce((t,e)=>{const n=aa(`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 zT(t,e){t&&f0.flushSync(()=>t.dispatchEvent(e))}bH(zT,"dispatchDiscreteCustomEvent");var EH=Object.defineProperty,CH=(t,e)=>EH(t,"name",{value:e,configurable:!0});function Cl(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)}),[])}CH(Cl,"useCallbackRef");var kH=Object.defineProperty,An=(t,e)=>kH(t,"name",{value:e,configurable:!0}),C_="dismissableLayer.update",PH="dismissableLayer.pointerDownOutside",TH="dismissableLayer.focusOutside",G4,UT=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),yx=g.forwardRef(An(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...h}=e,p=g.useContext(UT),[m,_]=g.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=g.useState({}),w=Vt(n,_),E=Array.from(p.layers),[P]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=P?E.indexOf(P):-1,k=m?E.indexOf(m):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,L=k>=T,O=g.useRef(!1),A=WT(N=>{a==null||a(N),c==null||c(N),N.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(N=>{if(!(N instanceof Node))return!1;const W=[...p.branches].some(Y=>Y.contains(N));return L&&!W},[p.branches,L])}),M=GT(N=>{if(s&&O.current)return;const W=N.target;[...p.branches].some(q=>q.contains(W))||(u==null||u(N),c==null||c(N),N.defaultPrevented||d==null||d())},x),D=m?k===E.length-1:!1,F=Cl(N=>{N.key==="Escape"&&(i==null||i(N),!N.defaultPrevented&&d&&(N.preventDefault(),d()))});return g.useEffect(()=>{if(D)return x.addEventListener("keydown",F,{capture:!0}),()=>x.removeEventListener("keydown",F,{capture:!0})},[x,D,F]),g.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(G4=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),k_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=G4))}},[m,x,r,p]),g.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),k_())},[m,p]),g.useEffect(()=>{const N=An(()=>y({}),"handleUpdate");return document.addEventListener(C_,N),()=>document.removeEventListener(C_,N)},[]),S.jsx(ln.div,{...h,ref:w,style:{pointerEvents:R?L?"auto":"none":void 0,...e.style},onFocusCapture:jt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:jt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:jt(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function BT(){const t=g.useContext(UT),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}An(BT,"useDismissableLayerSurface");var RH=An(()=>!0,"IS_TRUE");function WT(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=RH}=e,u=Cl(t),c=g.useRef(!1),d=g.useRef(!1),h=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,h.current.clear()}An(m,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}An(_,"isOutsideInteractionIntercepted");function x(T){if(!d.current)return;const k=T.target;k instanceof Node&&[...i].some(L=>L.contains(k))||h.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}An(x,"handleInteractionCapture");function y(T){d.current&&h.current.set(T.type,!1)}An(y,"handleInteractionBubble");const w=An(T=>{if(T.target&&!c.current){let k=function(){n.removeEventListener("click",p.current);const L=_();m(),L||_x(PH,u,R,{discrete:!0})};if(An(k,"handleAndDispatchPointerDownOutsideEvent"),!a(T.target)){n.removeEventListener("click",p.current),m(),c.current=!1;return}const R={originalEvent:T};d.current=!0,s.current=r&&T.button===0,h.current.clear(),!r||T.button!==0?k():(n.removeEventListener("click",p.current),p.current=k,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();c.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)n.addEventListener(T,x,!0),n.addEventListener(T,y);const P=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(P),n.removeEventListener("pointerdown",w),n.removeEventListener("click",p.current);for(const T of E)n.removeEventListener(T,x,!0),n.removeEventListener(T,y)}},[n,u,r,s,i,a]),{onPointerDownCapture:An(()=>c.current=!0,"onPointerDownCapture")}}An(WT,"usePointerDownOutside");function GT(t,e=globalThis==null?void 0:globalThis.document){const n=Cl(t),r=g.useRef(!1);return g.useEffect(()=>{const s=An(i=>{i.target&&!r.current&&_x(TH,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:An(()=>r.current=!0,"onFocusCapture"),onBlurCapture:An(()=>r.current=!1,"onBlurCapture")}}An(GT,"useFocusOutside");function k_(){const t=new CustomEvent(C_);document.dispatchEvent(t)}An(k_,"dispatchUpdate");function _x(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?zT(s,i):s.dispatchEvent(i)}An(_x,"handleAndDispatchCustomEvent");var AH=Object.defineProperty,fr=(t,e)=>AH(t,"name",{value:e,configurable:!0}),d1="focusScope.autoFocusOnMount",f1="focusScope.autoFocusOnUnmount",K4={bubbles:!1,cancelable:!0},KT=g.forwardRef(fr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...u}=e,[c,d]=g.useState(null),h=Cl(i),p=Cl(a),m=g.useRef(null),_=Vt(n,d),x=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let w=function(k){if(x.paused||!c)return;const R=k.target;c.contains(R)?m.current=R:Wi(m.current,{select:!0})},E=function(k){if(x.paused||!c)return;const R=k.relatedTarget;R!==null&&(c.contains(R)||Wi(m.current,{select:!0}))},P=function(k){if(document.activeElement===document.body)for(const L of k)L.removedNodes.length>0&&Wi(c)};fr(w,"handleFocusIn"),fr(E,"handleFocusOut"),fr(P,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",E);const T=new MutationObserver(P);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),T.disconnect()}}},[s,c,x.paused]),g.useEffect(()=>{if(c){Z4.add(x);const w=document.activeElement;if(!c.contains(w)){const P=new CustomEvent(d1,K4);c.addEventListener(d1,h),c.dispatchEvent(P),P.defaultPrevented||(ZT(JT(xx(c)),{select:!0}),document.activeElement===w&&Wi(c))}return()=>{c.removeEventListener(d1,h),setTimeout(()=>{const P=new CustomEvent(f1,K4);c.addEventListener(f1,p),c.dispatchEvent(P),P.defaultPrevented||Wi(w??document.body,{select:!0}),c.removeEventListener(f1,p),Z4.remove(x)},0)}}},[c,h,p,x]);const y=g.useCallback(w=>{if(!r&&!s||x.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,P=document.activeElement;if(E&&P){const T=w.currentTarget,[k,R]=qT(T);k&&R?!w.shiftKey&&P===R?(w.preventDefault(),r&&Wi(k,{select:!0})):w.shiftKey&&P===k&&(w.preventDefault(),r&&Wi(R,{select:!0})):P===T&&w.preventDefault()}},[r,s,x.paused]);return S.jsx(ln.div,{tabIndex:-1,...u,ref:_,onKeyDown:y})},"FocusScope"));function ZT(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wi(r,{select:e}),document.activeElement!==n)return}fr(ZT,"focusFirst");function qT(t){const e=xx(t),n=P_(e,t),r=P_(e.reverse(),t);return[n,r]}fr(qT,"getTabbableEdges");function xx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:fr(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},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}fr(xx,"getTabbableCandidates");function P_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):YT(r,{upTo:e})))return r}fr(P_,"findVisible");function YT(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}fr(YT,"isHidden");function XT(t){return t instanceof HTMLInputElement&&"select"in t}fr(XT,"isSelectableInput");function Wi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&XT(t)&&e&&t.select()}}fr(Wi,"focus");var Z4=QT();function QT(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=T_(t,e),t.unshift(e)},remove(e){var n;t=T_(t,e),(n=t[0])==null||n.resume()}}}fr(QT,"createFocusScopesStack");function T_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}fr(T_,"arrayRemove");function JT(t){return t.filter(e=>e.tagName!=="A")}fr(JT,"removeLinks");var IH=Object.defineProperty,MH=(t,e)=>IH(t,"name",{value:e,configurable:!0}),wx=g.forwardRef(MH(function(e,n){var c;const{container:r,...s}=e,[i,a]=g.useState(!1);Ir(()=>a(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?f0.createPortal(S.jsx(ln.div,{...s,ref:n}),u):null},"Portal")),OH=Object.defineProperty,ao=(t,e)=>OH(t,"name",{value:e,configurable:!0});function eR(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}ao(eR,"useStateMachine");var ma=ao(t=>{const{present:e,children:n}=t,r=tR(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=nR(r.ref,rR(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function tR(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,d]=eR(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??yu(r.current),a.current=void 0):i.current="none"},[c]),Ir(()=>{const h=r.current,p=s.current;if(p!==t){const _=i.current,x=yu(h);t?(a.current=x,d("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&_!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Ir(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=ao(x=>{const w=yu(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(d("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),_=ao(x=>{x.target===e&&(i.current=yu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=yu(p)}else r.current=null;n(h)},[])}}ao(tR,"usePresence");function R_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ao(R_,"setRef");function nR(...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=R_(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():R_(r[a],null)}}},[])}ao(nR,"useStableComposedRefs");function yu(t){return(t==null?void 0:t.animationName)||"none"}ao(yu,"getAnimationName");function rR(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)}ao(rR,"getElementRef");var LH=Object.defineProperty,bx=(t,e)=>LH(t,"name",{value:e,configurable:!0}),lp=0,ri=null;function DH(t){return h0(),t.children}bx(DH,"FocusGuards");function h0(){g.useEffect(()=>{ri||(ri={start:A_(),end:A_()});const{start:t,end:e}=ri;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),lp++,()=>{lp===1&&(ri==null||ri.start.remove(),ri==null||ri.end.remove(),ri=null),lp=Math.max(0,lp-1)}},[])}bx(h0,"useFocusGuards");function A_(){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}bx(A_,"createFocusGuard");var di=function(){return di=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},di.apply(this,arguments)};function sR(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 NH(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 Fp="right-scroll-bar-position",Vp="width-before-scroll-bar",jH="with-scroll-bars-hidden",FH="--removed-body-scroll-bar-size";function h1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function VH(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 $H=typeof window<"u"?g.useLayoutEffect:g.useEffect,q4=new WeakMap;function HH(t,e){var n=VH(null,function(r){return t.forEach(function(s){return h1(s,r)})});return $H(function(){var r=q4.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||h1(u,null)}),i.forEach(function(u){s.has(u)||h1(u,a)})}q4.set(n,t)},[t]),n}function zH(t){return t}function UH(t,e){e===void 0&&(e=zH);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)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function BH(t){t===void 0&&(t={});var e=UH(null);return e.options=di({async:!0,ssr:!1},t),e}var iR=function(t){var e=t.sideCar,n=sR(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,di({},n))};iR.isSideCarExport=!0;function WH(t,e){return t.useMedium(e),iR}var oR=BH(),p1=function(){},p0=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:p1,onWheelCapture:p1,onTouchMoveCapture:p1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,d=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,_=t.noRelative,x=t.noIsolation,y=t.inert,w=t.allowPinchZoom,E=t.as,P=E===void 0?"div":E,T=t.gapMode,k=sR(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,L=HH([n,e]),O=di(di({},k),s);return g.createElement(g.Fragment,null,h&&g.createElement(R,{sideCar:oR,removeScrollBar:d,shards:p,noRelative:_,noIsolation:x,inert:y,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:T}),a?g.cloneElement(g.Children.only(u),di(di({},O),{ref:L})):g.createElement(P,di({},O,{className:c,ref:L}),u))});p0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};p0.classNames={fullWidth:Vp,zeroRight:Fp};var GH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=GH();return e&&t.setAttribute("nonce",e),t}function ZH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function qH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var YH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=KH())&&(ZH(e,n),qH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},XH=function(){var t=YH();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},aR=function(){var t=XH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},QH={left:0,top:0,right:0,gap:0},m1=function(t){return parseInt(t||"",10)||0},JH=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[m1(n),m1(r),m1(s)]},ez=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return QH;var e=JH(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])}},tz=aR(),Tu="data-scroll-locked",nz=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(jH,` {
|
|
72
|
+
overflow: hidden `).concat(r,`;
|
|
73
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
74
|
+
}
|
|
75
|
+
body[`).concat(Tu,`] {
|
|
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(Fp,` {
|
|
89
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.`).concat(Vp,` {
|
|
93
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.`).concat(Fp," .").concat(Fp,` {
|
|
97
|
+
right: 0 `).concat(r,`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.`).concat(Vp," .").concat(Vp,` {
|
|
101
|
+
margin-right: 0 `).concat(r,`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
body[`).concat(Tu,`] {
|
|
105
|
+
`).concat(FH,": ").concat(u,`px;
|
|
106
|
+
}
|
|
107
|
+
`)},Y4=function(){var t=parseInt(document.body.getAttribute(Tu)||"0",10);return isFinite(t)?t:0},rz=function(){g.useEffect(function(){return document.body.setAttribute(Tu,(Y4()+1).toString()),function(){var t=Y4()-1;t<=0?document.body.removeAttribute(Tu):document.body.setAttribute(Tu,t.toString())}},[])},sz=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;rz();var i=g.useMemo(function(){return ez(s)},[s]);return g.createElement(tz,{styles:nz(i,!e,s,n?"":"!important")})},I_=!1;if(typeof window<"u")try{var up=Object.defineProperty({},"passive",{get:function(){return I_=!0,!0}});window.addEventListener("test",up,up),window.removeEventListener("test",up,up)}catch{I_=!1}var lu=I_?{passive:!1}:!1,iz=function(t){return t.tagName==="TEXTAREA"},lR=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!iz(t)&&n[e]==="visible")},oz=function(t){return lR(t,"overflowY")},az=function(t){return lR(t,"overflowX")},X4=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=uR(t,r);if(s){var i=cR(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},uR=function(t,e){return t==="v"?oz(e):az(e)},cR=function(t,e){return t==="v"?lz(e):uz(e)},cz=function(t,e){return t==="h"&&e==="rtl"?-1:1},dz=function(t,e,n,r,s){var i=cz(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),d=!1,h=a>0,p=0,m=0;do{if(!u)break;var _=cR(t,u),x=_[0],y=_[1],w=_[2],E=y-w-i*x;(x||E)&&uR(t,u)&&(p+=E,m+=x);var P=u.parentNode;u=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(d=!0),d},cp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Q4=function(t){return[t.deltaX,t.deltaY]},J4=function(t){return t&&"current"in t?t.current:t},fz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},hz=function(t){return`
|
|
108
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
109
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
110
|
+
`)},pz=0,uu=[];function mz(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(pz++)[0],i=g.useState(aR)[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 y=NH([t.lockRef.current],(t.shards||[]).map(J4),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=g.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var E=cp(y),P=n.current,T="deltaX"in y?y.deltaX:P[0]-E[0],k="deltaY"in y?y.deltaY:P[1]-E[1],R,L=y.target,O=Math.abs(T)>Math.abs(k)?"h":"v";if("touches"in y&&O==="h"&&L.type==="range")return!1;var A=window.getSelection(),M=A&&A.anchorNode,D=M?M===L||M.contains(L):!1;if(D)return!1;var F=X4(O,L);if(!F)return!0;if(F?R=O:(R=O==="v"?"h":"v",F=X4(O,L)),!F)return!1;if(!r.current&&"changedTouches"in y&&(T||k)&&(r.current=R),!R)return!0;var N=r.current||R;return dz(N,w,y,N==="h"?T:k)},[]),c=g.useCallback(function(y){var w=y;if(!(!uu.length||uu[uu.length-1]!==i)){var E="deltaY"in w?Q4(w):cp(w),P=e.current.filter(function(R){return R.name===w.type&&(R.target===w.target||w.target===R.shadowParent)&&fz(R.delta,E)})[0];if(P&&P.should){w.cancelable&&w.preventDefault();return}if(!P){var T=(a.current.shards||[]).map(J4).filter(Boolean).filter(function(R){return R.contains(w.target)}),k=T.length>0?u(w,T[0]):!a.current.noIsolation;k&&w.cancelable&&w.preventDefault()}}},[]),d=g.useCallback(function(y,w,E,P){var T={name:y,delta:w,target:E,should:P,shadowParent:gz(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(k){return k!==T})},1)},[]),h=g.useCallback(function(y){n.current=cp(y),r.current=void 0},[]),p=g.useCallback(function(y){d(y.type,Q4(y),y.target,u(y,t.lockRef.current))},[]),m=g.useCallback(function(y){d(y.type,cp(y),y.target,u(y,t.lockRef.current))},[]);g.useEffect(function(){return uu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,lu),document.addEventListener("touchmove",c,lu),document.addEventListener("touchstart",h,lu),function(){uu=uu.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,lu),document.removeEventListener("touchmove",c,lu),document.removeEventListener("touchstart",h,lu)}},[]);var _=t.removeScrollBar,x=t.inert;return g.createElement(g.Fragment,null,x?g.createElement(i,{styles:hz(s)}):null,_?g.createElement(sz,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function gz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const vz=WH(oR,mz);var Sx=g.forwardRef(function(t,e){return g.createElement(p0,di({},t,{ref:e,sideCar:vz}))});Sx.classNames=p0.classNames;var yz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},cu=new WeakMap,dp=new WeakMap,fp={},g1=0,dR=function(t){return t&&(t.host||dR(t.parentNode))},_z=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=dR(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})},xz=function(t,e,n,r){var s=_z(e,Array.isArray(t)?t:[t]);fp[n]||(fp[n]=new WeakMap);var i=fp[n],a=[],u=new Set,c=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var _=m.getAttribute(r),x=_!==null&&_!=="false",y=(cu.get(m)||0)+1,w=(i.get(m)||0)+1;cu.set(m,y),i.set(m,w),a.push(m),y===1&&x&&dp.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",m,E)}})};return h(e),u.clear(),g1++,function(){a.forEach(function(p){var m=cu.get(p)-1,_=i.get(p)-1;cu.set(p,m),i.set(p,_),m||(dp.has(p)||p.removeAttribute(r),dp.delete(p)),_||p.removeAttribute(n)}),g1--,g1||(cu=new WeakMap,cu=new WeakMap,dp=new WeakMap,fp={})}},fR=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=yz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),xz(r,s,n,"aria-hidden")):function(){return null}},wz=Object.defineProperty,Ks=(t,e)=>wz(t,"name",{value:e,configurable:!0}),Ex="Dialog",[hR,XJ]=wi(Ex),[bz,ho]=hR(Ex),Cx=Ks(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=g.useRef(null),c=g.useRef(null),[d,h]=pa({prop:r,defaultProp:s??!1,onChange:i,caller:Ex}),[p,m]=g.useState(0),[_,x]=g.useState(0);return S.jsx(bz,{scope:e,triggerRef:u,contentRef:c,contentId:Jo(),titleId:Jo(),descriptionId:Jo(),titlePresent:p>0,descriptionPresent:_>0,setTitleCount:m,setDescriptionCount:x,open:d,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(y=>!y),[h]),modal:a,children:n})},"Dialog"),pR="DialogPortal",[Sz,mR]=hR(pR,{forceMount:void 0}),kx=Ks(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ho(pR,e);return S.jsx(Sz,{scope:e,forceMount:n,children:g.Children.map(r,a=>S.jsx(ma,{present:n||i.open,children:S.jsx(wx,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),M_="DialogOverlay",Px=g.forwardRef(Ks(function(e,n){const r=mR(M_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ho(M_,e.__scopeDialog);return a.modal?S.jsx(ma,{present:s||a.open,children:S.jsx(Cz,{...i,ref:n})}):null},"DialogOverlay")),Ez=aa("DialogOverlay.RemoveScroll"),Cz=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(M_,r),a=BT(),u=Vt(n,a);return S.jsx(Sx,{as:Ez,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(ln.div,{"data-state":Ix(i.open),...s,ref:u,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),qd="DialogContent",Tx=g.forwardRef(Ks(function(e,n){const r=mR(qd,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ho(qd,e.__scopeDialog);return S.jsx(ma,{present:s||a.open,children:a.modal?S.jsx(kz,{...i,ref:n}):S.jsx(Pz,{...i,ref:n})})},"DialogContent")),kz=g.forwardRef(Ks(function(e,n){const r=ho(qd,e.__scopeDialog),s=g.useRef(null),i=Vt(n,r.contentRef,s);return g.useEffect(()=>{const a=s.current;if(a)return fR(a)},[]),S.jsx(gR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:jt(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:jt(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&a.preventDefault()}),onFocusOutside:jt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),Pz=g.forwardRef(Ks(function(e,n){const r=ho(qd,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(gR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),gR=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...u}=e,c=ho(qd,r);return h0(),S.jsx(S.Fragment,{children:S.jsx(KT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(yx,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Ix(c.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),Tz="DialogTitle",Rx=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(Tz,r),{setTitleCount:a}=i;return Ir(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),S.jsx(ln.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),Rz="DialogDescription",Ax=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(Rz,r),{setDescriptionCount:a}=i;return Ir(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),S.jsx(ln.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Ix(t){return t?"open":"closed"}Ks(Ix,"getState");const Az=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"}))]]),Iz=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"}))]]),Mz=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"}))]]),Oz=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"}))]]),Lz=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"}))]]),Dz=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"}))]]),Nz=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"}))]]),jz=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"}))]]),Fz=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"}))]]),Vz=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"}))]]),$z=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"}))]]),Hz=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"}))]]),zz=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"}))]]),Uz=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"}))]]),Bz=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"}))]]),Wz=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"}))]]),Gz=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Wn=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...d}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:_=!1,...x}=g.useContext(Gz);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||_?"scale(-1, 1)":void 0,...x,...d},!!n&&g.createElement("title",null,n),u,c.get(i??m))});Wn.displayName="IconBase";const vR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Az}));vR.displayName="ArrowLeftIcon";const Kz=vR,yR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Iz}));yR.displayName="ArrowSquareOutIcon";const Zz=yR,_R=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Mz}));_R.displayName="ArrowUpIcon";const qz=_R,xR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Oz}));xR.displayName="CaretDownIcon";const Yz=xR,wR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Lz}));wR.displayName="ChatCircleIcon";const Xz=wR,bR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Dz}));bR.displayName="CheckIcon";const SR=bR,ER=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Nz}));ER.displayName="CircleNotchIcon";const m0=ER,CR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:jz}));CR.displayName="CopyIcon";const Yd=CR,kR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Fz}));kR.displayName="MagnifyingGlassIcon";const Qz=kR,PR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Vz}));PR.displayName="PencilSimpleIcon";const Jz=PR,TR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:$z}));TR.displayName="SidebarSimpleIcon";const eU=TR,RR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Hz}));RR.displayName="SignOutIcon";const tU=RR,AR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:zz}));AR.displayName="SparkleIcon";const v1=AR,IR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Uz}));IR.displayName="SwatchesIcon";const MR=IR,OR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Bz}));OR.displayName="TrashIcon";const nU=OR,LR=g.forwardRef((t,e)=>g.createElement(Wn,{ref:e,...t,weights:Wz}));LR.displayName="XIcon";const DR=LR;function NR(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=NR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function rU(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=NR(t))&&(r&&(r+=" "),r+=e);return r}const sU=(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},iU=(t,e)=>({classGroupId:t,validator:e}),jR=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),jm="-",ek=[],oU="arbitrary..",aU=t=>{const e=uU(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return lU(a);const u=a.split(jm),c=u[0]===""&&u.length>1?1:0;return FR(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?sU(d,c):c:d||ek}return n[a]||ek}}},FR=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=FR(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(jm):t.slice(e).join(jm),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},lU=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?oU+r:void 0})(),uU=t=>{const{theme:e,classGroups:n}=t;return cU(n,e)},cU=(t,e)=>{const n=jR();for(const r in t){const s=t[r];Mx(s,n,r,e)}return n},Mx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];dU(a,e,n,r)}},dU=(t,e,n,r)=>{if(typeof t=="string"){fU(t,e,n);return}if(typeof t=="function"){hU(t,e,n,r);return}pU(t,e,n,r)},fU=(t,e,n)=>{const r=t===""?e:VR(e,t);r.classGroupId=n},hU=(t,e,n,r)=>{if(mU(t)){Mx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(iU(n,t))},pU=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];Mx(c,VR(e,u),n,r)}},VR=(t,e)=>{let n=t;const r=e.split(jm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=jR(),n.nextPart.set(a,u)),n=u}return n},mU=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,gU=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)}}},O_="!",tk=":",vU=[],nk=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),yU=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,d;const h=s.length;for(let y=0;y<h;y++){const w=s[y];if(a===0&&u===0){if(w===tk){i.push(s.slice(c,y)),c=y+1;continue}if(w==="/"){d=y;continue}}w==="["?a++:w==="]"?a--:w==="("?u++:w===")"&&u--}const p=i.length===0?s:s.slice(c);let m=p,_=!1;p.endsWith(O_)?(m=p.slice(0,-1),_=!0):p.startsWith(O_)&&(m=p.slice(1),_=!0);const x=d&&d>c?d-c:void 0;return nk(i,_,m,x)};if(e){const s=e+tk,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):nk(vU,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},_U=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}},xU=t=>({cache:gU(t.cacheSize),parseClassName:yU(t),sortModifiers:_U(t),postfixLookupClassGroupIds:wU(t),...aU(t)}),wU=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},bU=/\s+/,SU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(bU);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:m,modifiers:_,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let E=!!w,P;if(E){const O=y.substring(0,w);P=r(O);const A=P&&a[P]?r(y):void 0;A&&A!==P&&(P=A,E=!1)}else P=r(y);if(!P){if(!E){d=p+(d.length>0?" "+d:d);continue}if(P=r(y),!P){d=p+(d.length>0?" "+d:d);continue}E=!1}const T=_.length===0?"":_.length===1?_[0]:i(_).join(":"),k=x?T+O_:T,R=k+P;if(u.indexOf(R)>-1)continue;u.push(R);const L=s(P,E);for(let O=0;O<L.length;++O){const A=L[O];u.push(k+A)}d=p+(d.length>0?" "+d:d)}return d},EU=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=$R(n))&&(s&&(s+=" "),s+=r);return s},$R=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=$R(t[r]))&&(n&&(n+=" "),n+=e);return n},CU=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((h,p)=>p(h),t());return n=xU(d),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const d=r(c);if(d)return d;const h=SU(c,n);return s(c,h),h};return i=a,(...c)=>i(EU(...c))},kU=[],wn=t=>{const e=n=>n[t]||kU;return e.isThemeGetter=!0,e},HR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RU=/\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$/,AU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,No=t=>PU.test(t),it=t=>!!t&&!Number.isNaN(Number(t)),si=t=>!!t&&Number.isInteger(Number(t)),y1=t=>t.endsWith("%")&&it(t.slice(0,-1)),Ni=t=>TU.test(t),UR=()=>!0,OU=t=>RU.test(t)&&!AU.test(t),Ox=()=>!1,LU=t=>IU.test(t),DU=t=>MU.test(t),NU=t=>!Me(t)&&!Le(t),jU=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)),FU=t=>ga(t,GR,Ox),Me=t=>HR.test(t),za=t=>ga(t,KR,OU),rk=t=>ga(t,GU,it),VU=t=>ga(t,qR,UR),$U=t=>ga(t,ZR,Ox),sk=t=>ga(t,BR,Ox),HU=t=>ga(t,WR,DU),hp=t=>ga(t,YR,LU),Le=t=>zR.test(t),ud=t=>Tl(t,KR),zU=t=>Tl(t,ZR),ik=t=>Tl(t,BR),UU=t=>Tl(t,GR),BU=t=>Tl(t,WR),pp=t=>Tl(t,YR,!0),WU=t=>Tl(t,qR,!0),ga=(t,e,n)=>{const r=HR.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Tl=(t,e,n=!1)=>{const r=zR.exec(t);return r?r[1]?e(r[1]):n:!1},BR=t=>t==="position"||t==="percentage",WR=t=>t==="image"||t==="url",GR=t=>t==="length"||t==="size"||t==="bg-size",KR=t=>t==="length",GU=t=>t==="number",ZR=t=>t==="family-name",qR=t=>t==="number"||t==="weight",YR=t=>t==="shadow",KU=()=>{const t=wn("color"),e=wn("font"),n=wn("text"),r=wn("font-weight"),s=wn("tracking"),i=wn("leading"),a=wn("breakpoint"),u=wn("container"),c=wn("spacing"),d=wn("radius"),h=wn("shadow"),p=wn("inset-shadow"),m=wn("text-shadow"),_=wn("drop-shadow"),x=wn("blur"),y=wn("perspective"),w=wn("aspect"),E=wn("ease"),P=wn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...k(),Le,Me],L=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],A=()=>[Le,Me,c],M=()=>[No,"full","auto",...A()],D=()=>[si,"none","subgrid",Le,Me],F=()=>["auto",{span:["full",si,Le,Me]},si,Le,Me],N=()=>[si,"auto",Le,Me],W=()=>["auto","min","max","fr",Le,Me],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],K=()=>[No,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[No,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[No,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],H=()=>[t,Le,Me],j=()=>[...k(),ik,sk,{position:[Le,Me]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",UU,FU,{size:[Le,Me]}],ie=()=>[y1,ud,za],ae=()=>["","none","full",d,Le,Me],ue=()=>["",it,ud,za],Se=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[it,y1,ik,sk],ye=()=>["","none",x,Le,Me],be=()=>["none",it,Le,Me],je=()=>["none",it,Le,Me],Te=()=>[it,Le,Me],We=()=>[No,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ni],breakpoint:[Ni],color:[UR],container:[Ni],"drop-shadow":[Ni],ease:["in","out","in-out"],font:[NU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ni],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ni],shadow:[Ni],spacing:["px",it],text:[Ni],"text-shadow":[Ni],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",No,Me,Le,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Le,Me]}],"container-named":[jU],columns:[{columns:[it,Me,Le,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[si,"auto",Le,Me]}],basis:[{basis:[No,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,No,"auto","initial","none",Me]}],grow:[{grow:["",it,Le,Me]}],shrink:[{shrink:["",it,Le,Me]}],order:[{order:[si,"first","last","none",Le,Me]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"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:K()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,ud,za]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,WU,VU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",y1,Me]}],"font-family":[{font:[zU,$U,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,Le,Me]}],"line-clamp":[{"line-clamp":[it,"none",Le,rk]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Le,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,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:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",Le,za]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[it,"auto",Le,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:[si,Le,Me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,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",Le,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:j()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},si,Le,Me],radial:["",Le,Me],conic:[si,Le,Me]},BU,HU]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"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:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"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:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,Le,Me]}],"outline-w":[{outline:["",it,ud,za]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,pp,hp]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,pp,hp]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[it,za]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",m,pp,hp]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[it,Le,Me]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"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":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"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":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"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":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"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":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"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":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"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":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Le,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"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:j()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Me]}],filter:[{filter:["","none",Le,Me]}],blur:[{blur:ye()}],brightness:[{brightness:[it,Le,Me]}],contrast:[{contrast:[it,Le,Me]}],"drop-shadow":[{"drop-shadow":["","none",_,pp,hp]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",it,Le,Me]}],"hue-rotate":[{"hue-rotate":[it,Le,Me]}],invert:[{invert:["",it,Le,Me]}],saturate:[{saturate:[it,Le,Me]}],sepia:[{sepia:["",it,Le,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Me]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[it,Le,Me]}],"backdrop-contrast":[{"backdrop-contrast":[it,Le,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,Le,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,Le,Me]}],"backdrop-invert":[{"backdrop-invert":["",it,Le,Me]}],"backdrop-opacity":[{"backdrop-opacity":[it,Le,Me]}],"backdrop-saturate":[{"backdrop-saturate":[it,Le,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",it,Le,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",Le,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",Le,Me]}],ease:[{ease:["linear","initial",E,Le,Me]}],delay:[{delay:[it,Le,Me]}],animate:[{animate:["none",P,Le,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Le,Me]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[Le,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"translate-none":["translate-none"],zoom:[{zoom:[si,Le,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",Le,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",Le,Me]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[it,ud,za,rk]}],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"]}},ZU=CU(KU);function pr(...t){return ZU(rU(t))}const Xd={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},ok=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function XR(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=ok[Math.abs(e)%ok.length];return{color:n,backgroundColor:`${n}22`}}function QR(t,e={}){const{axis:n="y"}=e,r=g.useRef(new Map),[s,i]=g.useState(null),[a,u]=g.useState([]),c=g.useRef([]),d=g.useRef(0),h=g.useRef(null),p=g.useRef(null),m=g.useCallback(()=>{if(!t.current)return;const P=[];r.current.forEach((T,k)=>{P[k]={top:T.offsetTop,height:T.offsetHeight,left:T.offsetLeft,width:T.offsetWidth}}),c.current=P,u(P)},[t]),_=g.useCallback((E,P)=>{P?r.current.set(E,P):r.current.delete(E),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),x=g.useCallback(E=>{const P=E.clientX,T=E.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const k=t.current;if(!k)return;const R=k.getBoundingClientRect(),L=n==="x"?P:T;let O=null,A=1/0,M=null;const D=c.current,F=n==="x"?k.scrollLeft:k.scrollTop,N=n==="x"?k.clientLeft:k.clientTop,W=n==="x"?R.left:R.top,Y=n==="x"?k.offsetWidth:k.offsetHeight,q=n==="x"?R.width:R.height,B=Y>0?q/Y:1;for(let K=0;K<D.length;K++){const $=D[K];if(!$)continue;const J=n==="x"?$.left:$.top,H=W+(N+J-F)*B,j=(n==="x"?$.width:$.height)*B,X=H+j;L>=H&&L<=X&&(M=K);const te=H+j/2,ie=Math.abs(L-te);ie<A&&(A=ie,O=K)}i(M??O)})},[n,t]),y=g.useCallback(()=>{d.current+=1,m()},[m]),w=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:d,handlers:{onMouseMove:x,onMouseEnter:y,onMouseLeave:w},registerItem:_,measureItems:m}}function qU(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const JR=(t,e)=>`style:${t}:${e}`,e5=t=>`text:${t}`,t5=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"]},n5=t=>t5(t)[0],mp=(t,e)=>t5(t).includes(e),YU=t=>{const e=n5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${JR(e,t.property)}${n}`:`${e5(e)}${n}`},Fn=[];for(let t=0;t<256;++t)Fn.push((t+256).toString(16).slice(1));function XU(t,e=0){return(Fn[t[e+0]]+Fn[t[e+1]]+Fn[t[e+2]]+Fn[t[e+3]]+"-"+Fn[t[e+4]]+Fn[t[e+5]]+"-"+Fn[t[e+6]]+Fn[t[e+7]]+"-"+Fn[t[e+8]]+Fn[t[e+9]]+"-"+Fn[t[e+10]]+Fn[t[e+11]]+Fn[t[e+12]]+Fn[t[e+13]]+Fn[t[e+14]]+Fn[t[e+15]]).toLowerCase()}const QU=new Uint8Array(16);function JU(){return crypto.getRandomValues(QU)}function ak(t,e,n){return crypto.randomUUID?crypto.randomUUID():eB(t)}function eB(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??JU();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,XU(r)}const tB=300;class nB{constructor(){Do(this,"history",{current:new Map,past:[],future:[]});Do(this,"pendingChanges",new Map);Do(this,"currentBatchId",null);Do(this,"debounceTimer",null);Do(this,"onChangeCallbacks",[]);Do(this,"stateBeforePending",null);Do(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=ak(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=n5(e.elementId),r=e.type==="style"?JR(n,e.property):e5(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=YU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},tB),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"&&mp(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"&&mp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>mp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>mp(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=ak(),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 Fm={kind:"base"};function Qd(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function rB(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const sB={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}},r5=Object.fromEntries(Object.entries(sB).map(([t,e])=>[t,{isEnabled:e.default}]));st("view");const s5=st(!0),i5=st(null),iB=st("chat"),o5=st(0),a5=st({name:null,email:null}),lk=st(Fm);st(null);const Jd=new Map,oB=t=>{const e=Qd(t);let n=Jd.get(e);return n||(n=new nB,Jd.set(e,n)),n};st(t=>oB(t(lk)),(t,e,n)=>{Jd.set(Qd(t(lk)),n)});const aB=t=>{for(const e of[...Jd.keys()])e==="base"||t.has(e)||Jd.delete(e)},ef=st(new Map),uk=st(null);st(null);const L_=st(0),Vm=st(null),D_=st(!1),N_=st(null),l5=st(!1),u5=st(!1),j_=st(null),F_=st(null),tf=st(null),Lx=st(null),lo=st(null),Tf=st({active:!1}),c5=st([]),ck=st(null),lB=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&rB(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},uB=st(null,(t,e,n)=>{const r=c=>{const d=c??Fm;return d.kind==="variant"&&!n.has(Qd(d))},s=t(ef);let i=null;for(const[c,d]of s)r(d.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const d of i)c.delete(d);e(ef,c)}const a=t(uk);a&&r(a.target)&&(e(uk,null),e(hB,!1));const u=t(ck);u&&(i!=null&&i.has(u.commentId))&&e(ck,null),aB(n)}),V_=st(r5),cB=st(!1),d5=st(null),Rf=st(!0),fc=st(!1),f5=st(!1),h5=st(!1),p5=st(null),dB=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},g0=st(dB()),fB=st(null),hB=st(!1);st(0);st(0);var $p={exports:{}},pB=$p.exports,dk;function mB(){return dk||(dk=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(pB,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(y,w){var E=y[w];if(typeof E.bind=="function")return E.bind(y);try{return Function.prototype.bind.call(E,y)}catch{return function(){return Function.prototype.apply.apply(E,[y,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 d(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?c:console[y]!==void 0?u(console,y):console.log!==void 0?u(console,"log"):e}function h(){for(var y=this.getLevel(),w=0;w<s.length;w++){var E=s[w];this[E]=w<y?e:this.methodFactory(E,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function p(y){return function(){typeof console!==n&&(h.call(this),this[y].apply(this,arguments))}}function m(y,w,E){return d(y)||p.apply(this,arguments)}function _(y,w){var E=this,P,T,k,R="loglevel";typeof y=="string"?R+=":"+y:typeof y=="symbol"&&(R=void 0);function L(F){var N=(s[F]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=N;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+N+";"}catch{}}}function O(){var F;if(!(typeof window===n||!R)){try{F=window.localStorage[R]}catch{}if(typeof F===n)try{var N=window.document.cookie,W=encodeURIComponent(R),Y=N.indexOf(W+"=");Y!==-1&&(F=/^([^;]+)/.exec(N.slice(Y+W.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 M(F){var N=F;if(typeof N=="string"&&E.levels[N.toUpperCase()]!==void 0&&(N=E.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=E.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+F)}E.name=y,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=w||m,E.getLevel=function(){return k??T??P},E.setLevel=function(F,N){return k=M(F),N!==!1&&L(k),h.call(E)},E.setDefaultLevel=function(F){T=M(F),O()||E.setLevel(F,!1)},E.resetLevel=function(){k=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&&(P=M(a.getLevel())),h.call(E),a===E)for(var F in i)i[F].rebuild()},P=M(a?a.getLevel():"WARN");var D=O();D!=null&&(k=M(D)),h.call(E)}a=new _,a.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var E=i[w];return E||(E=i[w]=new _(w,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})})($p)),$p.exports}var gB=mB();const Hs=n0(gB),vB="INFO",yB=vB.toUpperCase();Hs.setLevel(Hs.levels[yB]||Hs.levels.INFO);const ks=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Hs.trace(`${e}${n}`,...r),debug:(n,...r)=>Hs.debug(`${e}${n}`,...r),info:(n,...r)=>Hs.info(`${e}${n}`,...r),warn:(n,...r)=>Hs.warn(`${e}${n}`,...r),error:(n,...r)=>{Hs.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}:{}};Ee.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Hs.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Hs.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Hs.debug(`${e}Mount: ${n}`,...r)}};let Hp=0;const _B=()=>{Hp+=1;let t=!1;return()=>{t||(t=!0,Hp=Math.max(0,Hp-1))}},xB=()=>Hp>0;function wB(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const bB=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Dx=({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:bB.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),SB=["top","right","bottom","left"],la=Math.min,io=Math.max,$m=Math.round,gp=Math.floor,oo=t=>({x:t,y:t}),EB={left:"right",right:"left",bottom:"top",top:"bottom"};function m5(t,e,n){return io(t,la(e,n))}function uo(t,e){return typeof t=="function"?t(e):t}function ua(t){return t.split("-")[0]}function hc(t){return t.split("-")[1]}function Nx(t){return t==="x"?"y":"x"}function jx(t){return t==="y"?"height":"width"}function pi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Fx(t){return Nx(pi(t))}function CB(t,e,n){n===void 0&&(n=!1);const r=hc(t),s=Fx(t),i=jx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Hm(a)),[a,Hm(a)]}function kB(t){const e=Hm(t);return[$_(t),e,$_(e)]}function $_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fk=["left","right"],hk=["right","left"],PB=["top","bottom"],TB=["bottom","top"];function RB(t,e,n){switch(t){case"top":case"bottom":return n?e?hk:fk:e?fk:hk;case"left":case"right":return e?PB:TB;default:return[]}}function AB(t,e,n,r){const s=hc(t);let i=RB(ua(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map($_)))),i}function Hm(t){const e=ua(t);return EB[e]+t.slice(e.length)}function IB(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 g5(t){return typeof t!="number"?IB(t):{top:t,right:t,bottom:t,left:t}}function zm(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 pk(t,e,n){let{reference:r,floating:s}=t;const i=pi(e),a=Fx(e),u=jx(a),c=ua(e),d=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[u]/2-s[u]/2;let _;switch(c){case"top":_={x:h,y:r.y-s.height};break;case"bottom":_={x:h,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:p};break;case"left":_={x:r.x-s.width,y:p};break;default:_={x:r.x,y:r.y}}const x=hc(e);return x&&(_[a]+=m*(x==="end"?1:-1)*(n&&d?-1:1)),_}async function MB(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:_=0}=uo(e,t),x=g5(_),w=u[m?p==="floating"?"reference":"floating":p],E=zm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),P=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),k=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},R=zm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:T,strategy:c}):P);return{top:(E.top-R.top+x.top)/k.y,bottom:(R.bottom-E.bottom+x.bottom)/k.y,left:(E.left-R.left+x.left)/k.x,right:(R.right-E.right+x.right)/k.x}}const OB=50,LB=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:MB},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=pk(d,r,c),m=r,_=0;const x={};for(let y=0;y<i.length;y++){const w=i[y];if(!w)continue;const{name:E,fn:P}=w,{x:T,y:k,data:R,reset:L}=await P({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:d,platform:u,elements:{reference:t,floating:e}});h=T??h,p=k??p,x[E]={...x[E],...R},L&&_<OB&&(_++,typeof L=="object"&&(L.placement&&(m=L.placement),L.rects&&(d=L.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):L.rects),{x:h,y:p}=pk(d,m,c)),y=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:x}},DB=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:d,padding:h=0}=uo(t,e)||{};if(d==null)return{};const p=g5(h),m={x:n,y:r},_=Fx(s),x=jx(_),y=await a.getDimensions(d),w=_==="y",E=w?"top":"left",P=w?"bottom":"right",T=w?"clientHeight":"clientWidth",k=i.reference[x]+i.reference[_]-m[_]-i.floating[x],R=m[_]-i.reference[_],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=L?L[T]:0;(!O||!await(a.isElement==null?void 0:a.isElement(L)))&&(O=u.floating[T]||i.floating[x]);const A=k/2-R/2,M=O/2-y[x]/2-1,D=la(p[E],M),F=la(p[P],M),N=O-y[x]-F,W=O/2-y[x]/2+A,Y=m5(D,W,N),q=!c.arrow&&hc(s)!=null&&W!==Y&&i.reference[x]/2-(W<D?D:F)-y[x]/2<0,B=q?W<D?W-D:W-N:0;return{[_]:m[_]+B,data:{[_]:Y,centerOffset:W-Y-B,...q&&{alignmentOffset:B}},reset:q}}}),NB=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:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...w}=uo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=ua(s),P=pi(u),T=ua(u)===u,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=m||(T||!y?[Hm(u)]:kB(u)),L=x!=="none";!m&&L&&R.push(...AB(u,y,x,k));const O=[u,...R],A=await c.detectOverflow(e,w),M=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(A[E]),p){const Y=CB(s,a,k);M.push(A[Y[0]],A[Y[1]])}if(D=[...D,{placement:s,overflows:M}],!M.every(Y=>Y<=0)){var F,N;const Y=(((F=i.flip)==null?void 0:F.index)||0)+1,q=O[Y];if(q&&(!(p==="alignment"?P!==pi(q):!1)||D.every($=>pi($.placement)===P?$.overflows[0]>0:!0)))return{data:{index:Y,overflows:D},reset:{placement:q}};let B=(N=D.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!B)switch(_){case"bestFit":{var W;const K=(W=D.filter($=>{if(L){const J=pi($.placement);return J===P||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,H)=>J+H,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:W[0];K&&(B=K);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function mk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function gk(t){return SB.some(e=>t[e]>=0)}const jB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=uo(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=mk(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:gk(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=mk(a,n.floating);return{data:{escapedOffsets:u,escaped:gk(u)}}}default:return{}}}}},v5=new Set(["left","top"]);async function FB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=ua(n),u=hc(n),c=pi(n)==="y",d=v5.has(a)?-1:1,h=i&&c?-1:1,p=uo(e,t);let{mainAxis:m,crossAxis:_,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"&&(_=u==="end"?x*-1:x),c?{x:_*h,y:m*d}:{x:m*d,y:_*h}}const VB=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 FB(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}}}}},$B=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:P=>{let{x:T,y:k}=P;return{x:T,y:k}}},...d}=uo(t,e),h={x:n,y:r},p=await i.detectOverflow(e,d),m=pi(s),_=Nx(m);let x=h[_],y=h[m];const w=(P,T)=>m5(T+p[P==="y"?"top":"left"],T,T-p[P==="y"?"bottom":"right"]);a&&(x=w(_,x)),u&&(y=w(m,y));const E=c.fn({...e,[_]:x,[m]:y});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[_]:a,[m]:u}}}}}},HB=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:d=0,mainAxis:h=!0,crossAxis:p=!0}=uo(t,e),m={x:s,y:i},_=pi(a),x=Nx(_);let y=m[x],w=m[_];const E=uo(d,e),P=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",L=u.reference[x]-u.floating[R]+P.mainAxis,O=u.reference[x]+u.reference[R]-P.mainAxis;y<L?y=L:y>O&&(y=O)}if(p){var T,k;const R=x==="y"?"width":"height",L=v5.has(ua(a)),O=u.reference[_]-u.floating[R]+(L&&((T=c.offset)==null?void 0:T[_])||0)+(L?0:P.crossAxis),A=u.reference[_]+u.reference[R]+(L?0:((k=c.offset)==null?void 0:k[_])||0)-(L?P.crossAxis:0);w<O?w=O:w>A&&(w=A)}return{[x]:y,[_]:w}}}},zB=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}=uo(t,e),c=await s.detectOverflow(e,u),d=ua(n),h=hc(n),p=pi(n)==="y",{width:m,height:_}=r.floating;let x,y;d==="top"||d==="bottom"?(x=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,x=h==="end"?"top":"bottom");const w=_-c.top-c.bottom,E=m-c.left-c.right,P=la(_-c[x],w),T=la(m-c[y],E),k=e.middlewareData.shift,R=!k;let L=P,O=T;k!=null&&k.enabled.x&&(O=E),k!=null&&k.enabled.y&&(L=w),R&&!h&&(p?O=m-2*io(c.left,c.right):L=_-2*io(c.top,c.bottom)),await a({...e,availableWidth:O,availableHeight:L});const A=await s.getDimensions(i.floating);return m!==A.width||_!==A.height?{reset:{rects:!0}}:{}}}};function v0(){return typeof window<"u"}function pc(t){return y5(t)?(t.nodeName||"").toLowerCase():"#document"}function Mr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function po(t){var e;return(e=(y5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function y5(t){return v0()?t instanceof Node||t instanceof Mr(t).Node:!1}function yi(t){return v0()?t instanceof Element||t instanceof Mr(t).Element:!1}function va(t){return v0()?t instanceof HTMLElement||t instanceof Mr(t).HTMLElement:!1}function vk(t){return!v0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Mr(t).ShadowRoot}function y0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=_i(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function UB(t){return/^(table|td|th)$/.test(pc(t))}function _0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BB=/transform|translate|scale|rotate|perspective|filter/,WB=/paint|layout|strict|content/,Ua=t=>!!t&&t!=="none";let _1;function Vx(t){const e=yi(t)?_i(t):t;return Ua(e.transform)||Ua(e.translate)||Ua(e.scale)||Ua(e.rotate)||Ua(e.perspective)||!$x()&&(Ua(e.backdropFilter)||Ua(e.filter))||BB.test(e.willChange||"")||WB.test(e.contain||"")}function GB(t){let e=kl(t);for(;va(e)&&!nf(e);){if(Vx(e))return e;if(_0(e))return null;e=kl(e)}return null}function $x(){return _1==null&&(_1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_1}function nf(t){return/^(html|body|#document)$/.test(pc(t))}function _i(t){return Mr(t).getComputedStyle(t)}function x0(t){return yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function kl(t){if(pc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vk(t)&&t.host||po(t);return vk(e)?e.host:e}function _5(t){const e=kl(t);return nf(e)?(t.ownerDocument||t).body:va(e)&&y0(e)?e:_5(e)}function rf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=_5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Mr(s);if(i){const u=H_(a);return e.concat(a,a.visualViewport||[],y0(s)?s:[],u&&n?rf(u):[])}else return e.concat(s,rf(s,[],n))}function H_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function x5(t){const e=_i(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=va(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=$m(n)!==i||$m(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function Hx(t){return yi(t)?t:t.contextElement}function Ru(t){const e=Hx(t);if(!va(e))return oo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=x5(e);let a=(i?$m(n.width):n.width)/r,u=(i?$m(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const KB=oo(0);function w5(t){const e=Mr(t);return!$x()||!e.visualViewport?KB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ZB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Mr(t)}function Pl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Hx(t);let a=oo(1);e&&(r?yi(r)&&(a=Ru(r)):a=Ru(t));const u=ZB(i,n,r)?w5(i):oo(0);let c=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Mr(i),_=yi(r)?Mr(r):r;let x=m,y=H_(x);for(;y&&_!==x;){const w=Ru(y),E=y.getBoundingClientRect(),P=_i(y),T=E.left+(y.clientLeft+parseFloat(P.paddingLeft))*w.x,k=E.top+(y.clientTop+parseFloat(P.paddingTop))*w.y;c*=w.x,d*=w.y,h*=w.x,p*=w.y,c+=T,d+=k,x=Mr(y),y=H_(x)}}return zm({width:h,height:p,x:c,y:d})}function w0(t,e){const n=x0(t).scrollLeft;return e?e.left+n:Pl(po(t)).left+n}function b5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-w0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function qB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=po(r),u=e?_0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},d=oo(1);const h=oo(0),p=va(r);if((p||!i)&&((pc(r)!=="body"||y0(a))&&(c=x0(r)),p)){const _=Pl(r);d=Ru(r),h.x=_.x+r.clientLeft,h.y=_.y+r.clientTop}const m=a&&!p&&!i?b5(a,c):oo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-c.scrollTop*d.y+h.y+m.y}}function YB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function XB(t){const e=x0(t),n=t.ownerDocument.body,r=io(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=io(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+w0(t);const a=-e.scrollTop;return _i(n).direction==="rtl"&&(i+=io(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const QB=25;function JB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Mr(t),i=po(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,d=0,h=0;if(a){const m=!$x()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(w0(i)<=0){const m=i.ownerDocument,_=m.body,x=getComputedStyle(_),y=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-_.clientWidth-y),E=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;E<=QB&&(u-=E)}return{width:u,height:c,x:d,y:h}}function eW(t,e){const n=Pl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Ru(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:u,x:c,y:d}}function yk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=JB(t,n,e);else if(e==="document")r=XB(po(t));else if(yi(e))r=eW(e,n);else{const s=w5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return zm(r)}function tW(t,e){const n=e.get(t);if(n)return n;let r=rf(t,[],!1).filter(u=>yi(u)&&pc(u)!=="body"),s=null;const i=_i(t).position==="fixed";let a=i?kl(t):t;for(;yi(a)&&!nf(a);){const u=_i(a),c=Vx(a),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=kl(a)}return e.set(t,r),r}function nW(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?_0(e)?[]:tW(e,this._c):[].concat(n),r],u=yk(e,a[0],s);let c=u.top,d=u.right,h=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const _=yk(e,a[m],s);c=io(_.top,c),d=la(_.right,d),h=la(_.bottom,h),p=io(_.left,p)}return{width:d-p,height:h-c,x:p,y:c}}function rW(t){const{width:e,height:n}=x5(t);return{width:e,height:n}}function sW(t,e,n){const r=va(e),s=po(e),i=n==="fixed",a=Pl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=oo(0);if((r||!i)&&((pc(e)!=="body"||y0(s))&&(u=x0(e)),r)){const m=Pl(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=w0(s));const d=s&&!r&&!i?b5(s,u):oo(0),h=a.left+u.scrollLeft-c.x-d.x,p=a.top+u.scrollTop-c.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function x1(t){return _i(t).position==="static"}function _k(t,e){if(!va(t)||_i(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return po(t)===n&&(n=n.ownerDocument.body),n}function S5(t,e){const n=Mr(t);if(_0(t))return n;if(!va(t)){let s=kl(t);for(;s&&!nf(s);){if(yi(s)&&!x1(s))return s;s=kl(s)}return n}let r=_k(t,e);for(;r&&UB(r)&&x1(r);)r=_k(r,e);return r&&nf(r)&&x1(r)&&!Vx(r)?n:r||GB(t)||n}const iW=async function(t){const e=this.getOffsetParent||S5,n=this.getDimensions,r=await n(t.floating);return{reference:sW(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oW(t){return _i(t).direction==="rtl"}const aW={convertOffsetParentRelativeRectToViewportRelativeRect:qB,getDocumentElement:po,getClippingRect:nW,getOffsetParent:S5,getElementRects:iW,getClientRects:YB,getDimensions:rW,getScale:Ru,isElement:yi,isRTL:oW};function E5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function lW(t,e,n){let r=null,s;const i=po(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 m=t.getBoundingClientRect(),{left:_,top:x,width:y,height:w}=m;if(h||e(),!y||!w)return;const E=gp(x),P=gp(i.clientWidth-(_+y)),T=gp(i.clientHeight-(x+w)),k=gp(_),L={rootMargin:-E+"px "+-P+"px "+-T+"px "+-k+"px",threshold:io(0,la(1,p))||1};let O=!0;function A(M){const D=M[0].intersectionRatio;if(!E5(m,t.getBoundingClientRect()))return u();if(D!==p){if(!O)return u();D?u(!1,D):s=setTimeout(()=>{u(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(A,{...L,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,L)}r.observe(t)}const c=Mr(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function uW(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,d=Hx(t),h=s||i?[...d?rf(d):[],...e?rf(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n),i&&E.addEventListener("resize",n)});const p=d&&u?lW(d,n,i):null;let m=-1,_=null;a&&(_=new ResizeObserver(E=>{let[P]=E;P&&P.target===d&&_&&e&&(_.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=_)==null||T.observe(e)})),n()}),d&&!c&&_.observe(d),e&&_.observe(e));let x,y=c?Pl(t):null;c&&w();function w(){const E=Pl(t);y&&!E5(y,E)&&n(),y=E,x=requestAnimationFrame(w)}return n(),()=>{var E;h.forEach(P=>{s&&P.removeEventListener("scroll",n),i&&P.removeEventListener("resize",n)}),p==null||p(),(E=_)==null||E.disconnect(),_=null,c&&cancelAnimationFrame(x)}}const cW=VB,dW=$B,fW=NB,hW=zB,pW=jB,xk=DB,mW=HB,gW=(t,e,n)=>{const r=new Map,s=n??{},i={...aW,...s.platform,_c:r};return LB(t,e,{...s,platform:i})};var vW=typeof document<"u",yW=function(){},zp=vW?g.useLayoutEffect:yW;function Um(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(!Um(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)&&!Um(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function C5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function wk(t,e){const n=C5(t);return Math.round(e*n)/n}function w1(t){const e=g.useRef(t);return zp(()=>{e.current=t}),e}function _W(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:d}=t,[h,p]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,_]=g.useState(r);Um(m,r)||_(r);const[x,y]=g.useState(null),[w,E]=g.useState(null),P=g.useCallback($=>{$!==L.current&&(L.current=$,y($))},[]),T=g.useCallback($=>{$!==O.current&&(O.current=$,E($))},[]),k=i||x,R=a||w,L=g.useRef(null),O=g.useRef(null),A=g.useRef(h),M=c!=null,D=w1(c),F=w1(s),N=w1(d),W=g.useCallback(()=>{if(!L.current||!O.current)return;const $={placement:e,strategy:n,middleware:m};F.current&&($.platform=F.current),gW(L.current,O.current,$).then(J=>{const H={...J,isPositioned:N.current!==!1};Y.current&&!Um(A.current,H)&&(A.current=H,f0.flushSync(()=>{p(H)}))})},[m,e,n,F,N]);zp(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[d]);const Y=g.useRef(!1);zp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),zp(()=>{if(k&&(L.current=k),R&&(O.current=R),k&&R){if(D.current)return D.current(k,R,W);W()}},[k,R,W,D,M]);const q=g.useMemo(()=>({reference:L,floating:O,setReference:P,setFloating:T}),[P,T]),B=g.useMemo(()=>({reference:k,floating:R}),[k,R]),K=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const J=wk(B.floating,h.x),H=wk(B.floating,h.y);return u?{...$,transform:"translate("+J+"px, "+H+"px)",...C5(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:H}},[n,u,B.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:W,refs:q,elements:B,floatingStyles:K}),[h,W,q,B,K])}const xW=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?xk({element:r.current,padding:s}).fn(n):{}:r?xk({element:r,padding:s}).fn(n):{}}}},wW=(t,e)=>{const n=cW(t);return{name:n.name,fn:n.fn,options:[t,e]}},bW=(t,e)=>{const n=dW(t);return{name:n.name,fn:n.fn,options:[t,e]}},SW=(t,e)=>({fn:mW(t).fn,options:[t,e]}),EW=(t,e)=>{const n=fW(t);return{name:n.name,fn:n.fn,options:[t,e]}},CW=(t,e)=>{const n=hW(t);return{name:n.name,fn:n.fn,options:[t,e]}},kW=(t,e)=>{const n=pW(t);return{name:n.name,fn:n.fn,options:[t,e]}},PW=(t,e)=>{const n=xW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var TW=Object.defineProperty,RW=(t,e)=>TW(t,"name",{value:e,configurable:!0});function zx(t){const[e,n]=g.useState(void 0);return Ir(()=>{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,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,u=d.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}RW(zx,"useSize");var AW=Object.defineProperty,ea=(t,e)=>AW(t,"name",{value:e,configurable:!0}),k5="Popper",[P5,b0]=wi(k5),[IW,T5]=P5(k5),MW=ea(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,a]=g.useState(void 0);return S.jsx(IW,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),OW="PopperAnchor",LW=g.forwardRef(ea(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=T5(OW,r),u=g.useRef(null),c=a.onAnchorChange,d=g.useCallback(y=>{u.current=y,y&&c(y)},[c]),h=Vt(n,d),p=g.useRef(null);g.useEffect(()=>{if(!s)return;const y=p.current;p.current=s.current,y!==p.current&&c(p.current)});const m=a.placementState&&S0(a.placementState),_=m==null?void 0:m[0],x=m==null?void 0:m[1];return s?null:S.jsx(ln.div,{"data-radix-popper-side":_,"data-radix-popper-align":x,...i,ref:h})},"PopperAnchor")),R5="PopperContent",[DW,QJ]=P5(R5),NW=g.forwardRef(ea(function(e,n){var se,ye,be,je,Te,We,Rt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:y,...w}=e,E=T5(R5,r),[P,T]=g.useState(null),k=Vt(n,T),[R,L]=g.useState(null),O=zx(R),A=(O==null?void 0:O.width)??0,M=(O==null?void 0:O.height)??0,D=s+(a!=="center"?"-"+a:""),F=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(h)?h:[h],W=N.length>0,Y={padding:F,boundary:N.filter(A5),altBoundary:W},{refs:q,floatingStyles:B,placement:K,isPositioned:$,middlewareData:J}=_W({strategy:"fixed",placement:D,whileElementsMounted:ea((...Ye)=>uW(...Ye,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[wW({mainAxis:i+M,alignmentAxis:u}),d&&bW({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?SW():void 0,...Y}),d&&EW({...Y}),CW({...Y,apply:ea(({elements:Ye,rects:we,availableWidth:Mt,availableHeight:Je})=>{const{width:He,height:tt}=we.reference,Ge=Ye.floating.style;Ge.setProperty("--radix-popper-available-width",`${Mt}px`),Ge.setProperty("--radix-popper-available-height",`${Je}px`),Ge.setProperty("--radix-popper-anchor-width",`${He}px`),Ge.setProperty("--radix-popper-anchor-height",`${tt}px`)},"apply")}),R&&PW({element:R,padding:c}),jW({arrowWidth:A,arrowHeight:M}),_&&kW({strategy:"referenceHidden",...Y,boundary:W?Y.boundary:void 0})]}),H=E.setPlacementState;Ir(()=>(H(K),()=>{H(void 0)}),[K,H]);const[j,X]=S0(K),te=Cl(y);Ir(()=>{$&&(te==null||te())},[$,te]);const ie=(se=J.arrow)==null?void 0:se.x,ae=(ye=J.arrow)==null?void 0:ye.y,ue=((be=J.arrow)==null?void 0:be.centerOffset)!==0,[Se,oe]=g.useState();return Ir(()=>{P&&oe(window.getComputedStyle(P).zIndex)},[P]),S.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:$?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(je=J.transformOrigin)==null?void 0:je.x,(Te=J.transformOrigin)==null?void 0:Te.y].join(" "),...((We=J.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(DW,{scope:r,placedSide:j,placedAlign:X,onArrowChange:L,arrowX:ie,arrowY:ae,shouldHideArrow:ue,children:S.jsx(ln.div,{"data-side":j,"data-align":X,...w,ref:k,style:{...w.style,animation:$?(Rt=w.style)==null?void 0:Rt.animation:"none"}})})})},"PopperContent"));function A5(t){return t!==null}ea(A5,"isNotNull");var jW=ea(t=>({name:"transformOrigin",options:t,fn(e){var w,E,P;const{placement:n,rects:r,middlewareData:s}=e,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[d,h]=S0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((E=s.arrow)==null?void 0:E.x)??0)+u/2,_=(((P=s.arrow)==null?void 0:P.y)??0)+c/2;let x="",y="";return d==="bottom"?(x=a?p:`${m}px`,y=`${-c}px`):d==="top"?(x=a?p:`${m}px`,y=`${r.floating.height+c}px`):d==="right"?(x=`${-c}px`,y=a?p:`${_}px`):d==="left"&&(x=`${r.floating.width+c}px`,y=a?p:`${_}px`),{data:{x,y}}}}),"transformOrigin");function S0(t){const[e,n="center"]=t.split("-");return[e,n]}ea(S0,"getSideAndAlignFromPlacement");var I5=MW,M5=LW,O5=NW,FW=Object.defineProperty,ya=(t,e)=>FW(t,"name",{value:e,configurable:!0}),Ux="Popover",[L5,JJ]=wi(Ux,[b0]),Bx=b0(),[VW,mc]=L5(Ux),$W=ya(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=Bx(e),c=g.useRef(null),[d,h]=g.useState(!1),[p,m]=pa({prop:r,defaultProp:s??!1,onChange:i,caller:Ux});return S.jsx(I5,{...u,children:S.jsx(VW,{scope:e,contentId:Jo(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(_=>!_),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>h(!0),[]),onCustomAnchorRemove:g.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),HW="PopoverTrigger",zW=g.forwardRef(ya(function(e,n){const{__scopePopover:r,...s}=e,i=mc(HW,r),a=Bx(r),u=Vt(n,i.triggerRef),c=S.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Wx(i.open),...s,ref:u,onClick:jt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(M5,{asChild:!0,...a,children:c})},"PopoverTrigger")),D5="PopoverPortal",[UW,BW]=L5(D5,{forceMount:void 0}),WW=ya(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=mc(D5,e);return S.jsx(UW,{scope:e,forceMount:n,children:S.jsx(ma,{present:n||i.open,children:S.jsx(wx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),sf="PopoverContent",GW=g.forwardRef(ya(function(e,n){const r=BW(sf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=mc(sf,e.__scopePopover);return S.jsx(ma,{present:s||a.open,children:a.modal?S.jsx(ZW,{...i,ref:n}):S.jsx(qW,{...i,ref:n})})},"PopoverContent")),KW=aa("PopoverContent.RemoveScroll"),ZW=g.forwardRef(ya(function(e,n){const r=mc(sf,e.__scopePopover),s=g.useRef(null),i=Vt(n,s),a=g.useRef(!1);return g.useEffect(()=>{const u=s.current;if(u)return fR(u)},[]),S.jsx(Sx,{as:KW,allowPinchZoom:!0,children:S.jsx(N5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jt(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:jt(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:jt(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),qW=g.forwardRef(ya(function(e,n){const r=mc(sf,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(N5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),N5=g.forwardRef(ya(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,_=mc(sf,r),x=Bx(r);return h0(),S.jsx(KT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(yx,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(O5,{"data-state":Wx(_.open),role:"dialog",id:_.contentId,...x,...m,ref:n,style:{...m.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)"}})})})},"PopoverContentImpl"));function Wx(t){return t?"open":"closed"}ya(Wx,"getState");var j5=$W,F5=zW,V5=WW,$5=GW;const H5=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[d,h]=g.useState(!1),p=i?a??t:t,m=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 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?S.jsxs(j5,{open:d,onOpenChange:h,children:[S.jsx(F5,{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(Yz,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(V5,{children:S.jsx($5,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(_=>{const x=_.icon;return S.jsxs("button",{onClick:()=>{_.isDisabled||(_.onClick(),h(!1))},disabled:_.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,_.label]},_.label)})})})]}):null]})};var YW=Object.defineProperty,XW=(t,e)=>YW(t,"name",{value:e,configurable:!0}),QW=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"}),JW=g.forwardRef(XW(function(e,n){return S.jsx(ln.span,{...e,ref:n,style:{...QW,...e.style}})},"VisuallyHidden")),eG=JW,tG=Object.defineProperty,Mn=(t,e)=>tG(t,"name",{value:e,configurable:!0}),[Gx,eee]=wi("Tooltip",[b0]),Kx=b0(),nG="TooltipProvider",rG=700,z_="tooltip.open",[sG,Zx]=Gx(nG),iG=Mn(t=>{const{__scopeTooltip:e,delayDuration:n=rG,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 d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(sG,{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(d=>{u.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),U_="Tooltip",[oG,Af]=Gx(U_),aG=Mn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=Zx(U_,t.__scopeTooltip),d=Kx(e),[h,p]=g.useState(null),[m,_]=g.useState(void 0),x=Jo(),y=g.useRef(0),w=a??c.disableHoverableContent,E=u??c.delayDuration,P=g.useRef(!1),[T,k]=pa({prop:r,defaultProp:s??!1,onChange:Mn(D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(z_))):c.onClose(),i==null||i(D)},"onChange"),caller:U_}),R=g.useMemo(()=>T?P.current?"delayed-open":"instant-open":"closed",[T]),L=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,P.current=!1,k(!0)},[k]),O=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),A=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{P.current=!0,k(!0),y.current=0},E)},[E,k]);g.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const M=m??x;return S.jsx(I5,{...d,children:S.jsx(oG,{scope:e,contentId:M,setContentId:_,open:T,stateAttribute:R,trigger:h,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?A():L()},[c.isOpenDelayedRef,A,L]),onTriggerLeave:g.useCallback(()=>{w?O():(window.clearTimeout(y.current),y.current=0)},[O,w]),onOpen:L,onClose:O,disableHoverableContent:w,children:n})})},"Tooltip"),bk="TooltipTrigger",lG=g.forwardRef(Mn(function(e,n){const{__scopeTooltip:r,...s}=e,i=Af(bk,r),a=Zx(bk,r),u=Kx(r),c=g.useRef(null),d=Vt(n,c,i.onTriggerChange),h=g.useRef(!1),p=g.useRef(!1),m=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(M5,{asChild:!0,...u,children:S.jsx(ln.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:jt(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:jt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:jt(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:jt(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:jt(e.onBlur,i.onClose),onClick:jt(e.onClick,i.onClose)})})},"TooltipTrigger")),z5="TooltipPortal",[uG,cG]=Gx(z5,{forceMount:void 0}),dG=Mn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Af(z5,e);return S.jsx(uG,{scope:e,forceMount:n,children:S.jsx(ma,{present:n||i.open,children:S.jsx(wx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),of="TooltipContent",fG=g.forwardRef(Mn(function(e,n){const r=cG(of,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,u=Af(of,e.__scopeTooltip);return S.jsx(ma,{present:s||u.open,children:u.disableHoverableContent?S.jsx(U5,{side:i,...a,ref:n}):S.jsx(hG,{side:i,...a,ref:n})})},"TooltipContent")),hG=g.forwardRef(Mn(function(e,n){const r=Af(of,e.__scopeTooltip),s=Zx(of,e.__scopeTooltip),i=g.useRef(null),a=Vt(n,i),[u,c]=g.useState(null),{trigger:d,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,_=g.useCallback(()=>{c(null),m(!1)},[m]),x=g.useCallback((y,w)=>{const E=y.currentTarget,P={x:y.clientX,y:y.clientY},T=B5(P,E.getBoundingClientRect()),k=W5(P,T),R=G5(w.getBoundingClientRect()),L=Z5([...k,...R]);c(L),m(!0)},[m]);return g.useEffect(()=>()=>_(),[_]),g.useEffect(()=>{if(d&&p){const y=Mn(E=>x(E,p),"handleTriggerLeave"),w=Mn(E=>x(E,d),"handleContentLeave");return d.addEventListener("pointerleave",y),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",w)}}},[d,p,x,_]),g.useEffect(()=>{if(u){const y=Mn(w=>{const E=w.target,P={x:w.clientX,y:w.clientY},T=(d==null?void 0:d.contains(E))||(p==null?void 0:p.contains(E)),k=!K5(P,u);T?_():k&&(_(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,p,u,h,_]),S.jsx(U5,{...e,ref:a})},"TooltipContentHoverable")),pG=jT("TooltipContent"),U5=g.forwardRef(Mn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,h=Af(of,r),p=Kx(r),{onClose:m}=h;g.useEffect(()=>(document.addEventListener(z_,m),()=>document.removeEventListener(z_,m)),[m]),g.useEffect(()=>{if(h.trigger){const x=Mn(y=>{y.target instanceof Node&&y.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[h.trigger,m]);const{setContentId:_}=h;return Ir(()=>(_(a),()=>{_(void 0)}),[a,_]),S.jsx(yx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:S.jsxs(O5,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...d,ref:n,style:{...d.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(pG,{children:s}),i?S.jsx(eG,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function B5(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")}}Mn(B5,"getExitSideFromRect");function W5(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}Mn(W5,"getPaddedExitPoints");function G5(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}]}Mn(G5,"getPointsFromRect");function K5(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],d=u.x,h=u.y,p=c.x,m=c.y;h>r!=m>r&&n<(p-d)*(r-h)/(m-h)+d&&(s=!s)}return s}Mn(K5,"isPointInPolygon");function Z5(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),q5(e)}Mn(Z5,"getHull");function q5(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)}Mn(q5,"getHullPresorted");var mG=iG,gG=aG,vG=lG,yG=dG,_G=fG;const Id={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},Y5={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"}},X5=g.createContext(null);function E0(){const t=g.useContext(X5);return t?t.classes:Y5.pill}function xG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function wG({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{xG(()=>r(i))},[]);return S.jsx(X5.Provider,{value:{shape:n,setShape:s,classes:Y5[n]},children:t})}const Q5=g.createContext(null);function J5({value:t,children:e}){return S.jsx(Q5.Provider,{value:t,children:e})}function bG(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function qx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,d]=g.useState(!1),h=a!==void 0?a:c,[p,m]=g.useState(!1),_=E0(),x=g.useContext(Q5);g.useEffect(()=>{h&&m(!0)},[h]);const y=()=>{h||m(!1)},w=bG(n);return S.jsx(mG,{delayDuration:s,children:S.jsxs(gG,{open:h,onOpenChange:E=>{d(E),u==null||u(E)},children:[S.jsx(vG,{asChild:!0,children:e}),p&&S.jsx(yG,{forceMount:!0,container:x??void 0,children:S.jsx(_G,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(so.div,{className:pr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",_.bg,i),style:{fontVariationSettings:Id.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:y,children:t})})})]})})}const to=({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(qx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),C0="/__rivet/preview",Sk=`${C0}/variant/`,Ek=`${C0}/history/`,eA=t=>t?t.startsWith("/")?t:`/${t}`:"/",SG=t=>`${C0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${eA(t.routePath)}`,EG=t=>`${C0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${eA(t.routePath)}`,CG=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(Sk)||e.pathname.startsWith(Ek)}catch{return t.startsWith(Sk)||t.startsWith(Ek)}},Ck=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")?SG({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},kk="/rivet/",tA=t=>{if(!t.startsWith(kk))return null;const e=t.slice(kk.length);return!e||e==="/"?null:`/${e}`},af=(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(()=>{})},kG=(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),af(r,e))}},Bm=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},Pk=6,B_="original",Yx="Original",Xx="The original state of your app before any variants were generated.",Tk=200,hn=ks("AgentVariantsPanel"),b1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},PG=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,du=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},TG=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Au(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function ji(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 RG=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},tl=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")},nA=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},rA=t=>t.status==="succeeded"&&!tl(t)&&(!t.previewUnavailable||nA(t)),S1=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"},Rk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},AG=t=>{var e;return RG(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},Ak=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),IG=(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}),MG=()=>{var Sa,$r,Hf,vr;const t=Qe(Tf),e=Qe(c5),n=Qe(d5),r=Qe(Rf),s=Qe(V_),i=((Sa=s.deployPrototype)==null?void 0:Sa.isEnabled)??!1,a=(($r=s.canvasShare)==null?void 0:$r.isEnabled)??!1,u=((Hf=s.variantSend)==null?void 0:Hf.isEnabled)??!1,c=((vr=s.designContextViewer)==null?void 0:vr.isEnabled)??!1,d=Qe(h5),h=Qe(p5),p=at(L_),m=at(Vm),_=at(D_),x=at(N_),y=at(l5),w=at(u5),E=at(tf),P=at(Lx),T=at(i5);g.useEffect(()=>(T("Directions"),()=>T(null)),[T]);const k=Qe(lo),R=Qe(fc),L=at(lo),O=g.useCallback((z=!1)=>{if(kG(k),L(null),z&&k&&!R){const le=Bm("ended",k);Ee.capture(le.event,le.properties)}},[R,L,k]),A=Qe(j_),M=at(j_),D=Qe(F_),F=at(F_),N=D?`${D.sessionId}:${D.variantId}`:null,[W,Y]=g.useState(""),[q,B]=g.useState(null),[K,$]=g.useState(null),[J,H]=g.useState({}),[j,X]=g.useState(null),[te,ie]=g.useState({}),[ae,ue]=g.useState(null),[Se,oe]=g.useState([]),se=g.useRef([]);se.current=Se;const[ye,be]=g.useState(!1),je=g.useRef(!1);je.current=D!==null||A!==null||ye;const Te=g.useMemo(()=>t.active?t.variants:[],[t]),We=g.useMemo(()=>Te.filter(AG),[Te]),Rt=g.useMemo(()=>Ak(We,J),[We,J]),Ye=(j==null?void 0:j.key)===Rt?j.shareUrl:null,we=t.active?t.sessionId:null,Mt=g.useMemo(()=>{const z=new Set;for(const le of Te)le.adoptedSource&&z.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return z},[Te]),Je=g.useMemo(()=>[...Se.filter(le=>le.sessionId!==we&&!Mt.has(`${le.sessionId}:${le.variantId}`))].sort((le,Ae)=>{const he=new Date(le.createdAt).getTime(),pe=new Date(Ae.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(he)?0:he)}),[Mt,Se,we]),He=g.useMemo(()=>D?Te.find(z=>{var le,Ae;return((le=z.adoptedSource)==null?void 0:le.sessionId)===D.sessionId&&((Ae=z.adoptedSource)==null?void 0:Ae.variantId)===D.variantId})??null:null,[D,Te]),tt=g.useMemo(()=>D?Je.find(z=>z.sessionId===D.sessionId&&z.variantId===D.variantId)??null:null,[D,Je]),Ge=t.active?t.projectContext:null,ct=(Ge==null?void 0:Ge.kind)==="fresh"?Ge.workspacePath:n,vn=!t.active&&Je.length>0&&Je.every(z=>z.projectKind==="fresh"),Sn=t.active?TG(Ge):!!n&&!vn,St=g.useMemo(()=>ct?`?projectPath=${encodeURIComponent(ct)}`:"",[ct]),rr=g.useRef(null),En=g.useRef(null),is=typeof window>"u"?"/":tA(window.location.pathname)??"/",rn=g.useRef(null),mr=g.useRef(!1),Zs=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),b1(),rn.current={kind:"live",variantId:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]),Al=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),b1(),rn.current={kind:"past",entry:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]);g.useEffect(()=>{const z=he=>{const pe=rn.current;if(!pe)return;const ke=he.clientX-pe.startX,Ke=he.clientY-pe.startY;if(!pe.committed){if(ke*ke+Ke*Ke<Pk*Pk)return;if(b1(),pe.kind==="live"){const Pe=Te.find(Kn=>Kn.workItemId===pe.variantId);if(!Pe||Pe.status!=="succeeded"){rn.current=null;return}const sr=Ck({sessionId:we,variant:Pe,projectContext:Ge,routePath:is});E({sessionId:we??"",variantId:Pe.workItemId,label:Pe.label||"Direction",url:sr,source:"live",runLabel:Pe.runLabel,description:Pe.description})}else{const{entry:Pe}=pe,sr=du(Pe),Kn=sr?EG({sessionId:Pe.sessionId,variantId:Pe.variantId,routePath:is}):`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/preview${St}`;if(E({sessionId:Pe.sessionId,variantId:Pe.variantId,label:Pe.label||"Direction",url:Kn,source:sr?"history-dev-server":"history-static",runLabel:Pe.runLabel,description:Pe.brief}),sr){const As=Rk(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/run${St}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(As,{method:"POST"})).ok)return;const yr=Rk(Kn,"replay",String(Date.now()));E(Dn=>!Dn||Dn.sessionId!==Pe.sessionId||Dn.variantId!==Pe.variantId||Dn.source!=="history-dev-server"?Dn:{...Dn,url:yr}),L(Dn=>{if(!Dn)return Dn;const us=lt=>!lt||lt.sessionId!==Pe.sessionId||lt.variantId!==Pe.variantId?lt:{...lt,url:yr};return{...Dn,left:us(Dn.left),right:us(Dn.right)}})}catch(ls){hn.warn("history replay drag boot failed",ls)}})()}}pe.committed=!0}P({x:he.clientX,y:he.clientY})},le=()=>{const he=rn.current;he!=null&&he.committed&&(mr.current=!0),rn.current=null,P(null)},Ae=he=>{if(he.key!=="Escape")return;const pe=rn.current;pe!=null&&pe.committed&&(pe.kind==="past"&&du(pe.entry)&&af({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),rn.current=null,E(null),P(null))};return window.addEventListener("pointermove",z),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",Ae),()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",Ae)}},[Te,we,Ge,is,St,E,P,L]);const Ln=g.useMemo(()=>{var le;if(ye||N)return null;const z=A?Te.find(Ae=>Ae.workItemId===A):null;return A&&!z?null:z?tl(z)?z.workItemId:null:t.active?((le=Te.find(Ae=>{var he,pe;return tl(Ae)&&(((he=Ae.preview)==null?void 0:he.kind)==="static_artifact"||((pe=Ae.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[A,N,ye,t,Te]),Si=g.useCallback(async z=>{var Ae,he,pe,ke;if(!we)return;const le=(z==null?void 0:z.workItemId)??null;B({kind:"switch",variantId:le??void 0});try{if(((Ae=z==null?void 0:z.preview)==null?void 0:Ae.kind)==="static_artifact"){if(_(!1),x(null),((he=z.refinement)==null?void 0:he.status)==="succeeded"){const Pe=z.preview.url.includes("?")?"&":"?";m(`${z.preview.url}${Pe}refinement=${encodeURIComponent(z.refinement.workItemId)}`)}else m(z.preview.url);p(Pe=>Pe+1);return}if(le&&we&&t.active&&t.projectContext.kind==="fresh"&&((pe=t.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((ke=z==null?void 0:z.preview)==null?void 0:ke.kind)!=="dev_server"){_(!1),x(null),m(`/api/variants/${we}/static/${le}`),p(Pe=>Pe+1);return}const Ke=z&&le?Ck({sessionId:we,variant:z,projectContext:t.active?t.projectContext:null,routePath:is}):null;if(Ke){_(!1),x(null),m(Ke),p(Pe=>Pe+1);return}Ee.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:le,previewKind:z?S1(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),x(null)}catch(Ke){hn.warn("preview display failed",Ke),Ee.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:le,previewKind:z?S1(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:Ke instanceof Error?Ke.message:String(Ke)}),_(!1),x(null)}finally{B(null)}},[we,t,is,p,m,_,x]),Ps=g.useRef(!1),qs=g.useRef(null),os=g.useRef(0),yn=g.useCallback(()=>{if(os.current++,y(!1),w(!1),!Ps.current)return;const z=qs.current;Ps.current=!1,qs.current=null;const le=z?new URLSearchParams({sessionId:z.sessionId,variantId:z.variantId}):null,Ae=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(Ae,{method:"POST"}).catch(he=>hn.warn("history replay stop failed",he))},[y,w]),mo=g.useCallback(async z=>{if(we){B({kind:"switch",variantId:z.workItemId});try{const le=await fetch(`/api/variants/${we}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!le.ok){const Ae=await ji(le);throw new Error(Ae.message??`Preview restoration failed (${le.status})`)}}catch(le){hn.warn("preview restoration failed",le),Ee.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:z.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{B(null)}}},[we]),Fr=g.useCallback(z=>{var ke,Ke,Pe,sr,Kn;if(mr.current){mr.current=!1;return}const le=tl(z),Ae=z.status==="pending"||z.status==="running"||rA(z);if(!le&&!Ae)return;yn();const he=S1(z),pe=Te.find(As=>As.workItemId===A);Ee.capture("variants_panel.preview_requested",{sessionId:we,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:z.workItemId,variantStatus:z.status,isPreviewReady:le,isArmed:Ae,previewKind:he,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((Ke=(ke=z.actions)==null?void 0:ke.view)==null?void 0:Ke.enabled)??null,previewUnavailableReason:((Pe=z.previewUnavailable)==null?void 0:Pe.reason)??null}),M(z.workItemId),F(null),le?(En.current=z.workItemId,be(!1),O(!0),Si(z)):(En.current=null,be(!1),m(null),_(!1),Ee.capture("variants_panel.preview_armed",{sessionId:we,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:z.workItemId,variantStatus:z.status,previewKind:he,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((Kn=(sr=z.actions)==null?void 0:sr.view)==null?void 0:Kn.enabled)??null}),nA(z)&&mo(z)),Ee.capture("variants_panel.preview_switched",{sessionId:we,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:z.workItemId,armed:Ae})},[A,we,O,M,F,yn,mo,Si,Te,m,_]),as=t.active?`${t.sessionId}:${t.stage}`:"inactive",Ei=g.useRef(!1);g.useEffect(()=>{if(r)return;let z=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${St}`,{credentials:"same-origin"});if(!le.ok)return;const Ae=await le.json();if(z)return;const he=(Ae.variants??[]).filter(pe=>{var ke,Ke;return((ke=pe.preview)==null?void 0:ke.kind)==="static"||((Ke=pe.serve)==null?void 0:Ke.kind)==="static"||du(pe)});if(!Ei.current&&!je.current&&as==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((ke,Ke)=>new Date(Ke.createdAt).getTime()-new Date(ke.createdAt).getTime()).find(ke=>!du(ke));pe&&(Ei.current=!0,F({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static"}),be(!1),m(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${St}`))}if(IG(se.current,he))return;se.current=he,oe(he)}catch(le){hn.warn("Failed to load past variants",le)}})(),()=>{z=!0}},[r,as,St]);const qe=g.useCallback(()=>{Ps.current=!1,qs.current=null,y(!1),w(!1),F(null),M(null),be(!0),_(!1),x(null),m(null),p(z=>z+1)},[M,y,w,p,m,x,F,_]),Ot=g.useCallback(z=>{if(mr.current){mr.current=!1;return}if(O(!0),F({sessionId:z.sessionId,variantId:z.variantId,previewKind:du(z)?"dev_server":"static"}),M(null),be(!1),du(z)){const le=++os.current;Ps.current=!0,qs.current={sessionId:z.sessionId,variantId:z.variantId},y(!0),w(!0),(async()=>{B({kind:"switch"}),Ee.capture("variants_panel.history_replay_started",{sessionId:z.sessionId,variantId:z.variantId});const Ae=he=>Ee.capture("variants_panel.history_replay_failed",{sessionId:z.sessionId,variantId:z.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/run${St}`,{method:"POST"});if(le!==os.current)return;if(!he.ok){const{errorCode:pe}=await ji(he);hn.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),Ae({httpStatus:he.status,errorCode:pe}),qe();return}w(!1),_(!0),x(null),m(null),p(pe=>pe+1),Ee.capture("variants_panel.history_replay_ready",{sessionId:z.sessionId,variantId:z.variantId})}catch(he){if(le!==os.current)return;hn.warn("history replay failed",he),Ae({errorMessage:he instanceof Error?he.message:String(he)}),qe()}finally{B(null)}})();return}yn(),_(!1),x(null),m(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/preview${St}`)},[qe,B,y,w,p,F,M,m,x,O,_,yn,St]),Wt=g.useCallback(async()=>{yn();const z=()=>{O(!0),M(null),F(null),be(!0),En.current=null,_(!1),x(null),m(null),p(le=>le+1)};if(!we){z();return}B({kind:"switch"});try{const le=await fetch(`/api/variants/${we}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){hn.warn(`switch to original failed: HTTP ${le.status}`);return}z(),_(!0),Ee.capture("variants_panel.preview_switched",{sessionId:we,fromVariantId:A,toVariantId:null,target:"original",armed:!1})}catch(le){hn.warn("preview-port original switch failed",le)}finally{B(null)}},[A,we,M,F,p,m,x,O,_,yn]),Cn=g.useCallback(async z=>{var Ae,he;const le=((he=(Ae=z.actions)==null?void 0:Ae.commit)==null?void 0:he.enabled)??z.status==="succeeded";if(!(!we||!le)){Ee.capture("variants_panel.commit_clicked",{sessionId:we,variantId:z.workItemId,variantLabel:z.label}),B({kind:"commit",variantId:z.workItemId});try{const pe=await fetch(`/api/variants/${we}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!pe.ok){const{message:Ke,errorCode:Pe}=await ji(pe);hn.warn(`commit failed: HTTP ${pe.status} ${Pe??""} ${Ke??""}`),Ee.capture("variants_panel.commit_failed",{sessionId:we,variantId:z.workItemId,httpStatus:pe.status,errorCode:Pe??null,errorMessage:Ke??null}),mt.error("Couldn't send direction",{description:Ke??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const ke=await pe.json().catch(()=>null);Ee.capture("variants_panel.commit_succeeded",{sessionId:we,variantId:z.workItemId,payloadKind:(ke==null?void 0:ke.payloadKind)??null,duplicate:(ke==null?void 0:ke.duplicate)??!1}),mt.success(`Sent "${z.label}" to your project`,{description:(ke==null?void 0:ke.payloadKind)==="project-created"?`Project created at ${(ke==null?void 0:ke.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(ke==null?void 0:ke.payloadKind)!=="project-created"&&(m(null),_(!1),p(Ke=>Ke+1))}catch(pe){hn.warn("commit failed",pe),Ee.capture("variants_panel.commit_failed",{sessionId:we,variantId:z.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),mt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{B(null)}}},[we,p,m,_]),Vr=g.useCallback(async(z,le,Ae)=>{Ee.capture("variants_panel.deploy_clicked",{sessionId:z,variantId:le,variantLabel:Ae});try{const he=await fetch(`/api/variants/${z}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...n?{projectPath:n}:{}})});if(!he.ok){const{message:Ke,errorCode:Pe}=await ji(he);return hn.warn(`deploy failed: HTTP ${he.status} ${Pe??""} ${Ke??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:he.status,errorCode:Pe??null,errorMessage:Ke??null}),mt.error("Couldn't deploy this direction",{description:Ke??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const pe=await he.json().catch(()=>null),ke=pe==null?void 0:pe.shareUrl;return ke?(await navigator.clipboard.writeText(ke).catch(()=>{}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:z,variantId:le}),mt.success(`"${Ae}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}}),ke):(mt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return hn.warn("deploy failed",he),Ee.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),mt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Xt=g.useCallback(async z=>{if(!we)return;const le=J[z.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}B({kind:"deploy",variantId:z.workItemId});try{const Ae=await Vr(we,z.workItemId,z.label);Ae&&H(he=>({...he,[z.workItemId]:Ae}))}finally{B(null)}},[we,J,Vr]),un=g.useCallback(async()=>{if(!(!we||We.length===0)){if(Ye){await navigator.clipboard.writeText(Ye).catch(()=>{}),mt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Ye,"_blank","noopener")}});return}Ee.capture("variants_panel.deploy_clicked",{sessionId:we,variantId:"canvas",variantLabel:"Canvas",variantCount:We.length}),B({kind:"deploy-canvas"});try{const z=await fetch(`/api/variants/${we}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:We.map(ke=>ke.workItemId),...n?{projectPath:n}:{}})});if(!z.ok){const{message:ke,errorCode:Ke}=await ji(z);hn.warn(`canvas deploy failed: HTTP ${z.status} ${Ke??""} ${ke??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:we,variantId:"canvas",httpStatus:z.status,errorCode:Ke??null,errorMessage:ke??null,variantCount:We.length}),mt.error("Couldn't share this canvas",{description:ke??`The server rejected the request (HTTP ${z.status}). Try again.`});return}const le=await z.json().catch(()=>null),Ae=le==null?void 0:le.shareUrl;if(!Ae){mt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(ke=>typeof ke.variantId=="string"&&typeof ke.shareUrl=="string").map(ke=>[ke.variantId,ke.shareUrl])),pe=Object.keys(he).length>0?{...J,...he}:J;pe!==J&&H(pe),await navigator.clipboard.writeText(Ae).catch(()=>{}),X({key:Ak(We,pe),shareUrl:Ae}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:we,variantId:"canvas",variantCount:We.length}),mt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ae,"_blank","noopener")}})}catch(z){hn.warn("canvas deploy failed",z),Ee.capture("variants_panel.deploy_failed",{sessionId:we,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:z instanceof Error?z.message:String(z),variantCount:We.length}),mt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{B(null)}}},[Ye,We,J,n,we]),Ys=g.useCallback(async z=>{const le=`${z.sessionId}:${z.variantId}`,Ae=te[le];if(Ae){await navigator.clipboard.writeText(Ae).catch(()=>{}),mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ae,"_blank","noopener")}});return}ue(le);try{const he=await Vr(z.sessionId,z.variantId,z.label);he&&ie(pe=>({...pe,[le]:he}))}finally{ue(null)}},[te,Vr]),cn=g.useCallback(async z=>{if(we){Ee.capture("variants_panel.remove_clicked",{sessionId:we,variantId:z.workItemId,variantLabelLength:z.label.length}),B({kind:"remove",variantId:z.workItemId});try{const le=await fetch(`/api/variants/${we}/${z.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:Ae}=await ji(le);hn.warn(`remove failed: HTTP ${le.status} ${Ae??""}`),mt.error("Couldn't remove direction",{description:Ae??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(z.workItemId===Ln||z.workItemId===A)&&(M(null),m(null),_(!1),p(Ae=>Ae+1))}catch(le){hn.warn("remove failed",le),mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{B(null)}}},[we,A,Ln,M,m,_,p]),Gn=g.useCallback(async z=>{if(!ct){mt.error("Couldn't remove direction",{description:"No project path available."});return}Ee.capture("variants_panel.remove_past_clicked",{sessionId:z.sessionId,variantId:z.variantId});const le=`${z.sessionId}:${z.variantId}`,Ae=he=>he.sessionId===z.sessionId&&he.variantId===z.variantId;B({kind:"remove",variantId:le}),oe(he=>he.filter(pe=>!Ae(pe))),N===le&&(F(null),m(null),_(!1),p(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:ct})});if(!he.ok){const{message:pe}=await ji(he);oe(ke=>ke.some(Ae)?ke:[...ke,z]),mt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){hn.warn("remove past failed",he),oe(pe=>pe.some(Ae)?pe:[...pe,z]),mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{B(null)}},[ct,N,F,m,_,p]),Ts=g.useCallback(z=>{$(z)},[]),gr=g.useCallback(async()=>{if(K)try{K.kind==="active"?await cn(K.variant):await Gn(K.entry)}finally{$(null)}},[K,cn,Gn]),xa=PG(K),gc=(q==null?void 0:q.kind)==="remove"&&q.variantId===xa,[Df,O0]=g.useState(null),[L0,Rs]=g.useState(null),Nf=g.useCallback(z=>{Rs(z)},[]),jf=g.useCallback(()=>{Rs(null)},[]),D0=g.useCallback(async z=>{const le=z.trim();if(le)try{await navigator.clipboard.writeText(le),mt.success("Copied")}catch{mt.error("Couldn't copy")}},[]),Ff=g.useCallback(async(z,le)=>{Rs(null);const Ae=le.trim();if(!Ae||z.kind==="original")return;if(z.kind==="active"){if(!we||Ae===z.variant.label)return;Ee.capture("variants_panel.rename",{sessionId:we,variantId:z.variant.workItemId,labelLength:Ae.length,past:!1});try{const ke=await fetch(`/api/variants/${we}/${z.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ae})});if(!ke.ok){const{message:Ke}=await ji(ke);mt.error("Couldn't rename direction",{description:Ke??`The server rejected the request (HTTP ${ke.status}). Try again.`})}}catch(ke){hn.warn("rename failed",ke),mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=z;if(Ae===he.label.trim())return;if(!ct){mt.error("Couldn't rename direction",{description:"No project path available."});return}Ee.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:Ae.length,past:!0});const pe=ke=>ke.sessionId===he.sessionId&&ke.variantId===he.variantId;oe(ke=>ke.map(Ke=>pe(Ke)?{...Ke,label:Ae}:Ke));try{const ke=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ae,projectPath:ct})});if(!ke.ok){const{message:Ke}=await ji(ke);oe(Pe=>Pe.map(sr=>pe(sr)?{...sr,label:he.label}:sr)),mt.error("Couldn't rename direction",{description:Ke??`The server rejected the request (HTTP ${ke.status}). Try again.`})}}catch(ke){hn.warn("rename failed",ke),oe(Ke=>Ke.map(Pe=>pe(Pe)?{...Pe,label:he.label}:Pe)),mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[we,ct]);g.useEffect(()=>{if(rr.current!==we){const le=rr.current===null;if(rr.current=we,En.current=null,X(null),m(null),_(!1),x(null),O(),M(null),F(null),be(!1),Ei.current=!1,!le)return}if(N||ye||!Ln||t.active!==!0||En.current===Ln)return;const z=Te.find(le=>le.workItemId===Ln);z&&(En.current=Ln,O(),Si(z))},[we,N,ye,Ln,t,Te,Si,O,M,F,m,x,_]),g.useEffect(()=>{!D||!He||(En.current=null,F(null),M(He.workItemId),be(!1))},[He,D,we,M,F]),g.useEffect(()=>{!D||He||tt||F(null)},[He,D,tt,we,F,Je]),g.useEffect(()=>{const z=W.trim().toLowerCase(),le=Te.filter(Pe=>tl(Pe)&&Au(z,Pe.label,Pe.runLabel)),Ae=Je.filter(Pe=>Au(z,Pe.label,Pe.runLabel,Pe.brief)),he=Sn&&Au(z,Yx,Xx);if(le.length===0&&Ae.length===0&&!he)return;const pe=[...le.map(Pe=>({source:"live",variant:Pe})),...Ae.map(Pe=>({source:"past",entry:Pe})),...he?[{source:"original"}]:[]],ke=Pe=>Pe.source==="live"?`live:${Pe.variant.workItemId}`:Pe.source==="past"?`past:${Pe.entry.sessionId}:${Pe.entry.variantId}`:B_,Ke=Pe=>{if(xB())return;if(Pe.key==="Enter"){const us=Te.find(lt=>lt.workItemId===Df);us&&tl(us)&&(Pe.preventDefault(),Fr(us));return}if(Pe.key!=="ArrowUp"&&Pe.key!=="ArrowDown")return;Pe.preventDefault();let Kn=Ln?`live:${Ln}`:null;N?Kn=`past:${N}`:ye&&(Kn=B_);const As=Kn?pe.findIndex(us=>ke(us)===Kn):-1;let ls;if(As===-1?ls=Pe.key==="ArrowDown"?0:pe.length-1:Pe.key==="ArrowDown"?ls=Math.min(As+1,pe.length-1):ls=Math.max(As-1,0),ls===As)return;const yr=pe[ls];yr.source==="live"?Fr(yr.variant):yr.source==="past"?Ot(yr.entry):Wt();const Dn=document.querySelector(`[data-variant-key="${ke(yr)}"]`);Dn instanceof HTMLElement&&Dn.focus({preventScroll:!0})};return window.addEventListener("keydown",Ke),()=>window.removeEventListener("keydown",Ke)},[Te,Je,W,Sn,N,ye,Ln,Df,Fr,Ot,Wt]);const Il=Te.find(z=>z.workItemId===Ln)??null,Ml=N?Je.find(z=>`${z.sessionId}:${z.variantId}`===N)??null:null,vc=!!Ml,N0=t.active?t.artifacts??[]:[],xt=[...(t.active?Te.filter(z=>z.status!=="cancelled"):[]).map(z=>({kind:"active",variant:z})),...Je.map(z=>({kind:"past",entry:z})),...Sn?[{kind:"original"}]:[]],Vf=W.trim().toLowerCase(),wa=Vf?xt.filter(z=>NG(z,Vf)):xt,$f=new Set(Te.map(z=>z.requestId).filter(Boolean)),ba=e.filter(z=>!$f.has(z.requestId)),Ol=ba.length>0,Ll=r&&!Ol&&xt.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[xt.length>0?S.jsx("div",{className:"px-3 pt-2 pb-1",children:S.jsxs("div",{className:"relative",children:[S.jsx(Qz,{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:W,onChange:z=>Y(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:[Ol?S.jsx(YG,{groups:ba}):null,Ll?S.jsx(XG,{}):null,t.active&&xt.length===0&&!Ol&&!Ll?S.jsx(QG,{}):null,!t.active&&!Ol&&!Ll&&Je.length===0&&!Sn?S.jsx(JG,{isMCPSession:d,mcpEditor:h}):null,xt.length>0&&wa.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",W.trim(),"”."]}):null,wa.length>0?S.jsx($G,{rows:wa,activeVariantId:A??Ln,activePastKey:N,isOriginalSelected:ye,busy:q,editingKey:L0,onSelectActive:Fr,onSelectPast:Ot,onSelectOriginal:Wt,onActivePointerDown:Zs,onPastPointerDown:Al,onHover:O0,onRemove:z=>Ts({kind:"active",variant:z}),onRemovePast:z=>Ts({kind:"past",entry:z}),onStartRename:Nf,onCommitRename:Ff,onCancelRename:jf,onCopyVariantContext:D0,activeSessionId:t.active?t.sessionId:null,projectPath:ct}):null,t.active&&c?S.jsx(GG,{artifacts:N0}):null]}),vc&&Ml?S.jsx(UG,{entry:Ml,deploying:ae===N,deployedUrl:N?te[N]??null:null,onDeploy:Ys,isDeployDisabled:!i}):null,!vc&&t.active?S.jsx(qG,{selectedVariant:Il,busy:q,onSend:Cn,onDeploy:Xt,onDeployCanvas:un,canDeploy:i&&(Ge==null?void 0:Ge.kind)==="fresh",canDeployCanvas:i&&a&&(Ge==null?void 0:Ge.kind)==="fresh",canSendToAgent:u,canvasVariantCount:We.length,canvasDeployedUrl:Ye,deployedUrl:Il?J[Il.workItemId]??null:null}):null,S.jsx(LG,{target:K,isConfirming:gc,onCancel:()=>$(null),onConfirm:gr})]})},OG=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",LG=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=OG(t);return S.jsx(Cx,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:S.jsxs(kx,{children:[S.jsx(Px,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Tx,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(Rx,{className:"text-content text-base font-medium",children:"Remove direction?"}),S.jsxs(Ax,{className:"text-content-subtle text-sm leading-5",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:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors 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"})]})]})})]})})},DG=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:B_,NG=(t,e)=>t.kind==="active"?Au(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Au(e,t.entry.label,t.entry.runLabel,t.entry.brief):Au(e,Yx,Xx),jG=t=>t.length<=Tk?t:`${t.slice(0,Tk-1)}…`,FG=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,VG=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(u=>!!u).join(`
|
|
111
|
+
`);if(!t.reference)return e;const n=((a=t.projectPath)==null?void 0:a.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
|
|
112
|
+
`);return e?`${e}
|
|
113
|
+
|
|
114
|
+
${s}`:s},$G=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:x,onCommitRename:y,onCancelRename:w,onCopyVariantContext:E,activeSessionId:P,projectPath:T})=>{const k=g.useRef(null),{activeIndex:R,itemRects:L,sessionRef:O,handlers:A,registerItem:M}=QR(k),D=(s==null?void 0:s.kind)==="switch",F=R!==null?L[R]:null;return S.jsxs("div",{ref:k,className:"relative",onMouseEnter:A.onMouseEnter,onMouseMove:A.onMouseMove,onMouseLeave:A.onMouseLeave,children:[S.jsx(ro,{children:F&&S.jsx(_l.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:F.top,left:F.left,width:F.width,height:F.height},animate:{opacity:1,top:F.top,left:F.left,width:F.width,height:F.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Xd.fast,opacity:{duration:.08}}},O.current)}),S.jsx("ul",{className:"relative",children:t.map((N,W)=>{const Y=DG(N);let q=!1;return N.kind==="active"?q=N.variant.workItemId===e:N.kind==="past"?q=`${N.entry.sessionId}:${N.entry.variantId}`===n:q=r,S.jsx(HG,{rowKey:Y,row:N,index:W,isSelected:q,isEditing:i===Y,isSwitchInFlight:D,busy:s,registerItem:M,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:x,onCommitRename:y,onCancelRename:w,onCopyVariantContext:E,activeSessionId:P,projectPath:T},Y)})})]})},HG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:u,onSelectActive:c,onSelectPast:d,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:m,onHover:_,onRemove:x,onRemovePast:y,onStartRename:w,onCommitRename:E,onCancelRename:P,onCopyVariantContext:T,activeSessionId:k,projectPath:R})=>{var Se,oe;const L=g.useRef(null);qU(u,n,L);const O=e.kind==="active",A=e.kind==="original",M=e.kind==="active"?e.variant:null,D=e.kind==="past"?e.entry:null,F=O?M.status==="succeeded":!0,N=O?tl(M):!0,W=O?rA(M):!1,Y=O&&(M.status==="pending"||M.status==="running"),q=O?F&&(N||W)||Y:!0,B=O&&M.status==="failed",K=O&&M.status==="cancelled",$=O&&(!q||i),J=O&&(a==null?void 0:a.kind)==="remove"&&a.variantId===M.workItemId,H=O&&(((Se=M.refinement)==null?void 0:Se.status)==="pending"||((oe=M.refinement)==null?void 0:oe.status)==="running");let j=Yx;O?j=M.label||`Direction ${n+1}`:D&&(j=D.label.trim()||"Untitled direction");let X;O?X=M.runLabel:D&&(X=D.runLabel);let te=Xx;O?te=M.description:D&&(te=D.brief);const ie=te?jG(te):null,ae=FG(e,k),ue=ae?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:L,"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(zG,{initial:j,onCommit:se=>E(e,se),onCancel:P}),ie&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ie})]})})}):S.jsxs("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:q?0:-1,"data-variant-id":O?M.workItemId:void 0,"data-variant-key":t,onClick:()=>{if($)return;const se=window.getSelection();se&&!se.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?d(e.entry):h())},onKeyDown:se=>{$||(se.key==="Enter"||se.key===" ")&&(se.preventDefault(),se.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?d(e.entry):h())},onPointerDown:se=>{$||(e.kind==="active"?F&&p(e.variant.workItemId,se):e.kind==="past"&&m(e.entry,se))},"aria-pressed":q?r:void 0,"aria-disabled":O?!q:void 0,"aria-busy":Y||H,onMouseEnter:O?()=>_(M.workItemId):void 0,onMouseLeave:O?()=>_(null):void 0,className:pr("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",F&&N&&"cursor-grab active:cursor-grabbing",(Y||W)&&"cursor-pointer",!F&&!Y&&!W&&"cursor-not-allowed opacity-60",$&&"cursor-not-allowed opacity-50"),style:F?{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:[(Y||H)&&S.jsx(Dx,{className:"text-content-muted shrink-0 text-sm","data-testid":H&&!Y?"variant-refining":void 0}),S.jsx(to,{label:"Double-click to rename",disabled:A,children:S.jsx("span",{onDoubleClick:se=>{se.stopPropagation(),A||w(t)},className:pr("min-w-0 flex-1 truncate text-sm font-medium select-text",A?"cursor-default":"cursor-text",F||r?"text-content":"text-content-muted"),children:j})}),B&&S.jsx(to,{label:M.errorMessage??M.errorCode??"Failed",disabled:!M.errorMessage&&!M.errorCode,children:S.jsx("span",{className:"shrink-0",children:S.jsx(Ik,{label:"Failed"})})}),K&&S.jsx(Ik,{label:"Cancelled"}),X&&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:XR(X),children:X})]}),ie&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ie})]})}),S.jsxs("div",{className:pr("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:[te||ae?S.jsx(to,{label:ue,children:S.jsx("button",{type:"button","aria-label":ue,onClick:se=>{se.stopPropagation(),T(VG({label:j,description:te,reference:ae,projectPath:R}))},onPointerDown:se=>se.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(Yd,{size:13,weight:"bold"})})}):null,!A&&S.jsx(to,{label:"Rename",children:S.jsx("button",{type:"button","aria-label":"Rename direction",onClick:se=>{se.stopPropagation(),w(t)},onPointerDown:se=>se.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(Jz,{size:13,weight:"bold"})})}),!A&&S.jsx(to,{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:J,onClick:se=>{se.stopPropagation(),e.kind==="active"?x(e.variant):y(e.entry)},onPointerDown:se=>se.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(nU,{size:13,weight:"bold"})})})]})]})},zG=({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"})},Ik=({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}),UG=({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(Yd,{size:12,weight:"bold"}):null,a]})]})},BG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},WG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},GG=({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(KG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},KG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=Qe(fc),s=WG[t.kind],i=t.source?BG[t.source]:null,a=[t.kind==="design_context"?null:i,t.summary].filter(Boolean).join(" · "),u=t.kind==="design_context"&&!!t.viewUrl,c=`${e?"Hide":"View"} ${s} artifact${t.label?`: ${t.label}`:""}`;return u?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:s}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),a?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:a}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{r||Ee.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${s} 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(Zz,{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":c,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:s}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),a?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:a}):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(ZG,{artifact:t})}):null]})},ZG=({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]}),qG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:d,deployedUrl:h})=>{var O,A,M,D;const p=t?((A=(O=t.actions)==null?void 0:O.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,m=p&&e===null,_=(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),y=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!p||e!==null,E=a&&c>0,T=x?"Deploying…":h?"Copy link":"Share",R=y?"Sharing…":d?"Copy canvas link":"Share canvas",L=_?"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(H5,{primaryLabel:T,primaryIcon:h&&!x?Yd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:E?[{label:R,icon:d&&!y?Yd:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,title:(D=(M=t==null?void 0:t.actions)==null?void 0:M.commit)==null?void 0:D.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:L}):null]})]})},sA=()=>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(Dx,{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"})})]})}),YG=({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(sA,{},`${e.requestId}-${r}`)))}),XG=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(sA,{},e))}),QG=()=>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."})]}),Mk="Try different ways to create a dropdown that feels fluid and dynamic",JG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=wB(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Mk).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:["“",Mk,"”"]}),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(SR,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Yd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},eK=({onClose:t})=>{const e=Qe(i5);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(to,{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(eU,{className:"h-4 w-4",weight:"bold"})})})]}):null},tK='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',nK=({itemSelector:t=tK,loop:e=!1}={})=>{const n=g.useRef(null),r=g.useRef(null),s=g.useCallback(a=>{var u;n.current=a,a?r.current=_B():((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 d=Array.from(c.querySelectorAll(t));if(d.length===0)return;a.preventDefault(),a.stopPropagation();const h=d.indexOf(document.activeElement),p=d.length-1,m=y=>{if(h===-1)return y===1?0:p;const w=h+y;return e?(w+d.length)%d.length:Math.min(Math.max(w,0),p)};let _;u==="Home"?_=0:u==="End"?_=p:u==="ArrowDown"?_=m(1):_=m(-1),(x=d[_])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Ok="/assets/arena-Db0j1set.png",rK=ks("useIntegrations"),E1=["integrations"],sK="rivet:connect-result",iK=t=>typeof t=="object"&&t!==null&&t.type===sK,oK=st(null),Lk=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},aK=()=>{const t=X8(),[e,n]=BP(oK),r=oy({queryKey:E1,queryFn:Lk,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:E1,refetchType:"none"}),t.fetchQuery({queryKey:E1,queryFn:Lk})),[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 d=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await d.json().catch(()=>({}));if(!d.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);return c.location.href=h.authUrl,await new Promise(p=>{let m=!1,_=null;const x=async(w,E=!1)=>{if(!m){m=!0,window.removeEventListener("message",y),_&&clearInterval(_);try{const T=(await s()).some(k=>k.provider===u&&k.status==="connected");p(E&&T?"connected":w)}catch{p(w)}}},y=w=>{if(iK(w.data)&&w.data.provider===u){if(w.data.status==="error"){rK.warn(`Connect failed for ${u}:`,w.data.message),x("failed");return}x("connected")}};window.addEventListener("message",y),_=setInterval(()=>{c.closed&&x("closed",!0)},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 d=await c.json().catch(()=>({}));throw new Error(d.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}},Iu=({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(qx,{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},Ba=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Dk=ks("ConnectorsModal"),lK=()=>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"})}),uK=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Ok})`,maskImage:`url(${Ok})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),cK=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(lK,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(uK,{})}],dK=({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:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,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(SR,{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 bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold 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 bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},W_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:d}=aK(),h=o0(),[p,m]=g.useState(null),_=E=>s.find(P=>P.provider===E),x=g.useCallback(E=>{const P=Date.now(),T=Ba({action:"connect",outcome:"started",provider:E,entryPoint:n});h==null||h.capture(T.event,T.properties),c(E).then(k=>{const R=Date.now()-P;if(k==="connected"){const O=Ba({action:"connect",outcome:"completed",provider:E,entryPoint:n,durationMs:R});h==null||h.capture(O.event,O.properties);return}const L=Ba({action:"connect",outcome:"failed",provider:E,entryPoint:n,durationMs:R,failureReason:k==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(L.event,L.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not connect.",L=Ba({action:"connect",outcome:"failed",provider:E,entryPoint:n,durationMs:Date.now()-P,failureReason:R.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(L.event,L.properties),Dk.warn(`Connect error for ${E}:`,R),mt.error(R)})},[c,n,h]),y=g.useCallback(E=>{const P=Date.now(),T=Ba({action:"disconnect",outcome:"started",provider:E,entryPoint:n});h==null||h.capture(T.event,T.properties),d(E).then(()=>{const k=Ba({action:"disconnect",outcome:"completed",provider:E,entryPoint:n,durationMs:Date.now()-P});h==null||h.capture(k.event,k.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not disconnect.",L=Ba({action:"disconnect",outcome:"failed",provider:E,entryPoint:n,durationMs:Date.now()-P,failureReason:"request_failed"});h==null||h.capture(L.event,L.properties),Dk.warn(`Disconnect error for ${E}:`,R),mt.error(R)})},[n,d,h]),w=n==="onboarding";return S.jsx(Cx,{open:t,onOpenChange:E=>!E&&e(),children:S.jsxs(kx,{children:[S.jsx(Px,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Tx,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(J5,{value:p,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(Rx,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(Iu,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:S.jsx(DR,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(Ax,{className:"text-content-subtle text-sm",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:cK.map(E=>S.jsx(dK,{meta:E,integration:_(E.provider),isPending:i||u===E.provider,isHighlighted:r===E.provider,onConnect:()=>x(E.provider),onDisconnect:()=>y(E.provider)},E.provider))}),w?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},Nk=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),fK=ks("SupportTicketModal"),jk=5e3,C1="feedback",hK=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},pK=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=hK(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}`},mK=({isOpen:t,onClose:e,contactEmail:n})=>{const r=o0(),[s,i]=g.useState(""),[a,u]=g.useState(!1),[c,d]=g.useState(null),h=g.useCallback(()=>{i("")},[]),p=g.useCallback(()=>{a||(h(),e())},[a,e,h]),m=g.useCallback(async()=>{const w=s.trim();if(!(!w||a)){u(!0);try{const E=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,P=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,T=n==null?void 0:n.trim(),k=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:C1,message:w,contactEmail:T||void 0,metadata:{posthogSessionId:E??void 0,posthogDistinctId:P??void 0,appVersion:"0.14.13",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!k.ok){const R=await pK(k);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:C1,has_posthog_session_id:!!E}),mt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(E){const P=E instanceof Error?E.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:C1,error:P}),fK.error("Failed to submit support ticket:",P),mt.error("Could not send feedback",{description:P})}finally{u(!1)}}},[n,a,s,e,r,h]),_=g.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),x=jk-s.length,y=a||s.trim().length===0;return S.jsx(Cx,{open:t,onOpenChange:w=>!w&&p(),children:S.jsxs(kx,{children:[S.jsx(Px,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(Tx,{ref:d,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(J5,{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(Rx,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(Iu,{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(DR,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(Ax,{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:w=>i(w.target.value),onKeyDown:_,maxLength:jk,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(Iu,{onClick:m,disabled:y,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(m0,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(qz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},gK=ks("ProfileAvatar"),iA=(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):""},vK=(t,e)=>iA(t,e).charAt(0).toUpperCase(),yK=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=Qe(a5),i=Qe(f5),a=Qe(fc),[u,c]=g.useState(!1),[d,h]=g.useState(!1),[p,m]=g.useState(!1),[_,x]=g.useState(!1),{containerRef:y,onKeyDown:w}=nK(),E=Qe(Rf),P=vK(r,s);if(!P)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(Nk,{className:"h-7 w-7 rounded-full"}),S.jsx(Nk,{className:"h-3 w-16"})]}):null;const T=iA(r,s),k=(r==null?void 0:r.trim())||null,R=(s==null?void 0:s.trim())||null,L=async()=>{x(!0);try{const O=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!O.ok)throw new Error(`Logout failed: ${O.status}`)}catch(O){gK.warn("Logout request failed",O),mt.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(F5,{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:P}),T?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:T}):null]})}),S.jsx(V5,{children:S.jsxs($5,{ref:y,onKeyDown:w,role:"menu",className:"z-[60] min-w-[180px] rounded-lg bg-surface-2 p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[k||R?S.jsxs("div",{className:"border-b border-main-border px-3 py-2",children:[k?S.jsx("div",{className:"truncate text-xs font-medium text-content",children:k}):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(MR,{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),m(!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(Xz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:L,disabled:_,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(tU,{className:"h-3.5 w-3.5",weight:"bold"}),_?"Logging out…":"Log out"]})]})})]}),S.jsx(W_,{isOpen:d,onClose:()=>h(!1)}),S.jsx(mK,{isOpen:p,onClose:()=>m(!1),contactEmail:s??void 0})]})},_K=({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(eK,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(MG,{})}),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(yK,{side:"top",align:"start"})})]});async function xK(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(a){const u=n[i-1];if(u===void 0||r&&!r(a))throw a;s==null||s(a,i,u),await new Promise(c=>setTimeout(c,u))}}const Fk=ks("useServerConfig"),oA=[250,500,1e3,2e3,4e3],Vk=oA.length+1,wK=async()=>{var n;const t=await fetch("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},bK=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),a=g.useCallback(async()=>{try{r(!0),i(null);const u=await xK(wK,{delaysMs:oA,onRetry:(c,d,h)=>{Fk.warn(`Server config fetch failed (attempt ${d}); retrying in ${h}ms`,c)}});return e(u),u}catch(u){const c=u instanceof Error?u.message:"Failed to fetch server config";throw i(c),Fk.warn("Error fetching server config:",u),u}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},SK="#1C1C20",Fi=[118,118,124],$k=.85,EK=3,CK=.15,vp=36,kK=4.4,PK=.7,TK=3.5,RK=.8,Hk=9,AK=11,IK=[1.35,1.12,.95,.85],MK=[0,1.1,2.3,3.1],OK=[0,.35,.16,.13],LK=[.9,.5,.4,.35],Wa=3,k1=[[{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}]],yp=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},Up=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ga=(t,e)=>(Math.round(t/e-.5)+.5)*e,DK=Math.sin(Math.PI/3),zk=(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*DK;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()},NK=(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)-Hk}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)-Hk}return Up(.5-r/(2*AK))},aA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=at(o5),r=g.useRef(null),s=g.useCallback(i=>{var D;if((D=r.current)==null||D.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=[],d=0,h=0,p=vp,m=vp,_=null,x=null,y=0,w=-1;const E=new Array(33),P=F=>{const N=Math.round(F*32);let W=E[N];if(!W){const Y=N/32,q=Math.round(Fi[0]+(255-Fi[0])*Y),B=Math.round(Fi[1]+(255-Fi[1])*Y),K=Math.round(Fi[2]+(255-Fi[2])*Y);W=`rgba(${q}, ${B}, ${K}, ${$k})`,E[N]=W}return W},T=F=>{const N=1-.35*F,W=Math.round(Fi[0]*N),Y=Math.round(Fi[1]*N),q=Math.round(Fi[2]*N);return`rgba(${W}, ${Y}, ${q}, ${$k})`},k=F=>{let N=Math.floor(Math.random()*k1.length);N===w&&(N=(N+1)%k1.length),w=N;const W=[0,0,0,0],Y=k1[N].map((j,X)=>{const te=j.level,ie=W[te]++,ae=MK[te]+ie*OK[te],ue=LK[te]+yp(N*131+X*17+5)*.2;if(j.hline){const se=Ga((j.y??0)*h,m);return{hline:!0,x1:Ga(j.x1*d,p),x2:Ga(j.x2*d,p),y1:se,y2:se,level:te,start:ae,dur:ue}}const Se=Ga(j.x1*d,p),oe=Ga((j.y1??0)*h,m);return{hline:!1,x1:Se,y1:oe,x2:Math.max(Ga(j.x2*d,p),Se+p),y2:Math.max(Ga((j.y2??0)*h,m),oe+m),level:te,start:ae,dur:ue}}),q=Y.reduce((j,X)=>Math.max(j,X.start+X.dur),0),B=c.length,K=new Float32Array(B*Wa),$=new Int16Array(B*Wa).fill(-1),J=new Uint8Array(B),H=Y[0];for(let j=0;j<B;j++){const X=c[j];X.x>H.x1&&X.x<H.x2&&X.y>H.y1&&X.y<H.y2&&(J[j]=1);const te=j*Wa;for(let ie=0;ie<Y.length;ie++){const ae=NK(X.x,X.y,Y[ie]);if(ae<=.02)continue;let ue=te;for(let Se=te;Se<te+Wa;Se++){if($[Se]===-1){ue=Se;break}K[Se]<K[ue]&&(ue=Se)}($[ue]===-1||ae>K[ue])&&(K[ue]=ae,$[ue]=ie)}}return{startT:F,buildEnd:q,els:Y,frame:H,cellQ:K,cellEl:$,inFrame:J}},R=()=>{const F=i.getBoundingClientRect();d=Math.max(1,F.width),h=Math.max(1,F.height);const N=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*N),i.height=Math.round(h*N),a.setTransform(N,0,0,N,0,0);const W=Math.max(8,Math.round(d/vp)),Y=Math.max(6,Math.round(h/vp));p=d/W,m=h/Y,c=[];for(let q=0;q<Y;q++){const B=Y>1?q/(Y-1):.5,K=kK*(1+PK*.4*(B*2-1));for(let $=0;$<W;$++){const J=q*8191+$*131+1,H={x:($+.5)*p,y:(q+.5)*m,size:K,seed:J,phase:yp(J),kind:0};H.kind=Math.floor(yp(J*97)*3),c.push(H)}}x=null,_=null},L=new Float32Array(32),O=F=>{a.fillStyle=SK,a.fillRect(0,0,d,h),_||(_=k(F+.2)),F>=_.startT+_.buildEnd+TK&&(x=_,y=F,_=k(F+.2));let N=0;x&&(N=1-Up((F-y)/RK),N<=0&&(x=null));const W=_;for(let H=0;H<W.els.length;H++){const j=W.els[H];L[H]=Up(Math.min(1,Math.max(0,(F-W.startT-j.start)/j.dur)))}const Y=L[0],q=T(0),B=T(Y),K=N>0?T(N):q,$=N>0?T(Math.max(Y,N)):B,J=c.length;for(let H=0;H<J;H++){const j=c[H];let X=0,te=0;const ie=H*Wa;for(let be=ie;be<ie+Wa;be++){const je=W.cellEl[be];if(je<0)break;const Te=W.cellQ[be]*L[je];Te>X&&(X=Te,te=W.els[je].level)}if(x)for(let be=ie;be<ie+Wa;be++){const je=x.cellEl[be];if(je<0)break;const Te=x.cellQ[be]*N;Te>X&&(X=Te,te=x.els[je].level)}const ae=F/EK+j.phase,ue=Math.floor(ae),Se=ae-ue,oe=Up(Math.min(Se,1-Se)/CK),se=Math.floor(yp(j.seed*97+ue*7919)*3);se!==j.kind&&X<.02&&oe<.05&&(j.kind=se);const ye=Math.max(oe*(1-X),X);if(!(ye<.01))if(X<.02){const be=W.inFrame[H]===1,je=x?x.inFrame[H]===1:!1;be?a.fillStyle=je?$:B:a.fillStyle=je?K:q;const Te=Math.max(be?Y:0,je?N:0);zk(a,j.kind,j.x,j.y,j.size*ye*(1-.2*Te))}else{a.fillStyle=P(X);const be=1+(IK[te]-1)*X;zk(a,j.kind,j.x,j.y,j.size*ye*be)}}};R();let A=0;if(u)_=k(-100),O(0);else{const F=performance.now(),N=W=>{O((W-F)/1e3),A=requestAnimationFrame(N)};A=requestAnimationFrame(N)}const M=new ResizeObserver(()=>{R(),u&&(_=k(-100),O(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(A),M.disconnect(),e&&n(F=>F-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},jK=async(t=null)=>{if(t)return FK(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return _p();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return _p()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:_p()},lA=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},FK=t=>lA(t),_p=()=>lA("/"),P1=ks("usePreviewUpstreamHealth"),VK=500,$K=4e3,HK=15e3,zK=3,UK=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??VK,i=e.probeMsWhileUp??$K,a=e.firstUnreachableCaptureAfterMs??HK,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,d=e.skip??!1,h=g.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=g.useState(t==="static"),[_,x]=g.useState(0),[y,w]=g.useState(null),[E,P]=g.useState(0),[T,k]=g.useState(!1),[R,L]=g.useState(!1),[O,A]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){m(!0),w(null),P(0),k(!1),L(!0),A(null);return}if(d){m(!1),w(null),P(0),k(!1),L(!0),A("upstream_unreachable"),n.current=null;return}let M=!0;const D=Date.now();w(D),P(0),k(!1),m(!1),L(!1),A("upstream_unreachable");const F={current:!1},N={current:!1},W={current:!1},Y={current:null},q={current:!1},B={current:!1},K={current:0},$={current:!1},J={current:null};let H=null;const j=()=>{W.current||(W.current=!0,M&&L(!0))},X=()=>{H!==null&&(clearTimeout(H),H=null)},te=(ae,ue)=>{X(),H=setTimeout(ue,ae)},ie=async()=>{var Te;if(!M)return;P(We=>We+1);const{isOk:ae,unavailableReason:ue,upstreamStatus:Se}=await jK(c);if(!M)return;j(),J.current=Se;const oe=ae&&Se!==null&&Se>=500;oe&&B.current?K.current+=1:ae&&!oe&&(K.current=0);const se=K.current>=zK;if(se&&!$.current&&Se!==null&&($.current=!0,Ee==null||Ee.capture("preview_upstream_error_responses",{framework:t,upstream_status:Se,consecutive_count:K.current}),P1.warn(`Preview upstream is listening but has served ${K.current} consecutive ${Se} responses`),(Te=h.current)==null||Te.call(h,{upstreamStatus:Se,consecutiveCount:K.current})),ae&&!se){oe||(B.current=!0,$.current=!1);const We=!q.current;q.current=!0,m(!0),A(null),Y.current=null,N.current=!1,k(!1),F.current?We&&(Ee==null||Ee.capture("preview_upstream_restored",{framework:t})):(F.current=!0,Ee==null||Ee.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),te(i,ie);return}const be=q.current;q.current=!1,m(!1),A(ue),Y.current===null&&(Y.current=Date.now(),N.current=!1,k(!1)),be&&(Ee==null||Ee.capture("preview_upstream_lost",{framework:t,upstream_status:Se}),x(We=>We+1),P1.warn("Preview upstream became unavailable after it was ready"));const je=Date.now()-Y.current;je>=a&&!N.current&&(N.current=!0,k(!0),Ee==null||Ee.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:je,upstream_status:J.current}),P1.warn("Dev server did not become ready within timeout window")),te(s,ie)};return n.current=()=>te(0,ie),te(0,ie),()=>{M=!1,n.current=null,X()}},[t,s,i,a,c,d]),g.useEffect(()=>{var D;if(t==="static"||u===void 0)return;const M=r.current;r.current=u,M!==null&&M!==u&&((D=n.current)==null||D.call(n))},[t,u]),{isUpstreamReady:p,iframeRemountKey:_,probeStartedAt:y,probeAttemptCount:E,isFirstUnreachableWindowExceeded:T,initialProbeComplete:R,unavailableReason:O}};function BK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const uA=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}`},cA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${uA(t)}${e}`:e,WK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",GK=t=>WK,KK=ks("PreviewSurface"),Uk=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",dA=({target:t,src:e,framework:n,remountKey:r})=>(Qe(g0),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:GK(),onLoad:()=>{Ee==null||Ee.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Uk(e,t),framework:n}))},onError:()=>{Ee==null||Ee.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Uk(e,t),framework:n})),KK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),ZK="modulepreload",qK=function(t){return"/"+t},Bk={},YK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.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(d=>{if(d=qK(d),d in Bk)return;Bk[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":ZK,h||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((_,x)=>{m.addEventListener("load",_),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}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)})},XK=g.lazy(()=>YK(()=>Promise.resolve().then(()=>Rq),void 0)),QK={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"},JK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},eZ={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"},Md=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:d,role:h="status",busy:p=!1,className:m=""})=>{const _=g.useCallback(y=>{y&&d&&(Ee==null||Ee.capture("status_surface_shown",{state:d,tone:i,fill:a}))},[d,i,a]),x=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:_,className:`${QK[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,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:JK[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(y=>S.jsx("button",{type:"button",onClick:y.onClick,className:eZ[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},G_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Md,{...r,size:n,busy:!0,backdrop:S.jsx(aA,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Md,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(XK,{className:"absolute inset-0"})})}):S.jsx(Md,{...r,size:n,busy:!0,media:S.jsx(m0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),fA=({icon:t,...e})=>S.jsx(Md,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Wm=t=>S.jsx(Md,{...t,tone:"error",role:"alert"}),Wk="/static/",tZ=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(Wk)}catch{return t.endsWith(Wk)}},nZ=({isInteractionDisabled:t=!1,framework:e,userPort:n,activeDemoSessionId:r=null,holdPreviewNavigation:s=!1})=>{var Je;const i=Qe(L_),a=at(L_),u=Qe(Vm),c=at(Vm),d=Qe(Tf),h=Qe(g0),p=Qe(D_),m=Qe(N_),_=Qe(l5),x=Qe(u5),y=at(N_),w=Qe(lo),E=Qe(F_),P=at(D_),T=d.active&&d.projectContext.kind==="fresh",k=Qe(j_),R=d.active?d.variants.find(He=>He.workItemId===k&&(He.status==="pending"||He.status==="running"||He.status==="succeeded"&&!He.preview&&typeof He.port!="number"&&(!He.previewUnavailable||He.previewUnavailable.reason==="idle_timeout")))??null:null,L=d.active&&d.variants.some(He=>He.status==="pending"||He.status==="running"),O=T||L,A=d.active?d.variants.find(He=>{var tt;return He.workItemId===k&&He.status==="succeeded"&&!!He.previewUnavailable&&((tt=He.previewUnavailable)==null?void 0:tt.reason)!=="idle_timeout"})??null:null,M=e==="static"&&u!==null&&tZ(u);g.useEffect(()=>{d.active||P(!1)},[d.active,P]);const D=g.useRef(!1);g.useEffect(()=>{const He=!!(w!=null&&w.left||w!=null&&w.right),tt=He&&!D.current;D.current=He;const Ge=d.active?d.sessionId:null;!Ge||!BK({enteringSplit:tt,isExistingSession:d.active&&d.projectContext.kind==="existing",hasActiveVariantProxy:p&&m!==null})||(P(!1),y(null),a(ct=>ct+1),fetch(`/api/variants/${encodeURIComponent(Ge)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,d,p,m,P,y,a]);const N=g.useMemo(()=>{var Sn;if(p||u&&!M||!d.active)return null;const{stage:He,variants:tt}=d,Ge=He==="ready"||He==="degraded",ct=tt.some(St=>{var rr,En;return((rr=St.refinement)==null?void 0:rr.status)==="pending"||((En=St.refinement)==null?void 0:En.status)==="running"});if(!Ge&&!ct)return null;const vn=tt.find(St=>{var rr;return St.status==="succeeded"&&((rr=St.preview)==null?void 0:rr.kind)==="static_artifact"});return((Sn=vn==null?void 0:vn.preview)==null?void 0:Sn.kind)==="static_artifact"?vn.preview.url:null},[M,u,p,d])??u,W=g.useMemo(()=>!d.active||!N?null:d.variants.find(He=>{var tt;return((tt=He.preview)==null?void 0:tt.kind)==="static_artifact"&&N.startsWith(He.preview.url)})??null,[N,d]),Y=g.useMemo(()=>{if((E==null?void 0:E.previewKind)==="static")return{kind:"variant",sessionId:E.sessionId,variantId:E.variantId};if(!d.active)return Fm;if(W)return{kind:"variant",sessionId:d.sessionId,variantId:W.workItemId};if(N){const tt=N.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Ge=tt!=null&&tt[1]?decodeURIComponent(tt[1]):null,ct=tt!=null&&tt[2]?decodeURIComponent(tt[2]):null;if(Ge===d.sessionId&&ct&&d.variants.some(St=>St.workItemId===ct))return{kind:"variant",sessionId:d.sessionId,variantId:ct};const vn=N.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Sn=vn!=null&&vn[1]?decodeURIComponent(vn[1]):null;if(Sn&&d.variants.some(St=>St.workItemId===Sn))return{kind:"variant",sessionId:d.sessionId,variantId:Sn}}const He=!!(w!=null&&w.left||w!=null&&w.right);return(!He||T)&&!N&&p&&m&&d.variants.some(tt=>tt.workItemId===m)?{kind:"variant",sessionId:d.sessionId,variantId:m}:(!He||T)&&!N&&k&&d.variants.some(tt=>tt.workItemId===k)?{kind:"variant",sessionId:d.sessionId,variantId:k}:Fm},[E,W,d,p,m,N,w,T,k]),q=g.useRef(null);g.useEffect(()=>{var ct,vn;if(!W||((ct=W.preview)==null?void 0:ct.kind)!=="static_artifact"||((vn=W.refinement)==null?void 0:vn.status)!=="succeeded")return;const He=`${W.workItemId}:${W.refinement.workItemId}`;if(q.current===He)return;q.current=He;const tt=W.preview.url.includes("?")?"&":"?",Ge=`${W.preview.url}${tt}refinement=${encodeURIComponent(W.refinement.workItemId)}`;N!==Ge&&(c(Ge),a(Sn=>Sn+1))},[N,W,a,c,d]);const B=N!==null&&CG(N),K=N!==null&&!B||T&&!p&&!B,{isUpstreamReady:$,iframeRemountKey:J,probeAttemptCount:H,initialProbeComplete:j}=UK(e,{rerunProbeImmediatelyOnVersion:i,probePath:B?N:null,skip:K}),[X,te]=g.useState(()=>_&&$?i:null),ie=g.useRef(null);g.useEffect(()=>{if(!_){ie.current=null,te(null);return}if(X===i){ie.current=null;return}const He=ie.current;if(!He||He.remountKey!==i){ie.current={remountKey:i,probeAttemptCount:H};return}$&&H>He.probeAttemptCount&&(ie.current=null,te(i))},[X,i,_,H,$]);const ue=N!==null&&!B||$,oe=x||_&&X!==i||_&&!ue,se=`${J}:${i}`,ye=r?`/try/${encodeURIComponent(r)}`:"",be=tA(window.location.pathname),je=e==="static"?`${ye}/static${be??"/"}`:`${ye}${be??"/"}`,Te=uA(h);let We=null;N&&(We=cA({agentApplyMode:h,url:N}));const Ye=R||oe?"about:blank":(B&&!ue?"about:blank":We)??(s||!ue?"about:blank":`${Te}${je}`),we=!!R||!!A||!ue&&j;let Mt=null;return oe?Mt=S.jsx(G_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):R?Mt=S.jsx(G_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):A?Mt=S.jsx(Wm,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:((Je=A.previewUnavailable)==null?void 0:Je.reason)==="missing_dev_script"?"This project has no dev script for Rivet to run.":"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):we&&(Mt=O?S.jsx(fA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Wm,{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(dA,{target:Y,src:Ye,framework:e,remountKey:se})]})};function Gk({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var k;const u=Qe(lo),c=at(lo),d=Qe(fc),h=o0(),p=Qe(Tf),m=Qe(g0),_=g.useRef(!1),x=g.useCallback(()=>{_.current||(_.current=!0,af({source:i,sessionId:e,variantId:n}))},[i,e,n]),y=g.useCallback(()=>{if(a){if(c(null),!d){const O=Bm("ended",u);h==null||h.capture(O.event,O.properties)}return}x();const R={...u};delete R[t];const L=R.left||R.right?R:null;if(c(L),!d){const O=Bm(L?"updated":"ended",L??u);h==null||h.capture(O.event,O.properties)}},[a,d,h,c,t,u,x]),w=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),E=g.useMemo(()=>!p.active||p.sessionId!==e?null:p.variants.find(R=>R.workItemId===n)??null,[e,n,p]),P=g.useMemo(()=>{var L,O;let R=r;if(((L=E==null?void 0:E.preview)==null?void 0:L.kind)==="static_artifact"&&((O=E.refinement)==null?void 0:O.status)==="succeeded"){const A=E.preview.url.includes("?")?"&":"?";R=`${E.preview.url}${A}refinement=${encodeURIComponent(E.refinement.workItemId)}`}return cA({agentApplyMode:m,url:R})},[m,E,r]),T=((k=E==null?void 0:E.refinement)==null?void 0:k.status)==="succeeded"?`${n}:${E.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(to,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:y,"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(dA,{target:w,src:P,framework:"static",remountKey:T})})]})}const Kk=240;function rZ(){const t=Qe(tf),e=Qe(Lx),n=g.useRef(null);return g.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-Kk/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:Kk},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:XR(t.runLabel),children:t.runLabel}):null]}),t.description?S.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function sZ(){const t=Qe(tf),e=Qe(Lx),n=Qe(lo),r=Qe(fc),s=at(tf),i=at(lo),a=o0(),u=g.useRef(null),[c,d]=g.useState(null),[h,p]=g.useState("hidden");g.useEffect(()=>{if(!t){p("hidden"),d(null);return}const x=requestAnimationFrame(()=>p("visible"));return()=>cancelAnimationFrame(x)},[t]);const m=g.useCallback((x,y)=>{const w=u.current;if(!w)return null;const E=w.getBoundingClientRect();return x<E.left||x>E.right||y<E.top||y>E.bottom?null:x<(E.left+E.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const x=m(e.x,e.y);d(y=>y===x?y:x)},[t,e,m]),g.useEffect(()=>{if(!t)return;const x=y=>{const w=m(y.clientX,y.clientY);if(w&&t.url){const E={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},P=n==null?void 0:n[w];P&&(P.sessionId!==E.sessionId||P.variantId!==E.variantId)&&af(P);const T={...n??{},[w]:E};if(i(T),!r){const k=Bm(n?"updated":"started",T);a==null||a.capture(k.event,k.properties)}p("exiting"),window.setTimeout(()=>s(null),220)}else af(t),p("exiting"),window.setTimeout(()=>s(null),220)};return window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x)}},[t,m,r,a,s,i,n]),!t)return null;const _=["variant-drop-zones",h==="visible"&&"is-visible",h==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:u,className:_,"aria-hidden":"true",children:[S.jsx(Zk,{side:"left",hovered:c==="left",canDrop:!!t.url,label:t.label}),S.jsx(Zk,{side:"right",hovered:c==="right",canDrop:!!t.url,label:t.label})]})}function Zk({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 hA=(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)}`},qk=(t,e)=>{if(!t)return;const n=hA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},iZ=()=>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(aA,{trackGlobalLoaderCount:!1})})}),oZ=({isLoading:t=!1,isInteractionDisabled:e=!1,activeDemoSessionId:n=null,holdHostedTryoutPreviewNavigation:r=!1})=>{const{config:s,fetchConfig:i,isLoading:a,error:u}=bK();return g.useEffect(()=>{i().catch(c=>{Ee==null||Ee.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error",attempts:Vk})})},[i]),a?r?S.jsx("div",{className:"bg-main flex h-full min-h-0 w-full flex-1","aria-busy":"true"}):S.jsx(iZ,{}):u||!s?S.jsx(Wm,{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:()=>{Ee==null||Ee.capture("preview_config_retry_clicked"),i().catch(c=>{Ee==null||Ee.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error",attempts:Vk})})}}]}):S.jsx(aZ,{isLoading:t,isInteractionDisabled:e,framework:s.framework,userPort:s.userPort,activeDemoSessionId:n,holdHostedTryoutPreviewNavigation:r})};function aZ(t){const e=Qe(lo),n=Qe(tf),r=Qe(Tf),s=Qe(Vm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=g.useMemo(()=>{var R,L;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const y=(R=i??a)==null?void 0:R.variantId,w=r.variants.filter(O=>{var A;return O.status==="succeeded"&&((A=O.preview)==null?void 0:A.kind)==="static_artifact"&&O.workItemId!==y}),E=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),T=w.find(O=>{var A;return((A=O.preview)==null?void 0:A.kind)==="static_artifact"&&O.preview.url===E})??w[0];if(((L=T==null?void 0:T.preview)==null?void 0:L.kind)!=="static_artifact")return;const k=hA(r,r.sessionId,T.workItemId);if(k)return{sessionId:r.sessionId,variantId:T.workItemId,label:T.label,url:k,source:"live"}},[r,i,a,s]),c=qk(i,r)??(a?u:void 0),d=qk(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!d,m=!!(c||d),_=S.jsx(nZ,{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":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(Gk,{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&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:_}),d&&S.jsx(Gk,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(sZ,{}),S.jsx(rZ,{})]})})}const pA=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(m0,{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 Gi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
115
|
+
* GSAP 3.15.0
|
|
116
|
+
* https://gsap.com
|
|
117
|
+
*
|
|
118
|
+
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
119
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
120
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
121
|
+
*/var ts={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},lf={duration:.5,overwrite:!1,delay:0},Qx,Bn,Bt,bs=1e8,kt=1/bs,K_=Math.PI*2,lZ=K_/4,uZ=0,gA=Math.sqrt,cZ=Math.cos,dZ=Math.sin,On=function(e){return typeof e=="string"},nn=function(e){return typeof e=="function"},co=function(e){return typeof e=="number"},Jx=function(e){return typeof e>"u"},xi=function(e){return typeof e=="object"},Or=function(e){return e!==!1},ew=function(){return typeof window<"u"},xp=function(e){return nn(e)||On(e)},vA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},nr=Array.isArray,fZ=/random\([^)]+\)/g,hZ=/,\s*/g,Yk=/(?:-?\.?\d|\.)+/gi,yA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Eu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,T1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,_A=/[+-]=-?[.\d]+/,pZ=/[^,'"\[\]\s]+/gi,mZ=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,qt,oi,Z_,tw,rs={},Gm={},xA,wA=function(e){return(Gm=rc(e,rs))&&jr},nw=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},uf=function(e,n){return!n&&console.warn(e)},bA=function(e,n){return e&&(rs[e]=n)&&Gm&&(Gm[e]=n)||rs},cf=function(){return 0},gZ={suppressEvents:!0,isStart:!0,kill:!1},Bp={suppressEvents:!0,kill:!1},vZ={suppressEvents:!0},rw={},ta=[],q_={},SA,Zr={},R1={},Xk=30,Wp=[],sw="",iw=function(e){var n=e[0],r,s;if(xi(n)||nn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Wp.length;s--&&!Wp[s].targetTest(n););r=Wp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new WA(e[s],r)))||e.splice(s,1);return e},xl=function(e){return e._gsap||iw(Ss(e))[0]._gsap},EA=function(e,n,r){return(r=e[n])&&nn(r)?e[n]():Jx(r)&&e.getAttribute&&e.getAttribute(n)||r},Lr=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},Zt=function(e){return Math.round(e*1e7)/1e7||0},Mu=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},yZ=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Km=function(){var e=ta.length,n=ta.slice(0),r,s;for(q_={},ta.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},ow=function(e){return!!(e._initted||e._startAt||e.add)},CA=function(e,n,r,s){ta.length&&!Bn&&Km(),e.render(n,r,!!(Bn&&n<0&&ow(e))),ta.length&&!Bn&&Km()},kA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(pZ).length<2?n:On(e)?e.trim():e},PA=function(e){return e},ss=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},_Z=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},rc=function(e,n){for(var r in n)e[r]=n[r];return e},Qk=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=xi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Zm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Od=function(e){var n=e.parent||qt,r=e.keyframes?_Z(nr(e.keyframes)):ss;if(Or(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},xZ=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},TA=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},k0=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},ca=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},wl=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},wZ=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},Y_=function(e,n,r,s){return e._startAt&&(Bn?e._startAt.revert(Bp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},bZ=function t(e){return!e||e._ts&&t(e.parent)},Jk=function(e){return e._repeat?sc(e._tTime,e=e.duration()+e._rDelay)*e:0},sc=function(e,n){var r=Math.floor(e=Zt(e/n));return e&&r===e?r-1:r},qm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},P0=function(e){return e._end=Zt(e._start+(e._tDur/Math.abs(e._ts||e._rts||kt)||0))},T0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Zt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),P0(e),r._dirty||wl(r,e)),e},RA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=qm(e.rawTime(),n),(!n._dur||If(0,n.totalDuration(),r)-n._tTime>kt)&&n.render(r,!0)),wl(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=-kt}},fi=function(e,n,r,s){return n.parent&&ca(n),n._start=Zt((co(r)?r:r||e!==qt?vs(e,r,n):e._time)+n._delay),n._end=Zt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),TA(e,n,"_first","_last",e._sort?"_start":0),X_(n)||(e._recent=n),s||RA(e,n),e._ts<0&&T0(e,e._tTime),e},AA=function(e,n){return(rs.ScrollTrigger||nw("scrollTrigger",n))&&rs.ScrollTrigger.create(n,e)},IA=function(e,n,r,s,i){if(lw(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!Bn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&SA!==qr.frame)return ta.push(e),e._lazy=[i,s],1},SZ=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},X_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},EZ=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&SZ(e)&&!(!e._initted&&X_(e))||(e._ts<0||e._dp._ts<0)&&!X_(e))?0:1,u=e._rDelay,c=0,d,h,p;if(u&&e._repeat&&(c=If(0,e._tDur,n),h=sc(c,u),e._yoyo&&h&1&&(a=1-a),h!==sc(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Bn||s||e._zTime===kt||!n&&e._zTime){if(!e._initted&&IA(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?kt:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,d=e._pt;d;)d.r(a,d.d),d=d._next;n<0&&Y_(e,n,r,!0),e._onUpdate&&!r&&Xr(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&Xr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&ca(e,1),!r&&!Bn&&(Xr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},CZ=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}},ic=function(e,n,r,s){var i=e._repeat,a=Zt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Zt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&T0(e,e._tTime=e._tDur*u),e.parent&&P0(e),r||wl(e.parent,e),e},e8=function(e){return e instanceof Rr?wl(e):ic(e,e._dur)},kZ={_start:0,endTime:cf,totalDuration:cf},vs=function t(e,n,r){var s=e.labels,i=e._recent||kZ,a=e.duration()>=bs?i.endTime(!1):e._dur,u,c,d;return On(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=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)*(d?(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)),d&&r&&(c=c/100*(nr(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},Ld=function(e,n,r){var s=co(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=Or(c.vars.inherit)&&c.parent;a.immediateRender=Or(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new gn(n[0],a,n[i+1])},_a=function(e,n){return e||e===0?n(e):n},If=function(e,n,r){return r<e?e:r>n?n:r},er=function(e,n){return!On(e)||!(n=mZ.exec(e))?"":n[1]},PZ=function(e,n,r){return _a(r,function(s){return If(e,n,s)})},Q_=[].slice,MA=function(e,n){return e&&xi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&xi(e[0]))&&!e.nodeType&&e!==oi},TZ=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return On(s)&&!n||MA(s,1)?(i=r).push.apply(i,Ss(s)):r.push(s)})||r},Ss=function(e,n,r){return Bt&&!n&&Bt.selector?Bt.selector(e):On(e)&&!r&&(Z_||!oc())?Q_.call((n||tw).querySelectorAll(e),0):nr(e)?TZ(e,r):MA(e)?Q_.call(e,0):e?[e]:[]},J_=function(e){return e=Ss(e)[0]||uf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Ss(n,r.querySelectorAll?r:r===e?uf("Invalid scope")||tw.createElement("div"):e)}},OA=function(e){return e.sort(function(){return .5-Math.random()})},LA=function(e){if(nn(e))return e;var n=xi(e)?e:{each:e},r=bl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,d=n.axis,h=s,p=s;return On(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(m,_,x){var y=(x||n).length,w=a[y],E,P,T,k,R,L,O,A,M;if(!w){if(M=n.grid==="auto"?0:(n.grid||[1,bs])[1],!M){for(O=-bs;O<(O=x[M++].getBoundingClientRect().left)&&M<y;);M<y&&M--}for(w=a[y]=[],E=c?Math.min(M,y)*h-.5:s%M,P=M===bs?0:c?y*p/M-.5:s/M|0,O=0,A=bs,L=0;L<y;L++)T=L%M-E,k=P-(L/M|0),w[L]=R=d?Math.abs(d==="y"?k:T):gA(T*T+k*k),R>O&&(O=R),R<A&&(A=R);s==="random"&&OA(w),w.max=O-A,w.min=A,w.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(M>y?y-1:d?d==="y"?y/M:M:Math.max(M,y/M))||0)*(s==="edges"?-1:1),w.b=y<0?i-y:i,w.u=er(n.amount||n.each)||0,r=r&&y<0?HZ(r):r}return y=(w[m]-w.min)/w.max||0,Zt(w.b+(r?r(y):y)*w.v)+w.u}},e2=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Zt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(co(r)?0:er(r))}},DA=function(e,n){var r=nr(e),s,i;return!r&&xi(e)&&(s=r=e.radius||bs,e.values?(e=Ss(e.values),(i=!co(e[0]))&&(s*=s)):e=e2(e.increment)),_a(n,r?nn(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),d=bs,h=0,p=e.length,m,_;p--;)i?(m=e[p].x-u,_=e[p].y-c,m=m*m+_*_):m=Math.abs(e[p]-u),m<d&&(d=m,h=p);return h=!s||d<=s?e[h]:a,i||h===a||co(a)?h:h+er(a)}:e2(e))},NA=function(e,n,r,s){return _a(nr(e)?!n:r===!0?!!(r=0):!s,function(){return nr(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})},RZ=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)}},AZ=function(e,n){return function(r){return e(parseFloat(r))+(n||er(r))}},IZ=function(e,n,r){return FA(e,n,0,1,r)},jA=function(e,n,r){return _a(r,function(s){return e[~~n(s)]})},MZ=function t(e,n,r){var s=n-e;return nr(e)?jA(e,t(0,e.length),n):_a(r,function(i){return(s+(i-e)%s)%s+e})},OZ=function t(e,n,r){var s=n-e,i=s*2;return nr(e)?jA(e,t(0,e.length-1),n):_a(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},df=function(e){return e.replace(fZ,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(hZ);return NA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},FA=function(e,n,r,s,i){var a=n-e,u=s-r;return _a(i,function(c){return r+((c-e)/a*u||0)})},LZ=function t(e,n,r,s){var i=isNaN(e+n)?0:function(_){return(1-_)*e+_*n};if(!i){var a=On(e),u={},c,d,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(nr(e)&&!nr(n)){for(h=[],p=e.length,m=p-2,d=1;d<p;d++)h.push(t(e[d-1],e[d]));p--,i=function(x){x*=p;var y=Math.min(m,~~x);return h[y](x-y)},r=n}else s||(e=rc(nr(e)?[]:{},e));if(!h){for(c in n)aw.call(u,e,c,"get",n[c]);i=function(x){return dw(x,u)||(a?e.p:e)}}}return _a(r,i)},t8=function(e,n,r){var s=e.labels,i=bs,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},Xr=function(e,n,r){var s=e.vars,i=s[n],a=Bt,u=e._ctx,c,d,h;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&ta.length&&Km(),u&&(Bt=u),h=c?i.apply(d,c):i.call(d),Bt=a,h},_d=function(e){return ca(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Bn),e.progress()<1&&Xr(e,"onInterrupt"),e},Cu,VA=[],$A=function(e){if(e)if(e=!e.name&&e.default||e,ew()||e.headless){var n=e.name,r=nn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:cf,render:dw,add:aw,kill:XZ,modifier:YZ,rawVars:0},a={targetTest:0,get:0,getSetter:cw,aliases:{},register:0};if(oc(),e!==s){if(Zr[n])return;ss(s,ss(Zm(e,i),a)),rc(s.prototype,rc(i,Zm(e,a))),Zr[s.prop=n]=s,e.targetTest&&(Wp.push(s),rw[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}bA(n,s),e.register&&e.register(jr,s,Dr)}else VA.push(e)},Et=255,xd={aqua:[0,Et,Et],lime:[0,Et,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Et],navy:[0,0,128],white:[Et,Et,Et],olive:[128,128,0],yellow:[Et,Et,0],orange:[Et,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Et,0,0],pink:[Et,192,203],cyan:[0,Et,Et],transparent:[Et,Et,Et,0]},A1=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)*Et+.5|0},HA=function(e,n,r){var s=e?co(e)?[e>>16,e>>8&Et,e&Et]:0:xd.black,i,a,u,c,d,h,p,m,_,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),xd[e])s=xd[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&Et,s&Et,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Et,e&Et]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(Yk),!n)c=+s[0]%360/360,d=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(d+1):h+d-h*d,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=A1(c+1/3,i,a),s[1]=A1(c,i,a),s[2]=A1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(yA),r&&s.length<4&&(s[3]=1),s}else s=e.match(Yk)||xd.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/Et,a=s[1]/Et,u=s[2]/Et,p=Math.max(i,a,u),m=Math.min(i,a,u),h=(p+m)/2,p===m?c=d=0:(_=p-m,d=h>.5?_/(2-p-m):_/(p+m),c=p===i?(a-u)/_+(a<u?6:0):p===a?(u-i)/_+2:(i-a)/_+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},zA=function(e){var n=[],r=[],s=-1;return e.split(na).forEach(function(i){var a=i.match(Eu)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},n8=function(e,n,r){var s="",i=(e+s).match(na),a=n?"hsla(":"rgba(",u=0,c,d,h,p;if(!i)return e;if(i=i.map(function(m){return(m=HA(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=zA(e),c=r.c,c.join(s)!==h.c.join(s)))for(d=e.replace(na,"1").split(Eu),p=d.length-1;u<p;u++)s+=d[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!d)for(d=e.split(na),p=d.length-1;u<p;u++)s+=d[u]+i[u];return s+d[p]},na=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in xd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),DZ=/hsl[a]?\(/,UA=function(e){var n=e.join(" "),r;if(na.lastIndex=0,na.test(n))return r=DZ.test(n),e[1]=n8(e[1],r),e[0]=n8(e[0],r,zA(e[1])),!0},ff,qr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,d,h,p,m,_,x=function y(w){var E=t()-s,P=w===!0,T,k,R,L;if((E>e||E<0)&&(r+=E-n),s+=E,R=s-r,T=R-a,(T>0||P)&&(L=++p.frame,m=R-p.time*1e3,p.time=R=R/1e3,a+=T+(T>=i?4:i-T),k=1),P||(c=d(y)),k)for(_=0;_<u.length;_++)u[_](R,m,L,w)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){xA&&(!Z_&&ew()&&(oi=Z_=window,tw=oi.document||{},rs.gsap=jr,(oi.gsapVersions||(oi.gsapVersions=[])).push(jr.version),wA(Gm||oi.GreenSockGlobals||!oi.gsap&&oi||{}),VA.forEach($A)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),d=h||function(w){return setTimeout(w,a-p.time*1e3+1|0)},ff=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),ff=0,d=cf},lagSmoothing:function(w,E){e=w||1/0,n=Math.min(E||33,e)},fps:function(w){i=1e3/(w||240),a=p.time*1e3+i},add:function(w,E,P){var T=E?function(k,R,L,O){w(k,R,L,O),p.remove(T)}:w;return p.remove(w),u[P?"unshift":"push"](T),oc(),T},remove:function(w,E){~(E=u.indexOf(w))&&u.splice(E,1)&&_>=E&&_--},_listeners:u},p})(),oc=function(){return!ff&&qr.wake()},ft={},NZ=/^[\d.\-M][\d.\-,\s]/,jZ=/["']/g,FZ=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,d;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,d=c.substr(0,u),n[s]=isNaN(d)?d.replace(jZ,"").trim():+d,s=c.substr(u+1).trim();return n},VZ=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)},$Z=function(e){var n=(e+"").split("("),r=ft[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[FZ(n[1])]:VZ(e).split(",").map(kA)):ft._CE&&NZ.test(e)?ft._CE("",e):r},HZ=function(e){return function(n){return 1-e(1-n)}},bl=function(e,n){return e&&(nn(e)?e:ft[e]||$Z(e))||n},Rl=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 Lr(e,function(u){ft[u]=rs[u]=i,ft[a=u.toLowerCase()]=r;for(var c in i)ft[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ft[u+"."+c]=i[c]}),i},BA=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},I1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/K_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*dZ((h-a)*i)+1},c=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:BA(u);return i=K_/i,c.config=function(d,h){return t(e,d,h)},c},M1=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)}:BA(r);return s.config=function(i){return t(e,i)},s};Lr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Rl(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})});ft.Linear.easeNone=ft.none=ft.Linear.easeIn;Rl("Elastic",I1("in"),I1("out"),I1());(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};Rl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Rl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Rl("Circ",function(t){return-(gA(1-t*t)-1)});Rl("Sine",function(t){return t===1?1:-cZ(t*lZ)+1});Rl("Back",M1("in"),M1("out"),M1());ft.SteppedEase=ft.steps=rs.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-kt;return function(u){return((s*If(0,a,u)|0)+i)*r}}};lf.ease=ft["quad.out"];Lr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return sw+=t+","+t+"Params,"});var WA=function(e,n){this.id=uZ++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:EA,this.set=n?n.getSetter:cw},hf=(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,ic(this,+n.duration,1,1),this.data=n.data,Bt&&(this._ctx=Bt,Bt.data.push(this)),ff||qr.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,ic(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(oc(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(T0(this,r),!i._dp||i.parent||RA(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)&&fi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===kt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),CA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+Jk(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)+Jk(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?sc(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-kt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?qm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-kt?0:this._rts,this.totalTime(If(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),P0(this),wZ(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):(oc(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==kt&&(this._tTime-=kt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Zt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&fi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Or(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?qm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=vZ);var s=Bn;return Bn=r,ow(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Bn=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,e8(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,e8(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(vs(this,r),Or(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Or(s)),this._dur||(this._zTime=-kt),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?-kt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-kt,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)-kt)},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=nn(r)?r:PA,c=function(){var h=s.then;s.then=null,i&&i(),nn(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(){_d(this)},t})();ss(hf.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:-kt,_prom:0,_ps:!1,_rts:1});var Rr=(function(t){mA(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=Or(r.sortChildren),qt&&fi(r.parent||qt,Gi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&AA(Gi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Ld(0,arguments,this),this},n.from=function(s,i,a){return Ld(1,arguments,this),this},n.fromTo=function(s,i,a,u){return Ld(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Od(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new gn(s,i,vs(this,a),1),this},n.call=function(s,i,a){return fi(this,gn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,d,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=d,a.onCompleteParams=h,a.parent=this,new gn(s,a,vs(this,c)),this},n.staggerFrom=function(s,i,a,u,c,d,h){return a.runBackwards=1,Od(a).immediateRender=Or(a.immediateRender),this.staggerTo(s,i,a,u,c,d,h)},n.staggerFromTo=function(s,i,a,u,c,d,h,p){return u.startAt=a,Od(u).immediateRender=Or(u.immediateRender),this.staggerTo(s,i,u,c,d,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=s<=0?0:Zt(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,_,x,y,w,E,P,T,k,R,L,O;if(this!==qt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&d&&(h+=this._time-u,s+=this._time-u),m=h,k=this._start,T=this._ts,E=!T,p&&(d||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(L=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,a);if(m=Zt(h%w),h===c?(y=this._repeat,m=d):(R=Zt(h/w),y=~~R,y&&y===R&&(m=d,y--),m>d&&(m=d)),R=sc(this._tTime,w),!u&&this._tTime&&R!==y&&this._tTime-R*w-this._dur<=0&&(R=y),L&&y&1&&(m=d-m,O=1),y!==R&&!this._lock){var A=L&&R&1,M=A===(L&&y&1);if(y<R&&(A=!A),u=A?0:h%d?d:h,this._lock=1,this.render(u||(O?0:Zt(y*w)),i,!d)._lock=0,this._tTime=h,!i&&this.parent&&Xr(this,"onRepeat"),this.vars.repeatRefresh&&!O&&(this.invalidate()._lock=1,R=y),u&&u!==this._time||E!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,M&&(this._lock=2,u=A?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!O&&this.invalidate()),this._lock=0,!this._ts&&!E)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(P=CZ(this,Zt(u),Zt(m)),P&&(h-=m-(m=P._start))),this._tTime=h,this._time=m,this._act=!!T,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&d&&!i&&!R&&(Xr(this,"onStart"),this._tTime!==h))return this;if(m>=u&&s>=0)for(_=this._first;_;){if(x=_._next,(_._act||m>=_._start)&&_._ts&&P!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(m-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(m-_._start)*_._ts,i,a),m!==this._time||!this._ts&&!E){P=0,x&&(h+=this._zTime=-kt);break}}_=x}else{_=this._last;for(var D=s<0?s:m;_;){if(x=_._prev,(_._act||D<=_._end)&&_._ts&&P!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(D-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(D-_._start)*_._ts,i,a||Bn&&ow(_)),m!==this._time||!this._ts&&!E){P=0,x&&(h+=this._zTime=D?-kt:kt);break}}_=x}}if(P&&!i&&(this.pause(),P.render(m>=u?0:-kt)._zTime=m>=u?1:-1,this._ts))return this._start=k,P0(this),this.render(s,i,a);this._onUpdate&&!i&&Xr(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(k===this._start||Math.abs(T)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(h===c&&this._ts>0||!h&&this._ts<0)&&ca(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(Xr(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(co(i)||(i=vs(this,i,s)),!(s instanceof hf)){if(nr(s))return s.forEach(function(u){return a.add(u,i)}),this;if(On(s))return this.addLabel(s,i);if(nn(s))s=gn.delayedCall(0,s);else return this}return this!==s?fi(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=-bs);for(var c=[],d=this._first;d;)d._start>=u&&(d instanceof gn?i&&c.push(d):(a&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,a)))),d=d._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 On(s)?this.removeLabel(s):nn(s)?this.killTweensOf(s):(s.parent===this&&k0(this,s),s===this._recent&&(this._recent=this._last),wl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Zt(qr.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]=vs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=gn.delayedCall(0,i||cf,a);return u.data="isPause",this._hasPause=1,fi(this,u,vs(this,s))},n.removePause=function(s){var i=this._first;for(s=vs(this,s);i;)i._start===s&&i.data==="isPause"&&ca(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)qo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=Ss(s),c=this._first,d=co(i),h;c;)c instanceof gn?yZ(c._targets,u)&&(d?(!qo||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=vs(a,s),c=i,d=c.startAt,h=c.onStart,p=c.onStartParams,m=c.immediateRender,_,x=gn.to(a,ss({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale())||kt,onStart:function(){if(a.pause(),!_){var w=i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale());x._dur!==w&&ic(x,w,0,1).render(x._time,!0,!0),_=1}h&&h.apply(x,p||[])}},i));return m?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,ss({startAt:{time:vs(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),t8(this,vs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),t8(this,vs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+kt)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,d;for(s=Zt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(d in c)c[d]>=a&&(c[d]+=s);return wl(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={}),wl(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=bs,d,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;)d=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,fi(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Zt(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=d;ic(a,a===qt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(qt._ts&&(CA(qt,qm(s,qt)),SA=qr.frame),qr.frame>=Xk){Xk+=ts.autoSleep||120;var i=qt._first;if((!i||!i._ts)&&ts.autoSleep&&qr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||qr.sleep()}}},e})(hf);ss(Rr.prototype,{_lock:0,_hasPause:0,_forcing:0});var zZ=function(e,n,r,s,i,a,u){var c=new Dr(this._pt,e,n,0,1,XA,null,i),d=0,h=0,p,m,_,x,y,w,E,P;for(c.b=r,c.e=s,r+="",s+="",(E=~s.indexOf("random("))&&(s=df(s)),a&&(P=[r,s],a(P,e,n),r=P[0],s=P[1]),m=r.match(T1)||[];p=T1.exec(s);)x=p[0],y=s.substring(d,p.index),_?_=(_+1)%5:y.substr(-5)==="rgba("&&(_=1),x!==m[h++]&&(w=parseFloat(m[h-1])||0,c._pt={_next:c._pt,p:y||h===1?y:",",s:w,c:x.charAt(1)==="="?Mu(w,x)-w:parseFloat(x)-w,m:_&&_<4?Math.round:0},d=T1.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=u,(_A.test(s)||E)&&(c.e=0),this._pt=c,c},aw=function(e,n,r,s,i,a,u,c,d,h){nn(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:nn(p)?d?e[n.indexOf("set")||!nn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,_=nn(p)?d?KZ:qA:uw,x;if(On(s)&&(~s.indexOf("random(")&&(s=df(s)),s.charAt(1)==="="&&(x=Mu(m,s)+(er(m)||0),(x||x===0)&&(s=x))),!h||m!==s||t2)return!isNaN(m*s)&&s!==""?(x=new Dr(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?qZ:YA,0,_),d&&(x.fp=d),u&&x.modifier(u,this,e),this._pt=x):(!p&&!(n in e)&&nw(n,s),zZ.call(this,e,n,m,s,_,c||ts.stringFilter,d))},UZ=function(e,n,r,s,i){if(nn(e)&&(e=Dd(e,i,n,r,s)),!xi(e)||e.style&&e.nodeType||nr(e)||vA(e))return On(e)?Dd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Dd(e[u],i,n,r,s);return a},GA=function(e,n,r,s,i,a){var u,c,d,h;if(Zr[e]&&(u=new Zr[e]).init(i,u.rawVars?n[e]:UZ(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Dr(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==Cu))for(d=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)d[u._props[h]]=c;return u},qo,t2,lw=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,d=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,_=s.autoRevert,x=e._dur,y=e._startAt,w=e._targets,E=e.parent,P=E&&E.data==="nested"?E.vars.targets:w,T=e._overwrite==="auto"&&!Qx,k=e.timeline,R=s.easeReverse||p,L,O,A,M,D,F,N,W,Y,q,B,K,$;if(k&&(!m||!i)&&(i="none"),e._ease=bl(i,lf.ease),e._rEase=R&&(bl(R)||e._ease),e._from=!k&&!!s.runBackwards,e._from&&(e.ratio=1),!k||m&&!s.stagger){if(W=w[0]?xl(w[0]).harness:0,K=W&&s[W.prop],L=Zm(s,rw),y&&(y._zTime<0&&y.progress(1),n<0&&h&&u&&!_?y.render(-1,!0):y.revert(h&&x?Bp:gZ),y._lazy=0),a){if(ca(e._startAt=gn.set(w,ss({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:!y&&Or(c),startAt:null,delay:0,onUpdate:d&&function(){return Xr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Bn||!u&&!_)&&e._startAt.revert(Bp),u&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!y){if(n&&(u=!1),A=ss({overwrite:!1,data:"isFromStart",lazy:u&&!y&&Or(c),immediateRender:u,stagger:0,parent:E},L),K&&(A[W.prop]=K),ca(e._startAt=gn.set(w,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Bn?e._startAt.revert(Bp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,kt,kt);else if(!n)return}for(e._pt=e._ptCache=0,c=x&&Or(c)||c&&!x,O=0;O<w.length;O++){if(D=w[O],N=D._gsap||iw(w)[O]._gsap,e._ptLookup[O]=q={},q_[N.id]&&ta.length&&Km(),B=P===w?O:P.indexOf(D),W&&(Y=new W).init(D,K||L,e,B,P)!==!1&&(e._pt=M=new Dr(e._pt,D,Y.name,0,1,Y.render,Y,0,Y.priority),Y._props.forEach(function(J){q[J]=M}),Y.priority&&(F=1)),!W||K)for(A in L)Zr[A]&&(Y=GA(A,L,e,B,D,P))?Y.priority&&(F=1):q[A]=M=aw.call(e,D,A,"get",L[A],B,P,0,s.stringFilter);e._op&&e._op[O]&&e.kill(D,e._op[O]),T&&e._pt&&(qo=e,qt.killTweensOf(D,q,e.globalTime(n)),$=!e.parent,qo=0),e._pt&&c&&(q_[N.id]=1)}F&&QA(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!$,m&&n<=0&&k.render(bs,!0,!0)},BZ=function(e,n,r,s,i,a,u,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,_;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,_=e._targets.length;_--;){if(h=m[_][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 t2=1,e.vars[n]="+=0",lw(e,u),t2=0,c?uf(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(h)}for(_=d.length;_--;)p=d[_],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)+er(p.e)),p.b&&(p.b=h.s+er(p.b))},WZ=function(e,n){var r=e[0]?xl(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=rc({},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},GZ=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(nr(n))u=r[e]||(r[e]=[]),n.forEach(function(c,d){return u.push({t:d/(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})},Dd=function(e,n,r,s,i){return nn(e)?e.call(n,r,s,i):On(e)&&~e.indexOf("random(")?df(e):e},KA=sw+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",ZA={};Lr(KA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return ZA[t]=1});var gn=(function(t){mA(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:Od(s))||this;var c=u.vars,d=c.duration,h=c.delay,p=c.immediateRender,m=c.stagger,_=c.overwrite,x=c.keyframes,y=c.defaults,w=c.scrollTrigger,E=s.parent||qt,P=(nr(r)||vA(r)?co(r[0]):"length"in s)?[r]:Ss(r),T,k,R,L,O,A,M,D;if(u._targets=P.length?iw(P):uf("GSAP target "+r+" not found. https://gsap.com",!ts.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=_,x||m||xp(d)||xp(h)){s=u.vars;var F=s.easeReverse||s.yoyoEase;if(T=u.timeline=new Rr({data:"nested",defaults:y||{},targets:E&&E.data==="nested"?E.vars.targets:P}),T.kill(),T.parent=T._dp=Gi(u),T._start=0,m||xp(d)||xp(h)){if(L=P.length,M=m&&LA(m),xi(m))for(O in m)~KA.indexOf(O)&&(D||(D={}),D[O]=m[O]);for(k=0;k<L;k++)R=Zm(s,ZA),R.stagger=0,F&&(R.easeReverse=F),D&&rc(R,D),A=P[k],R.duration=+Dd(d,Gi(u),k,A,P),R.delay=(+Dd(h,Gi(u),k,A,P)||0)-u._delay,!m&&L===1&&R.delay&&(u._delay=h=R.delay,u._start+=h,R.delay=0),T.to(A,R,M?M(k,A,P):0),T._ease=ft.none;T.duration()?d=h=0:u.timeline=0}else if(x){Od(ss(T.vars.defaults,{ease:"none"})),T._ease=bl(x.ease||s.ease||"none");var N=0,W,Y,q;if(nr(x))x.forEach(function(B){return T.to(P,B,">")}),T.duration();else{R={};for(O in x)O==="ease"||O==="easeEach"||GZ(O,x[O],R,x.easeEach);for(O in R)for(W=R[O].sort(function(B,K){return B.t-K.t}),N=0,k=0;k<W.length;k++)Y=W[k],q={ease:Y.e,duration:(Y.t-(k?W[k-1].t:0))/100*d},q[O]=Y.v,T.to(P,q,N),N+=q.duration;T.duration()<d&&T.to({},{duration:d-T.duration()})}}d||u.duration(d=T.duration())}else u.timeline=0;return _===!0&&!Qx&&(qo=Gi(u),qt.killTweensOf(P),qo=0),fi(E,Gi(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!d&&!x&&u._start===Zt(E._time)&&Or(p)&&bZ(Gi(u))&&E.data!=="nested")&&(u._tTime=-kt,u.render(Math.max(0,-h)||0)),w&&AA(Gi(u),w),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,d=this._dur,h=s<0,p=s>c-kt&&!h?c:s<kt?0:s,m,_,x,y,w,E,P,T;if(!d)EZ(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,T=this.timeline,this._repeat){if(y=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(y*100+s,i,a);if(m=Zt(p%y),p===c?(x=this._repeat,m=d):(w=Zt(p/y),x=~~w,x&&x===w?(m=d,x--):m>d&&(m=d)),E=this._yoyo&&x&1,E&&(m=d-m),w=sc(this._tTime,y),m===u&&!a&&this._initted&&x===w)return this._tTime=p,this;x!==w&&this.vars.repeatRefresh&&!E&&!this._lock&&m!==y&&this._initted&&(this._lock=a=1,this.render(Zt(y*x),!0).invalidate()._lock=0)}if(!this._initted){if(IA(this,h?s:m,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&x!==w))return this;if(d!==this._dur)return this.render(s,i,a)}if(this._rEase){var k=m<u;if(k!==this._inv){var R=k?u:d-u;this._inv=k,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=R?(k?-1:1)/R:0,this._invScale=k?-this.ratio:1-this.ratio,this._invEase=k?this._rEase:this._ease}this.ratio=P=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=P=this._ease(m/d);if(this._from&&(this.ratio=P=1-P),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!w&&(Xr(this,"onStart"),this._tTime!==p))return this;for(_=this._pt;_;)_.r(P,_.d),_=_._next;T&&T.render(s<0?s:T._dur*T._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&Y_(this,s,i,a),Xr(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&Xr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&Y_(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ca(this,1),!i&&!(h&&!u)&&(p||u||E)&&(Xr(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){ff||qr.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||lw(this,d),h=this._ease(d/this._dur),BZ(this,s,i,a,u,h,d,c)?this.resetTo(s,i,a,u,1):(T0(this,0),this.parent||TA(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?_d(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Bn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,qo&&qo.vars.overwrite!==!0)._first||_d(this),this.parent&&a!==this.timeline.totalDuration()&&ic(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?Ss(s):u,d=this._ptLookup,h=this._pt,p,m,_,x,y,w,E;if((!i||i==="all")&&xZ(u,c))return i==="all"&&(this._pt=0),_d(this);for(p=this._op=this._op||[],i!=="all"&&(On(i)&&(y={},Lr(i,function(P){return y[P]=1}),i=y),i=WZ(u,i)),E=u.length;E--;)if(~c.indexOf(u[E])){m=d[E],i==="all"?(p[E]=i,x=m,_={}):(_=p[E]=p[E]||{},x=i);for(y in x)w=m&&m[y],w&&((!("kill"in w.d)||w.d.kill(y)===!0)&&k0(this,w,"_pt"),delete m[y]),_!=="all"&&(_[y]=1)}return this._initted&&!this._pt&&h&&_d(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Ld(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 Ld(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})(hf);ss(gn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Lr("staggerTo,staggerFrom,staggerFromTo",function(t){gn[t]=function(){var e=new Rr,n=Q_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var uw=function(e,n,r){return e[n]=r},qA=function(e,n,r){return e[n](r)},KZ=function(e,n,r,s){return e[n](s.fp,r)},ZZ=function(e,n,r){return e.setAttribute(n,r)},cw=function(e,n){return nn(e[n])?qA:Jx(e[n])&&e.setAttribute?ZZ:uw},YA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},qZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},XA=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)},dw=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},YZ=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},XZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?k0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},QZ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},QA=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},Dr=(function(){function t(n,r,s,i,a,u,c,d,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||YA,this.d=c||this,this.set=d||uw,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=QZ,this.m=r,this.mt=i,this.tween=s},t})();Lr(sw+"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 rw[t]=1});rs.TweenMax=rs.TweenLite=gn;rs.TimelineLite=rs.TimelineMax=Rr;qt=new Rr({sortChildren:!1,defaults:lf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ts.stringFilter=UA;var Sl=[],Gp={},JZ=[],r8=0,eq=0,O1=function(e){return(Gp[e]||JZ).map(function(n){return n()})},n2=function(){var e=Date.now(),n=[];e-r8>2&&(O1("matchMediaInit"),Sl.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,d;for(u in s)a=oi.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,d=1);d&&(r.revert(),c&&n.push(r))}),O1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),r8=e,O1("matchMedia"))},JA=(function(){function t(n,r){this.selector=r&&J_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=eq++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){nn(r)&&(i=s,s=r,r=nn);var a=this,u=function(){var d=Bt,h=a.selector,p;return d&&d!==a&&d.data.push(a),i&&(a.selector=J_(i)),Bt=a,p=s.apply(a,arguments),nn(p)&&a._r.push(p),Bt=d,a.selector=h,a.isReverted=!1,p};return a.last=u,r===nn?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},e.ignore=function(r){var s=Bt;Bt=null,r(this),Bt=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof gn&&!(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,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.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--;)d=i.data[c],d instanceof Rr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof gn)&&d.revert&&d.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=Sl.length;a--;)Sl[a].id===this.id&&Sl.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),tq=(function(){function t(n){this.contexts=[],this.scope=n,Bt&&Bt.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){xi(r)||(r={matches:r});var a=new JA(0,i||this.scope),u=a.conditions={},c,d,h;Bt&&!a.selector&&(a.selector=Bt.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(d in r)d==="all"?h=1:(c=oi.matchMedia(r[d]),c&&(Sl.indexOf(a)<0&&Sl.push(a),(u[d]=c.matches)&&(h=1),c.addListener?c.addListener(n2):c.addEventListener("change",n2)));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})(),Ym={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 $A(s)})},timeline:function(e){return new Rr(e)},getTweensOf:function(e,n){return qt.getTweensOf(e,n)},getProperty:function(e,n,r,s){On(e)&&(e=Ss(e)[0]);var i=xl(e||{}).get,a=r?PA:kA;return r==="native"&&(r=""),e&&(n?a((Zr[n]&&Zr[n].get||i)(e,n,r,s)):function(u,c,d){return a((Zr[u]&&Zr[u].get||i)(e,u,c,d))})},quickSetter:function(e,n,r){if(e=Ss(e),e.length>1){var s=e.map(function(h){return jr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Zr[n],u=xl(e),c=u.harness&&(u.harness.aliases||{})[n]||n,d=a?function(h){var p=new a;Cu._pt=0,p.init(e,r?h+r:h,Cu,0,[e]),p.render(1,p),Cu._pt&&dw(1,Cu)}:u.set(e,c);return a?d:function(h){return d(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=jr.to(e,ss((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,d,h){return i.resetTo(n,c,d,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=bl(e.ease,lf.ease)),Qk(lf,e||{})},config:function(e){return Qk(ts,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&&!Zr[u]&&!rs[u]&&uf(n+" effect requires "+u+" plugin.")}),R1[n]=function(u,c,d){return r(Ss(u),ss(c||{},i),d)},a&&(Rr.prototype[n]=function(u,c,d){return this.add(R1[n](u,xi(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){ft[e]=bl(n)},parseEase:function(e,n){return arguments.length?bl(e,n):ft},getById:function(e){return qt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Rr(e),s,i;for(r.smoothChildTiming=Or(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 gn&&s.vars.onComplete===s._targets[0]))&&fi(r,s,s._start-s._delay),s=i;return fi(qt,r,0),r},context:function(e,n){return e?new JA(e,n):Bt},matchMedia:function(e){return new tq(e)},matchMediaRefresh:function(){return Sl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||n2()},addEventListener:function(e,n){var r=Gp[e]||(Gp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Gp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:MZ,wrapYoyo:OZ,distribute:LA,random:NA,snap:DA,normalize:IZ,getUnit:er,clamp:PZ,splitColor:HA,toArray:Ss,selector:J_,mapRange:FA,pipe:RZ,unitize:AZ,interpolate:LZ,shuffle:OA},install:wA,effects:R1,ticker:qr,updateRoot:Rr.updateRoot,plugins:Zr,globalTimeline:qt,core:{PropTween:Dr,globals:bA,Tween:gn,Timeline:Rr,Animation:hf,getCache:xl,_removeLinkedListItem:k0,reverting:function(){return Bn},context:function(e){return e&&Bt&&(Bt.data.push(e),e._ctx=Bt),Bt},suppressOverwrites:function(e){return Qx=e}}};Lr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Ym[t]=gn[t]});qr.add(Rr.updateRoot);Cu=Ym.to({},{duration:0});var nq=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},rq=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=nq(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},L1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,d;if(On(i)&&(c={},Lr(i,function(h){return c[h]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}rq(u,i)}}}},jr=Ym.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;)Bn?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)}},L1("roundProps",e2),L1("modifiers"),L1("snap",DA))||Ym;gn.version=Rr.version=jr.version="3.15.0";xA=1;ew()&&oc();ft.Power0;ft.Power1;ft.Power2;ft.Power3;ft.Power4;ft.Linear;ft.Quad;ft.Cubic;ft.Quart;ft.Quint;ft.Strong;ft.Elastic;ft.Back;ft.SteppedEase;ft.Bounce;ft.Sine;ft.Expo;ft.Circ;/*!
|
|
122
|
+
* CSSPlugin 3.15.0
|
|
123
|
+
* https://gsap.com
|
|
124
|
+
*
|
|
125
|
+
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
126
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
127
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
128
|
+
*/var s8,Yo,Ou,fw,ol,i8,hw,sq=function(){return typeof window<"u"},fo={},Ja=180/Math.PI,Lu=Math.PI/180,fu=Math.atan2,o8=1e8,pw=/([A-Z])/g,iq=/(left|right|width|margin|padding|x)/i,oq=/[\s,\(]\S/,mi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},r2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},aq=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)},lq=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)},uq=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)},cq=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},eI=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},tI=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},dq=function(e,n,r){return e.style[n]=r},fq=function(e,n,r){return e.style.setProperty(n,r)},hq=function(e,n,r){return e._gsap[n]=r},pq=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},mq=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},gq=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Yt="transform",Nr=Yt+"Origin",vq=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in fo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=mi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=Zi(s,u)}):this.tfm[e]=a.x?a[e]:Zi(s,e),e===Nr&&(this.tfm.zOrigin=a.zOrigin);else return mi.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(Yt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Nr,n,"")),e=Yt}(i||n)&&this.props.push(e,n,i[e])},nI=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},yq=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(pw,"-$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=hw(),(!i||!i.isStart)&&!r[Yt]&&(nI(r),s.zOrigin&&r[Nr]&&(r[Nr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},rI=function(e,n){var r={target:e,props:[],revert:yq,save:vq};return e._gsap||jr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},sI,s2=function(e,n){var r=Yo.createElementNS?Yo.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Yo.createElement(e);return r&&r.style?r:Yo.createElement(e)},Qr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(pw,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,ac(n)||n,1)||""},a8="O,Moz,ms,Ms,Webkit".split(","),ac=function(e,n,r){var s=n||ol,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(a8[a]+e in i););return a<0?null:(a===3?"ms":a>=0?a8[a]:"")+e},i2=function(){sq()&&window.document&&(s8=window,Yo=s8.document,Ou=Yo.documentElement,ol=s2("div")||{style:{}},s2("div"),Yt=ac(Yt),Nr=Yt+"Origin",ol.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",sI=!!ac("perspective"),hw=jr.core.reverting,fw=1)},l8=function(e){var n=e.ownerSVGElement,r=s2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Ou.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Ou.removeChild(r),i},u8=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},iI=function(e){var n,r;try{n=e.getBBox()}catch{n=l8(e),r=1}return n&&(n.width||n.height)||r||(n=l8(e)),n&&!n.width&&!n.x&&!n.y?{x:+u8(e,["x","cx","x1"])||0,y:+u8(e,["y","cy","y1"])||0,width:0,height:0}:n},oI=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&iI(e))},da=function(e,n){if(n){var r=e.style,s;n in fo&&n!==Nr&&(n=Yt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(pw,"-$1").toLowerCase())):r.removeAttribute(n)}},Xo=function(e,n,r,s,i,a){var u=new Dr(e._pt,n,r,0,1,a?tI:eI);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},c8={deg:1,rad:1,turn:1},_q={grid:1,flex:1},fa=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=ol.style,c=iq.test(n),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(c?"Width":"Height"),p=100,m=s==="px",_=s==="%",x,y,w,E;if(s===a||!i||c8[s]||c8[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),E=e.getCTM&&oI(e),(_||a==="%")&&(fo[n]||~n.indexOf("adius")))return x=E?e.getBBox()[c?"width":"height"]:e[h],an(_?i/x*p:i/100*x);if(u[c?"width":"height"]=p+(m?a:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,E&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===Yo||!y.appendChild)&&(y=Yo.body),w=y._gsap,w&&_&&w.width&&c&&w.time===qr.time&&!w.uncache)return an(i/w.width*p);if(_&&(n==="height"||n==="width")){var P=e.style[n];e.style[n]=p+s,x=e[h],P?e.style[n]=P:da(e,n)}else(_||a==="%")&&!_q[Qr(y,"display")]&&(u.position=Qr(e,"position")),y===e&&(u.position="static"),y.appendChild(ol),x=ol[h],y.removeChild(ol),u.position="absolute";return c&&_&&(w=xl(y),w.time=qr.time,w.width=y[h]),an(m?x*i/p:x&&i?p/x*i:0)},Zi=function(e,n,r,s){var i;return fw||i2(),n in mi&&n!=="transform"&&(n=mi[n],~n.indexOf(",")&&(n=n.split(",")[0])),fo[n]&&n!=="transform"?(i=mf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Qm(Qr(e,Nr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Xm[n]&&Xm[n](e,n,r)||Qr(e,n)||EA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?fa(e,n,i,r)+r:i},xq=function(e,n,r,s){if(!r||r==="none"){var i=ac(n,e,1),a=i&&Qr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Qr(e,"borderTopColor"))}var u=new Dr(this._pt,e.style,n,0,1,XA),c=0,d=0,h,p,m,_,x,y,w,E,P,T,k,R;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Qr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=Qr(e,n)||s,y?e.style[n]=y:da(e,n)),h=[r,s],UA(h),r=h[0],s=h[1],m=r.match(Eu)||[],R=s.match(Eu)||[],R.length){for(;p=Eu.exec(s);)w=p[0],P=s.substring(c,p.index),x?x=(x+1)%5:(P.substr(-5)==="rgba("||P.substr(-5)==="hsla(")&&(x=1),w!==(y=m[d++]||"")&&(_=parseFloat(y)||0,k=y.substr((_+"").length),w.charAt(1)==="="&&(w=Mu(_,w)+k),E=parseFloat(w),T=w.substr((E+"").length),c=Eu.lastIndex-T.length,T||(T=T||ts.units[n]||k,c===s.length&&(s+=T,u.e+=T)),k!==T&&(_=fa(e,n,y,T)||0),u._pt={_next:u._pt,p:P||d===1?P:",",s:_,c:E-_,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"?tI:eI;return _A.test(s)&&(u.e=0),this._pt=u,u},d8={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},wq=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]=d8[r]||r,n[1]=d8[s]||s,n.join(" ")},bq=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,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)u=i[d],fo[u]&&(c=1,u=u==="transformOrigin"?Nr:Yt),da(r,u);c&&(da(r,Yt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",mf(r,1),a.uncache=1,nI(s)))}},Xm={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Dr(e._pt,n,r,0,0,bq);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},pf=[1,0,0,1,0,0],aI={},lI=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},f8=function(e){var n=Qr(e,Yt);return lI(n)?pf:n.substr(7).match(yA).map(an)},mw=function(e,n){var r=e._gsap||xl(e),s=e.style,i=f8(e),a,u,c,d;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"?pf:i):(i===pf&&!e.offsetParent&&e!==Ou&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,u=e.nextElementSibling,Ou.appendChild(e)),i=f8(e),c?s.display=c:da(e,"display"),d&&(u?a.insertBefore(e,u):a?a.appendChild(e):Ou.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},o2=function(e,n,r,s,i,a){var u=e._gsap,c=i||mw(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,_=c[0],x=c[1],y=c[2],w=c[3],E=c[4],P=c[5],T=n.split(" "),k=parseFloat(T[0])||0,R=parseFloat(T[1])||0,L,O,A,M;r?c!==pf&&(O=_*w-x*y)&&(A=k*(w/O)+R*(-y/O)+(y*P-w*E)/O,M=k*(-x/O)+R*(_/O)-(_*P-x*E)/O,k=A,R=M):(L=iI(e),k=L.x+(~T[0].indexOf("%")?k/100*L.width:k),R=L.y+(~(T[1]||T[0]).indexOf("%")?R/100*L.height:R)),s||s!==!1&&u.smooth?(E=k-d,P=R-h,u.xOffset=p+(E*_+P*y)-E,u.yOffset=m+(E*x+P*w)-P):u.xOffset=u.yOffset=0,u.xOrigin=k,u.yOrigin=R,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Nr]="0px 0px",a&&(Xo(a,u,"xOrigin",d,k),Xo(a,u,"yOrigin",h,R),Xo(a,u,"xOffset",p,u.xOffset),Xo(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",k+" "+R)},mf=function(e,n){var r=e._gsap||new WA(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),d=Qr(e,Nr)||"0",h,p,m,_,x,y,w,E,P,T,k,R,L,O,A,M,D,F,N,W,Y,q,B,K,$,J,H,j,X,te,ie,ae;return h=p=m=y=w=E=P=T=k=0,_=x=1,r.svg=!!(e.getCTM&&oI(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Yt]=(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[Yt]!=="none"?c[Yt]:"")),s.scale=s.rotate=s.translate="none"),O=mw(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),d=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",K=""):K=!n&&e.getAttribute("data-svg-origin"),o2(e,K||d,!!K||r.originIsAbsolute,r.smooth!==!1,O)),R=r.xOrigin||0,L=r.yOrigin||0,O!==pf&&(F=O[0],N=O[1],W=O[2],Y=O[3],h=q=O[4],p=B=O[5],O.length===6?(_=Math.sqrt(F*F+N*N),x=Math.sqrt(Y*Y+W*W),y=F||N?fu(N,F)*Ja:0,P=W||Y?fu(W,Y)*Ja+y:0,P&&(x*=Math.abs(Math.cos(P*Lu))),r.svg&&(h-=R-(R*F+L*W),p-=L-(R*N+L*Y))):(ae=O[6],te=O[7],H=O[8],j=O[9],X=O[10],ie=O[11],h=O[12],p=O[13],m=O[14],A=fu(ae,X),w=A*Ja,A&&(M=Math.cos(-A),D=Math.sin(-A),K=q*M+H*D,$=B*M+j*D,J=ae*M+X*D,H=q*-D+H*M,j=B*-D+j*M,X=ae*-D+X*M,ie=te*-D+ie*M,q=K,B=$,ae=J),A=fu(-W,X),E=A*Ja,A&&(M=Math.cos(-A),D=Math.sin(-A),K=F*M-H*D,$=N*M-j*D,J=W*M-X*D,ie=Y*D+ie*M,F=K,N=$,W=J),A=fu(N,F),y=A*Ja,A&&(M=Math.cos(A),D=Math.sin(A),K=F*M+N*D,$=q*M+B*D,N=N*M-F*D,B=B*M-q*D,F=K,q=$),w&&Math.abs(w)+Math.abs(y)>359.9&&(w=y=0,E=180-E),_=an(Math.sqrt(F*F+N*N+W*W)),x=an(Math.sqrt(B*B+ae*ae)),A=fu(q,B),P=Math.abs(A)>2e-4?A*Ja:0,k=ie?1/(ie<0?-ie:ie):0),r.svg&&(K=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!lI(Qr(e,Yt)),K&&e.setAttribute("transform",K))),Math.abs(P)>90&&Math.abs(P)<270&&(i?(_*=-1,P+=y<=0?180:-180,y+=y<=0?180:-180):(x*=-1,P+=P<=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=m+a,r.scaleX=an(_),r.scaleY=an(x),r.rotation=an(y)+u,r.rotationX=an(w)+u,r.rotationY=an(E)+u,r.skewX=P+u,r.skewY=T+u,r.transformPerspective=k+a,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Nr]=Qm(d)),r.xOffset=r.yOffset=0,r.force3D=ts.force3D,r.renderTransform=r.svg?Eq:sI?uI:Sq,r.uncache=0,r},Qm=function(e){return(e=e.split(" "))[0]+" "+e[1]},D1=function(e,n,r){var s=er(n);return an(parseFloat(n)+parseFloat(fa(e,"x",r+"px",s)))+s},Sq=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,uI(e,n)},Ka="0deg",cd="0px",Za=") ",uI=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,d=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,_=r.skewY,x=r.scaleX,y=r.scaleY,w=r.transformPerspective,E=r.force3D,P=r.target,T=r.zOrigin,k="",R=E==="auto"&&e&&e!==1||E===!0;if(T&&(p!==Ka||h!==Ka)){var L=parseFloat(h)*Lu,O=Math.sin(L),A=Math.cos(L),M;L=parseFloat(p)*Lu,M=Math.cos(L),a=D1(P,a,O*M*-T),u=D1(P,u,-Math.sin(L)*-T),c=D1(P,c,A*M*-T+T)}w!==cd&&(k+="perspective("+w+Za),(s||i)&&(k+="translate("+s+"%, "+i+"%) "),(R||a!==cd||u!==cd||c!==cd)&&(k+=c!==cd||R?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+Za),d!==Ka&&(k+="rotate("+d+Za),h!==Ka&&(k+="rotateY("+h+Za),p!==Ka&&(k+="rotateX("+p+Za),(m!==Ka||_!==Ka)&&(k+="skew("+m+", "+_+Za),(x!==1||y!==1)&&(k+="scale("+x+", "+y+Za),P.style[Yt]=k||"translate(0, 0)"},Eq=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,d=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,_=r.target,x=r.xOrigin,y=r.yOrigin,w=r.xOffset,E=r.yOffset,P=r.forceCSS,T=parseFloat(a),k=parseFloat(u),R,L,O,A,M;c=parseFloat(c),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,c+=h),c||d?(c*=Lu,d*=Lu,R=Math.cos(c)*p,L=Math.sin(c)*p,O=Math.sin(c-d)*-m,A=Math.cos(c-d)*m,d&&(h*=Lu,M=Math.tan(d-h),M=Math.sqrt(1+M*M),O*=M,A*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),R*=M,L*=M)),R=an(R),L=an(L),O=an(O),A=an(A)):(R=p,A=m,L=O=0),(T&&!~(a+"").indexOf("px")||k&&!~(u+"").indexOf("px"))&&(T=fa(_,"x",a,"px"),k=fa(_,"y",u,"px")),(x||y||w||E)&&(T=an(T+x-(x*R+y*O)+w),k=an(k+y-(x*L+y*A)+E)),(s||i)&&(M=_.getBBox(),T=an(T+s/100*M.width),k=an(k+i/100*M.height)),M="matrix("+R+","+L+","+O+","+A+","+T+","+k+")",_.setAttribute("transform",M),P&&(_.style[Yt]=M)},Cq=function(e,n,r,s,i){var a=360,u=On(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Ja:1),d=c-s,h=s+d+"deg",p,m;return u&&(p=i.split("_")[1],p==="short"&&(d%=a,d!==d%(a/2)&&(d+=d<0?a:-a)),p==="cw"&&d<0?d=(d+a*o8)%a-~~(d/a)*a:p==="ccw"&&d>0&&(d=(d-a*o8)%a-~~(d/a)*a)),e._pt=m=new Dr(e._pt,n,r,s,d,aq),m.e=h,m.u="deg",e._props.push(r),m},h8=function(e,n){for(var r in n)e[r]=n[r];return e},kq=function(e,n,r){var s=h8({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,d,h,p,m,_,x;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),a[Yt]=n,u=mf(r,1),da(r,Yt),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Yt],a[Yt]=n,u=mf(r,1),a[Yt]=d);for(c in fo)d=s[c],h=u[c],d!==h&&i.indexOf(c)<0&&(_=er(d),x=er(h),p=_!==x?fa(r,c,d,x):parseFloat(d),m=parseFloat(h),e._pt=new Dr(e._pt,u,c,p,m-p,r2),e._pt.u=x||0,e._props.push(c));h8(u,s)};Lr("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});Xm[e>1?"border"+t:t]=function(u,c,d,h,p){var m,_;if(arguments.length<4)return m=a.map(function(x){return Zi(u,x,d)}),_=m.join(" "),_.split(m[0]).length===5?m[0]:_;m=(h+"").split(" "),_={},a.forEach(function(x,y){return _[x]=m[y]=m[y]||m[(y-1)/2|0]}),u.init(c,_,p)}});var cI={name:"css",register:i2,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,d,h,p,m,_,x,y,w,E,P,T,k,R,L,O,A,M;fw||i2(),this.styles=this.styles||rI(e),A=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(h=n[y],!(Zr[y]&&GA(y,n,r,s,e,i)))){if(_=typeof h,x=Xm[y],_==="function"&&(h=h.call(r,s,e,i),_=typeof h),_==="string"&&~h.indexOf("random(")&&(h=df(h)),x)x(this,e,y,h,r)&&(O=1);else if(y.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(y)+"").trim(),h+="",na.lastIndex=0,na.test(d)||(w=er(d),E=er(h),E?w!==E&&(d=fa(e,y,d,E)+E):w&&(h+=w)),this.add(u,"setProperty",d,h,s,i,0,0,y),a.push(y),A.push(y,0,u[y]);else if(_!=="undefined"){if(c&&y in c?(d=typeof c[y]=="function"?c[y].call(r,s,e,i):c[y],On(d)&&~d.indexOf("random(")&&(d=df(d)),er(d+"")||d==="auto"||(d+=ts.units[y]||er(Zi(e,y))||""),(d+"").charAt(1)==="="&&(d=Zi(e,y))):d=Zi(e,y),m=parseFloat(d),P=_==="string"&&h.charAt(1)==="="&&h.substr(0,2),P&&(h=h.substr(2)),p=parseFloat(h),y in mi&&(y==="autoAlpha"&&(m===1&&Zi(e,"visibility")==="hidden"&&p&&(m=0),A.push("visibility",0,u.visibility),Xo(this,u,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),y!=="scale"&&y!=="transform"&&(y=mi[y],~y.indexOf(",")&&(y=y.split(",")[0]))),T=y in fo,T){if(this.styles.save(y),M=h,_==="string"&&h.substring(0,6)==="var(--"){if(h=Qr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=h,h=Qr(e,"perspective"),D?e.style.perspective=D:da(e,"perspective")}p=parseFloat(h)}if(k||(R=e._gsap,R.renderTransform&&!n.parseTransform||mf(e,n.parseTransform),L=n.smoothOrigin!==!1&&R.smooth,k=this._pt=new Dr(this._pt,u,Yt,0,1,R.renderTransform,R,0,-1),k.dep=1),y==="scale")this._pt=new Dr(this._pt,R,"scaleY",R.scaleY,(P?Mu(R.scaleY,P+p):p)-R.scaleY||0,r2),this._pt.u=0,a.push("scaleY",y),y+="X";else if(y==="transformOrigin"){A.push(Nr,0,u[Nr]),h=wq(h),R.svg?o2(e,h,0,L,0,this):(E=parseFloat(h.split(" ")[2])||0,E!==R.zOrigin&&Xo(this,R,"zOrigin",R.zOrigin,E),Xo(this,u,y,Qm(d),Qm(h)));continue}else if(y==="svgOrigin"){o2(e,h,1,L,0,this);continue}else if(y in aI){Cq(this,R,y,m,P?Mu(m,P+h):h);continue}else if(y==="smoothOrigin"){Xo(this,R,"smooth",R.smooth,h);continue}else if(y==="force3D"){R[y]=h;continue}else if(y==="transform"){kq(this,h,e);continue}}else y in u||(y=ac(y)||y);if(T||(p||p===0)&&(m||m===0)&&!oq.test(h)&&y in u)w=(d+"").substr((m+"").length),p||(p=0),E=er(h)||(y in ts.units?ts.units[y]:w),w!==E&&(m=fa(e,y,d,E)),this._pt=new Dr(this._pt,T?R:u,y,m,(P?Mu(m,P+p):p)-m,!T&&(E==="px"||y==="zIndex")&&n.autoRound!==!1?cq:r2),this._pt.u=E||0,T&&M!==h?(this._pt.b=d,this._pt.e=M,this._pt.r=uq):w!==E&&E!=="%"&&(this._pt.b=d,this._pt.r=lq);else if(y in u)xq.call(this,e,y,d,P?P+h:h);else if(y in e)this.add(e,y,d||e[y],P?P+h:h,s,i);else if(y!=="parseTransform"){nw(y,h);continue}T||(y in u?A.push(y,0,u[y]):typeof e[y]=="function"?A.push(y,2,e[y]()):A.push(y,1,d||e[y])),a.push(y)}}O&&QA(this)},render:function(e,n){if(n.tween._time||!hw())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Zi,aliases:mi,getSetter:function(e,n,r){var s=mi[n];return s&&s.indexOf(",")<0&&(n=s),n in fo&&n!==Nr&&(e._gsap.x||Zi(e,"x"))?r&&i8===r?n==="scale"?pq:hq:(i8=r||{})&&(n==="scale"?mq:gq):e.style&&!Jx(e.style[n])?dq:~n.indexOf("-")?fq:cw(e,n)},core:{_removeProperty:da,_getMatrix:mw}};jr.utils.checkPrefix=ac;jr.core.getStyleSaver=rI;(function(t,e,n,r){var s=Lr(t+","+e+","+n,function(i){fo[i]=1});Lr(e,function(i){ts.units[i]="deg",aI[i]=1}),mi[s[13]]=t+","+e,Lr(r,function(i){var a=i.split(":");mi[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");Lr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){ts.units[t]="px"});jr.registerPlugin(cI);var Fs=jr.registerPlugin(cI)||jr;Fs.core.Tween;const Kp="/assets/logo-animation",N1=1280,Pq=[{id:"eraser",src:`${Kp}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Kp}/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:`${Kp}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],Tq=[{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}],a2=({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,P)=>E+Math.random()*(P-E);let d=null,h,p=1;const m=Pq.map(E=>({...E})),_=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const E=s.getBoundingClientRect(),P=E.width||N1,T=E.height||N1*.64;p=P/N1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const R=250*p/337,L=[],O=(A,M,D)=>{const F=document.createElement("div");return F.className="la-obj",F.style.width=`${M}px`,F.innerHTML=`<img src="${A}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(F),F};return Tq.forEach((A,M)=>{const D=A.w*p,F=O(`${Kp}/sea/${A.k}.png`,D,M%2===0);Fs.set(F,{x:A.x*P-D/2,y:A.y*T-D/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),L.push({el:F,hero:!1,rest:1})}),m.forEach(A=>{const M=A.cssW*p;A.el=O(A.src,M,!!A.flip),A.finalScale=A.fit*R/(A.cssW*p),Fs.set(A.el,{x:A.seaX*P-M/2,y:A.seaY*T-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),L.push({el:A.el,hero:!0,rest:150/A.cssW})}),L},x=(E,P)=>{const T=s.getBoundingClientRect(),k=a.getBoundingClientRect();return{x:k.left-T.left+E/326*k.width,y:k.top-T.top+P/337*k.height}},y=()=>{d&&d.revert();const E=_();if(u){d=Fs.context(()=>{E.filter(k=>!k.hero).forEach(k=>Fs.set(k.el,{scale:0})),m.forEach(k=>{if(!k.el)return;const R=x(k.localX,k.localY);Fs.set(k.el,{x:R.x-k.cssW*p/2,y:R.y-k.cssH*p/2,rotation:k.rot,scale:k.finalScale})})},s);return}const P=[],T=[];d=Fs.context(()=>{const k=Fs.timeline();k.to(E.map(R=>R.el),{scale:R=>E[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),k.add(()=>{E.forEach(({el:R,hero:L},O)=>{const A=L?P:T,M=O%2?1:-1;A.push(Fs.to(R,{rotation:"+="+c(2.5,6)*M,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),Fs.to(R,{y:"+="+c(5,11)*M,x:"+="+c(4,9)*-M,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),k.to({},{duration:1.1}),k.add("pick"),m.forEach((R,L)=>{R.el&&k.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+L*.08)}),k.add("clear","pick+=0.7"),k.add(()=>T.forEach(R=>R.kill()),"clear"),k.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"),k.add("assemble","clear+=0.25"),k.add(()=>P.forEach(R=>R.kill()),"assemble"),m.forEach((R,L)=>{if(!R.el||R.finalScale===void 0)return;const O=x(R.localX,R.localY);k.to(R.el,{x:O.x-R.cssW*p/2,y:O.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+L*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||k.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Fs.ticker.fps(12),y();const w=()=>{clearTimeout(h),h=setTimeout(y,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(h),d==null||d.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"})})})},Rq=Object.freeze(Object.defineProperty({__proto__:null,default:a2},Symbol.toStringTag,{value:"Module"})),p8=({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"})]}),dI=({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(a2,{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(p8,{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(a2,{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(p8,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Aq="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",Iq=({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:Aq,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(m0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),Mq="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",Jm=44,dd=8,wp=16,Oq=4,m8=-18,Lq=.18,Dq=[.22,1,.36,1],g8=.92,Nq=1,jq=.95,Fq=.4,Vq=[.19,1,.22,1],j1=0,$q=1,Hq=0,zq=0,Uq=0,fI=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+dd,s=Math.max(r,e.width-Jm-dd),i=Math.max(dd,e.height-Jm-dd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(dd,t.y))}},gw=()=>({width:window.innerWidth,height:window.innerHeight}),Bq=({position:t,boundsLeftPx:e=0})=>fI({position:t,viewport:gw(),boundsLeft:e}),Wq=()=>{if(typeof window>"u")return{x:wp,y:wp};const t=gw();return{x:t.width-Jm-wp,y:t.height-Jm-wp}},Gq=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=Oq,Kq=t=>t.button===void 0||t.button<=Uq,v8=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Zq=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=g.useRef(null),c=g.useRef(!1),[d,h]=g.useState(!1),[p,m]=g.useState(!1),_=n?!1:{opacity:j1,scale:g8,x:m8},x=n?{opacity:j1}:{opacity:j1,scale:g8,x:m8},y=n?{duration:zq}:{duration:Lq,ease:Dq,scale:{duration:Fq,ease:Vq}},w=g.useCallback(()=>{const R=u.current;R&&(c.current=R.hasMoved),u.current=null,h(!1)},[]),E=g.useCallback(R=>{const L=u.current;if(!L)return;const O=v8(R),A=O.x-L.startPointer.x,M=O.y-L.startPointer.y,D=L.hasMoved||Gq({deltaX:A,deltaY:M});u.current={...L,hasMoved:D},D&&a(fI({position:{x:L.startPosition.x+A,y:L.startPosition.y+M},viewport:gw(),boundsLeft:s}))},[a,s]),P=g.useCallback(R=>{if(u.current||!Kq(R))return;const L=v8(R);u.current={startPointer:L,startPosition:r,hasMoved:!1},h(!0)},[r]),T=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),k=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:w,onPointerCancel:w,onMouseMove:E,onMouseUp:w}):null,S.jsx(ro,{children:t?S.jsx(to,{label:k,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(_l.button,{type:"button","aria-label":k,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:_,animate:{opacity:$q,scale:Nq,x:Hq},whileTap:{scale:jq},exit:x,transition:y,onPointerDown:P,onMouseDown:P,onPointerMove:E,onPointerUp:w,onPointerCancel:w,onMouseMove:E,onMouseUp:w,onClick:T,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 ${d?"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:Mq,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},F1=ks("useConfig"),qq=300*1e3,Yq=1800*1e3,Xq=60*1e3,Qq=300*1e3,Jq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},eY=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},tY=t=>({...r5,...t??{}}),nY=()=>{const t=Qe(V_),e=at(V_),n=at(h5),r=at(p5),s=at(g0),i=at(fB),a=at(f5),u=at(cB),c=at(Rf),d=at(a5),h=at(fc),p=g.useCallback(P=>{a(P.agentModeAvailable),d({name:P.name??null,email:P.email??null}),h(P.demoMode===!0),P.isMCPSession&&n(!0),P.mcpEditor&&r(P.mcpEditor),s(P.agentApplyMode??eY()??null),i(P.queueAccessToken??Jq())},[s,a,h,n,r,i,d]),m=oy({queryKey:["rivet-config"],queryFn:async()=>{const P=await fetch("/api/config");if(!P.ok)throw new Error(`Failed to fetch config: ${P.statusText}`);return await P.json()},staleTime:qq,gcTime:Yq}),_=oy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const P=await fetch("/api/feature-flags");if(!P.ok)throw new Error(`Failed to fetch feature flags: ${P.statusText}`);return await P.json()},staleTime:Xq,gcTime:Qq}),{refetch:x}=m,{refetch:y}=_;g.useLayoutEffect(()=>{m.data&&(p(m.data),c(!1),F1.info("Config loaded:",m.data)),_.data&&(e(tY(_.data.featureFlags)),u(!0))},[m.data,_.data,p,c,e,u]),g.useLayoutEffect(()=>{m.error&&(u(!0),c(!1),F1.warn("Failed to load config:",m.error instanceof Error?m.error.message:"Failed to load config")),_.error&&(u(!0),F1.warn("Failed to load feature flags:",_.error instanceof Error?_.error.message:"Failed to load feature flags"))},[m.error,_.error,c,u]);const w=g.useCallback(async()=>{const[P]=await Promise.all([x(),y()]);return P.data?P.data:null},[x,y]);let E=null;return m.error instanceof Error?E=m.error.message:m.error&&(E="Failed to load config"),{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&_.isPending,error:E,refetchConfig:w}},Zp="rivet_just_signed_in",hu=ks("useOAuthCallback"),rY="https://rivet-proxy.onrender.com",sY=()=>{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,d;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{hu.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=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");hu.info(`Completing OAuth with session: ${x}`);const y=await fetch(`${rY}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:m}),signal:n.signal}),w=await y.json();if(!y.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(hu.info("OAuth authentication completed successfully"),r)return;if((u=w.user)!=null&&u.id?(Ee.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Ee.alias(w.user.email,w.user.id)):(c=w.user)!=null&&c.email&&Ee.identify(w.user.email,{email:w.user.email}),(d=w.user)!=null&&d.email&&p)try{const P=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:p,refreshToken:m,userId:w.user.id}),signal:n.signal});P.ok||hu.warn(`Local auth store returned ${P.status}`)}catch(P){if(r)return;hu.warn("Failed to store auth locally:",P)}if(r)return;window.sessionStorage.setItem(Zp,"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";hu.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},V1=ks("useAgentVariantsSession"),iY=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,y8=(t,e,n)=>{e.size===0&&!n||t.set(ef,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})},oY=(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(d=>d.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},aY=({enabled:t=!0}={})=>{const e=at(Tf),n=at(s5),r=at(iB),s=at(c5),i=at(uB),a=V2(),u=g.useRef(null);g.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=d=>{try{const h=JSON.parse(d.data),p=u.current;if(h.active){const x=new Set(h.variants.map(y=>y.requestId).filter(y=>!!y));s(y=>y.filter(E=>!x.has(E.requestId))),y8(a,x,!1),a.set(ef,y=>{let w=y;for(const E of h.variants){const P=E.adoptedSource;P&&(w=lB(w,{kind:"variant",sessionId:P.sessionId,variantId:P.variantId},{kind:"variant",sessionId:h.sessionId,variantId:E.workItemId}))}return w}),a.set(ef,y=>oY(y,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,y8(a,new Set,iY(h));e(h);const m=!h.active&&p!==null,_=h.active&&h.sessionId!==p;if(_&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>V1.warn("failed to reset preview-port on session switch",x)),m||_){const x=new Set;if(h.active)for(const w of h.variants)x.add(Qd({kind:"variant",sessionId:h.sessionId,variantId:w.workItemId}));const y=a.get(lo);for(const w of[y==null?void 0:y.left,y==null?void 0:y.right])w&&x.add(Qd({kind:"variant",sessionId:w.sessionId,variantId:w.variantId}));i(x)}}catch(h){V1.warn("failed to parse SSE event payload",h)}},c.onerror=d=>{V1.warn("SSE error (auto-reconnects)",d)},()=>{c.close()}},[t,e,n,r,s,i,a])};var lY=Object.defineProperty,In=(t,e)=>lY(t,"name",{value:e,configurable:!0});function vw(t){const e=t+"CollectionProvider",[n,r]=wi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=In(y=>{const{scope:w,children:E}=y,P=g.useRef(null),T=g.useRef(new Map).current;return S.jsx(s,{scope:w,itemMap:T,collectionRef:P,children:E})},"CollectionProvider");a.displayName=e;const u=t+"CollectionSlot",c=aa(u),d=g.forwardRef((y,w)=>{const{scope:E,children:P}=y,T=i(u,E),k=Vt(w,T.collectionRef);return S.jsx(c,{ref:k,children:P})});d.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=aa(h),_=g.forwardRef((y,w)=>{const{scope:E,children:P,...T}=y,k=g.useRef(null),R=Vt(w,k),L=i(h,E);return g.useEffect(()=>(L.itemMap.set(k,{ref:k,...T}),()=>void L.itemMap.delete(k))),S.jsx(m,{[p]:"",ref:R,children:P})});_.displayName=h;function x(y){const w=i(t+"CollectionConsumer",y);return g.useCallback(()=>{const P=w.collectionRef.current;if(!P)return[];const T=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((L,O)=>T.indexOf(L.ref.current)-T.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return In(x,"useCollection"),[{Provider:a,Slot:d,ItemSlot:_},x,r]}In(vw,"createCollection");var _8=new WeakMap,pn,Gr,$1=(Gr=class extends Map{constructor(n){super(n);ze(this,pn);Re(this,pn,[...super.keys()]),_8.set(this,!0)}set(n,r){return _8.get(this)&&(this.has(n)?U(this,pn)[U(this,pn).indexOf(n)]=n:U(this,pn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=U(this,pn).length,u=yw(n);let c=u>=0?u:a+u;const d=c<0||c>=a?-1:c;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const h=this.size+(i?0:1);u<0&&c++;const p=[...U(this,pn)];let m,_=!1;for(let x=c;x<h;x++)if(c===x){let y=p[x];p[x]===r&&(y=p[x+1]),i&&this.delete(r),m=this.get(y),this.set(r,s)}else{!_&&p[x-1]===r&&(_=!0);const y=p[_?x:x-1],w=m;m=this.get(y),this.delete(y),this.set(y,w)}return this}with(n,r,s){const i=new Gr(this);return i.insert(n,r,s),i}before(n){const r=U(this,pn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=U(this,pn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=U(this,pn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=U(this,pn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Re(this,pn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&U(this,pn).splice(U(this,pn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=qp(U(this,pn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=qp(U(this,pn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return U(this,pn).indexOf(n)}keyAt(n){return qp(U(this,pn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new Gr(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new Gr(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const u of this)i===0&&n.length===1?a=u:a=Reflect.apply(r,this,[a,u,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const u=this.at(a);a===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Gr(r)}toReversed(){const n=new Gr;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Gr(r)}slice(n,r){const s=new Gr;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const u=this.keyAt(a),c=this.get(u);s.set(u,c)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},pn=new WeakMap,In(Gr,"OrderedDict"),Gr);function qp(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=hI(t,e);return n===-1?void 0:t[n]}In(qp,"at");function hI(t,e){const n=t.length,r=yw(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}In(hI,"toSafeIndex");function yw(t){return t!==t||t===0?0:Math.trunc(t)}In(yw,"toSafeInteger");function uY(t){const e=t+"CollectionProvider",[n,r]=wi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new $1,setItemMap:In(()=>{},"setItemMap")}),a=In(({state:T,...k})=>T?S.jsx(c,{...k,state:T}):S.jsx(u,{...k}),"CollectionProvider");a.displayName=e;const u=In(T=>{const k=w();return S.jsx(c,{...T,state:k})},"CollectionInit");u.displayName=e+"Init";const c=In(T=>{const{scope:k,children:R,state:L}=T,O=g.useRef(null),[A,M]=g.useState(null),D=Vt(O,M),[F,N]=L;return g.useEffect(()=>{if(!A)return;const W=gI(()=>{});return W.observe(A,{childList:!0,subtree:!0}),()=>{W.disconnect()}},[A]),S.jsx(s,{scope:k,itemMap:F,setItemMap:N,collectionRef:D,collectionRefObject:O,collectionElement:A,children:R})},"CollectionProviderImpl");c.displayName=e+"Impl";const d=t+"CollectionSlot",h=aa(d),p=g.forwardRef((T,k)=>{const{scope:R,children:L}=T,O=i(d,R),A=Vt(k,O.collectionRef);return S.jsx(h,{ref:A,children:L})});p.displayName=d;const m=t+"CollectionItemSlot",_="data-radix-collection-item",x=aa(m),y=g.forwardRef((T,k)=>{const{scope:R,children:L,...O}=T,A=g.useRef(null),[M,D]=g.useState(null),F=Vt(k,A,D),N=i(m,R),{setItemMap:W}=N,Y=g.useRef(O);pI(Y.current,O)||(Y.current=O);const q=Y.current;return g.useEffect(()=>{const B=q;return W(K=>M?K.has(M)?K.set(M,{...B,element:M}).toSorted(l2):(K.set(M,{...B,element:M}),K.toSorted(l2)):K),()=>{W(K=>!M||!K.has(M)?K:(K.delete(M),new $1(K)))}},[M,q,W]),S.jsx(x,{[_]:"",ref:F,children:L})});y.displayName=m;function w(){return g.useState(new $1)}In(w,"useInitCollection");function E(T){const{itemMap:k}=i(t+"CollectionConsumer",T);return k}return In(E,"useCollection"),[{Provider:a,Slot:p,ItemSlot:y},{createCollectionScope:r,useCollection:E,useInitCollection:w}]}In(uY,"createCollection");function pI(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}In(pI,"shallowEqual");function mI(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}In(mI,"isElementPreceding");function l2(t,e){return!t[1].element||!e[1].element?0:mI(t[1].element,e[1].element)?-1:1}In(l2,"sortByDocumentPosition");function gI(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}In(gI,"getChildListObserver");var cY=Object.defineProperty,Mf=(t,e)=>cY(t,"name",{value:e,configurable:!0}),_w="Collapsible",[dY,vI]=wi(_w),[fY,xw]=dY(_w),hY=g.forwardRef(Mf(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:u,...c}=e,[d,h]=pa({prop:s,defaultProp:i??!1,onChange:u,caller:_w});return S.jsx(fY,{scope:r,disabled:a,contentId:Jo(),open:d,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),children:S.jsx(ln.div,{"data-state":R0(d),"data-disabled":a?"":void 0,...c,ref:n})})},"Collapsible")),pY="CollapsibleTrigger",mY=g.forwardRef(Mf(function(e,n){const{__scopeCollapsible:r,...s}=e,i=xw(pY,r);return S.jsx(ln.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":R0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:jt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),yI="CollapsibleContent",gY=g.forwardRef(Mf(function(e,n){const{forceMount:r,...s}=e,i=xw(yI,e.__scopeCollapsible);return S.jsx(ma,{present:r||i.open,children:({present:a})=>S.jsx(vY,{...s,ref:n,present:a})})},"CollapsibleContent")),vY=g.forwardRef(Mf(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,u=xw(yI,r),[c,d]=g.useState(s),h=g.useRef(null),p=Vt(n,h),m=g.useRef(0),_=m.current,x=g.useRef(0),y=x.current,w=u.open||c,E=g.useRef(w),P=g.useRef(void 0);return g.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),Ir(()=>{const T=h.current;if(T){P.current=P.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const k=T.getBoundingClientRect();m.current=k.height,x.current=k.width,E.current||(T.style.transitionDuration=P.current.transitionDuration,T.style.animationName=P.current.animationName),d(s)}},[u.open,s]),S.jsx(ln.div,{"data-state":R0(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function R0(t){return t?"open":"closed"}Mf(R0,"getState");var yY=hY,_Y=mY,xY=gY,wY=Object.defineProperty,bY=(t,e)=>wY(t,"name",{value:e,configurable:!0}),SY=g.createContext(void 0);function ww(t){const e=g.useContext(SY);return t||e||"ltr"}bY(ww,"useDirection");var EY=Object.defineProperty,ns=(t,e)=>EY(t,"name",{value:e,configurable:!0}),bi="Accordion",CY=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[bw,kY,PY]=vw(bi),[A0,tee]=wi(bi,[PY,vI]),Sw=vI(),TY=g.forwardRef(ns(function(e,n){const{type:r,...s}=e,i=s,a=s;return S.jsx(bw.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(MY,{...a,ref:n}):S.jsx(IY,{...i,ref:n})})},"Accordion")),[_I,RY]=A0(bi),[xI,AY]=A0(bi,{collapsible:!1}),IY=g.forwardRef(ns(function(e,n){const{value:r,defaultValue:s,onValueChange:i=ns(()=>{},"onValueChange"),collapsible:a=!1,...u}=e,[c,d]=pa({prop:r,defaultProp:s??"",onChange:i,caller:bi});return S.jsx(_I,{scope:e.__scopeAccordion,value:g.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:g.useCallback(()=>a&&d(""),[a,d]),children:S.jsx(xI,{scope:e.__scopeAccordion,collapsible:a,children:S.jsx(wI,{...u,ref:n})})})},"AccordionImplSingle")),MY=g.forwardRef(ns(function(e,n){const{value:r,defaultValue:s,onValueChange:i=ns(()=>{},"onValueChange"),...a}=e,[u,c]=pa({prop:r,defaultProp:s??[],onChange:i,caller:bi}),d=g.useCallback(p=>c((m=[])=>[...m,p]),[c]),h=g.useCallback(p=>c((m=[])=>m.filter(_=>_!==p)),[c]);return S.jsx(_I,{scope:e.__scopeAccordion,value:u,onItemOpen:d,onItemClose:h,children:S.jsx(xI,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(wI,{...a,ref:n})})})},"AccordionImplMultiple")),[OY,I0]=A0(bi),wI=g.forwardRef(ns(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...u}=e,c=g.useRef(null),d=Vt(c,n),h=kY(r),m=ww(i)==="ltr",_=jt(e.onKeyDown,x=>{var M;if(!CY.includes(x.key))return;const y=x.target,w=h().filter(D=>{var F;return!((F=D.ref.current)!=null&&F.disabled)}),E=w.findIndex(D=>D.ref.current===y),P=w.length;if(E===-1)return;x.preventDefault();let T=E;const k=0,R=P-1,L=ns(()=>{T=E+1,T>R&&(T=k)},"moveNext"),O=ns(()=>{T=E-1,T<k&&(T=R)},"movePrev");switch(x.key){case"Home":T=k;break;case"End":T=R;break;case"ArrowRight":a==="horizontal"&&(m?L():O());break;case"ArrowDown":a==="vertical"&&L();break;case"ArrowLeft":a==="horizontal"&&(m?O():L());break;case"ArrowUp":a==="vertical"&&O();break}const A=T%P;(M=w[A].ref.current)==null||M.focus()});return S.jsx(OY,{scope:r,disabled:s,direction:i,orientation:a,children:S.jsx(bw.Slot,{scope:r,children:S.jsx(ln.div,{...u,"data-orientation":a,ref:d,onKeyDown:s?void 0:_})})})},"AccordionImpl")),u2="AccordionItem",[LY,Ew]=A0(u2),DY=g.forwardRef(ns(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=I0(u2,r),u=RY(u2,r),c=Sw(r),d=Jo(),h=s&&u.value.includes(s)||!1,p=a.disabled||e.disabled;return S.jsx(LY,{scope:r,open:h,disabled:p,triggerId:d,children:S.jsx(yY,{"data-orientation":a.orientation,"data-state":Cw(h),...c,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?u.onItemOpen(s):u.onItemClose(s)}})})},"AccordionItem")),NY="AccordionHeader",jY=g.forwardRef(ns(function(e,n){const{__scopeAccordion:r,...s}=e,i=I0(bi,r),a=Ew(NY,r);return S.jsx(ln.h3,{"data-orientation":i.orientation,"data-state":Cw(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),x8="AccordionTrigger",FY=g.forwardRef(ns(function(e,n){const{__scopeAccordion:r,...s}=e,i=I0(bi,r),a=Ew(x8,r),u=AY(x8,r),c=Sw(r);return S.jsx(bw.ItemSlot,{scope:r,children:S.jsx(_Y,{"aria-disabled":a.open&&!u.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),VY="AccordionContent",$Y=g.forwardRef(ns(function(e,n){const{__scopeAccordion:r,...s}=e,i=I0(bi,r),a=Ew(VY,r),u=Sw(r);return S.jsx(xY,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...u,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function Cw(t){return t?"open":"closed"}ns(Cw,"getState");var bI=TY,HY=DY,zY=jY,UY=FY,BY=$Y;/**
|
|
129
|
+
* @license lucide-react v1.27.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const SI=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
134
|
+
* @license lucide-react v1.27.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const WY=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
139
|
+
* @license lucide-react v1.27.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const GY=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
144
|
+
* @license lucide-react v1.27.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const w8=t=>{const e=GY(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
149
|
+
* @license lucide-react v1.27.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/var H1={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"};/**
|
|
154
|
+
* @license lucide-react v1.27.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const KY=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},ZY=g.createContext({}),qY=()=>g.useContext(ZY),YY=g.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:_=""}=qY()??{},x=r??p?Number(n??h)*24/Number(e??d):n??h;return g.createElement("svg",{ref:c,...H1,width:e??d??H1.width,height:e??d??H1.height,stroke:t??m,strokeWidth:x,className:SI("lucide",_,s),...!i&&!KY(u)&&{"aria-hidden":"true"},...u},[...a.map(([y,w])=>g.createElement(y,w)),...Array.isArray(i)?i:[i]])});/**
|
|
159
|
+
* @license lucide-react v1.27.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const et=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(YY,{ref:i,iconNode:e,className:SI(`lucide-${WY(w8(t))}`,`lucide-${t}`,r),...s}));return n.displayName=w8(t),n};/**
|
|
164
|
+
* @license lucide-react v1.27.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const XY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],QY=et("arrow-left",XY);/**
|
|
169
|
+
* @license lucide-react v1.27.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const JY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],eX=et("arrow-right",JY);/**
|
|
174
|
+
* @license lucide-react v1.27.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const tX=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],nX=et("arrow-up",tX);/**
|
|
179
|
+
* @license lucide-react v1.27.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const rX=[["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"}]],sX=et("bell",rX);/**
|
|
184
|
+
* @license lucide-react v1.27.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const iX=[["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"}]],oX=et("brain",iX);/**
|
|
189
|
+
* @license lucide-react v1.27.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const aX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lX=et("check",aX);/**
|
|
194
|
+
* @license lucide-react v1.27.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const uX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cX=et("chevron-down",uX);/**
|
|
199
|
+
* @license lucide-react v1.27.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const dX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fX=et("chevron-right",dX);/**
|
|
204
|
+
* @license lucide-react v1.27.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const hX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pX=et("circle",hX);/**
|
|
209
|
+
* @license lucide-react v1.27.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const mX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],gX=et("clock",mX);/**
|
|
214
|
+
* @license lucide-react v1.27.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const vX=[["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"}]],yX=et("copy",vX);/**
|
|
219
|
+
* @license lucide-react v1.27.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const _X=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],xX=et("dot",_X);/**
|
|
224
|
+
* @license lucide-react v1.27.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const wX=[["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"}]],bX=et("globe",wX);/**
|
|
229
|
+
* @license lucide-react v1.27.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const SX=[["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"}]],EX=et("heart",SX);/**
|
|
234
|
+
* @license lucide-react v1.27.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const CX=[["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"}]],kX=et("house",CX);/**
|
|
239
|
+
* @license lucide-react v1.27.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const PX=[["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"}]],TX=et("image",PX);/**
|
|
244
|
+
* @license lucide-react v1.27.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const RX=[["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"}]],AX=et("inbox",RX);/**
|
|
249
|
+
* @license lucide-react v1.27.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const IX=[["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"}]],MX=et("lightbulb",IX);/**
|
|
254
|
+
* @license lucide-react v1.27.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const OX=[["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"}]],LX=et("link",OX);/**
|
|
259
|
+
* @license lucide-react v1.27.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const DX=[["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"}]],NX=et("loader",DX);/**
|
|
264
|
+
* @license lucide-react v1.27.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const jX=[["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"}]],FX=et("lock",jX);/**
|
|
269
|
+
* @license lucide-react v1.27.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const VX=[["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"}]],$X=et("mail",VX);/**
|
|
274
|
+
* @license lucide-react v1.27.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const HX=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],zX=et("menu",HX);/**
|
|
279
|
+
* @license lucide-react v1.27.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const UX=[["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"}]],BX=et("message-circle",UX);/**
|
|
284
|
+
* @license lucide-react v1.27.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const WX=[["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"}]],GX=et("monitor",WX);/**
|
|
289
|
+
* @license lucide-react v1.27.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const KX=[["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"}]],ZX=et("moon",KX);/**
|
|
294
|
+
* @license lucide-react v1.27.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const qX=[["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"}]],YX=et("paintbrush",qX);/**
|
|
299
|
+
* @license lucide-react v1.27.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const XX=[["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"}]],QX=et("palette",XX);/**
|
|
304
|
+
* @license lucide-react v1.27.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const JX=[["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"}]],eQ=et("pause",JX);/**
|
|
309
|
+
* @license lucide-react v1.27.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const tQ=[["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"}]],nQ=et("pencil",tQ);/**
|
|
314
|
+
* @license lucide-react v1.27.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const rQ=[["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"}]],sQ=et("pipette",rQ);/**
|
|
319
|
+
* @license lucide-react v1.27.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const iQ=[["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"}]],oQ=et("play",iQ);/**
|
|
324
|
+
* @license lucide-react v1.27.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const aQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lQ=et("plus",aQ);/**
|
|
329
|
+
* @license lucide-react v1.27.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const uQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],cQ=et("rectangle-horizontal",uQ);/**
|
|
334
|
+
* @license lucide-react v1.27.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const dQ=[["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"}]],fQ=et("rocket",dQ);/**
|
|
339
|
+
* @license lucide-react v1.27.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const hQ=[["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"}]],pQ=et("rotate-ccw",hQ);/**
|
|
344
|
+
* @license lucide-react v1.27.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const mQ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],gQ=et("search",mQ);/**
|
|
349
|
+
* @license lucide-react v1.27.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const vQ=[["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"}]],yQ=et("settings",vQ);/**
|
|
354
|
+
* @license lucide-react v1.27.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const _Q=[["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"}]],xQ=et("shield",_Q);/**
|
|
359
|
+
* @license lucide-react v1.27.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const wQ=[["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"}]],bQ=et("skip-forward",wQ);/**
|
|
364
|
+
* @license lucide-react v1.27.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const SQ=[["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"}]],EQ=et("square-library",SQ);/**
|
|
369
|
+
* @license lucide-react v1.27.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const CQ=[["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"}]],kQ=et("star",CQ);/**
|
|
374
|
+
* @license lucide-react v1.27.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const PQ=[["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"}]],TQ=et("sun",PQ);/**
|
|
379
|
+
* @license lucide-react v1.27.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const RQ=[["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"}]],AQ=et("user",RQ);/**
|
|
384
|
+
* @license lucide-react v1.27.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const IQ=[["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"}]],MQ=et("users",IQ);/**
|
|
389
|
+
* @license lucide-react v1.27.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const OQ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],LQ=et("x",OQ),DQ={"chevron-right":fX,"chevron-down":cX,pipette:sQ,x:LQ,copy:yX,menu:zX,dot:xX,monitor:GX,sun:TQ,moon:ZX,"rectangle-horizontal":cQ,circle:pX,"square-library":EQ,clock:gX,star:kQ,settings:yQ,plus:lQ,"arrow-left":QY,"arrow-right":eX,"arrow-up":nX,search:gQ,loader:NX,users:MQ,lock:FX,mail:$X,bell:sX,shield:xQ,palette:QX,lightbulb:MX,rocket:fQ,heart:EX,paintbrush:YX,brain:oX,globe:bX,user:AQ,image:TX,link:LX,check:lX,"rotate-ccw":pQ,play:oQ,pause:eQ,home:kX,"message-circle":BX,inbox:AX,pencil:nQ,"skip-forward":bQ},b8={lucide:DQ},EI=g.createContext(null);function NQ(t){const e=g.useContext(EI);return e?b8[e.iconLibrary][t]:b8.lucide[t]}function jQ({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(EI.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const CI=g.createContext(null);function kw(){return g.useContext(CI)}const kI=g.createContext(null);function PI(){const t=g.useContext(kI);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const FQ=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=g.useRef(null),u=g.useRef(new Map),[c,d]=g.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:_,handlers:x,registerItem:y,measureItems:w}=QR(a),E=g.useCallback((oe,se)=>{se?u.current.set(oe,se):u.current.delete(oe)},[]),P=g.useCallback(()=>{if(!a.current)return;const oe=new Map;u.current.forEach((se,ye)=>{oe.set(ye,{top:se.offsetTop,left:se.offsetLeft,width:se.offsetWidth,height:se.offsetHeight})}),d(oe)},[]),[T,k]=g.useState(()=>r==="single"?t.defaultValue??"":""),[R,L]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),O=t.onValueChange,A=t.onValueChange,M=t.value,D=new Set(r==="multiple"?t.value??R:(()=>{const oe=t.value??T;return oe?[oe]:[]})()),F=g.useCallback(oe=>{const se=t;se.onValueChange?se.onValueChange(oe):k(oe)},[O]),N=g.useCallback(oe=>{const se=t;se.onValueChange?se.onValueChange(oe):L(oe)},[A]),W=g.useCallback(oe=>{if(r==="multiple"){const se=t.value??R;N(se.filter(ye=>ye!==oe))}else F("")},[r,F,N,R,M]);g.useEffect(()=>{w(),P()},[w,P,n]);const Y=[...D].join(",");g.useEffect(()=>{w(),P()},[w,P,Y]);const[q,B]=g.useState(null),K=h!==null?m[h]:null,$=q!==null?m[q]:null,J=h!==null&&!c.has(h),H=E0(),{value:j,defaultValue:X,onValueChange:te,collapsible:ie,type:ae,...ue}=i,Se=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:N}:{type:"single",collapsible:t.collapsible??!0,value:t.value??T,onValueChange:F};return S.jsx(CI.Provider,{value:{registerItem:y,registerFullItem:E,activeIndex:h,grouped:!0,remeasure:()=>{w(),P()},openValues:D,openItemRects:c,toggleValue:W},children:S.jsx(bI,{...Se,asChild:!0,children:S.jsxs("div",{ref:oe=>{a.current=oe,typeof e=="function"?e(oe):e&&(e.current=oe)},onMouseEnter:x.onMouseEnter,onMouseMove:oe=>{const se=a.current;if(se){const ye=se.getBoundingClientRect(),be=se.offsetHeight,je=ye.height,Te=be>0?je/be:1,We=(oe.clientY-ye.top)/Te+se.scrollTop;for(const[Rt,Ye]of c){const we=m[Rt];if(!we)continue;const Mt=we.top+we.height,Je=Ye.top+Ye.height;if(We>=Mt&&We<=Je){p(null);return}}}x.onMouseMove(oe)},onMouseLeave:x.onMouseLeave,onFocus:oe=>{var ye;const se=(ye=oe.target.closest("[data-proximity-index]"))==null?void 0:ye.getAttribute("data-proximity-index");if(se!=null){const be=Number(se);p(be),B(oe.target.matches(":focus-visible")?be:null)}},onBlur:oe=>{var se;(se=a.current)!=null&&se.contains(oe.relatedTarget)||(B(null),p(null))},className:pr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ue,children:[S.jsx(ro,{children:[...c.entries()].map(([oe,se])=>S.jsx(so.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:se.top,left:se.left,width:se.width,height:se.height,opacity:J?.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-${oe}`))}),S.jsx(ro,{children:K&&S.jsx(so.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:K.top,left:K.left,width:K.width,height:K.height},animate:{opacity:1,top:K.top,left:K.left,width:K.width,height:K.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Xd.fast,opacity:{duration:.08}}},_.current)}),S.jsx(ro,{children:$&&S.jsx(so.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:{...Xd.fast,opacity:{duration:.08}}})}),n]})})})});FQ.displayName="AccordionGroup";const TI=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[d,h]=g.useState(()=>e==="single"?r??"":""),[p,m]=g.useState(()=>e==="multiple"?r??[]:[]),_=new Set(e==="multiple"?s??p:(()=>{const P=s??d;return P?[P]:[]})()),x=g.useCallback(P=>{i?i(P):h(P)},[i]),y=g.useCallback(P=>{i?i(P):m(P)},[i]),w=g.useCallback(P=>{e==="multiple"?y((s??p).filter(k=>k!==P)):x("")},[e,s,p,x,y]),E=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:y}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:x};return S.jsx(bI,{...E,asChild:!0,children:S.jsx("div",{ref:c,className:pr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:S.jsx(RI.Provider,{value:_,children:S.jsx(AI.Provider,{value:w,children:t})})})})});TI.displayName="Accordion";const RI=g.createContext(new Set),AI=g.createContext(()=>{}),II=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=g.useRef(null),c=kw(),d=g.useContext(RI),h=g.useContext(AI),p=E0(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),_=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,_.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),S.jsx(kI.Provider,{value:{index:e,value:t,isOpen:m,onToggle:x,triggerRef:_},children:S.jsxs(HY,{ref:y=>{u.current=y,typeof a=="function"?a(y):a&&(a.current=y)},value:t,disabled:n,"data-proximity-index":e,className:pr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(ro,{children:m&&S.jsx(so.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]})})});II.displayName="AccordionItem";const MI=g.forwardRef(({children:t,className:e,...n},r)=>{const s=NQ("chevron-right"),i=kw(),{index:a,isOpen:u,triggerRef:c}=PI(),d=E0(),[h,p]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,_=S.jsx(zY,{asChild:!0,children:S.jsx("div",{children:S.jsxs(UY,{ref:r,className:pr(`relative z-10 flex items-center gap-2.5 ${d.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:Id.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:pr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?Id.semibold:Id.normal},children:t})]}),S.jsx(so.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:Xd.fast,children:S.jsx(s,{size:16,strokeWidth:u||m?2:1.5,className:pr("transition-[color,stroke-width] duration-80",u||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:_}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(ro,{children:h&&S.jsx(so.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),_]})});MI.displayName="AccordionTrigger";const OI=g.forwardRef(({children:t,className:e,...n},r)=>{const s=kw(),{isOpen:i}=PI();return S.jsx(ro,{initial:!1,children:i&&S.jsx(BY,{forceMount:!0,asChild:!0,...n,children:S.jsx(so.div,{ref:r,className:pr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Xd.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})})})})});OI.displayName="AccordionContent";const Yp=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(TI,{type:"multiple",defaultValue:e,className:pr("w-full",n),children:t}),VQ=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return S.jsxs(II,{value:t,className:pr("w-full",!u&&"border-t border-main-border"),children:[S.jsxs(MI,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(OI,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Yp.Item=VQ;const $Q=()=>{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},HQ=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},S8="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",E8="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",zQ="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",Xp=["Applying","Thinking","Planning","Crafting"],UQ=Xp.reduce((t,e)=>t.length>=e.length?t:e),BQ=20,WQ="Still working — runs can take a few minutes.",GQ=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=$Q();g.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%Xp.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=BQ?WQ:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(_l.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(_l.path,{animate:{d:[S8,E8,zQ,E8,S8]},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:Id.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:UQ}),S.jsx(ro,{mode:"popLayout",initial:!1,children:S.jsx(_l.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:Xp[n]},Xp[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:HQ(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var KQ=Object.defineProperty,ZQ=(t,e)=>KQ(t,"name",{value:e,configurable:!0});function Pw(t,[e,n]){return Math.min(n,Math.max(e,t))}ZQ(Pw,"clamp");var qQ=Object.defineProperty,YQ=(t,e)=>qQ(t,"name",{value:e,configurable:!0});function LI(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])}YQ(LI,"usePrevious");var XQ=Object.defineProperty,gt=(t,e)=>XQ(t,"name",{value:e,configurable:!0}),DI=["PageUp","PageDown"],NI=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jI={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Of="Slider",[c2,QQ,JQ]=vw(Of),[Tw,nee]=wi(Of,[JQ]),[eJ,Lf]=Tw(Of),tJ=g.forwardRef(gt(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:u="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[s],value:p,onValueChange:m=gt(()=>{},"onValueChange"),onValueCommit:_=gt(()=>{},"onValueCommit"),inverted:x=!1,form:y,...w}=e,E=g.useRef(new Set),P=g.useRef(0),T=g.useRef(!1),R=u==="horizontal"?nJ:rJ,[L,O]=g.useState(null),A=Vt(n,O),[M=[],D]=pa({prop:p,defaultProp:h,onChange:gt(K=>{var J;(J=[...E.current][P.current])==null||J.focus({preventScroll:!0,focusVisible:T.current}),T.current=!1,m(K)},"onChange")}),F=g.useRef(M),N=g.useRef(M);g.useEffect(()=>{const K=y?L==null?void 0:L.ownerDocument.getElementById(y):L==null?void 0:L.closest("form");if(K instanceof HTMLFormElement){const $=gt(()=>D(N.current),"reset");return K.addEventListener("reset",$),()=>K.removeEventListener("reset",$)}},[L,y,D]);function W(K){const $=WI(M,K);B(K,$)}gt(W,"handleSlideStart");function Y(K){B(K,P.current)}gt(Y,"handleSlideMove");function q(){String(M)!==String(F.current)&&_(M)}gt(q,"handleSlideEnd");function B(K,$,{commit:J}={commit:!1}){const H=Aw(a),j=Nd(Math.round((K-s)/a)*a+s,H),X=Pw(j,[s,i]);D((te=[])=>{const ie=UI(te,X,$);if(ZI(ie,d*a)){P.current=ie.indexOf(X);const ae=String(ie)!==String(te);return ae&&J&&_(ie),ae?ie:te}else return te})}return gt(B,"updateValues"),S.jsx(eJ,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:P,thumbs:E.current,values:M,orientation:u,form:y,children:S.jsx(c2.Provider,{scope:e.__scopeSlider,children:S.jsx(c2.Slot,{scope:e.__scopeSlider,children:S.jsx(R,{"aria-disabled":c,"data-disabled":c?"":void 0,...w,ref:A,onPointerDown:jt(w.onPointerDown,()=>{c||(F.current=M,T.current=!1)}),min:s,max:i,inverted:x,onSlideStart:c?void 0:W,onSlideMove:c?void 0:Y,onSlideEnd:c?void 0:q,onHomeKeyDown:()=>{c||(T.current=!0,B(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(T.current=!0,B(i,M.length-1,{commit:!0}))},onStepKeyDown:({event:K,direction:$})=>{if(!c){T.current=!0;const j=DI.includes(K.key)||K.shiftKey&&NI.includes(K.key)?10:1,X=P.current,te=M[X],ie=qI(te,{min:s,step:a,direction:$,multiplier:j});B(ie,X,{commit:!0})}}})})})})},"Slider")),[FI,VI]=Tw(Of,{startEdge:"left",endEdge:"right",size:"width",direction:1}),nJ=g.forwardRef(gt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:u,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...p}=e,[m,_]=g.useState(null),x=Vt(n,_),y=g.useRef(void 0),w=ww(i),E=w==="ltr",P=E&&!a||!E&&a;function T(k){const R=y.current||m.getBoundingClientRect(),L=[0,R.width],A=M0(L,P?[r,s]:[s,r]);return y.current=R,A(k-R.left)}return gt(T,"getValueFromPointer"),S.jsx(FI,{scope:e.__scopeSlider,startEdge:P?"left":"right",endEdge:P?"right":"left",direction:P?1:-1,size:"width",children:S.jsx($I,{dir:w,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const R=T(k.clientX);u==null||u(R)},onSlideMove:k=>{const R=T(k.clientX);c==null||c(R)},onSlideEnd:()=>{y.current=void 0,d==null||d()},onStepKeyDown:k=>{const L=jI[P?"from-left":"from-right"].includes(k.key);h==null||h({event:k,direction:L?-1:1})}})})},"SliderHorizontal")),rJ=g.forwardRef(gt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...h}=e,p=g.useRef(null),m=Vt(n,p),_=g.useRef(void 0),x=!i;function y(w){const E=_.current||p.current.getBoundingClientRect(),P=[0,E.height],k=M0(P,x?[s,r]:[r,s]);return _.current=E,k(w-E.top)}return gt(y,"getValueFromPointer"),S.jsx(FI,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:S.jsx($I,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const E=y(w.clientY);a==null||a(E)},onSlideMove:w=>{const E=y(w.clientY);u==null||u(E)},onSlideEnd:()=>{_.current=void 0,c==null||c()},onStepKeyDown:w=>{const P=jI[x?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:P?-1:1})}})})},"SliderVertical")),$I=g.forwardRef(gt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:u,onEndKeyDown:c,onStepKeyDown:d,...h}=e,p=Lf(Of,r);return S.jsx(ln.span,{...h,ref:n,onKeyDown:jt(e.onKeyDown,m=>{m.key==="Home"?(u(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):DI.concat(NI).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:jt(e.onPointerDown,m=>{const _=m.target;_.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(_)?_.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:jt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:jt(e.onPointerUp,m=>{const _=m.target;_.hasPointerCapture(m.pointerId)&&(_.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),sJ="SliderTrack",iJ=g.forwardRef(gt(function(e,n){const{__scopeSlider:r,...s}=e,i=Lf(sJ,r);return S.jsx(ln.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),C8="SliderRange",oJ=g.forwardRef(gt(function(e,n){const{__scopeSlider:r,...s}=e,i=Lf(C8,r),a=VI(C8,r),u=g.useRef(null),c=Vt(n,u),d=i.values.length,h=i.values.map(_=>Rw(_,i.min,i.max)),p=d>1?Math.min(...h):0,m=100-Math.max(...h);return S.jsx(ln.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),aJ="SliderThumb",[lJ,HI]=Tw(aJ),uJ="SliderThumbProvider";function zI(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Lf(uJ,e),a=QQ(e),[u,c]=g.useState(null),d=g.useMemo(()=>u?a().findIndex(w=>w.ref.current===u):-1,[a,u]),h=zx(u),p=u?!!i.form||!!u.closest("form"):!0,m=i.values[d],_=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=m===void 0?0:Rw(m,i.min,i.max);g.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const y={value:m,name:_,form:i.form,isFormControl:p,index:d,thumb:u,onThumbChange:c,percent:x,size:h};return S.jsx(lJ,{scope:e,...y,children:YI(s)?s(y):r})}gt(zI,"SliderThumbProvider");var z1="SliderThumbTrigger",cJ=g.forwardRef(gt(function(e,n){const{__scopeSlider:r,...s}=e,i=Lf(z1,r),a=VI(z1,r),{index:u,value:c,percent:d,size:h,onThumbChange:p}=HI(z1,r),m=Vt(n,p),_=BI(u,i.values.length),x=h==null?void 0:h[a.size],y=x?GI(x,d,a.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${d}% + ${y}px)`},children:S.jsx(c2.ItemSlot,{scope:r,children:S.jsx(ln.span,{role:"slider","aria-label":e["aria-label"]||_,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:jt(e.onFocus,()=>{i.valueIndexToChangeRef.current=u})})})})},"SliderThumbTrigger")),dJ=g.forwardRef(gt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(zI,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:u})=>S.jsxs(S.Fragment,{children:[S.jsx(cJ,{...i,ref:n,__scopeSlider:r}),u?S.jsx(hJ,{__scopeSlider:r},a):null]})})},"SliderThumb")),fJ="SliderBubbleInput",hJ=g.forwardRef(gt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=HI(fJ,e),u=g.useRef(null),c=Vt(u,r),d=LI(s);return g.useEffect(()=>{const h=u.current;if(!h)return;const p=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&_){const x=new Event("input",{bubbles:!0});_.call(h,s),h.dispatchEvent(x)}},[d,s]),S.jsx(ln.input,{style:{display:"none"},name:i,form:a,...n,ref:c,defaultValue:s})},"SliderBubbleInput"));function UI(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}gt(UI,"getNextSortedValues");function Rw(t,e,n){const i=100/(n-e)*(t-e);return Pw(i,[0,100])}gt(Rw,"convertValueToPercentage");function BI(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}gt(BI,"getLabel");function WI(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)}gt(WI,"getClosestValueIndex");function GI(t,e,n){const r=t/2,i=M0([0,50],[0,r]);return(r-i(e)*n)*n}gt(GI,"getThumbInBoundsOffset");function KI(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}gt(KI,"getStepsBetweenValues");function ZI(t,e){if(e>0){const n=KI(t);return Math.min(...n)>=e}return!0}gt(ZI,"hasMinStepsBetweenValues");function M0(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])}}gt(M0,"linearScale");function Aw(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}gt(Aw,"getDecimalCount");function Nd(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}gt(Nd,"roundValue");function qI(t,{min:e,step:n,direction:r,multiplier:s}){const i=Aw(n),a=(t-e)/n,u=Math.round(a),c=Nd(u*n+e,i)===Nd(t,i);let d;return c?d=u+s*r:r>0?d=Math.ceil(a):d=Math.floor(a),Nd(d*n+e,i)}gt(qI,"getNextStepValue");function YI(t){return typeof t=="function"}gt(YI,"isFunction");const d2=g.forwardRef(({className:t,...e},n)=>S.jsxs(tJ,{ref:n,className:pr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(iJ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(oJ,{className:"absolute h-full bg-primary"})}),S.jsx(dJ,{className:pr("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")})]}));d2.displayName="Slider";const pJ=[{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"}],mJ=[{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"}],gJ=[{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"}],bp=[{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."}],vJ=()=>{window.location.hash=""},Vi=({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]}),k8=({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))}),yJ=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",_J=()=>{const t=bp.filter(n=>n.status==="showcased").length,e=bp.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:vJ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(Kz,{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(MR,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Vi,{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(Iu,{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(Iu,{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(Iu,{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(H5,{primaryLabel:"Ship",primaryIcon:v1,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(to,{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(qx,{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(Vi,{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(k8,{swatches:pJ})}),S.jsx(Vi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(k8,{swatches:mJ})}),S.jsx(Vi,{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(Vi,{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:gJ.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(Vi,{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(Yp,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(Yp.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(v1,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(Yp.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(d2,{defaultValue:[64],max:100,step:1}),S.jsx(d2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Vi,{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(pA,{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(Dx,{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(GQ,{hint:"Reading selected elements"})})]})}),S.jsx(Vi,{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(G_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(fA,{icon:S.jsx(v1,{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(Wm,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Vi,{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:bp.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:bp.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 ${yJ(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},xJ=64,e0=new Set;let Qp=null;const wJ=()=>{Qp=null;for(const t of e0)t()},bJ=()=>{e0.size!==0&&(Qp!==null&&clearTimeout(Qp),Qp=setTimeout(wJ,xJ))},SJ=t=>(e0.add(t),()=>{e0.delete(t)}),EJ=(t,e)=>typeof URL<"u"&&t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url):new URL(String(t),e),CJ=(t,e)=>{try{const n=EJ(t,e);return n.origin!==e?!1:n.pathname.startsWith("/api/")}catch{return!1}},kJ=({nativeFetch:t,pageOrigin:e,getShouldIntercept:n})=>{const r=(s,i)=>t(s,i).then(a=>(a.status===401&&n()&&CJ(s,e)&&bJ(),a));return window.fetch=r,()=>{window.fetch=t}},PJ=t=>!t.hasConfig||t.configLoading||t.demoMode!==!0||t.agentModeAvailable!==!0||t.pathnameDemoSessionId!==null?!1:(t.activeDemoSessionId??t.configuredDemoSessionId??null)===null,TJ=(t,e,n)=>t===!0&&e!==!0?null:n,RJ=t=>t?"Preparing your demo session…":null,AJ=t=>!(t==="/rivet"||t.startsWith("/rivet/")),IJ=t=>!AJ(t.pathname)||t.hasConfig?!1:!t.configLoading&&!t.isRetryingConfig,MJ=t=>{const e=t.match(/^\/try\/([^/]+)/);return e!=null&&e[1]?decodeURIComponent(e[1]):null},OJ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",LJ=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},U1=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),B1=ks("App"),DJ=2e3,NJ=60,P8="Connecting to Google...",T8="https://rivet-proxy.onrender.com",jJ=`<!doctype html>
|
|
394
|
+
<html lang="en">
|
|
395
|
+
<head>
|
|
396
|
+
<meta charset="utf-8" />
|
|
397
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
398
|
+
<title>${P8}</title>
|
|
399
|
+
<style>
|
|
400
|
+
:root { color-scheme: light dark; }
|
|
401
|
+
body {
|
|
402
|
+
margin: 0;
|
|
403
|
+
min-height: 100vh;
|
|
404
|
+
display: grid;
|
|
405
|
+
place-items: center;
|
|
406
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
407
|
+
background: #111215;
|
|
408
|
+
color: #f3f4f6;
|
|
409
|
+
}
|
|
410
|
+
.panel {
|
|
411
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
412
|
+
border-radius: 12px;
|
|
413
|
+
padding: 18px 22px;
|
|
414
|
+
background: rgba(255, 255, 255, 0.06);
|
|
415
|
+
font-size: 14px;
|
|
416
|
+
}
|
|
417
|
+
</style>
|
|
418
|
+
</head>
|
|
419
|
+
<body>
|
|
420
|
+
<div class="panel">${P8}</div>
|
|
421
|
+
</body>
|
|
422
|
+
</html>`,FJ="Too many people are trying Rivet right now. Please try again in a few minutes.",XI="Failed to start an isolated demo session.",VJ=async t=>{if(t.status===429)return FJ;try{const e=await t.json();if(e.error)return e.error;if(e.message)return e.message}catch{}return XI},f2=274,t0=395,W1=Math.min(t0,Math.round((f2+t0)/2*1.1)),R8="rivet:panelWidth:v2",$J=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},HJ=({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:d=!1})=>{const h=Qe(o5)>0,[p,m]=BP(s5),_=P$(),[x,y]=g.useState(()=>{if(typeof window>"u")return W1;const Y=Number(window.localStorage.getItem(R8));return Number.isFinite(Y)&&Y>=f2&&Y<=t0?Y:W1}),[w,E]=g.useState(!1),[P,T]=g.useState(Wq),k=p?x:0,[R,L]=g.useState(p);g.useEffect(()=>{if(!p){L(!1);return}T(Y=>Bq({position:Y,boundsLeftPx:x}))},[p,x]),g.useEffect(()=>{window.localStorage.setItem(R8,String(x))},[x]),g.useEffect(()=>{if(!p)return;const Y=q=>{q.key==="Escape"&&($J(q.target)||(q.preventDefault(),m(!1)))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[p,m]);const O=g.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation();const q=Y.clientX,B=x;E(!0);const K=J=>{const H=Math.min(t0,Math.max(f2,B+(J.clientX-q)));y(H)},$=()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),E(!1)};window.addEventListener("pointermove",K),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$)},[x]),A=g.useCallback(()=>y(W1),[]),M=sY(),D=Qe(Rf);aY({enabled:!D});const F=M.isProcessing?"Completing authentication...":a,N=F!==null,W=at(d5);return g.useEffect(()=>{W(t??null)},[t,W]),g.useEffect(()=>{n&&(document.body.style.cursor="auto")},[n]),S.jsxs(_l.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(Iq,{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(dI,{isSigningIn:s||N,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(oZ,{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(pA,{message:c})})}):null]}),n?null:S.jsx(S.Fragment,{children:!d&&!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(_l.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:p?0:-x},transition:_?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{p&&L(!0)},style:{width:x,willChange:"transform"},children:[S.jsx(_K,{onClose:()=>m(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:O,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 ${w?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),w&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(Zq,{isVisible:!0,isPanelOpen:p,isReducedMotion:!!_,position:P,dragBoundsLeftPx:k,onPositionChange:T,onToggle:()=>m(Y=>!Y)})]}):null}),S.jsx(tH,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},h2="rivet_connect_deep_link",zJ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(h2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(h2,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},UJ=zJ(),BJ=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Zp)==="1"),[r,s]=g.useState(!1),[i,a]=g.useState(UJ);g.useEffect(()=>{n&&window.sessionStorage.removeItem(Zp)},[n]);const{config:u,refetchConfig:c,loading:d,error:h}=nY(),p=at(Rf),[m,_]=g.useState(!1),[x,y]=g.useState(null),[w,E]=g.useState(!1),[P,T]=g.useState(!1),[k,R]=g.useState(null),[L,O]=g.useState(!1),A=g.useRef(!1),M=g.useRef(!1),D=MJ(window.location.pathname),F=(u==null?void 0:u.activeDemoSessionId)??null,N=D??k??F,W=g.useMemo(()=>TJ(u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,N),[u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,N]),Y=g.useMemo(()=>PJ({configLoading:d,hasConfig:u!==null,demoMode:u==null?void 0:u.demoMode,agentModeAvailable:u==null?void 0:u.agentModeAvailable,pathnameDemoSessionId:D,activeDemoSessionId:k,configuredDemoSessionId:F}),[u,d,D,k,F]);g.useLayoutEffect(()=>{if(!Y){O(!1);return}O(!0)},[Y]);const q=L,B=g.useMemo(()=>RJ(q),[q]),K=(u==null?void 0:u.demoMode)===!0&&q,$=g.useRef(null);$.current=N;const J=g.useCallback(async()=>{if(!A.current)return;R(null);const ye=await c();if((ye==null?void 0:ye.demoMode)===!0&&ye.agentModeAvailable!==!0){T(!1);return}(ye==null?void 0:ye.demoMode)===!0&&T(!0)},[c]);g.useEffect(()=>{if((u==null?void 0:u.demoMode)===!0)return SJ(()=>{J()})},[u==null?void 0:u.demoMode,J]),g.useEffect(()=>{if(A.current=(u==null?void 0:u.demoMode)===!0,(u==null?void 0:u.demoMode)!==!0)return;const ye=window.fetch.bind(window);return kJ({nativeFetch:ye,pageOrigin:window.location.origin,getShouldIntercept:()=>A.current})},[u==null?void 0:u.demoMode]),g.useEffect(()=>{(u==null?void 0:u.agentModeAvailable)===!0&&T(!1)},[u==null?void 0:u.agentModeAvailable]);const H=g.useCallback(async ye=>{const be=$.current;if(!(ye!=null&&ye.forceRefresh)&&be)return be;if(M.current)return"";M.current=!0;try{const je=await fetch("/api/demo/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!je.ok){const We=await VJ(je);throw new Error(We)}const Te=await je.json();if(!Te.sessionId)throw new Error("Demo session response missing session id.");return R(Te.sessionId),Te.sessionId}finally{M.current=!1}},[]);g.useEffect(()=>{F&&R(F)},[F]),g.useEffect(()=>{u!=null&&u.userId?(Ee.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Ee.alias(u.email,u.userId)):u!=null&&u.email&&Ee.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),g.useEffect(()=>{if(!u)return;const ye=!!u.demoMode,be=ye?N:null;Ee.register({source:"visual_editor",surface:"visual_editor",demo_mode:ye,...be?{demo_session_id:be}:{}})},[u,N]);const j=g.useCallback(async()=>{var We;const ye=globalThis.crypto.randomUUID(),be=Date.now();_(!0),y(null);const je=(u==null?void 0:u.demoMode)!==!0;if(je){const Rt=U1({outcome:"started",authAttemptId:ye,startedAt:be,now:be});Ee.capture(Rt.event,Rt.properties)}let Te=null;try{if(Te=window.open("","_blank"),!Te)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{Te.document.open(),Te.document.write(jJ),Te.document.close()}catch(we){B1.warn("Failed to render loading state in auth popup:",we)}const Rt=await fetch(`${T8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),Ye=await Rt.json();if(!Rt.ok||!Ye.success||!Ye.authUrl||!Ye.sessionId||!Ye.pollSecret)throw new Error(Ye.error||Ye.message||"Failed to start Google login");if(Te.closed)throw new Error("Sign-in window was closed before Google login started.");Te.location.href=Ye.authUrl;for(let we=0;we<NJ;we+=1){if(Te.closed)throw new Error("Sign-in window was closed before authentication completed.");const Je=await(await fetch(`${T8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:Ye.sessionId,pollSecret:Ye.pollSecret})})).json();if(Je.success&&Je.token&&((We=Je.user)!=null&&We.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Je.user.email,token:Je.token,refreshToken:Je.refreshToken,userId:Je.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");if(Te.close(),window.sessionStorage.setItem(Zp,"1"),je){const tt=U1({outcome:"completed",authAttemptId:ye,startedAt:be,now:Date.now()});Ee.capture(tt.event,tt.properties)}if((u==null?void 0:u.demoMode)===!0){await H({forceRefresh:!0}),window.location.reload();return}window.location.reload();return}if(Je.error&&Je.error!=="Pending")throw new Error(Je.error||"Google login failed");await new Promise(He=>setTimeout(He,DJ))}throw new Error("Authentication timed out. Please try again.")}catch(Rt){Te&&!Te.closed&&Te.close();const Ye=Rt instanceof Error?Rt.message:"Failed to start login flow";if(B1.warn("Hosted login failed:",Ye),je){const we=U1({outcome:"failed",authAttemptId:ye,startedAt:be,now:Date.now(),failureReason:LJ(Ye)});Ee.capture(we.event,we.properties)}y(Ye),_(!1)}},[u==null?void 0:u.demoMode,H]),X=(u==null?void 0:u.demoMode)===!0&&((u==null?void 0:u.agentModeAvailable)!==!0||P||m),te=u!=null&&u.agentModeAvailable!==!0,ie=OJ(t),ae=g.useCallback(async()=>{E(!0),p(!0);try{await c()}finally{p(!1),E(!1)}},[c,p]);if(g.useEffect(()=>{if(!Y)return;let ye=!1;return H({forceRefresh:!0}).catch(be=>{const je=be instanceof Error?be.message:XI;B1.warn("Hosted session bootstrap failed:",je),y(je),mt.error(je)}).finally(()=>{ye||O(!1)}),()=>{ye=!0}},[Y,H]),g.useEffect(()=>{const ye=()=>{const be=window.location.hash;e(be)};return window.addEventListener("hashchange",ye),()=>window.removeEventListener("hashchange",ye)},[]),ie==="design-system")return S.jsx(_J,{});const ue={pathname:window.location.pathname,configLoading:d,hasConfig:u!==null,isRetryingConfig:w};if(IJ(ue)){const ye=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:ye}),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:()=>{ae()},children:"Retry"})]})})}if(te)return S.jsx(dI,{isSigningIn:m,onStartSignIn:()=>{j()},errorMessage:x,displayMode:"full"});const oe=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&i!==null,se=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&n&&!r&&!oe;return S.jsxs(S.Fragment,{children:[S.jsx(HJ,{projectPath:u==null?void 0:u.projectPath,activeDemoSessionId:W,showLoginGate:X,onStartLogin:j,isStartingLogin:m,loginError:x,fullPageHostedLoginProgressMessage:(u==null?void 0:u.demoMode)===!0&&m?"Completing sign-in...":null,holdHostedTryoutPreviewNavigation:q,hostedTryoutPreviewHoldMessage:B,deferInspectorUntilPreviewReady:K}),S.jsx(W_,{context:"onboarding",isOpen:se,onClose:()=>s(!0)}),S.jsx(W_,{context:"menu",isOpen:oe,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(h2),a(null)}})]})},WJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",GJ=new aL,KJ={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},ZJ=()=>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."})});QN.createRoot(document.getElementById("root")).render(S.jsx(ve.StrictMode,{children:S.jsx(zN,{apiKey:WJ,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",...KJ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.14.13",env:"production"})}},children:S.jsx(GN,{fallback:S.jsx(ZJ,{}),children:S.jsx(lL,{client:GJ,children:S.jsx(wG,{defaultShape:"rounded",children:S.jsx(jQ,{defaultLibrary:"lucide",children:S.jsx(BJ,{})})})})})})}));
|